diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2010-04-23 16:34:39 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2010-04-23 16:34:39 +0000 |
commit | c65eb7dc0ec96144ef1a218665852f0ed15bed9b (patch) | |
tree | f75b9a46b95d7603975291ecc7559f6eb811da64 /databases/php52-pdo_sqlite | |
parent | c323b908ec65c004a4565bec77b95ca0c5b844d0 (diff) | |
download | ports-c65eb7dc0ec96144ef1a218665852f0ed15bed9b.tar.gz ports-c65eb7dc0ec96144ef1a218665852f0ed15bed9b.zip |
Notes
Diffstat (limited to 'databases/php52-pdo_sqlite')
-rw-r--r-- | databases/php52-pdo_sqlite/Makefile | 14 | ||||
-rw-r--r-- | databases/php52-pdo_sqlite/files/patch-sqlite_statement.c | 50 |
2 files changed, 64 insertions, 0 deletions
diff --git a/databases/php52-pdo_sqlite/Makefile b/databases/php52-pdo_sqlite/Makefile new file mode 100644 index 000000000000..cf5e6ffa7756 --- /dev/null +++ b/databases/php52-pdo_sqlite/Makefile @@ -0,0 +1,14 @@ +# New ports collection makefile for: php52-pdo_sqlite +# Date created: 17 Apr 2010 +# Whom: Alex Keda <admin@lissyara.su> +# +# $FreeBSD$ +# + +CATEGORIES= databases + +MASTERDIR= ${.CURDIR}/../../lang/php52 + +PKGNAMESUFFIX= -pdo_sqlite + +.include "${MASTERDIR}/Makefile" diff --git a/databases/php52-pdo_sqlite/files/patch-sqlite_statement.c b/databases/php52-pdo_sqlite/files/patch-sqlite_statement.c new file mode 100644 index 000000000000..8785b86ecff0 --- /dev/null +++ b/databases/php52-pdo_sqlite/files/patch-sqlite_statement.c @@ -0,0 +1,50 @@ +--- sqlite_statement.c.orig 2007-12-31 08:20:10.000000000 +0100 ++++ sqlite_statement.c 2008-12-07 11:50:35.000000000 +0100 +@@ -104,6 +104,21 @@ + 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 @@ + 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: |