@@ -392,13 +392,15 @@ 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 ' ,
399400 $ this ->table_prefix ,
400401 $ table_name ,
401- $ table_body
402+ $ table_body ,
403+ $ bypass_strict ? '' : ' STRICT '
402404 )
403405 );
404406 }
@@ -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,10 +468,11 @@ 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 ' ,
469472 $ this ->temporary_table_prefix ,
470473 $ table_name ,
471- $ table_body
474+ $ table_body ,
475+ $ bypass_strict ? '' : ' STRICT '
472476 )
473477 );
474478 }
0 commit comments