@@ -1483,9 +1483,6 @@ func TestBuildMaxLengthIndexWithNonRestrictedSqlMode(t *testing.T) {
1483
1483
tk := testkit .NewTestKit (t , store )
1484
1484
tk .MustExec ("use test" )
1485
1485
1486
- r := tk .MustQuery ("select @@sql_mode" )
1487
- defaultSQLMode := r .Rows ()[0 ][0 ].(string )
1488
-
1489
1486
maxIndexLength := config .GetGlobalConfig ().MaxIndexLength
1490
1487
1491
1488
tt := []struct {
@@ -1522,7 +1519,7 @@ func TestBuildMaxLengthIndexWithNonRestrictedSqlMode(t *testing.T) {
1522
1519
for _ , cs := range charset .CharacterSetInfos {
1523
1520
tableName := fmt .Sprintf ("t_%s" , cs .Name )
1524
1521
tk .MustExec (fmt .Sprintf ("drop table if exists %s" , tableName ))
1525
- tk .MustExec (fmt . Sprintf ( "set @@sql_mode='%s'" , defaultSQLMode ) )
1522
+ tk .MustExec ("set @@sql_mode=default" )
1526
1523
1527
1524
// test in strict sql mode
1528
1525
maxLen := cs .Maxlen
@@ -1587,7 +1584,7 @@ func TestBuildMaxLengthIndexWithNonRestrictedSqlMode(t *testing.T) {
1587
1584
tk .MustGetErrCode (sql , errno .ErrTooLongKey )
1588
1585
1589
1586
// The multiple column index in which the length sum exceeds the maximum size
1590
- // will return an error instead produce a warning.
1587
+ // will return an error instead produce a warning in strict sql mode .
1591
1588
indexLen = fmt .Sprintf ("(%d)" , expectKeyLength )
1592
1589
sql = fmt .Sprintf (sqlTemplate , mkTable , col , "" , indexLen , ", age" , cs .Name )
1593
1590
tk .MustGetErrCode (sql , errno .ErrTooLongKey )
0 commit comments