diff options
author | Lars Strojny <lstrojny@php.net> | 2013-01-14 17:59:11 +0100 |
---|---|---|
committer | Lars Strojny <lstrojny@php.net> | 2013-01-14 17:59:11 +0100 |
commit | 1e9a3ed234af443170d9ea8280a556d85299e301 (patch) | |
tree | 6f41889291d75d85d9c676b62cd3bb64cc11866b /ext/pdo_sqlite/sqlite_statement.c | |
parent | 99d087e5d437023c55f96dcde4b5b784bd8b0ac8 (diff) | |
download | php-git-1e9a3ed234af443170d9ea8280a556d85299e301.tar.gz |
Fix bug #63916: PDO::PARAM_INT casts to 32bit int internally even on 64bit builds in pdo_sqlite
Diffstat (limited to 'ext/pdo_sqlite/sqlite_statement.c')
-rw-r--r-- | ext/pdo_sqlite/sqlite_statement.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index d5b4df1fda..e970ad3e06 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -112,9 +112,15 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d } } else { convert_to_long(param->parameter); +#if LONG_MAX > 2147483647 + if (SQLITE_OK == sqlite3_bind_int64(S->stmt, param->paramno + 1, Z_LVAL_P(param->parameter))) { + return 1; + } +#else if (SQLITE_OK == sqlite3_bind_int(S->stmt, param->paramno + 1, Z_LVAL_P(param->parameter))) { return 1; } +#endif } pdo_sqlite_error_stmt(stmt); return 0; |