FreeBSD Bugzilla – Attachment 91795 Details for
Bug 129277
databases/php5-pdo_sqlite doesn't manage BLOB types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
patch-sqlite_statement.c
patch-sqlite_statement.c (text/plain), 1.58 KB, created by
Lapo Luchini
on 2008-11-29 13:30:01 UTC
(
hide
)
Description:
patch-sqlite_statement.c
Filename:
MIME Type:
Creator:
Lapo Luchini
Created:
2008-11-29 13:30:01 UTC
Size:
1.58 KB
patch
obsolete
>--- sqlite_statement.c.orig 2007-12-31 08:20:10.000000000 +0100 >+++ sqlite_statement.c 2008-11-29 14:00:33.074007425 +0100 >@@ -104,6 +104,21 @@ static int pdo_sqlite_stmt_param_hook(pd > pdo_sqlite_error_stmt(stmt); > return 0; > >+ case PDO_PARAM_INT: >+ case PDO_PARAM_BOOL: >+ if (Z_TYPE_P(param->parameter) == IS_NULL) { >+ if (sqlite3_bind_null(S->stmt, param->paramno + 1) == SQLITE_OK) { >+ return 1; >+ } >+ } else { >+ convert_to_long(param->parameter); >+ if (SQLITE_OK == sqlite3_bind_int(S->stmt, param->paramno + 1, Z_LVAL_P(param->parameter))) { >+ return 1; >+ } >+ } >+ pdo_sqlite_error_stmt(stmt); >+ return 0; >+ > case PDO_PARAM_LOB: > if (Z_TYPE_P(param->parameter) == IS_RESOURCE) { > php_stream *stm; >@@ -117,8 +132,24 @@ static int pdo_sqlite_stmt_param_hook(pd > pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC); > return 0; > } >+ } else if (Z_TYPE_P(param->parameter) == IS_NULL) { >+ if (sqlite3_bind_null(S->stmt, param->paramno + 1) == SQLITE_OK) { >+ return 1; >+ } >+ pdo_sqlite_error_stmt(stmt); >+ return 0; >+ } else { >+ convert_to_string(param->parameter); >+ } >+ >+ if (SQLITE_OK == sqlite3_bind_blob(S->stmt, param->paramno + 1, >+ Z_STRVAL_P(param->parameter), >+ Z_STRLEN_P(param->parameter), >+ SQLITE_STATIC)) { >+ return 1; > } >- /* fall through */ >+ pdo_sqlite_error_stmt(stmt); >+ return 0; > > case PDO_PARAM_STR: > default:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 129277
: 91795