php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #63214
Patch LargeQuerySupport revision 2012-10-03 23:12 UTC by james at kenjim dot com

Patch LargeQuerySupport for PDO related Bug #63214

Patch version 2012-10-03 23:12 UTC

Return to Bug #63214 | Download this patch
Patch Revisions:

Developer: james@kenjim.com

diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
index e39555f..690a62d 100644
--- a/ext/pdo_firebird/firebird_driver.c
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -401,7 +401,7 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, long sql
        long l, pindex = -1;

        /* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */
-       if (sql_len > SHORT_MAX) {
+       if (sql_len > USHORT_MAX) {
                strcpy(dbh->error_code, "01004");
                return 0;
        }
diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h
index bb15d54..4a13caf 100644
--- a/ext/pdo_firebird/php_pdo_firebird_int.h
+++ b/ext/pdo_firebird/php_pdo_firebird_int.h
@@ -36,6 +36,7 @@
 #define PDO_FB_DEF_TIMESTAMP_FMT PDO_FB_DEF_DATE_FMT " " PDO_FB_DEF_TIME_FMT

 #define SHORT_MAX (1 << (8*sizeof(short)-1))
+#define USHORT_MAX ((1 << (8*sizeof(short)))-1)

 #if SIZEOF_LONG == 8
 # define LL_MASK "l"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 12:01:31 2024 UTC