Skip to content

Commit c59c36f

Browse files
committed
Skip UPDATE ... FROM tests on SQLite < 3.33.0
1 parent d0346ce commit c59c36f

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/WP_SQLite_Driver_Tests.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6768,6 +6768,14 @@ public function testForeignKeyOnDeleteSetDefault(): void {
67686768
}
67696769

67706770
public function testUpdateWithJoinedTables(): void {
6771+
$sqlite_version = $this->engine->get_sqlite_version();
6772+
if ( version_compare( $sqlite_version, '3.33.0', '<' ) ) {
6773+
$this->markTestSkipped(
6774+
sprintf( "SQLite version %s doesn't support UPDATE with FROM clause.", $sqlite_version )
6775+
);
6776+
return;
6777+
}
6778+
67716779
$this->assertQuery( 'CREATE TABLE t1 (id INT, comment TEXT)' );
67726780
$this->assertQuery( 'CREATE TABLE t2 (id INT, name TEXT)' );
67736781
$this->assertQuery( 'CREATE TABLE t3 (id INT, name TEXT)' );
@@ -6841,6 +6849,14 @@ public function testUpdateWithJoinedTables(): void {
68416849
}
68426850

68436851
public function testUpdateWithJoinedTablesInNonStrictMode(): void {
6852+
$sqlite_version = $this->engine->get_sqlite_version();
6853+
if ( version_compare( $sqlite_version, '3.33.0', '<' ) ) {
6854+
$this->markTestSkipped(
6855+
sprintf( "SQLite version %s doesn't support UPDATE with FROM clause.", $sqlite_version )
6856+
);
6857+
return;
6858+
}
6859+
68446860
$this->assertQuery( "SET SESSION sql_mode = ''" );
68456861
$this->assertQuery( 'CREATE TABLE t1 (id INT, comment TEXT)' );
68466862
$this->assertQuery( 'CREATE TABLE t2 (id INT, name TEXT)' );
@@ -6915,6 +6931,14 @@ public function testUpdateWithJoinedTablesInNonStrictMode(): void {
69156931
}
69166932

69176933
public function testUpdateWithJoinComplexQuery(): void {
6934+
$sqlite_version = $this->engine->get_sqlite_version();
6935+
if ( version_compare( $sqlite_version, '3.33.0', '<' ) ) {
6936+
$this->markTestSkipped(
6937+
sprintf( "SQLite version %s doesn't support UPDATE with FROM clause.", $sqlite_version )
6938+
);
6939+
return;
6940+
}
6941+
69186942
$this->assertQuery( "SET SESSION sql_mode = ''" );
69196943

69206944
$default_date = '0000-00-00 00:00:00';

0 commit comments

Comments
 (0)