From 3e48baa49d45206444a4af4f808ce640ac83d5a4 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 18 Dec 2016 21:16:35 +0100 Subject: [PATCH 1/2] fix arg spec and datatype, follow up on 73594 --- ext/standard/dns_win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index f28977ab6a9..17f2e5434e9 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -347,12 +347,12 @@ PHP_FUNCTION(dns_get_record) { char *hostname; size_t hostname_len; - long type_param = PHP_DNS_ANY; + zend_long type_param = PHP_DNS_ANY; zval *authns = NULL, *addtl = NULL; int type, type_to_fetch, first_query = 1, store_results = 1; zend_bool raw = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz/!z/!b", &hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) { return; } From cf46ac1179376f58895feb6ed914b03bea19e295 Mon Sep 17 00:00:00 2001 From: Dorin Marcoci Date: Thu, 15 Dec 2016 10:57:45 +0200 Subject: [PATCH 2/2] Cursor is not opened on singleton selects. Test case for unregistered bug on FB3 singleton selects Set error mode to warning instead of exception. --- ext/pdo_firebird/firebird_statement.c | 4 ++-- ext/pdo_firebird/tests/bug_aaa.phpt | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 ext/pdo_firebird/tests/bug_aaa.phpt diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index f719ecc36dd..64968428bdd 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -152,8 +152,8 @@ static int firebird_stmt_execute(pdo_stmt_t *stmt) /* {{{ */ } *S->name = 0; - S->cursor_open = (S->out_sqlda.sqln > 0); /* A cursor is opened, when more than zero columns returned */ - S->exhausted = !S->cursor_open; + S->cursor_open = S->out_sqlda.sqln && (S->statement_type != isc_info_sql_stmt_exec_procedure); + S->exhausted = !S->out_sqlda.sqln; /* There are data to fetch */ return 1; } while (0); diff --git a/ext/pdo_firebird/tests/bug_aaa.phpt b/ext/pdo_firebird/tests/bug_aaa.phpt new file mode 100644 index 00000000000..821d59afd20 --- /dev/null +++ b/ext/pdo_firebird/tests/bug_aaa.phpt @@ -0,0 +1,19 @@ +--TEST-- +PDO_Firebird: cursor should not be marked as opened on singleton statements +--SKIPIF-- + +--FILE-- + PDO::ERRMODE_WARNING]) or die; +@$C->exec('drop table ta_table'); +$C->exec('create table ta_table (id integer)'); +$S = $C->prepare('insert into ta_table (id) values (:id) returning id'); +$S->execute(['id' => 1]); +$S->execute(['id' => 2]); +unset($S); +unset($C); +echo 'OK'; +?> +--EXPECT-- +OK \ No newline at end of file