diff --git a/load.php b/load.php index 4e082ee..819ca73 100644 --- a/load.php +++ b/load.php @@ -3,7 +3,7 @@ * Plugin Name: SQLite Database Integration * Description: SQLite database driver drop-in. * Author: The WordPress Team - * Version: 2.1.17-alpha + * Version: 2.1.17-alpha.1 * Requires PHP: 7.0 * Textdomain: sqlite-database-integration * diff --git a/readme.txt b/readme.txt index 479be3b..c46dbf3 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Contributors: wordpressdotorg, aristath, janjakes, zieladam, berislav.grgic Requires at least: 6.4 Tested up to: 6.6.1 Requires PHP: 7.0 -Stable tag: 2.1.17-alpha +Stable tag: 2.1.17-alpha.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, database diff --git a/tests/WP_SQLite_Metadata_Tests.php b/tests/WP_SQLite_Metadata_Tests.php index 2c718cb..cc66b35 100644 --- a/tests/WP_SQLite_Metadata_Tests.php +++ b/tests/WP_SQLite_Metadata_Tests.php @@ -78,7 +78,7 @@ public function testInformationSchemaTables() { $this->assertEquals( array( 'TABLE_CATALOG' => 'def', - 'TABLE_SCHEMA' => 'database', + 'TABLE_SCHEMA' => '', 'TABLE_NAME' => 'wp_options', 'TABLE_TYPE' => 'BASE TABLE', 'ENGINE' => 'InnoDB', diff --git a/wp-includes/sqlite/class-wp-sqlite-translator.php b/wp-includes/sqlite/class-wp-sqlite-translator.php index 2d47a63..a2c5ce3 100644 --- a/wp-includes/sqlite/class-wp-sqlite-translator.php +++ b/wp-includes/sqlite/class-wp-sqlite-translator.php @@ -1519,14 +1519,16 @@ private function execute_select() { if ( $table_name && str_starts_with( strtolower( $table_name ), 'information_schema' ) ) { $this->is_information_schema_query = true; - $updated_query = preg_replace( + + $database_name = $this->pdo->quote( defined( 'DB_NAME' ) ? DB_NAME : '' ); + $updated_query = preg_replace( '/' . $table_name . '\.tables/i', /** * TODO: Return real values for hardcoded column values. */ "(SELECT 'def' as TABLE_CATALOG, - 'database' as TABLE_SCHEMA, + $database_name as TABLE_SCHEMA, name as TABLE_NAME, CASE type WHEN 'table' THEN 'BASE TABLE'