Skip to content

Commit 0e7ce34

Browse files
committed
Fix missing table name column in SHOW CREATE TABLE statement
1 parent b0ca303 commit 0e7ce34

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

tests/WP_SQLite_Driver_Metadata_Tests.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,7 @@ public function testInformationSchemaForeignKeys(): void {
13191319
$this->assertEquals(
13201320
array(
13211321
(object) array(
1322+
'Table' => 't2',
13221323
'Create Table' => implode(
13231324
"\n",
13241325
array(
@@ -1451,6 +1452,7 @@ public function testInformationSchemaInlineForeignKeys(): void {
14511452
$this->assertEquals(
14521453
array(
14531454
(object) array(
1455+
'Table' => 't2',
14541456
'Create Table' => implode(
14551457
"\n",
14561458
array(
@@ -1558,6 +1560,7 @@ public function testInformationSchemaForeignKeysWithMultipleColumns(): void {
15581560
$this->assertEquals(
15591561
array(
15601562
(object) array(
1563+
'Table' => 't2',
15611564
'Create Table' => implode(
15621565
"\n",
15631566
array(
@@ -1681,6 +1684,7 @@ public function testInformationSchemaAlterTableAddForeignKeys(): void {
16811684
$this->assertEquals(
16821685
array(
16831686
(object) array(
1687+
'Table' => 't2',
16841688
'Create Table' => implode(
16851689
"\n",
16861690
array(
@@ -1725,6 +1729,7 @@ public function testInformationSchemaAlterTableDropForeignKeys(): void {
17251729
$this->assertEquals(
17261730
array(
17271731
(object) array(
1732+
'Table' => 't2',
17281733
'Create Table' => implode(
17291734
"\n",
17301735
array(
@@ -1764,6 +1769,7 @@ public function testInformationSchemaAlterTableDropForeignKeys(): void {
17641769
$this->assertEquals(
17651770
array(
17661771
(object) array(
1772+
'Table' => 't2',
17671773
'Create Table' => implode(
17681774
"\n",
17691775
array(
@@ -1799,6 +1805,7 @@ public function testInformationSchemaAlterTableDropForeignKeys(): void {
17991805
$this->assertEquals(
18001806
array(
18011807
(object) array(
1808+
'Table' => 't2',
18021809
'Create Table' => implode(
18031810
"\n",
18041811
array(
@@ -1830,6 +1837,7 @@ public function testInformationSchemaAlterTableDropForeignKeys(): void {
18301837
$this->assertEquals(
18311838
array(
18321839
(object) array(
1840+
'Table' => 't2',
18331841
'Create Table' => implode(
18341842
"\n",
18351843
array(
@@ -1852,6 +1860,7 @@ public function testInformationSchemaAlterTableDropPrimaryKey(): void {
18521860
$this->assertEquals(
18531861
array(
18541862
(object) array(
1863+
'Table' => 't',
18551864
'Create Table' => implode(
18561865
"\n",
18571866
array(
@@ -1882,6 +1891,7 @@ public function testInformationSchemaAlterTableDropPrimaryKey(): void {
18821891
$this->assertEquals(
18831892
array(
18841893
(object) array(
1894+
'Table' => 't',
18851895
'Create Table' => implode(
18861896
"\n",
18871897
array(
@@ -1913,6 +1923,7 @@ public function testInformationSchemaAlterTableDropUniqueKey(): void {
19131923
$this->assertEquals(
19141924
array(
19151925
(object) array(
1926+
'Table' => 't',
19161927
'Create Table' => implode(
19171928
"\n",
19181929
array(

tests/WP_SQLite_Driver_Tests.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9664,6 +9664,7 @@ public function testFullyQualifiedTableName(): void {
96649664
$this->assertEquals(
96659665
array(
96669666
(object) array(
9667+
'Table' => 't',
96679668
'Create Table' => implode(
96689669
"\n",
96699670
array(

wp-includes/sqlite-ast/class-wp-sqlite-driver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,7 @@ private function execute_show_statement( WP_Parser_Node $node ): void {
22632263
$this->set_results_from_fetched_data(
22642264
array(
22652265
(object) array(
2266+
'Table' => $table_name,
22662267
'Create Table' => $sql,
22672268
),
22682269
)

0 commit comments

Comments
 (0)