Fixed a bug regarding nested subqueries

Fixed a bug which could occur when using the expression extension with nested subqueries.
This commit is contained in:
Daniel Hammerschmid 2020-04-28 15:55:57 +02:00 committed by Gerhard Gruber
parent ce0675a4fe
commit 4aeade3621

View File

@ -108,12 +108,13 @@ func (e *expr) operator(operator string, value interface{}) *expr {
return e
}
if _, ok := value.(*expr); ok {
e.expr = "(" + e.expr + " " + operator + " (?))"
if vExpr, ok := value.(*expr); ok {
e.expr = "(" + e.expr + " " + operator + " (" + vExpr.expr + "))"
e.args = append(e.args, vExpr.args...)
} else {
e.expr = "(" + e.expr + " " + operator + " ?)"
}
e.args = append(e.args, value)
}
return e
}