aboutsummaryrefslogtreecommitdiffstats
path: root/src/sqlite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sqlite.c')
-rw-r--r--src/sqlite.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/sqlite.c b/src/sqlite.c
index 7a018b28aa4..261080da673 100644
--- a/src/sqlite.c
+++ b/src/sqlite.c
@@ -349,9 +349,7 @@ bind_values (sqlite3 *db, sqlite3_stmt *stmt, Lisp_Object values)
349 value = XCAR (values); 349 value = XCAR (values);
350 values = XCDR (values); 350 values = XCDR (values);
351 } 351 }
352 Lisp_Object type = Ftype_of (value); 352 if (STRINGP (value))
353
354 if (EQ (type, Qstring))
355 { 353 {
356 Lisp_Object encoded; 354 Lisp_Object encoded;
357 bool blob = false; 355 bool blob = false;
@@ -385,14 +383,11 @@ bind_values (sqlite3 *db, sqlite3_stmt *stmt, Lisp_Object values)
385 SSDATA (encoded), SBYTES (encoded), 383 SSDATA (encoded), SBYTES (encoded),
386 NULL); 384 NULL);
387 } 385 }
388 else if (EQ (type, Qinteger)) 386 else if (FIXNUMP (value))
389 { 387 ret = sqlite3_bind_int64 (stmt, i + 1, XFIXNUM (value));
390 if (BIGNUMP (value)) 388 else if (BIGNUMP (value))
391 ret = sqlite3_bind_int64 (stmt, i + 1, bignum_to_intmax (value)); 389 ret = sqlite3_bind_int64 (stmt, i + 1, bignum_to_intmax (value));
392 else 390 else if (FLOATP (value))
393 ret = sqlite3_bind_int64 (stmt, i + 1, XFIXNUM (value));
394 }
395 else if (EQ (type, Qfloat))
396 ret = sqlite3_bind_double (stmt, i + 1, XFLOAT_DATA (value)); 391 ret = sqlite3_bind_double (stmt, i + 1, XFLOAT_DATA (value));
397 else if (NILP (value)) 392 else if (NILP (value))
398 ret = sqlite3_bind_null (stmt, i + 1); 393 ret = sqlite3_bind_null (stmt, i + 1);