This repository was archived by the owner on Jun 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public function testInformationSchemaTables() {
78
78
$ this ->assertEquals (
79
79
array (
80
80
'TABLE_CATALOG ' => 'def ' ,
81
- 'TABLE_SCHEMA ' => 'database ' ,
81
+ 'TABLE_SCHEMA ' => '' ,
82
82
'TABLE_NAME ' => 'wp_options ' ,
83
83
'TABLE_TYPE ' => 'BASE TABLE ' ,
84
84
'ENGINE ' => 'InnoDB ' ,
Original file line number Diff line number Diff line change @@ -1528,14 +1528,16 @@ private function execute_select() {
1528
1528
1529
1529
if ( $ table_name && str_starts_with ( strtolower ( $ table_name ), 'information_schema ' ) ) {
1530
1530
$ this ->is_information_schema_query = true ;
1531
- $ updated_query = preg_replace (
1531
+
1532
+ $ database_name = $ this ->pdo ->quote ( defined ( 'DB_NAME ' ) ? DB_NAME : '' );
1533
+ $ updated_query = preg_replace (
1532
1534
'/ ' . $ table_name . '\.tables/i ' ,
1533
1535
/**
1534
1536
* TODO: Return real values for hardcoded column values.
1535
1537
*/
1536
1538
"(SELECT
1537
1539
'def' as TABLE_CATALOG,
1538
- 'database' as TABLE_SCHEMA,
1540
+ $ database_name as TABLE_SCHEMA,
1539
1541
name as TABLE_NAME,
1540
1542
CASE type
1541
1543
WHEN 'table' THEN 'BASE TABLE'
You can’t perform that action at this time.
0 commit comments