1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-08 22:58:17 -04:00

turned datatype mismatch error into a warning as it did more harm than good

This commit is contained in:
Kenichi Ishigaki 2012-04-27 05:11:47 +00:00
parent 29914cba9c
commit 6942cb3c59

View file

@ -704,9 +704,17 @@ sqlite_st_execute(SV *sth, imp_sth_t *imp_sth)
} }
else { else {
if (sql_type == SQLITE_INTEGER || sql_type == SQLITE_FLOAT) { if (sql_type == SQLITE_INTEGER || sql_type == SQLITE_FLOAT) {
sqlite_error(sth, -2, form("datatype mismatch: bind %d type %d as %s", i, sql_type, SvPV_nolen_undef_ok(value))); /*
* die on datatype mismatch did more harm than good
return -2; /* -> undef in SQLite.xsi */ * especially when DBIC heavily depends on this
* explicit type specification
*/
if (DBIc_has(imp_dbh, DBIcf_PrintWarn))
warn(
"datatype mismatch: bind param (%d) %s as %s",
i, sql_type, SvPV_nolen_undef_ok(value),
(sql_type == SQLITE_INTEGER ? "integer" : "float")
);
} }
rc = sqlite3_bind_text(imp_sth->stmt, i+1, data, len, SQLITE_TRANSIENT); rc = sqlite3_bind_text(imp_sth->stmt, i+1, data, len, SQLITE_TRANSIENT);
} }