1
0
Fork 0
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:
Kenichi Ishigaki 2012-04-27 06:46:23 +00:00
parent af9280707c
commit 9933faa0e8

View file

@ -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: