mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-08 14:48:32 -04:00
storing an (overflowed) integer as a double is apparently a bad idea; store it as a text to allow perl to convert it dynamically
This commit is contained in:
parent
af9280707c
commit
9933faa0e8
1 changed files with 7 additions and 1 deletions
8
dbdimp.c
8
dbdimp.c
|
@ -906,7 +906,13 @@ sqlite_st_fetch(SV *sth, imp_sth_t *imp_sth)
|
|||
#if defined(USE_64_BIT_INT)
|
||||
sv_setiv(AvARRAY(av)[i], sqlite3_column_int64(imp_sth->stmt, i));
|
||||
#else
|
||||
sv_setnv(AvARRAY(av)[i], (double)sqlite3_column_int64(imp_sth->stmt, i));
|
||||
val = (char*)sqlite3_column_text(imp_sth->stmt, i);
|
||||
if (sqlite_is_number(aTHX_ val, TRUE) == 1) {
|
||||
sv_setiv(AvARRAY(av)[i], atoi(val));
|
||||
} else {
|
||||
sv_setpv(AvARRAY(av)[i], val);
|
||||
SvUTF8_off(AvARRAY(av)[i]);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case SQLITE_FLOAT:
|
||||
|
|
Loading…
Add table
Reference in a new issue