@@ -69,7 +69,6 @@ protected function setUp(): void
6969 $ GLOBALS ['plugin_param ' ]['export_type ' ] = 'table ' ;
7070 $ GLOBALS ['plugin_param ' ]['single_table ' ] = false ;
7171 $ GLOBALS ['sql_constraints ' ] = null ;
72- $ GLOBALS ['sql_backquotes ' ] = null ;
7372 $ GLOBALS ['sql_indexes ' ] = null ;
7473 $ GLOBALS ['sql_auto_increments ' ] = null ;
7574
@@ -78,6 +77,7 @@ protected function setUp(): void
7877 new Export ($ GLOBALS ['dbi ' ]),
7978 new Transformations (),
8079 );
80+ $ this ->object ->useSqlBackquotes (false );
8181 }
8282
8383 /**
@@ -473,7 +473,6 @@ public function testExportDBCreate(): void
473473 {
474474 $ GLOBALS ['sql_compatibility ' ] = 'NONE ' ;
475475 $ GLOBALS ['sql_drop_database ' ] = true ;
476- $ GLOBALS ['sql_backquotes ' ] = true ;
477476 $ GLOBALS ['sql_create_database ' ] = true ;
478477 $ GLOBALS ['sql_create_table ' ] = true ;
479478 $ GLOBALS ['sql_create_view ' ] = true ;
@@ -491,12 +490,7 @@ public function testExportDBCreate(): void
491490
492491 $ GLOBALS ['dbi ' ] = $ dbi ;
493492
494- // Reset the object
495- $ this ->object = new ExportSql (
496- new Relation ($ GLOBALS ['dbi ' ]),
497- new Export ($ GLOBALS ['dbi ' ]),
498- new Transformations (),
499- );
493+ $ this ->object ->useSqlBackquotes (true );
500494
501495 ob_start ();
502496 $ this ->assertTrue (
@@ -518,7 +512,6 @@ public function testExportDBCreate(): void
518512 // case2: no backquotes
519513 unset($ GLOBALS ['sql_compatibility ' ]);
520514 $ GLOBALS ['cfg ' ]['Server ' ]['DisableIS ' ] = true ;
521- unset($ GLOBALS ['sql_backquotes ' ]);
522515
523516 $ dbi = $ this ->getMockBuilder (DatabaseInterface::class)
524517 ->disableOriginalConstructor ()
@@ -533,12 +526,7 @@ public function testExportDBCreate(): void
533526
534527 $ GLOBALS ['dbi ' ] = $ dbi ;
535528
536- // Reset the object
537- $ this ->object = new ExportSql (
538- new Relation ($ GLOBALS ['dbi ' ]),
539- new Export ($ GLOBALS ['dbi ' ]),
540- new Transformations (),
541- );
529+ $ this ->object ->useSqlBackquotes (false );
542530
543531 ob_start ();
544532 $ this ->assertTrue (
@@ -561,15 +549,9 @@ public function testExportDBCreate(): void
561549 public function testExportDBHeader (): void
562550 {
563551 $ GLOBALS ['sql_compatibility ' ] = 'MSSQL ' ;
564- $ GLOBALS ['sql_backquotes ' ] = true ;
565552 $ GLOBALS ['sql_include_comments ' ] = true ;
566553
567- // Reset the object
568- $ this ->object = new ExportSql (
569- new Relation ($ GLOBALS ['dbi ' ]),
570- new Export ($ GLOBALS ['dbi ' ]),
571- new Transformations (),
572- );
554+ $ this ->object ->useSqlBackquotes (true );
573555
574556 ob_start ();
575557 $ this ->assertTrue (
@@ -583,14 +565,8 @@ public function testExportDBHeader(): void
583565
584566 // case 2
585567 unset($ GLOBALS ['sql_compatibility ' ]);
586- unset($ GLOBALS ['sql_backquotes ' ]);
587568
588- // Reset the object
589- $ this ->object = new ExportSql (
590- new Relation ($ GLOBALS ['dbi ' ]),
591- new Export ($ GLOBALS ['dbi ' ]),
592- new Transformations (),
593- );
569+ $ this ->object ->useSqlBackquotes (false );
594570
595571 ob_start ();
596572 $ this ->assertTrue (
@@ -791,7 +767,6 @@ public function testGetTableDef(): void
791767 $ GLOBALS ['sql_compatibility ' ] = 'MSSQL ' ;
792768 $ GLOBALS ['sql_auto_increment ' ] = true ;
793769 $ GLOBALS ['sql_drop_table ' ] = true ;
794- $ GLOBALS ['sql_backquotes ' ] = true ;
795770 $ GLOBALS ['sql_if_not_exists ' ] = true ;
796771 $ GLOBALS ['sql_include_comments ' ] = true ;
797772 if (isset ($ GLOBALS ['sql_constraints ' ])) {
@@ -845,12 +820,7 @@ public function testGetTableDef(): void
845820 $ GLOBALS ['dbi ' ] = $ this ->createDatabaseInterface ($ dbiDummy );
846821 $ GLOBALS ['cfg ' ]['Server ' ]['DisableIS ' ] = false ;
847822
848- // Reset the object
849- $ this ->object = new ExportSql (
850- new Relation ($ GLOBALS ['dbi ' ]),
851- new Export ($ GLOBALS ['dbi ' ]),
852- new Transformations (),
853- );
823+ $ this ->object ->useSqlBackquotes (true );
854824
855825 $ result = $ this ->object ->getTableDef ('db ' , 'table ' , true , true , false );
856826
@@ -875,7 +845,6 @@ public function testGetTableDefWithError(): void
875845 $ GLOBALS ['sql_compatibility ' ] = '' ;
876846 $ GLOBALS ['sql_auto_increment ' ] = true ;
877847 $ GLOBALS ['sql_drop_table ' ] = true ;
878- $ GLOBALS ['sql_backquotes ' ] = false ;
879848 $ GLOBALS ['sql_if_not_exists ' ] = true ;
880849 $ GLOBALS ['sql_include_comments ' ] = true ;
881850
@@ -900,12 +869,7 @@ public function testGetTableDefWithError(): void
900869 $ GLOBALS ['dbi ' ] = $ this ->createDatabaseInterface ($ dbiDummy );
901870 $ GLOBALS ['cfg ' ]['Server ' ]['DisableIS ' ] = false ;
902871
903- // Reset the object
904- $ this ->object = new ExportSql (
905- new Relation ($ GLOBALS ['dbi ' ]),
906- new Export ($ GLOBALS ['dbi ' ]),
907- new Transformations (),
908- );
872+ $ this ->object ->useSqlBackquotes (false );
909873
910874 $ result = $ this ->object ->getTableDef ('db ' , 'table ' , true , true , false );
911875
@@ -977,15 +941,9 @@ public function testGetTableComments(): void
977941 public function testExportStructure (): void
978942 {
979943 $ GLOBALS ['sql_compatibility ' ] = 'MSSQL ' ;
980- $ GLOBALS ['sql_backquotes ' ] = true ;
981944 $ GLOBALS ['sql_include_comments ' ] = true ;
982945
983- // Reset the object
984- $ this ->object = new ExportSql (
985- new Relation ($ GLOBALS ['dbi ' ]),
986- new Export ($ GLOBALS ['dbi ' ]),
987- new Transformations (),
988- );
946+ $ this ->object ->useSqlBackquotes (true );
989947
990948 // case 1
991949 ob_start ();
@@ -1006,17 +964,11 @@ public function testExportStructure(): void
1006964
1007965 // case 2
1008966 unset($ GLOBALS ['sql_compatibility ' ]);
1009- unset($ GLOBALS ['sql_backquotes ' ]);
1010967
1011968 $ GLOBALS ['sql_create_trigger ' ] = true ;
1012969 $ GLOBALS ['sql_drop_table ' ] = true ;
1013970
1014- // Reset the object
1015- $ this ->object = new ExportSql (
1016- new Relation ($ GLOBALS ['dbi ' ]),
1017- new Export ($ GLOBALS ['dbi ' ]),
1018- new Transformations (),
1019- );
971+ $ this ->object ->useSqlBackquotes (false );
1020972
1021973 ob_start ();
1022974 $ this ->assertTrue (
@@ -1042,14 +994,8 @@ public function testExportStructure(): void
1042994
1043995 // case 3
1044996 $ GLOBALS ['sql_views_as_tables ' ] = false ;
1045- $ GLOBALS ['sql_backquotes ' ] = null ;
1046997
1047- // Reset the object
1048- $ this ->object = new ExportSql (
1049- new Relation ($ GLOBALS ['dbi ' ]),
1050- new Export ($ GLOBALS ['dbi ' ]),
1051- new Transformations (),
1052- );
998+ $ this ->object ->useSqlBackquotes (false );
1053999
10541000 ob_start ();
10551001 $ this ->assertTrue (
@@ -1192,7 +1138,6 @@ public function testExportData(): void
11921138
11931139 $ GLOBALS ['dbi ' ] = $ dbi ;
11941140 $ GLOBALS ['sql_compatibility ' ] = 'MSSQL ' ;
1195- $ GLOBALS ['sql_backquotes ' ] = true ;
11961141 $ GLOBALS ['sql_max_query_size ' ] = 50000 ;
11971142 $ GLOBALS ['sql_views_as_tables ' ] = true ;
11981143 $ GLOBALS ['sql_type ' ] = 'INSERT ' ;
@@ -1203,12 +1148,7 @@ public function testExportData(): void
12031148 $ GLOBALS ['sql_hex_for_binary ' ] = true ;
12041149 $ GLOBALS ['cfg ' ]['Server ' ]['DisableIS ' ] = false ;
12051150
1206- // Reset the object
1207- $ this ->object = new ExportSql (
1208- new Relation ($ GLOBALS ['dbi ' ]),
1209- new Export ($ GLOBALS ['dbi ' ]),
1210- new Transformations (),
1211- );
1151+ $ this ->object ->useSqlBackquotes (true );
12121152
12131153 ob_start ();
12141154 $ this ->object ->exportData ('db ' , 'table ' , 'example.com/err ' , 'SELECT a FROM b WHERE 1 ' );
@@ -1300,7 +1240,6 @@ public function testExportDataWithUpdate(): void
13001240
13011241 $ GLOBALS ['dbi ' ] = $ dbi ;
13021242 $ GLOBALS ['sql_compatibility ' ] = 'MSSQL ' ;
1303- $ GLOBALS ['sql_backquotes ' ] = true ;
13041243 $ GLOBALS ['sql_views_as_tables ' ] = true ;
13051244 $ GLOBALS ['sql_type ' ] = 'UPDATE ' ;
13061245 $ GLOBALS ['sql_delayed ' ] = ' DELAYED ' ;
@@ -1310,12 +1249,7 @@ public function testExportDataWithUpdate(): void
13101249 $ GLOBALS ['sql_hex_for_binary ' ] = true ;
13111250 $ GLOBALS ['cfg ' ]['Server ' ]['DisableIS ' ] = false ;
13121251
1313- // Reset the object
1314- $ this ->object = new ExportSql (
1315- new Relation ($ GLOBALS ['dbi ' ]),
1316- new Export ($ GLOBALS ['dbi ' ]),
1317- new Transformations (),
1318- );
1252+ $ this ->object ->useSqlBackquotes (true );
13191253
13201254 ob_start ();
13211255 $ this ->object ->exportData ('db ' , 'table ' , 'example.com/err ' , 'SELECT a FROM b WHERE 1 ' );
@@ -1358,14 +1292,8 @@ public function testExportDataWithIsView(): void
13581292 $ GLOBALS ['sql_include_comments ' ] = true ;
13591293 $ oldVal = $ GLOBALS ['sql_compatibility ' ] ?? '' ;
13601294 $ GLOBALS ['sql_compatibility ' ] = 'NONE ' ;
1361- $ GLOBALS ['sql_backquotes ' ] = true ;
13621295
1363- // Reset the object
1364- $ this ->object = new ExportSql (
1365- new Relation ($ GLOBALS ['dbi ' ]),
1366- new Export ($ GLOBALS ['dbi ' ]),
1367- new Transformations (),
1368- );
1296+ $ this ->object ->useSqlBackquotes (true );
13691297
13701298 ob_start ();
13711299 $ this ->assertTrue (
0 commit comments