executor: LOAD DATA INFILE support asterisk matching (#42050)
ref pingcap/tidb#40499
This commit is contained in:
@ -194,6 +194,18 @@ func TestBuildStringFromLabels(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEscapeGlobExceptAsterisk(t *testing.T) {
|
||||
cases := [][2]string{
|
||||
{"123", "123"},
|
||||
{"12*3", "12*3"},
|
||||
{"12?", `12\?`},
|
||||
{`[1-2]`, `\[1-2\]`},
|
||||
}
|
||||
for _, pair := range cases {
|
||||
require.Equal(t, pair[1], EscapeGlobExceptAsterisk(pair[0]))
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkDoMatch(b *testing.B) {
|
||||
escape := byte('\\')
|
||||
tbl := []struct {
|
||||
|
||||
Reference in New Issue
Block a user