executor: LOAD DATA INFILE support asterisk matching (#42050)

ref pingcap/tidb#40499
This commit is contained in:
lance6716
2023-03-13 13:50:39 +08:00
committed by GitHub
parent 34086a43e4
commit fd91259793
11 changed files with 419 additions and 135 deletions

View File

@ -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 {