Browse Source

fix #38072 (boolean arg for mysqli_autocommit() is always true on Solaris)

PECL_OPENSSL
Antony Dovgal 20 years ago
parent
commit
8a35e9d014
  1. 2
      NEWS
  2. 4
      ext/mysqli/mysqli_api.c
  3. 33
      ext/mysqli/tests/068.phpt

2
NEWS

@ -82,6 +82,8 @@ PHP NEWS
- Fixed memory leaks in openssl streams context options. (Pierre)
- Fixed handling of extremely long paths inside tempnam() function. (Ilia)
- Fixed bug #38072 (boolean arg for mysqli_autocommit() is always true on
Solaris). (Tony)
- Fixed bug #38067 (Parameters are not decoded from utf-8 when using encoding
option). (Dmitry)
- Fixed bug #38055 (Wrong interpretation of boolean parameters). (Dmitry)

4
ext/mysqli/mysqli_api.c

@ -57,14 +57,14 @@ PHP_FUNCTION(mysqli_autocommit)
{
MY_MYSQL *mysql;
zval *mysql_link;
unsigned long automode;
zend_bool automode;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ob", &mysql_link, mysqli_link_class_entry, &automode) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", MYSQLI_STATUS_VALID);
if (mysql_autocommit(mysql->mysql, automode)) {
if (mysql_autocommit(mysql->mysql, (my_bool)automode)) {
RETURN_FALSE;
}
RETURN_TRUE;

33
ext/mysqli/tests/068.phpt

@ -0,0 +1,33 @@
--TEST--
mysqli_autocommit() tests
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
include "connect.inc";
$mysqli = new mysqli($host, $user, $passwd, "test");
var_dump($mysqli->autocommit(false));
$result = $mysqli->query("SELECT @@autocommit");
var_dump($result->fetch_row());
var_dump($mysqli->autocommit(true));
$result = $mysqli->query("SELECT @@autocommit");
var_dump($result->fetch_row());
?>
--EXPECT--
bool(true)
array(1) {
[0]=>
string(1) "0"
}
bool(true)
array(1) {
[0]=>
string(1) "1"
}
Loading…
Cancel
Save