@@ -82,7 +82,8 @@ func TestAggPushDownEngine(t *testing.T) {
82
82
is := dom .InfoSchema ()
83
83
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
84
84
require .True (t , exists )
85
- for _ , tblInfo := range db .Tables {
85
+ for _ , tbl := range is .SchemaTables (db .Name ) {
86
+ tblInfo := tbl .Meta ()
86
87
if tblInfo .Name .L == "t" {
87
88
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
88
89
Count : 1 ,
@@ -130,7 +131,8 @@ func TestIssue15110And49616(t *testing.T) {
130
131
is := dom .InfoSchema ()
131
132
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
132
133
require .True (t , exists )
133
- for _ , tblInfo := range db .Tables {
134
+ for _ , tbl := range is .SchemaTables (db .Name ) {
135
+ tblInfo := tbl .Meta ()
134
136
if tblInfo .Name .L == "crm_rd_150m" {
135
137
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
136
138
Count : 1 ,
@@ -190,7 +192,8 @@ func TestNotReadOnlySQLOnTiFlash(t *testing.T) {
190
192
is := dom .InfoSchema ()
191
193
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
192
194
require .True (t , exists )
193
- for _ , tblInfo := range db .Tables {
195
+ for _ , tbl := range is .SchemaTables (db .Name ) {
196
+ tblInfo := tbl .Meta ()
194
197
if tblInfo .Name .L == "t" {
195
198
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
196
199
Count : 1 ,
@@ -226,7 +229,8 @@ func TestTimeToSecPushDownToTiFlash(t *testing.T) {
226
229
is := dom .InfoSchema ()
227
230
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
228
231
require .True (t , exists )
229
- for _ , tblInfo := range db .Tables {
232
+ for _ , tbl := range is .SchemaTables (db .Name ) {
233
+ tblInfo := tbl .Meta ()
230
234
if tblInfo .Name .L == "t" {
231
235
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
232
236
Count : 1 ,
@@ -260,7 +264,8 @@ func TestRightShiftPushDownToTiFlash(t *testing.T) {
260
264
is := dom .InfoSchema ()
261
265
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
262
266
require .True (t , exists )
263
- for _ , tblInfo := range db .Tables {
267
+ for _ , tbl := range is .SchemaTables (db .Name ) {
268
+ tblInfo := tbl .Meta ()
264
269
if tblInfo .Name .L == "t" {
265
270
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
266
271
Count : 1 ,
@@ -700,7 +705,8 @@ func TestReverseUTF8PushDownToTiFlash(t *testing.T) {
700
705
is := dom .InfoSchema ()
701
706
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
702
707
require .True (t , exists )
703
- for _ , tblInfo := range db .Tables {
708
+ for _ , tbl := range is .SchemaTables (db .Name ) {
709
+ tblInfo := tbl .Meta ()
704
710
if tblInfo .Name .L == "t" {
705
711
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
706
712
Count : 1 ,
@@ -734,7 +740,8 @@ func TestReversePushDownToTiFlash(t *testing.T) {
734
740
is := dom .InfoSchema ()
735
741
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
736
742
require .True (t , exists )
737
- for _ , tblInfo := range db .Tables {
743
+ for _ , tbl := range is .SchemaTables (db .Name ) {
744
+ tblInfo := tbl .Meta ()
738
745
if tblInfo .Name .L == "t" {
739
746
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
740
747
Count : 1 ,
@@ -768,7 +775,8 @@ func TestSpacePushDownToTiFlash(t *testing.T) {
768
775
is := dom .InfoSchema ()
769
776
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
770
777
require .True (t , exists )
771
- for _ , tblInfo := range db .Tables {
778
+ for _ , tbl := range is .SchemaTables (db .Name ) {
779
+ tblInfo := tbl .Meta ()
772
780
if tblInfo .Name .L == "t" {
773
781
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
774
782
Count : 1 ,
@@ -908,7 +916,8 @@ func TestConflictReadFromStorage(t *testing.T) {
908
916
is := dom .InfoSchema ()
909
917
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
910
918
require .True (t , exists )
911
- for _ , tblInfo := range db .Tables {
919
+ for _ , tbl := range is .SchemaTables (db .Name ) {
920
+ tblInfo := tbl .Meta ()
912
921
if tblInfo .Name .L == "t" {
913
922
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
914
923
Count : 1 ,
@@ -1189,7 +1198,8 @@ func TestRepeatPushDownToTiFlash(t *testing.T) {
1189
1198
is := dom .InfoSchema ()
1190
1199
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1191
1200
require .True (t , exists )
1192
- for _ , tblInfo := range db .Tables {
1201
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1202
+ tblInfo := tbl .Meta ()
1193
1203
if tblInfo .Name .L == "t" {
1194
1204
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1195
1205
Count : 1 ,
@@ -1218,7 +1228,8 @@ func TestIssue36194(t *testing.T) {
1218
1228
is := dom .InfoSchema ()
1219
1229
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1220
1230
require .True (t , exists )
1221
- for _ , tblInfo := range db .Tables {
1231
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1232
+ tblInfo := tbl .Meta ()
1222
1233
if tblInfo .Name .L == "t" {
1223
1234
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1224
1235
Count : 1 ,
@@ -1274,7 +1285,8 @@ func TestAggWithJsonPushDownToTiFlash(t *testing.T) {
1274
1285
is := dom .InfoSchema ()
1275
1286
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1276
1287
require .True (t , exists )
1277
- for _ , tblInfo := range db .Tables {
1288
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1289
+ tblInfo := tbl .Meta ()
1278
1290
if tblInfo .Name .L == "t" {
1279
1291
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1280
1292
Count : 1 ,
@@ -1323,7 +1335,8 @@ func TestLeftShiftPushDownToTiFlash(t *testing.T) {
1323
1335
is := dom .InfoSchema ()
1324
1336
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1325
1337
require .True (t , exists )
1326
- for _ , tblInfo := range db .Tables {
1338
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1339
+ tblInfo := tbl .Meta ()
1327
1340
if tblInfo .Name .L == "t" {
1328
1341
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1329
1342
Count : 1 ,
@@ -1415,7 +1428,8 @@ func TestEltPushDownToTiFlash(t *testing.T) {
1415
1428
is := dom .InfoSchema ()
1416
1429
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1417
1430
require .True (t , exists )
1418
- for _ , tblInfo := range db .Tables {
1431
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1432
+ tblInfo := tbl .Meta ()
1419
1433
if tblInfo .Name .L == "t" {
1420
1434
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1421
1435
Count : 1 ,
@@ -1448,7 +1462,8 @@ func TestRegexpInstrPushDownToTiFlash(t *testing.T) {
1448
1462
is := dom .InfoSchema ()
1449
1463
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1450
1464
require .True (t , exists )
1451
- for _ , tblInfo := range db .Tables {
1465
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1466
+ tblInfo := tbl .Meta ()
1452
1467
if tblInfo .Name .L == "t" {
1453
1468
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1454
1469
Count : 1 ,
@@ -1481,7 +1496,8 @@ func TestRegexpSubstrPushDownToTiFlash(t *testing.T) {
1481
1496
is := dom .InfoSchema ()
1482
1497
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1483
1498
require .True (t , exists )
1484
- for _ , tblInfo := range db .Tables {
1499
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1500
+ tblInfo := tbl .Meta ()
1485
1501
if tblInfo .Name .L == "t" {
1486
1502
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1487
1503
Count : 1 ,
@@ -1514,7 +1530,8 @@ func TestRegexpReplacePushDownToTiFlash(t *testing.T) {
1514
1530
is := dom .InfoSchema ()
1515
1531
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1516
1532
require .True (t , exists )
1517
- for _ , tblInfo := range db .Tables {
1533
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1534
+ tblInfo := tbl .Meta ()
1518
1535
if tblInfo .Name .L == "t" {
1519
1536
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1520
1537
Count : 1 ,
@@ -1551,7 +1568,8 @@ func TestCastTimeAsDurationToTiFlash(t *testing.T) {
1551
1568
is := dom .InfoSchema ()
1552
1569
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1553
1570
require .True (t , exists )
1554
- for _ , tblInfo := range db .Tables {
1571
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1572
+ tblInfo := tbl .Meta ()
1555
1573
if tblInfo .Name .L == "t" {
1556
1574
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1557
1575
Count : 1 ,
@@ -1933,7 +1951,8 @@ func TestIsIPv4ToTiFlash(t *testing.T) {
1933
1951
is := dom .InfoSchema ()
1934
1952
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1935
1953
require .True (t , exists )
1936
- for _ , tblInfo := range db .Tables {
1954
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1955
+ tblInfo := tbl .Meta ()
1937
1956
if tblInfo .Name .L == "t" {
1938
1957
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1939
1958
Count : 1 ,
@@ -1968,7 +1987,8 @@ func TestIsIPv6ToTiFlash(t *testing.T) {
1968
1987
is := dom .InfoSchema ()
1969
1988
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
1970
1989
require .True (t , exists )
1971
- for _ , tblInfo := range db .Tables {
1990
+ for _ , tbl := range is .SchemaTables (db .Name ) {
1991
+ tblInfo := tbl .Meta ()
1972
1992
if tblInfo .Name .L == "t" {
1973
1993
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
1974
1994
Count : 1 ,
@@ -2030,7 +2050,8 @@ func TestVirtualExprPushDown(t *testing.T) {
2030
2050
is := dom .InfoSchema ()
2031
2051
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
2032
2052
require .True (t , exists )
2033
- for _ , tblInfo := range db .Tables {
2053
+ for _ , tbl := range is .SchemaTables (db .Name ) {
2054
+ tblInfo := tbl .Meta ()
2034
2055
if tblInfo .Name .L == "t" {
2035
2056
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
2036
2057
Count : 1 ,
@@ -2086,7 +2107,8 @@ func TestWindowRangeFramePushDownTiflash(t *testing.T) {
2086
2107
is := dom .InfoSchema ()
2087
2108
db , exists := is .SchemaByName (model .NewCIStr ("test" ))
2088
2109
require .True (t , exists )
2089
- for _ , tblInfo := range db .Tables {
2110
+ for _ , tbl := range is .SchemaTables (db .Name ) {
2111
+ tblInfo := tbl .Meta ()
2090
2112
if tblInfo .Name .L == "first_range" || tblInfo .Name .L == "first_range_d64" {
2091
2113
tblInfo .TiFlashReplica = & model.TiFlashReplicaInfo {
2092
2114
Count : 1 ,
0 commit comments