Merge branch 'PHP-7.0' into PHP-7.1

* PHP-7.0:
  Cursor is not opened on singleton selects.
  fix arg spec and datatype, follow up on 73594
This commit is contained in:
Anatol Belski 2016-12-18 21:55:30 +01:00
commit f077ada348
3 changed files with 23 additions and 4 deletions

View file

@ -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);

View file

@ -0,0 +1,19 @@
--TEST--
PDO_Firebird: cursor should not be marked as opened on singleton statements
--SKIPIF--
<?php if (!extension_loaded('interbase') || !extension_loaded('pdo_firebird')) die('skip'); ?>
--FILE--
<?php
require 'testdb.inc';
$C = new PDO('firebird:dbname='.$test_base, $user, $password, [PDO::ATTR_ERRMODE => 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

View file

@ -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;
}