Fix failing tests

This commit is contained in:
Keyur Govande 2014-08-14 18:20:26 +00:00
parent c044164a96
commit 4e2c01617f
7 changed files with 29 additions and 14 deletions

View file

@ -62,18 +62,18 @@ mysqli_close($link);
--EXPECT-- --EXPECT--
array(7) { array(7) {
[0]=> [0]=>
float(3.14159274101) float(3.141593)
[1]=> [1]=>
float(-9.99999997475E-7) float(-1.0E-6)
[2]=> [2]=>
float(0) float(0)
[3]=> [3]=>
float(999999995904) float(1.0E+12)
[4]=> [4]=>
float(0.564642488956) float(0.5646425)
[5]=> [5]=>
float(1) float(1)
[6]=> [6]=>
float(8.88888914608E+14) float(8.888889E+14)
} }
done! done!

View file

@ -67,7 +67,7 @@ array(8) {
[3]=> [3]=>
int(4999999) int(4999999)
[4]=> [4]=>
float(2345.60009766) float(2345.6)
[5]=> [5]=>
float(5678.89563) float(5678.89563)
[6]=> [6]=>

View file

@ -66,7 +66,7 @@ array(8) {
[3]=> [3]=>
int(54) int(54)
[4]=> [4]=>
float(2.59999990463) float(2.6)
[5]=> [5]=>
float(58.89) float(58.89)
[6]=> [6]=>

View file

@ -41,6 +41,11 @@ require_once('skipifconnectfailure.inc');
if (false !== ($tmp = mysqli_change_user($link, $user, $passwd, $db . '_unknown_really'))) if (false !== ($tmp = mysqli_change_user($link, $user, $passwd, $db . '_unknown_really')))
printf("[009] Expecting false, got %s/%s\n", gettype($tmp), $tmp); 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("[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 (!mysqli_query($link, 'SET @mysqli_change_user_test_var=1')) 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)); printf("[010] Failed to set test variable: [%d] %s\n", mysqli_errno($link), mysqli_error($link));

View file

@ -43,6 +43,11 @@ if (!$IS_MYSQLND && (mysqli_get_server_version($link) < 50118 && mysqli_get_serv
if (false !== ($tmp = $mysqli->change_user($user, $passwd, $db . '_unknown_really'))) if (false !== ($tmp = $mysqli->change_user($user, $passwd, $db . '_unknown_really')))
printf("[008] Expecting false, got %s/%s\n", gettype($tmp), $tmp); printf("[008] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
// Reconnect because after 3 failed change_user attempts, the server blocks you off.
if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket))
printf("[001] 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('SET @mysqli_change_user_test_var=1')) if (!$mysqli->query('SET @mysqli_change_user_test_var=1'))
printf("[009] Failed to set test variable: [%d] %s\n", $mysqli->errno, $mysqli->error); printf("[009] Failed to set test variable: [%d] %s\n", $mysqli->errno, $mysqli->error);

View file

@ -36,7 +36,7 @@ $port, $socket, mysqli_connect_errno(), mysqli_connect_error());
mysqli_error($link)); mysqli_error($link));
} }
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(3), PRIMARY
KEY(id)) ENGINE=' . $engine . " DEFAULT CHARSET=gbk")) { KEY(id)) ENGINE=' . $engine . " DEFAULT CHARSET=gbk")) {
printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), printf("Failed to create test table: [%d] %s\n", mysqli_errno($link),
mysqli_error($link)); mysqli_error($link));

View file

@ -12,6 +12,11 @@ if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
exit(1); exit(1);
} }
if (!mysqli_query($link, 'SET SESSION sql_mode=\'\'')) {
printf("Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
exit(1);
}
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine)) { if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine)) {
printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
exit(1); exit(1);