diff options
Diffstat (limited to 'ext/pdo')
| -rw-r--r-- | ext/pdo/Makefile.frag | 2 | ||||
| -rw-r--r-- | ext/pdo/pdo_sql_parser.c | 2 | ||||
| -rw-r--r-- | ext/pdo/pdo_stmt.c | 10 | ||||
| -rw-r--r-- | ext/pdo/php_pdo_int.h | 2 | ||||
| -rw-r--r-- | ext/pdo/tests/pdo_036.phpt | 8 |
5 files changed, 12 insertions, 12 deletions
diff --git a/ext/pdo/Makefile.frag b/ext/pdo/Makefile.frag index 98f5c5f2ad..5ba5f80840 100644 --- a/ext/pdo/Makefile.frag +++ b/ext/pdo/Makefile.frag @@ -6,7 +6,7 @@ PDO_HEADER_FILES= \ $(srcdir)/pdo_sql_parser.c: $(srcdir)/pdo_sql_parser.re - (cd $(top_srcdir); $(RE2C) -o ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.re) + (cd $(top_srcdir); $(RE2C) --no-generation-date -o ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.re) install-pdo-headers: @echo "Installing PDO headers: $(INSTALL_ROOT)$(phpincludedir)/ext/pdo/" diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c index 1ed78c1cc5..aea362fdb2 100644 --- a/ext/pdo/pdo_sql_parser.c +++ b/ext/pdo/pdo_sql_parser.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue Aug 20 18:02:48 2013 */ +/* Generated by re2c 0.13.5 */ #line 1 "ext/pdo/pdo_sql_parser.re" /* +----------------------------------------------------------------------+ diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 9622cb3cc2..04e71823b9 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2499,16 +2499,15 @@ static void pdo_stmt_iter_get_data(zend_object_iterator *iter, zval ***data TSRM *data = &I->fetch_ahead; } -static int pdo_stmt_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, - ulong *int_key TSRMLS_DC) +static void pdo_stmt_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC) { struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data; if (I->key == (ulong)-1) { - return HASH_KEY_NON_EXISTANT; + ZVAL_NULL(key); + } else { + ZVAL_LONG(key, I->key); } - *int_key = I->key; - return HASH_KEY_IS_LONG; } static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC) @@ -2733,6 +2732,7 @@ static union _zend_function *row_get_ctor(zval *object TSRMLS_DC) ctor.function_name = "__construct"; ctor.scope = pdo_row_ce; ctor.handler = ZEND_FN(dbstmt_constructor); + ctor.fn_flags = ZEND_ACC_PUBLIC; return (union _zend_function*)&ctor; } diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h index 57c683ab0f..91d0bf0412 100644 --- a/ext/pdo/php_pdo_int.h +++ b/ext/pdo/php_pdo_int.h @@ -58,7 +58,7 @@ extern pdo_driver_t *pdo_find_driver(const char *name, int namelen); extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC); #define PDO_DBH_CLEAR_ERR() do { \ - strncpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \ + strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \ if (dbh->query_stmt) { \ dbh->query_stmt = NULL; \ zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \ diff --git a/ext/pdo/tests/pdo_036.phpt b/ext/pdo/tests/pdo_036.phpt index 94006c9e80..55c88762ba 100644 --- a/ext/pdo/tests/pdo_036.phpt +++ b/ext/pdo/tests/pdo_036.phpt @@ -5,19 +5,19 @@ Testing PDORow and PDOStatement instances with Reflection --FILE-- <?php -$instance = new reflectionclass('pdorow'); +$instance = new reflectionclass('pdostatement'); $x = $instance->newInstance(); var_dump($x); -$instance = new reflectionclass('pdostatement'); +$instance = new reflectionclass('pdorow'); $x = $instance->newInstance(); var_dump($x); ?> --EXPECTF-- -object(PDORow)#%d (0) { -} object(PDOStatement)#%d (1) { [%u|b%"queryString"]=> NULL } + +Fatal error: PDORow::__construct(): You should not create a PDOStatement manually in %spdo_036.php on line %d |
