@@ -97,6 +97,10 @@ func TestScatterRegion(t *testing.T) {
97
97
tk .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("table" ))
98
98
tk .MustExec ("set @@tidb_scatter_region = 'global';" )
99
99
tk .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("global" ))
100
+ tk .MustExec ("set @@tidb_scatter_region = 'TABLE';" )
101
+ tk .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("table" ))
102
+ tk .MustExec ("set @@tidb_scatter_region = 'GLOBAL';" )
103
+ tk .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("global" ))
100
104
tk .MustExec ("set @@tidb_scatter_region = '';" )
101
105
tk .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("" ))
102
106
@@ -111,13 +115,34 @@ func TestScatterRegion(t *testing.T) {
111
115
tk .MustQuery ("select @@global.tidb_scatter_region;" ).Check (testkit .Rows ("global" ))
112
116
tk .MustExec ("set global tidb_scatter_region = '';" )
113
117
tk .MustQuery ("select @@global.tidb_scatter_region;" ).Check (testkit .Rows ("" ))
118
+ tk2 = testkit .NewTestKit (t , store )
119
+ tk2 .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("" ))
120
+
121
+ tk .MustExec ("set global tidb_scatter_region = 'TABLE';" )
122
+ tk .MustQuery ("select @@global.tidb_scatter_region;" ).Check (testkit .Rows ("table" ))
123
+ tk .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("" ))
124
+ tk2 = testkit .NewTestKit (t , store )
125
+ tk2 .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("table" ))
126
+
127
+ tk .MustExec ("set global tidb_scatter_region = 'GLOBAL';" )
128
+ tk .MustQuery ("select @@global.tidb_scatter_region;" ).Check (testkit .Rows ("global" ))
129
+ tk .MustExec ("set global tidb_scatter_region = '';" )
130
+ tk .MustQuery ("select @@global.tidb_scatter_region;" ).Check (testkit .Rows ("" ))
114
131
115
132
err := tk .ExecToErr ("set @@tidb_scatter_region = 'test';" )
116
133
require .ErrorContains (t , err , "invalid value for 'test', it should be either '', 'table' or 'global'" )
134
+ err = tk .ExecToErr ("set @@tidb_scatter_region = 'te st';" )
135
+ require .ErrorContains (t , err , "invalid value for 'te st', it should be either '', 'table' or 'global'" )
117
136
err = tk .ExecToErr ("set @@tidb_scatter_region = '1';" )
118
137
require .ErrorContains (t , err , "invalid value for '1', it should be either '', 'table' or 'global'" )
119
138
err = tk .ExecToErr ("set @@tidb_scatter_region = 0;" )
120
139
require .ErrorContains (t , err , "invalid value for '0', it should be either '', 'table' or 'global'" )
140
+
141
+ tk .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("" ))
142
+ tk .MustExec ("set @@tidb_scatter_region = 'TaBlE';" )
143
+ tk .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("table" ))
144
+ tk .MustExec ("set @@tidb_scatter_region = 'gLoBaL';" )
145
+ tk .MustQuery ("select @@tidb_scatter_region;" ).Check (testkit .Rows ("global" ))
121
146
}
122
147
123
148
type kvStore interface {
0 commit comments