diff options
author | Ulf Wendel <uw@php.net> | 2007-07-23 12:04:19 +0000 |
---|---|---|
committer | Ulf Wendel <uw@php.net> | 2007-07-23 12:04:19 +0000 |
commit | 1884a16d01db5bf277d12bda0c62afb7de3f1cf0 (patch) | |
tree | f21b899b680b6c028ec489de44ef77510f5524dd | |
parent | 7bfd857fa1e762c4ac5c3abd3eba4c95406af147 (diff) | |
download | php-git-1884a16d01db5bf277d12bda0c62afb7de3f1cf0.tar.gz |
Primarily whitespace/CS - synching with mysqlnd SVN repository
-rw-r--r-- | ext/mysqli/tests/001.phpt | 10 | ||||
-rw-r--r-- | ext/mysqli/tests/002.phpt | 22 | ||||
-rw-r--r-- | ext/mysqli/tests/009.phpt | 22 | ||||
-rw-r--r-- | ext/mysqli/tests/020.phpt | 10 | ||||
-rw-r--r-- | ext/mysqli/tests/023.phpt | 12 | ||||
-rw-r--r-- | ext/mysqli/tests/024.phpt | 12 | ||||
-rw-r--r-- | ext/mysqli/tests/025.phpt | 12 | ||||
-rw-r--r-- | ext/mysqli/tests/045.phpt | 7 | ||||
-rw-r--r-- | ext/mysqli/tests/048.phpt | 14 | ||||
-rw-r--r-- | ext/mysqli/tests/060.phpt | 12 | ||||
-rw-r--r-- | ext/mysqli/tests/065.phpt | 42 | ||||
-rw-r--r-- | ext/mysqli/tests/067.phpt | 21 | ||||
-rw-r--r-- | ext/mysqli/tests/connect.inc | 72 | ||||
-rw-r--r-- | ext/mysqli/tests/skipif.inc | 2 | ||||
-rw-r--r-- | ext/mysqli/tests/skipifemb.inc | 8 | ||||
-rw-r--r-- | ext/mysqli/tests/skipifnotemb.inc | 8 | ||||
-rw-r--r-- | ext/mysqli/tests/table.inc | 24 |
17 files changed, 163 insertions, 147 deletions
diff --git a/ext/mysqli/tests/001.phpt b/ext/mysqli/tests/001.phpt index 51adb6a3de..1e76695d4f 100644 --- a/ext/mysqli/tests/001.phpt +++ b/ext/mysqli/tests/001.phpt @@ -34,13 +34,13 @@ mysqli connect /* temporary addition for Kent's setup, Win32 box */ for ($i = 0; $i < 10; $i++) { - if (!$link = mysqli_init()) - printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error()); + if (!$link = mysqli_init()) + printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error()); - if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) - printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error()); + if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) + printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error()); - mysqli_close($link); + mysqli_close($link); } /*** test mysqli_real_connect compressed ***/ diff --git a/ext/mysqli/tests/002.phpt b/ext/mysqli/tests/002.phpt index 5a9630bc2f..bfec8c7aca 100644 --- a/ext/mysqli/tests/002.phpt +++ b/ext/mysqli/tests/002.phpt @@ -1,35 +1,35 @@ --TEST-- -mysqli bind_result 1 +mysqli bind_result 1 --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) - printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); + printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null")) printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $rc = mysqli_query($link,"CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, - col3 int, col4 bigint, - col5 float, col6 double, - col7 date, col8 time, - col9 varbinary(10), - col10 varchar(50), - col11 char(20)) ENGINE=" . $engine); + col3 int, col4 bigint, + col5 float, col6 double, + col7 date, col8 time, + col9 varbinary(10), + col10 varchar(50), + col11 char(20)) ENGINE=" . $engine); if (!$rc) printf("[003] Cannot create table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - + $rc = mysqli_query($link, "INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)"); if (!$rc) printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); + mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); mysqli_execute($stmt); mysqli_fetch($stmt); diff --git a/ext/mysqli/tests/009.phpt b/ext/mysqli/tests/009.phpt index a7b285f3ef..f0b5ae2f01 100644 --- a/ext/mysqli/tests/009.phpt +++ b/ext/mysqli/tests/009.phpt @@ -27,17 +27,18 @@ mysqli fetch bigint values (ok to fail with 4.1.x) c4 bigint unsigned, c5 bigint unsigned, c6 bigint unsigned, - c7 bigint unsigned) ENGINE=" . $engine); + c7 bigint unsigned, + c8 bigint unsigned) ENGINE=" . $engine); if (!$rc) printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - $rc = mysqli_query($link, "INSERT INTO test_bind_fetch (c2,c3,c4,c5,c6,c7) ". - "VALUES (-23,4.0,33333333333333,0,-333333333333,99.9)"); + $rc = mysqli_query($link, "INSERT INTO test_bind_fetch (c2,c3,c4,c5,c6,c7,c8) ". + "VALUES (-23,4.0,33333333333333,0,-333333333333,99.9,1234)"); if (!$rc) printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch"); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); + mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8); mysqli_execute($stmt); $rc = mysqli_fetch($stmt); @@ -47,7 +48,8 @@ mysqli fetch bigint values (ok to fail with 4.1.x) $c6 = 0; } } - $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); + $c8 = 4567;// change this to test how mysqli/mysqlnd handles is_ref changing + $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8); var_dump($test); @@ -75,7 +77,7 @@ mysqli fetch bigint values (ok to fail with 4.1.x) ?> --EXPECTF-- -array(7) { +array(8) { [0]=> int(5) [1]=> @@ -90,12 +92,14 @@ array(7) { int(0) [6]=> int(100) + [7]=> + int(4567) } 20123456 3123456789 done! --UEXPECTF-- -array(7) { +array(8) { [0]=> int(5) [1]=> @@ -110,7 +114,9 @@ array(7) { int(0) [6]=> int(100) + [7]=> + int(4567) } 20123456 3123456789 -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/020.phpt b/ext/mysqli/tests/020.phpt index 65ac2a0e16..cc33d2e4fd 100644 --- a/ext/mysqli/tests/020.phpt +++ b/ext/mysqli/tests/020.phpt @@ -18,11 +18,11 @@ mysqli bind_param/bind_result date mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"); mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time, - c3 timestamp(14), - c4 year, - c5 datetime, - c6 timestamp(4), - c7 timestamp(6))"); + c3 timestamp(14), + c4 year, + c5 datetime, + c6 timestamp(4), + c7 timestamp(6))"); $stmt = mysqli_prepare($link, "INSERT INTO test_bind_result VALUES (?,?,?,?,?,?,?)"); mysqli_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7); diff --git a/ext/mysqli/tests/023.phpt b/ext/mysqli/tests/023.phpt index 97398001f8..d7bf23db72 100644 --- a/ext/mysqli/tests/023.phpt +++ b/ext/mysqli/tests/023.phpt @@ -14,12 +14,12 @@ mysqli bind_param/bind_prepare fetch long values mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned, - c2 int unsigned, - c3 int, - c4 int, - c5 int, - c6 int unsigned, - c7 int)"); + c2 int unsigned, + c3 int, + c4 int, + c5 int, + c6 int unsigned, + c7 int)"); $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)"); mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); diff --git a/ext/mysqli/tests/024.phpt b/ext/mysqli/tests/024.phpt index 58302b39d4..414a5a2b4b 100644 --- a/ext/mysqli/tests/024.phpt +++ b/ext/mysqli/tests/024.phpt @@ -14,12 +14,12 @@ mysqli bind_param/bind_result short values mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned, - c2 smallint unsigned, - c3 smallint, - c4 smallint, - c5 smallint, - c6 smallint unsigned, - c7 smallint)"); + c2 smallint unsigned, + c3 smallint, + c4 smallint, + c5 smallint, + c6 smallint unsigned, + c7 smallint)"); $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)"); mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); diff --git a/ext/mysqli/tests/025.phpt b/ext/mysqli/tests/025.phpt index 8d3e2388e1..9cf0351ce3 100644 --- a/ext/mysqli/tests/025.phpt +++ b/ext/mysqli/tests/025.phpt @@ -14,12 +14,12 @@ mysqli bind_param/bind_result tinyint values mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint, - c2 tinyint unsigned, - c3 tinyint not NULL, - c4 tinyint, - c5 tinyint, - c6 tinyint unsigned, - c7 tinyint)"); + c2 tinyint unsigned, + c3 tinyint not NULL, + c4 tinyint, + c5 tinyint, + c6 tinyint unsigned, + c7 tinyint)"); $stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES(?,?,?,?,?,?,?)"); mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); diff --git a/ext/mysqli/tests/045.phpt b/ext/mysqli/tests/045.phpt index 36bb92a525..62c348bc75 100644 --- a/ext/mysqli/tests/045.phpt +++ b/ext/mysqli/tests/045.phpt @@ -31,6 +31,11 @@ mysqli_bind_result (SHOW) mysqli_bind_result($stmt, $c1, $c2); mysqli_fetch($stmt); mysqli_stmt_close($stmt); + if (ini_get("unicode.semantics") && mysqli_get_server_version($link) < 50000) { + /* variables are binary */ + settype($c1, "unicode"); + settype($c2, "unicode"); + } $test = array ($c1,$c2); var_dump($test); @@ -53,4 +58,4 @@ array(2) { [1]=> unicode(%d) "%s" } -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/048.phpt b/ext/mysqli/tests/048.phpt index d713947763..8da3e4544d 100644 --- a/ext/mysqli/tests/048.phpt +++ b/ext/mysqli/tests/048.phpt @@ -12,13 +12,13 @@ mysqli bind_result (OO-Style) $mysql->select_db($db); $mysql->query("DROP TABLE IF EXISTS test_fetch_null"); - $mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, - col3 int, col4 bigint, - col5 float, col6 double, - col7 date, col8 time, - col9 varbinary(10), - col10 varchar(50), - col11 char(20))"); + $mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, + col3 int, col4 bigint, + col5 float, col6 double, + col7 date, col8 time, + col9 varbinary(10), + col10 varchar(50), + col11 char(20))"); $mysql->query("INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)"); diff --git a/ext/mysqli/tests/060.phpt b/ext/mysqli/tests/060.phpt index 805bf569cd..d77dca0342 100644 --- a/ext/mysqli/tests/060.phpt +++ b/ext/mysqli/tests/060.phpt @@ -20,12 +20,12 @@ mysqli_fetch_object with classes mysqli_query($link,"DROP TABLE IF EXISTS test_fetch"); mysqli_query($link,"CREATE TABLE test_fetch(c1 smallint unsigned, - c2 smallint unsigned, - c3 smallint, - c4 smallint, - c5 smallint, - c6 smallint unsigned, - c7 smallint)"); + c2 smallint unsigned, + c3 smallint, + c4 smallint, + c5 smallint, + c6 smallint unsigned, + c7 smallint)"); mysqli_query($link, "INSERT INTO test_fetch VALUES ( -23, 35999, NULL, -500, -9999999, -0, 0)"); diff --git a/ext/mysqli/tests/065.phpt b/ext/mysqli/tests/065.phpt index 80e3bbf92b..8f24152cfe 100644 --- a/ext/mysqli/tests/065.phpt +++ b/ext/mysqli/tests/065.phpt @@ -1,8 +1,8 @@ --TEST-- -set character set +set character set --SKIPIF-- -<?php -require_once('skipif.inc'); +<?php +require_once('skipif.inc'); if (!function_exists('mysqli_set_charset')) { die('skip mysqli_set_charset() not available'); } @@ -15,10 +15,10 @@ if (unicode_semantics()) { include "connect.inc"; if (!$mysql = new mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); - + printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); + if (!mysqli_query($mysql, "SET sql_mode=''")) - printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql)); + printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql)); $esc_str = chr(0xbf) . chr(0x5c); $len = $charset = array(); @@ -27,27 +27,27 @@ if (unicode_semantics()) { if ($mysql->set_charset("latin1")) { /* 5C should be escaped */ if (3 !== ($tmp = strlen($mysql->real_escape_string($esc_str)))) - printf("[003] Expecting 3/int got %s/%s\n", gettype($tmp), $tmp); - + printf("[003] Expecting 3/int got %s/%s\n", gettype($tmp), $tmp); + if ('latin1' !== ($tmp = $mysql->client_encoding())) - printf("[004] Expecting latin1/string got %s/%s\n", gettype($tmp), $tmp); + printf("[004] Expecting latin1/string got %s/%s\n", gettype($tmp), $tmp); } if ($res = $mysql->query("SHOW CHARACTER SET LIKE 'gbk'")) { - $res->free_result(); - if ($mysql->set_charset("gbk")) { - /* nothing should be escaped, it's a valid gbk character */ - - if (2 !== ($tmp = strlen($mysql->real_escape_string($esc_str)))) - printf("[005] Expecting 2/int got %s/%s\n", gettype($tmp), $tmp); - - if ('gbk' !== ($tmp = $mysql->client_encoding())) - printf("[005] Expecting gbk/string got %s/%s\n", gettype($tmp), $tmp);; - } + $res->free_result(); + if ($mysql->set_charset("gbk")) { + /* nothing should be escaped, it's a valid gbk character */ + + if (2 !== ($tmp = strlen($mysql->real_escape_string($esc_str)))) + printf("[005] Expecting 2/int got %s/%s\n", gettype($tmp), $tmp); + + if ('gbk' !== ($tmp = $mysql->client_encoding())) + printf("[005] Expecting gbk/string got %s/%s\n", gettype($tmp), $tmp);; + } } $mysql->close(); - - print "done!"; + + print "done!"; ?> --EXPECT-- done!
\ No newline at end of file diff --git a/ext/mysqli/tests/067.phpt b/ext/mysqli/tests/067.phpt index fd6016bd59..b7e457f298 100644 --- a/ext/mysqli/tests/067.phpt +++ b/ext/mysqli/tests/067.phpt @@ -10,9 +10,9 @@ function test: nested selects (cursors) /* skip cursor test for versions < 50004 */ if ((!$IS_MYSQLND && mysqli_get_client_version() < 50009) || - (mysqli_get_server_version($link) < 50009)) { - die(sprintf("skip Client library doesn't support cursors (%s/%s)", - mysqli_get_client_version(), mysqli_get_server_version($link)); + (mysqli_get_server_version($link) < 50009)) { + die(sprintf("skip Client library doesn't support cursors (%s/%s)", + mysqli_get_client_version(), mysqli_get_server_version($link)); } mysqli_close($link); ?> @@ -21,8 +21,8 @@ function test: nested selects (cursors) function open_cursor($mysql, $query) { if (!is_object($stmt = $mysql->prepare($query))) { - printf("[001] Cannot create statement object for '%s', [%d] %s\n", - $query, $mysql->errno, $mysql->error); + printf("[001] Cannot create statement object for '%s', [%d] %s\n", + $query, $mysql->errno, $mysql->error); } $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY); @@ -30,11 +30,16 @@ function test: nested selects (cursors) } include "connect.inc"; - $a = array(); - - /*** test mysqli_connect 127.0.0.1 ***/ $mysql = new mysqli($host, $user, $passwd, $db, $port, $socket); + if ((!$IS_MYSQLND && mysqli_get_client_version() < 50009) || + (mysqli_get_server_version($mysql) < 50009)) { + /* we really want to skip it... */ + die(var_dump(63)); + } + + $a = array(); + for ($i=0;$i < 3; $i++) { $mysql->query("DROP TABLE IF EXISTS cursor$i"); $mysql->query("CREATE TABLE cursor$i (a int not null) ENGINE=" . $engine); diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc index 8b86355564..5db701d93b 100644 --- a/ext/mysqli/tests/connect.inc +++ b/ext/mysqli/tests/connect.inc @@ -1,11 +1,11 @@ <?php - /* - Default values are "localhost", "root", - database "phptest" and empty password. - Change the MYSQL_TEST environment values - if you want to use another configuration - */ - + /* + Default values are "localhost", "root", + database "phptest" and empty password. + Change the MYSQL_TEST environment values + if you want to use another configuration + */ + $driver = new mysqli_driver; $host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "localhost"; @@ -15,40 +15,40 @@ $db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "phptest"; $engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM"; $socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null; - + /* Development setting: test experimal features and/or feature requests that never worked before? */ - $TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ? - ((1 == getenv("MYSQL_TEST_EXPERIMENTAL")) ? true : false) : - false; + $TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ? + ((1 == getenv("MYSQL_TEST_EXPERIMENTAL")) ? true : false) : + false; $IS_MYSQLND = stristr(mysqli_get_client_info(), "mysqlnd"); if (!$IS_MYSQLND) { - $MYSQLND_VERSION = NULL; + $MYSQLND_VERSION = NULL; } else { - if (preg_match('@Revision:\s+(\d+)\s*\$@ism', mysqli_get_client_info(), $matches)) { - $MYSQLND_VERSION = (int)$matches[1]; - } else { - $MYSQLND_VERSION = -1; - } + if (preg_match('@Revision:\s+(\d+)\s*\$@ism', mysqli_get_client_info(), $matches)) { + $MYSQLND_VERSION = (int)$matches[1]; + } else { + $MYSQLND_VERSION = -1; + } } - if (!function_exists('sys_get_temp_dir')) { - function sys_get_temp_dir() { - - if (!empty($_ENV['TMP'])) - return realpath( $_ENV['TMP'] ); - if (!empty($_ENV['TMPDIR'])) - return realpath( $_ENV['TMPDIR'] ); - if (!empty($_ENV['TEMP'])) - return realpath( $_ENV['TEMP'] ); - - $temp_file = tempnam(md5(uniqid(rand(), TRUE)), ''); - if ($temp_file) { - $temp_dir = realpath(dirname($temp_file)); - unlink($temp_file); - return $temp_dir; - } - return FALSE; - } - } + if (!function_exists('sys_get_temp_dir')) { + function sys_get_temp_dir() { + + if (!empty($_ENV['TMP'])) + return realpath( $_ENV['TMP'] ); + if (!empty($_ENV['TMPDIR'])) + return realpath( $_ENV['TMPDIR'] ); + if (!empty($_ENV['TEMP'])) + return realpath( $_ENV['TEMP'] ); + + $temp_file = tempnam(md5(uniqid(rand(), TRUE)), ''); + if ($temp_file) { + $temp_dir = realpath(dirname($temp_file)); + unlink($temp_file); + return $temp_dir; + } + return FALSE; + } + } ?>
\ No newline at end of file diff --git a/ext/mysqli/tests/skipif.inc b/ext/mysqli/tests/skipif.inc index 5562aab84b..a7581fb480 100644 --- a/ext/mysqli/tests/skipif.inc +++ b/ext/mysqli/tests/skipif.inc @@ -2,4 +2,4 @@ if (!extension_loaded('mysqli')){ die('skip mysqli extension not available'); } -?> +?>
\ No newline at end of file diff --git a/ext/mysqli/tests/skipifemb.inc b/ext/mysqli/tests/skipifemb.inc index 298c7219a6..254a4ccece 100644 --- a/ext/mysqli/tests/skipifemb.inc +++ b/ext/mysqli/tests/skipifemb.inc @@ -1,5 +1,5 @@ <?php - $driver = new mysqli_driver(); - if ($driver->embedded) - die("skip test doesn't run with embedded server"); -?> + $driver = new mysqli_driver(); + if ($driver->embedded) + die("skip test doesn't run with embedded server"); +?>
\ No newline at end of file diff --git a/ext/mysqli/tests/skipifnotemb.inc b/ext/mysqli/tests/skipifnotemb.inc index 8639130cbe..d73d185bc4 100644 --- a/ext/mysqli/tests/skipifnotemb.inc +++ b/ext/mysqli/tests/skipifnotemb.inc @@ -1,5 +1,5 @@ <?php - $driver = new mysqli_driver(); - if (!$driver->embedded) - die("skip test for with embedded server only"); -?> + $driver = new mysqli_driver(); + if (!$driver->embedded) + die("skip test for with embedded server only"); +?>
\ No newline at end of file diff --git a/ext/mysqli/tests/table.inc b/ext/mysqli/tests/table.inc index 142053cbed..bfbbed7102 100644 --- a/ext/mysqli/tests/table.inc +++ b/ext/mysqli/tests/table.inc @@ -2,22 +2,22 @@ require_once('connect.inc'); if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); - exit(1); -} - + printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", + $host, $user, $db, $port, $socket); + exit(1); +} + if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) { - printf("Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - exit(1); -} - + 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)) { - printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - exit(1); + printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + exit(1); } if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e"), (6, "f")')) { - printf("[%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[%d] %s\n", mysqli_errno($link), mysqli_error($link)); } ?>
\ No newline at end of file |