Skip to content

Commit 7ab0100

Browse files
committed
Ensure WHERE works
1 parent d903016 commit 7ab0100

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

tests/WP_SQLite_Metadata_Tests.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,21 @@ public function testCountTables() {
7474
}
7575

7676
public function testInformationSchemaTables() {
77-
$result = $this->assertQuery( "SELECT * FROM information_schema.tables" );
77+
$result = $this->assertQuery( "SELECT * FROM information_schema.tables WHERE TABLE_NAME = 'wp_options'" );
7878
$this->assertEquals(
7979
array(
80-
'TABLE_NAME' => '_mysql_data_types_cache',
80+
'TABLE_NAME' => 'wp_options',
8181
'TABLE_TYPE' => 'BASE TABLE',
8282
'TABLE_SCHEMA' => 'database',
8383
'ENGINE' => 'InnoDB',
8484
'TABLE_COLLATION' => 'utf8mb4_general_ci',
8585
'TABLE_COMMENT' => '',
86-
'CREATE_TABLE' => 'CREATE TABLE _mysql_data_types_cache (
87-
`table` TEXT NOT NULL,
88-
`column_or_index` TEXT NOT NULL,
89-
`mysql_type` TEXT NOT NULL,
90-
PRIMARY KEY(`table`, `column_or_index`)
91-
)',
86+
'CREATE_TABLE' => 'CREATE TABLE "wp_options"(
87+
"option_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
88+
"option_name" text NOT NULL DEFAULT \'\' COLLATE NOCASE,
89+
"option_value" text NOT NULL COLLATE NOCASE,
90+
"autoload" text NOT NULL DEFAULT \'yes\' COLLATE NOCASE
91+
)',
9292
'AUTO_INCREMENT' => null,
9393
'CREATE_TIME' => null,
9494
'UPDATE_TIME' => null,

wp-includes/sqlite/class-wp-sqlite-translator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,6 @@ private function execute_select() {
15381538
WHERE type IN ('table', 'view'))",
15391539
$updated_query
15401540
);
1541-
var_dump( $updated_query );
15421541
} elseif (
15431542
// Examples: @@SESSION.sql_mode, @@GLOBAL.max_allowed_packet, @@character_set_client
15441543
preg_match( '/@@((SESSION|GLOBAL)\s*\.\s*)?\w+\b/i', $updated_query ) === 1 ||

0 commit comments

Comments
 (0)