diff --git a/tests/integration/mysqli/skipif.inc b/tests/integration/mysqli/skipif.inc index ecc42627f..cac8e76f2 100644 --- a/tests/integration/mysqli/skipif.inc +++ b/tests/integration/mysqli/skipif.inc @@ -21,9 +21,84 @@ if (!extension_loaded("mysqli")) { mysqli_report(MYSQLI_REPORT_STRICT); // prevent warning if connect fails +/* +$link = @mysql_connect($MYSQL_SERVER, $MYSQL_USER, $MYSQL_PASSWD); +if (FALSE === $link) { + die("skip: " . mysql_error() . "\n"); +} + +if (!empty($MYSQL_DB)) { + if (FALSE === mysql_select_db($MYSQL_DB, $link)) { + die("skip: " . mysql_error() . "\n"); + } +} +*/ + try { - $link = @mysqli_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWD, $MYSQL_DB, $MYSQL_PORT, $MYSQL_SOCKET); - mysqli_close($link); + + $link = @mysqli_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWD); + + if (FALSE === $link) { + die("skip: " . mysqli_error() . "\n"); + } + + if (!empty($MYSQL_DB)) { + if (FALSE === mysqli_select_db($link, $MYSQL_DB)) { + /* Database doesn't exist, will try to create. */ + /* Create database. */ + $sql = "CREATE DATABASE " . $MYSQL_DB; + $result = mysqli_query($link, $sql); + mysqli_select_db($link, $MYSQL_DB); + + $result = mysqli_query($link, $sql); + if (FALSE === $result) { + die("skip: Error with database."); + } + + /* Create table `COLUMNS`. */ + if (mysqli_query($link, "DESCRIBE COLUMNS ")) { + /* Already exists */ + } else { + $sql = "CREATE TABLE COLUMNS( + id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, + code VARCHAR(30) NOT NULL + )"; + mysqli_query($link, $sql); + } + + + /* Create table `STATISTICS`. */ + if (mysqli_query($link, "DESCRIBE STATISTICS ")) { + /* Already exists */ + } else { + $sql = "CREATE TABLE STATISTICS( + )"; + mysqli_query($link, $sql); + } + + /* Create table `TRIGGERS`. */ + if (mysqli_query($link, "DESCRIBE TRIGGERS ")) { + /* Already exists */ + } else { + $sql = "CREATE TABLE TRIGGERS( + id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, + code VARCHAR(30) NOT NULL + )"; + mysqli_query($link, $sql); + } + + + /* commit transaction */ + if (!mysqli_commit($link)) { + print("Transaction commit failed.\n"); + } else { + echo "Transaction commit succeeded.\n"; + } + } + } + + mysqli_close($link); } catch (Exception $e) { - die("skip: " . $e->getMessage() . "\n"); + die("skip: " . $e->getMessage() . "\n"); } + diff --git a/tests/integration/mysqli/test_bind_param_object_oo.php b/tests/integration/mysqli/test_bind_param_object_oo.php index 61aee7eb1..c05abe917 100644 --- a/tests/integration/mysqli/test_bind_param_object_oo.php +++ b/tests/integration/mysqli/test_bind_param_object_oo.php @@ -44,8 +44,8 @@ [{"name":"Datastore/MySQL/all"}, [10, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [10, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [10, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [10, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [10, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [10, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [ 1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [ 1, "??", "??", "??", "??", "??"]], @@ -62,8 +62,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 10, "?? total time", "?? min time", @@ -86,7 +86,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -125,9 +125,14 @@ public function __toString() { function test_stmt_prepare($link, $name) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?"; - $stmt = $link->prepare($query); + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?"; + + $stmt = $link->prepare($query); + if (FALSE === $stmt) { + echo mysqli_error($link) . "\n"; + return; + } if (FALSE === $stmt->bind_param('s', $name) || FALSE === $stmt->execute() || FALSE === $stmt->bind_result($output)) { diff --git a/tests/integration/mysqli/test_bind_param_oo.php b/tests/integration/mysqli/test_bind_param_oo.php index 352bd69c8..95b3e1fca 100644 --- a/tests/integration/mysqli/test_bind_param_oo.php +++ b/tests/integration/mysqli/test_bind_param_oo.php @@ -36,8 +36,8 @@ [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -54,8 +54,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -78,7 +78,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -109,8 +109,8 @@ function test_stmt_prepare($link) { $stmt = $link->stmt_init(); $name = 'STATISTICS'; - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?"; if (FALSE === $stmt->prepare($query) || FALSE === $stmt->bind_param('s', $name) || FALSE === $stmt->execute() || diff --git a/tests/integration/mysqli/test_bind_param_proc.php b/tests/integration/mysqli/test_bind_param_proc.php index f1fa39020..d495fcc9e 100644 --- a/tests/integration/mysqli/test_bind_param_proc.php +++ b/tests/integration/mysqli/test_bind_param_proc.php @@ -35,8 +35,8 @@ [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -53,8 +53,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -77,7 +77,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -108,7 +108,7 @@ function test_stmt_prepare($link) { $stmt = mysqli_stmt_init($link); $name = 'STATISTICS'; - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?"; if (FALSE === mysqli_stmt_prepare($stmt, $query) || FALSE === mysqli_stmt_bind_param($stmt, 's', $name) || diff --git a/tests/integration/mysqli/test_explain_connect.php b/tests/integration/mysqli/test_explain_connect.php index 79942a8d2..bccea17a1 100644 --- a/tests/integration/mysqli/test_explain_connect.php +++ b/tests/integration/mysqli/test_explain_connect.php @@ -34,8 +34,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -52,8 +52,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -76,7 +76,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -105,7 +105,7 @@ function test_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_explain_construct.php b/tests/integration/mysqli/test_explain_construct.php index 93ff58766..ea8fd355b 100644 --- a/tests/integration/mysqli/test_explain_construct.php +++ b/tests/integration/mysqli/test_explain_construct.php @@ -35,8 +35,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -53,8 +53,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -77,7 +77,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -106,7 +106,8 @@ function test_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_explain_database_no_user.php b/tests/integration/mysqli/test_explain_database_no_user.php index 53e829924..5057b0385 100644 --- a/tests/integration/mysqli/test_explain_database_no_user.php +++ b/tests/integration/mysqli/test_explain_database_no_user.php @@ -34,8 +34,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -52,8 +52,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -76,7 +76,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -105,7 +105,7 @@ function test_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_explain_init_oo.php b/tests/integration/mysqli/test_explain_init_oo.php index 8c9e8428b..46b2b7ab4 100644 --- a/tests/integration/mysqli/test_explain_init_oo.php +++ b/tests/integration/mysqli/test_explain_init_oo.php @@ -34,8 +34,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -52,8 +52,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -76,7 +76,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -105,7 +105,7 @@ function test_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_explain_init_oo_persistent.php b/tests/integration/mysqli/test_explain_init_oo_persistent.php index 8b2539ccd..4afb861f7 100644 --- a/tests/integration/mysqli/test_explain_init_oo_persistent.php +++ b/tests/integration/mysqli/test_explain_init_oo_persistent.php @@ -34,8 +34,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -52,8 +52,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -76,7 +76,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -105,7 +105,7 @@ function test_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_explain_init_proc.php b/tests/integration/mysqli/test_explain_init_proc.php index 340b9620f..0c02d5407 100644 --- a/tests/integration/mysqli/test_explain_init_proc.php +++ b/tests/integration/mysqli/test_explain_init_proc.php @@ -34,8 +34,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -52,8 +52,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -76,7 +76,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -105,7 +105,8 @@ function test_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_explain_leading_whitespace.php b/tests/integration/mysqli/test_explain_leading_whitespace.php index bff581464..dda6d2b53 100644 --- a/tests/integration/mysqli/test_explain_leading_whitespace.php +++ b/tests/integration/mysqli/test_explain_leading_whitespace.php @@ -33,8 +33,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -51,13 +51,41 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - " SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", "?? max time", { + "explain_plan": [ + [ + "id", + "select_type", + "table", + "type", + "possible_keys", + "key", + "key_len", + "ref", + "rows", + "Extra" + ], + [ + [ + 1, + "SIMPLE", + "tables", + "ALL", + null, + "TABLE_NAME", + null, + null, + null, + "Using where; Skip_open_table; Scanned 1 database" + ] + ] + ], "backtrace": [ " in mysqli_stmt_execute called at __FILE__ (??)", " in test_prepare called at __FILE__ (??)" @@ -76,7 +104,7 @@ function test_prepare($link) { - $query = " SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_explain_reused_id.php b/tests/integration/mysqli/test_explain_reused_id.php index 06ed1d532..72a6ef11f 100644 --- a/tests/integration/mysqli/test_explain_reused_id.php +++ b/tests/integration/mysqli/test_explain_reused_id.php @@ -35,8 +35,8 @@ [{"name":"Datastore/allOther"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [2, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [2, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [2, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [2, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -53,8 +53,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -77,7 +77,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -98,8 +98,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ? AND ? = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=? AND ? = ?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -122,7 +122,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -202,6 +202,6 @@ function test_prepare($link, $query, $types = null, $params = null) exit(1); } -test_prepare($link, "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS' AND ? = ?", 'ii', array(1, 1)); -test_prepare($link, "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"); +test_prepare($link, "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS' AND ? = ?", 'ii', array(1, 1)); +test_prepare($link, "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"); mysqli_close($link); diff --git a/tests/integration/mysqli/test_explain_select_db_oo.php b/tests/integration/mysqli/test_explain_select_db_oo.php index b76f47b15..6e49fbfbd 100644 --- a/tests/integration/mysqli/test_explain_select_db_oo.php +++ b/tests/integration/mysqli/test_explain_select_db_oo.php @@ -34,8 +34,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -52,8 +52,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -76,7 +76,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -105,7 +105,8 @@ function test_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_explain_select_db_proc.php b/tests/integration/mysqli/test_explain_select_db_proc.php index ccb6a85f6..a01a0521b 100644 --- a/tests/integration/mysqli/test_explain_select_db_proc.php +++ b/tests/integration/mysqli/test_explain_select_db_proc.php @@ -34,8 +34,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -52,8 +52,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -76,7 +76,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -105,7 +105,7 @@ function test_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_multi_query_oo.php b/tests/integration/mysqli/test_multi_query_oo.php index c22fb4b6c..73145b8a1 100644 --- a/tests/integration/mysqli/test_multi_query_oo.php +++ b/tests/integration/mysqli/test_multi_query_oo.php @@ -40,8 +40,8 @@ [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -58,8 +58,9 @@ require_once(realpath (dirname ( __FILE__ )) . '/mysqli.inc'); function test_multi_query($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'; "; - $query .= "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'COLUMNS';"; + + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'; "; + $query .= "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='COLUMNS';"; if (FALSE === $link->multi_query($query)) { echo $link->error . "\n"; diff --git a/tests/integration/mysqli/test_multi_query_proc.php b/tests/integration/mysqli/test_multi_query_proc.php index fb8c4bd0f..a7ab69d2a 100644 --- a/tests/integration/mysqli/test_multi_query_proc.php +++ b/tests/integration/mysqli/test_multi_query_proc.php @@ -40,8 +40,8 @@ [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -58,8 +58,8 @@ require_once(realpath (dirname ( __FILE__ )) . '/mysqli.inc'); function test_multi_query($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'; "; - $query .= "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'COLUMNS';"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'; "; + $query .= "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='COLUMNS';"; if (FALSE === mysqli_multi_query($link, $query)) { echo $mysqli_error($link); diff --git a/tests/integration/mysqli/test_mysqli_query_1.php b/tests/integration/mysqli/test_mysqli_query_1.php index 05b2bb978..fce044642 100644 --- a/tests/integration/mysqli/test_mysqli_query_1.php +++ b/tests/integration/mysqli/test_mysqli_query_1.php @@ -37,8 +37,8 @@ [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"},[1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"},[1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -55,8 +55,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL id", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -79,7 +79,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -108,7 +108,8 @@ function test_mysqli_query($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; + $result = mysqli_query($link, $query); if (FALSE === $result) { diff --git a/tests/integration/mysqli/test_prepare_proc.php b/tests/integration/mysqli/test_prepare_proc.php index c5c25b68c..6bf7c5c33 100644 --- a/tests/integration/mysqli/test_prepare_proc.php +++ b/tests/integration/mysqli/test_prepare_proc.php @@ -33,8 +33,8 @@ [{"name":"Datastore/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -51,8 +51,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -75,7 +75,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -104,7 +104,7 @@ function test_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = mysqli_prepare($link, $query); if (FALSE === $stmt) { diff --git a/tests/integration/mysqli/test_query_oo.php b/tests/integration/mysqli/test_query_oo.php index 8f546c2f2..572276112 100644 --- a/tests/integration/mysqli/test_query_oo.php +++ b/tests/integration/mysqli/test_query_oo.php @@ -35,8 +35,8 @@ [{"name":"Datastore/allOther"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [2, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [2, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [2, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [2, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -55,7 +55,7 @@ function test_query1($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS';"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $result = $link->query($query); tap_not_equal(FALSE, $result, "test_query1 (query)"); @@ -63,7 +63,7 @@ function test_query1($link) if (FALSE !== $result) { while ($row = $result->fetch_array()) { - tap_equal($expected, $row, "test_query1 (fetch)"); + tap_equal($expected, $row, "test_query1 (fetch)"); } $result->close(); } @@ -71,7 +71,7 @@ function test_query1($link) function test_query2($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS';"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $result = $link->query($query, MYSQLI_USE_RESULT); tap_not_equal(FALSE, $result, "test_query2 (query)"); diff --git a/tests/integration/mysqli/test_query_proc.php b/tests/integration/mysqli/test_query_proc.php index d9d293b75..85b768edc 100644 --- a/tests/integration/mysqli/test_query_proc.php +++ b/tests/integration/mysqli/test_query_proc.php @@ -35,8 +35,8 @@ [{"name":"Datastore/allOther"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/all"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [2, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [2, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [2, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [2, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], @@ -56,11 +56,9 @@ /* Test the two argument form. */ function test_mysqli_query2($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS';"; - + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $result = mysqli_query($link, $query); tap_not_equal(FALSE, $result, "test_mysqli_query2 (query)"); - $expected = array(0 => "STATISTICS", "TABLE_NAME" => "STATISTICS"); if (FALSE !== $result) { @@ -74,8 +72,10 @@ function test_mysqli_query2($link) /* Test the three argument form. */ function test_mysqli_query3($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS';"; + + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $result = mysqli_query($link, $query, MYSQLI_USE_RESULT); + tap_not_equal(FALSE, $result, "test_mysqli_query3 (query)"); $expected = array(0 => "STATISTICS", "TABLE_NAME" => "STATISTICS"); diff --git a/tests/integration/mysqli/test_real_query_oo.php b/tests/integration/mysqli/test_real_query_oo.php index b7a8b8502..8c7c7d1d7 100644 --- a/tests/integration/mysqli/test_real_query_oo.php +++ b/tests/integration/mysqli/test_real_query_oo.php @@ -40,8 +40,8 @@ [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -58,8 +58,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?;", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -82,7 +82,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -111,7 +111,7 @@ function test_real_query($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS';"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; if ($link->real_query($query)) { $result = $link->use_result(); diff --git a/tests/integration/mysqli/test_real_query_proc.php b/tests/integration/mysqli/test_real_query_proc.php index 91eddcd9c..8693e21ff 100644 --- a/tests/integration/mysqli/test_real_query_proc.php +++ b/tests/integration/mysqli/test_real_query_proc.php @@ -42,8 +42,8 @@ [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -59,8 +59,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?;", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -83,7 +83,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -112,7 +112,7 @@ function test_real_query($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS';"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; if (mysqli_real_query($link, $query)) { $result = mysqli_use_result($link); diff --git a/tests/integration/mysqli/test_stmt_prepare_oo.php b/tests/integration/mysqli/test_stmt_prepare_oo.php index 81ad8593a..6294d064d 100644 --- a/tests/integration/mysqli/test_stmt_prepare_oo.php +++ b/tests/integration/mysqli/test_stmt_prepare_oo.php @@ -35,8 +35,8 @@ [{"name":"Datastore/MySQL/all"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [2, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [2, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [2, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [2, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [2, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -54,7 +54,7 @@ function test_stmt_construct($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'TRIGGERS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='TRIGGERS'"; $stmt = new mysqli_stmt($link, $query); if (FALSE === $stmt->execute() || @@ -64,9 +64,8 @@ function test_stmt_construct($link) return; } - while ($stmt->fetch()) { - echo $name . "\n"; - } + $stmt->fetch(); + echo $name . "\n"; $stmt->close(); } @@ -74,7 +73,7 @@ function test_stmt_construct($link) function test_stmt_prepare($link) { $stmt = $link->stmt_init(); - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; if (FALSE === $stmt->prepare($query) || FALSE === $stmt->execute() || diff --git a/tests/integration/mysqli/test_stmt_prepare_proc.php b/tests/integration/mysqli/test_stmt_prepare_proc.php index 121b87e1a..0cb3d74a8 100644 --- a/tests/integration/mysqli/test_stmt_prepare_proc.php +++ b/tests/integration/mysqli/test_stmt_prepare_proc.php @@ -35,8 +35,8 @@ [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -53,8 +53,8 @@ "OtherTransaction/php__FILE__", "", "?? SQL ID", - "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = ?", - "Datastore/statement/MySQL/TABLES/select", + "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name=?", + "Datastore/statement/MySQL/tables/select", 1, "?? total time", "?? min time", @@ -77,7 +77,7 @@ [ 1, "SIMPLE", - "TABLES", + "tables", "ALL", null, "TABLE_NAME", @@ -107,8 +107,7 @@ function test_stmt_prepare($link) { $stmt = mysqli_stmt_init($link); - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; - + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; if (FALSE === mysqli_stmt_prepare($stmt, $query) || FALSE === mysqli_stmt_execute($stmt) || FALSE === mysqli_stmt_bind_result($stmt, $name)) { diff --git a/tests/integration/mysqli/test_subclassing.php b/tests/integration/mysqli/test_subclassing.php index bb7f66352..f0e2e318b 100644 --- a/tests/integration/mysqli/test_subclassing.php +++ b/tests/integration/mysqli/test_subclassing.php @@ -33,8 +33,8 @@ classes. [{"name":"Datastore/MySQL/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/MySQL/allOther"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Datastore/operation/MySQL/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Datastore/statement/MySQL/TABLES/select", + [{"name":"Datastore/statement/MySQL/tables/select"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Datastore/statement/MySQL/tables/select", "scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], @@ -91,7 +91,7 @@ public function execute() function test_stmt_prepare($link) { - $query = "SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = 'STATISTICS'"; + $query = "SELECT TABLE_NAME FROM information_schema.tables WHERE table_name='STATISTICS'"; $stmt = $link->prepare($query); if (FALSE === $stmt->execute() ||