Skip to content

Fix warnings on site health screen #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/WP_SQLite_Metadata_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 4 additions & 2 deletions wp-includes/sqlite/class-wp-sqlite-translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1528,14 +1528,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'
Expand Down