com php-src: Merge branch 'PHP-5.5' into PHP-5.6: ext/mysqli/te sts/mysqli_change_user.phpt ext/mysqli/tests/mysqli_c hange_user_oo.phpt
ext/mysqlnd/config9.m4 ext/m ysqlnd/mysqlnd_ps_codec.c
| From: | Keyur Govande | Date: | Fri, 15 Aug 2014 23:47:06 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.5' into PHP-5.6: ext/mysqli/te sts/mysqli_change_user.phpt ext/mysqli/tests/mysqli_c hange_user_oo.phpt ext/mysqlnd/config9.m4 ext/m ysqlnd/mysqlnd_ps_codec.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-80550@lists.php.net to get a copy of this message | ||
Commit: 032dee4982f16363e648a52fa79073cb4519efa1
Author: Keyur Govande <keyur@php.net> Fri, 15 Aug 2014 23:47:06 +0000
Parents: 3e6cfeed8f4c3410bbb67c45585510654e0c7425 6279246d2c60437c583f9c273075579bf17be654
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=032dee4982f16363e648a52fa79073cb4519efa1
Log:
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
Update NEWS
Fix another failing test
Add NEWS
Fix failing tests
Patch for bug #67839 (mysqli does not handle 4-byte floats correctly)
Conflicts:
ext/mysqli/tests/mysqli_change_user.phpt
Bugs:
https://bugs.php.net/67839
Changed paths:
MM ext/mysqli/tests/mysqli_change_user.phpt
MM ext/mysqli/tests/mysqli_change_user_oo.phpt
MM ext/mysqlnd/config9.m4
MM ext/mysqlnd/mysqlnd_ps_codec.c
Diff:
diff --cc ext/mysqli/tests/mysqli_change_user.phpt
index 7a4530f,3bfb9eb...09009a1
--- a/ext/mysqli/tests/mysqli_change_user.phpt
+++ b/ext/mysqli/tests/mysqli_change_user.phpt
@@@ -32,22 -32,49 +32,46 @@@ require_once('skipifconnectfailure.inc'
printf("[006] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s,
port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
- if (false !== ($tmp = mysqli_change_user($link, $user . '_unknown_really', $passwd .
'non_empty', $db)))
+ if (false !== ($tmp = @mysqli_change_user($link, $user . '_unknown_really', $passwd .
'non_empty', $db)))
printf("[007] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
- if (false !== ($tmp = mysqli_change_user($link, $user, $passwd . '_unknown_really',
$db)))
- printf("[008] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
+ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
+ printf("[008] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s,
port=%s, socket=%s\n",
+ $host, $user, $db, $port, $socket);
- if (false !== ($tmp = mysqli_change_user($link, $user, $passwd, $db .
'_unknown_really')))
+ if (false !== ($tmp = @mysqli_change_user($link, $user, $passwd . '_unknown_really',
$db)))
printf("[009] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
+ // Reconnect because after 3 failed change_user attempts, the server blocks you off.
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
- printf("[010] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s,
port=%s, socket=%s\n",
- printf("[006] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s,
port=%s, socket=%s\n",
++ printf("[009a] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s,
port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
+ if (!mysqli_query($link, 'SET @mysqli_change_user_test_var=1'))
+ printf("[010] Failed to set test variable: [%d] %s\n", mysqli_errno($link),
mysqli_error($link));
+
+ if (!$res = mysqli_query($link, 'SELECT @mysqli_change_user_test_var AS test_var'))
+ printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ $tmp = mysqli_fetch_assoc($res);
+ mysqli_free_result($res);
+ if (1 != $tmp['test_var'])
+ printf("[012] Cannot set test variable\n");
+
+ if (true !== ($tmp = mysqli_change_user($link, $user, $passwd, $db)))
+ printf("[013] Expecting true, got %s/%s\n", gettype($tmp), $tmp);
+
+ if (!$res = mysqli_query($link, 'SELECT database() AS dbname, user() AS user'))
+ printf("[014] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ $tmp = mysqli_fetch_assoc($res);
+ mysqli_free_result($res);
+
+ if (substr($tmp['user'], 0, strlen($user)) !== $user)
+ printf("[015] Expecting user %s, got user() %s\n", $user, $tmp['user']);
+ if ($tmp['dbname'] != $db)
+ printf("[016] Expecting database %s, got database() %s\n", $db,
$tmp['dbname']);
+
- if (!$res = mysqli_query($link, 'SELECT @mysqli_change_user_test_var AS test_var'))
- printf("[017] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- $tmp = mysqli_fetch_assoc($res);
- mysqli_free_result($res);
- if (NULL !== $tmp['test_var'])
- printf("[019] Test variable is still set!\n");
+ if (false !== ($tmp = @mysqli_change_user($link, $user, $passwd, $db .
'_unknown_really')))
+ printf("[011] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
mysqli_close($link);
diff --cc ext/mysqlnd/config9.m4
index 0e08b97,deda441..78e1bf1
--- a/ext/mysqlnd/config9.m4
+++ b/ext/mysqlnd/config9.m4
@@@ -48,4 -48,42 +48,30 @@@ f
if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" =
"yes" || test "$PHP_MYSQLI" != "no"; then
PHP_ADD_BUILD_DIR([ext/mysqlnd], 1)
-
- dnl This creates a file so it has to be after above macros
- PHP_CHECK_TYPES([int8 uint8 int16 uint16 int32 uint32 uchar ulong int8_t uint8_t int16_t
uint16_t int32_t uint32_t int64_t uint64_t], [
- ext/mysqlnd/php_mysqlnd_config.h
- ],[
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
- ])
fi
+
+ dnl
+ dnl Check if the compiler supports Decimal32/64/128 types from the IEEE-754 2008 version
+ dnl References: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1657.pdf
+ dnl http://speleotrove.com/decimal/
+ dnl
+ AC_CACHE_CHECK([whether whether compiler supports Decimal32/64/128 types],
ac_cv_decimal_fp_supported,[
+ AC_TRY_RUN( [
+ #include <stdio.h>
+
+ int main(int argc, char **argv) {
+ typedef float dec32 __attribute__((mode(SD)));
+ dec32 k = 99.49f;
+ double d2 = (double)k;
+ return 0;
+ }
+ ],[
+ ac_cv_decimal_fp_supported=yes
+ ],[
+ ac_cv_decimal_fp_supported=no
+ ],[
+ ac_cv_decimal_fp_supported=no
+ ])])
+ if test "$ac_cv_decimal_fp_supported" = "yes"; then
+ AC_DEFINE(HAVE_DECIMAL_FP_SUPPORT, 1, [Define if the compiler supports Decimal32/64/128 types.])
+ fi