@@ -392,10 +392,12 @@ public function temporary_table_exists( string $table_name ): bool {
392392 * database. Tables that are missing will be created.
393393 */
394394 public function ensure_information_schema_tables (): void {
395+ $ bypass_strict = defined ( 'WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS ' ) && WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS ;
395396 foreach ( self ::INFORMATION_SCHEMA_TABLE_DEFINITIONS as $ table_name => $ table_body ) {
396397 $ this ->connection ->query (
397398 sprintf (
398- 'CREATE TABLE IF NOT EXISTS %s%s (%s) STRICT ' ,
399+ 'CREATE TABLE IF NOT EXISTS %s%s (%s)%s ' ,
400+ $ bypass_strict ? '' : ' STRICT ' ,
399401 $ this ->table_prefix ,
400402 $ table_name ,
401403 $ table_body
@@ -457,6 +459,7 @@ public function get_computed_information_schema_table_definition( string $table_
457459 * the SQLite database. Tables that are missing will be created.
458460 */
459461 public function ensure_temporary_information_schema_tables (): void {
462+ $ bypass_strict = defined ( 'WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS ' ) && WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS ;
460463 foreach ( self ::INFORMATION_SCHEMA_TABLE_DEFINITIONS as $ table_name => $ table_body ) {
461464 // Skip the "schemata" table; MySQL doesn't support temporary databases.
462465 if ( 'schemata ' === $ table_name ) {
@@ -465,7 +468,8 @@ public function ensure_temporary_information_schema_tables(): void {
465468
466469 $ this ->connection ->query (
467470 sprintf (
468- 'CREATE TEMPORARY TABLE IF NOT EXISTS %s%s (%s) STRICT ' ,
471+ 'CREATE TEMPORARY TABLE IF NOT EXISTS %s%s (%s)%s ' ,
472+ $ bypass_strict ? '' : ' STRICT ' ,
469473 $ this ->temporary_table_prefix ,
470474 $ table_name ,
471475 $ table_body
0 commit comments