1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 22:28:47 -04:00

DBD-SQLite: no need to count length for integer and float (#45578)

This commit is contained in:
Kenichi Ishigaki 2009-04-30 14:45:57 +00:00
parent 9e6ab8d21e
commit 0842e9de3a

View file

@ -864,7 +864,7 @@ sqlite_db_func_dispatcher(int is_unicode, sqlite3_context *context, int argc, sq
PUSHMARK(SP); PUSHMARK(SP);
for ( i=0; i < argc; i++ ) { for ( i=0; i < argc; i++ ) {
SV *arg; SV *arg;
STRLEN len = sqlite3_value_bytes(value[i]); STRLEN len;
int type = sqlite3_value_type(value[i]); int type = sqlite3_value_type(value[i]);
/* warn("func dispatch type: %d, value: %s\n", type, sqlite3_value_text(value[i])); */ /* warn("func dispatch type: %d, value: %s\n", type, sqlite3_value_text(value[i])); */
@ -876,6 +876,7 @@ sqlite_db_func_dispatcher(int is_unicode, sqlite3_context *context, int argc, sq
arg = sv_2mortal(newSVnv(sqlite3_value_double(value[i]))); arg = sv_2mortal(newSVnv(sqlite3_value_double(value[i])));
break; break;
case SQLITE_TEXT: case SQLITE_TEXT:
len = sqlite3_value_bytes(value[i]);
arg = newSVpvn((const char *)sqlite3_value_text(value[i]), len); arg = newSVpvn((const char *)sqlite3_value_text(value[i]), len);
if (is_unicode) { if (is_unicode) {
SvUTF8_on(arg); SvUTF8_on(arg);
@ -883,6 +884,7 @@ sqlite_db_func_dispatcher(int is_unicode, sqlite3_context *context, int argc, sq
arg = sv_2mortal(arg); arg = sv_2mortal(arg);
break; break;
case SQLITE_BLOB: case SQLITE_BLOB:
len = sqlite3_value_bytes(value[i]);
arg = sv_2mortal(newSVpvn(sqlite3_value_blob(value[i]), len)); arg = sv_2mortal(newSVpvn(sqlite3_value_blob(value[i]), len));
break; break;
default: default: