mirror of https://github.com/milvus-io/milvus.git
fix: Fix bug for parsing expression that include quotes (#28416)
issue: #28365 Fix bug for parsing error when a string enclosed in single quotes in an expression contains multiple double quotes. such as: ``` expr = "tag == '\"blue\"'" ``` Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>pull/28364/head
parent
de13865769
commit
31f442915b
|
@ -191,7 +191,7 @@ func (ib *indexBuilder) run() {
|
|||
for _, buildID := range buildIDs {
|
||||
ok := ib.process(buildID)
|
||||
if !ok {
|
||||
log.Ctx(ib.ctx).Info("there is no IndexNode available or etcd is not serviceable, wait a minute...")
|
||||
log.Ctx(ib.ctx).Info("there is no idle indexing node, wait a minute...")
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
@ -934,6 +934,7 @@ func Test_EscapeString(t *testing.T) {
|
|||
`str2 like 'abc"def-%'`,
|
||||
`str4 like "abc\367-%"`,
|
||||
`str4 like "中国"`,
|
||||
`tag == '"blue"'`,
|
||||
}
|
||||
for _, expr = range exprs {
|
||||
_, err = CreateSearchPlan(schema, expr, "FloatVectorField", &planpb.QueryInfo{
|
||||
|
|
|
@ -503,7 +503,7 @@ func convertEscapeSingle(literal string) (string, error) {
|
|||
b.WriteString(literal[start : end-1])
|
||||
b.WriteString(`'`)
|
||||
}
|
||||
start = end
|
||||
start = end + 1
|
||||
}
|
||||
b.WriteString(literal[end+1 : len(literal)-1])
|
||||
b.WriteString(`"`)
|
||||
|
|
|
@ -187,6 +187,13 @@ func Test_convertEscapeSingle(t *testing.T) {
|
|||
{`"\\\\'"`, `\\'`},
|
||||
{`"\\\\\'"`, `\\'`},
|
||||
{`'"'`, `"`},
|
||||
{`'""'`, `""`},
|
||||
{`'"""'`, `"""`},
|
||||
{`'"\""'`, `"""`},
|
||||
{`'a"b\"c\\"d'`, `a"b"c\"d`},
|
||||
{`"a\"b\"c\\\"d"`, `a"b"c\"d`},
|
||||
{`'A "test"'`, `A "test"`},
|
||||
{`"A \"test\""`, `A "test"`},
|
||||
{`'\"'`, `"`},
|
||||
{`'\\"'`, `\"`},
|
||||
{`'\\\"'`, `\"`},
|
||||
|
|
Loading…
Reference in New Issue