(sql string)
| 16 | var booleanPredicatePattern = regexp.MustCompile(`(?is)(?:\btrue\b|\bfalse\b)[\s)]*(?:=|!=|<>)|(?:=|!=|<>)[\s(]*(?:\btrue\b|\bfalse\b)`) |
| 17 | |
| 18 | func NeedsBooleanPredicateRewrite(sql string) bool { |
| 19 | return booleanPredicatePattern.MatchString(sql) |
| 20 | } |
| 21 | |
| 22 | func RewriteBooleanPredicates(sql string) (string, bool, error) { |
| 23 | sql = strings.TrimSpace(sql) |
no outgoing calls