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:
parent
ce0675a4fe
commit
4aeade3621
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user