cube2222/octosql

[BUG] operator should be changed when `in` with single value

xqbumu opened this issue · 0 comments

example sql:

select * from events where id in (1)

the id's right expr type change to logical.Constant

https://github.com/cube2222/octosql/blob/main/parser/parser.go#L642-L644

https://github.com/cube2222/octosql/blob/main/parser/parser.go#L832-L863

so, maybe we should change the operator to sqlparser.EqualStr after L862

	if operator == sqlparser.InStr {
		switch rightParsed.(type) {
		case *logical.Constant:
			operator = sqlparser.EqualStr
		}
	}