1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-08 14:48:32 -04:00

DBD-SQLite: reverted problematic number guessing (suggested by GUIDO); this reopens #29058 (group by) and #29629 (sqlite where length) issues, though.

This commit is contained in:
Kenichi Ishigaki 2009-04-10 07:16:40 +00:00
parent 018e33ddd4
commit ded22d4a9f

View file

@ -394,7 +394,8 @@ sqlite_st_execute (SV *sth, imp_sth_t *imp_sth)
retval = sqlite3_bind_blob(imp_sth->stmt, i+1, data, len, SQLITE_TRANSIENT); retval = sqlite3_bind_blob(imp_sth->stmt, i+1, data, len, SQLITE_TRANSIENT);
} }
else { else {
/* guess a bit before binding */ #if 0
/* stop guessing until we figure out better way to do this */
const int numtype = looks_like_number(value); const int numtype = looks_like_number(value);
if ((numtype & (IS_NUMBER_IN_UV|IS_NUMBER_NOT_INT)) == IS_NUMBER_IN_UV) { if ((numtype & (IS_NUMBER_IN_UV|IS_NUMBER_NOT_INT)) == IS_NUMBER_IN_UV) {
#if defined(USE_64_BIT_INT) #if defined(USE_64_BIT_INT)
@ -407,6 +408,7 @@ sqlite_st_execute (SV *sth, imp_sth_t *imp_sth)
retval = sqlite3_bind_double(imp_sth->stmt, i+1, SvNV(value)); retval = sqlite3_bind_double(imp_sth->stmt, i+1, SvNV(value));
} }
else { else {
#endif
STRLEN len; STRLEN len;
char *data; char *data;
if (imp_dbh->unicode) { if (imp_dbh->unicode) {
@ -414,7 +416,9 @@ sqlite_st_execute (SV *sth, imp_sth_t *imp_sth)
} }
data = SvPV(value, len); data = SvPV(value, len);
retval = sqlite3_bind_text(imp_sth->stmt, i+1, data, len, SQLITE_TRANSIENT); retval = sqlite3_bind_text(imp_sth->stmt, i+1, data, len, SQLITE_TRANSIENT);
#if 0
} }
#endif
} }
if (value) { if (value) {