Skip to content
Merged
Prev Previous commit
Next Next commit
Fix typos
  • Loading branch information
JanJakes committed Oct 29, 2025
commit b7f7921581182de9a9906ef809e85517bf2db6a4
8 changes: 4 additions & 4 deletions tests/WP_SQLite_Driver_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -11075,7 +11075,7 @@ public function testInsertErrors(): void {
// Missing table.
$this->assertQueryError(
'INSERT INTO missing_table VALUES (1)',
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'missing_table' doesn't exists"
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'missing_table' doesn't exist"
);

// Missing column.
Expand All @@ -11092,7 +11092,7 @@ public function testInsertErrorsInNonStrictMode(): void {
// Missing table.
$this->assertQueryError(
'INSERT INTO missing_table VALUES (1)',
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'missing_table' doesn't exists"
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'missing_table' doesn't exist"
);

// Missing column.
Expand All @@ -11108,7 +11108,7 @@ public function testUpdateErrors(): void {
// Missing table.
$this->assertQueryError(
'UPDATE missing_table SET value = 1',
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'missing_table' doesn't exists"
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'missing_table' doesn't exist"
);

// Missing column.
Expand All @@ -11125,7 +11125,7 @@ public function testUpdateErrorsInNonStrictMode(): void {
// Missing table.
$this->assertQueryError(
'UPDATE missing_table SET value = 1',
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'missing_table' doesn't exists"
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'missing_table' doesn't exist"
);

// Missing column.
Expand Down
12 changes: 6 additions & 6 deletions wp-includes/sqlite-ast/class-wp-sqlite-driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4421,7 +4421,7 @@ private function translate_insert_or_replace_body(
if ( 0 === count( $columns ) ) {
throw $this->new_driver_exception(
sprintf(
"SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s' doesn't exists",
"SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s' doesn't exist",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MySQL error codes! Nice

$table_name
),
'42S02'
Expand Down Expand Up @@ -4454,12 +4454,12 @@ private function translate_insert_or_replace_body(
}

// Check if all listed columns exist.
$unkwnown_columns = array_diff( $insert_list, array_column( $columns, 'COLUMN_NAME' ) );
if ( count( $unkwnown_columns ) > 0 ) {
$unknown_columns = array_diff( $insert_list, array_column( $columns, 'COLUMN_NAME' ) );
if ( count( $unknown_columns ) > 0 ) {
throw $this->new_driver_exception(
sprintf(
"SQLSTATE[42S22]: Column not found: 1054 Unknown column '%s' in 'field list'",
$unkwnown_columns[0]
$unknown_columns[0]
),
'42S22'
);
Expand Down Expand Up @@ -4662,7 +4662,7 @@ private function translate_update_list( string $table_name, WP_Parser_Node $node
if ( 0 === count( $columns ) ) {
throw $this->new_driver_exception(
sprintf(
"SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s' doesn't exists",
"SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s' doesn't exist",
$table_name
),
'42S02'
Expand Down Expand Up @@ -5121,7 +5121,7 @@ private function cast_value_for_insert_or_update(
* Numeric types accept string notation in SQLite as well.
* 2. In non-strict mode, cast all values.
*
* TODO: While close to MySQL behavior, this does't exactly match
* TODO: While close to MySQL behavior, this doesn't exactly match
* all special cases. We may improve this further to accept
* BLOBs for numeric types, and other special behaviors.
*/
Expand Down
Loading