Add support for subqueries

This commit is contained in:
Pijus Kamandulis
2024-12-07 22:29:26 +02:00
parent 3584f9b5ce
commit 66ea859f34
15 changed files with 3227 additions and 2290 deletions

View File

@@ -4,11 +4,11 @@ import (
"github.com/pikami/cosmium/parsers"
)
func (c memoryExecutorContext) misc_In(arguments []interface{}, row RowType) bool {
value := c.getFieldValue(arguments[0].(parsers.SelectItem), row)
func (r rowContext) misc_In(arguments []interface{}) bool {
value := r.resolveSelectItem(arguments[0].(parsers.SelectItem))
for i := 1; i < len(arguments); i++ {
compareValue := c.getFieldValue(arguments[i].(parsers.SelectItem), row)
compareValue := r.resolveSelectItem(arguments[i].(parsers.SelectItem))
if compareValues(value, compareValue) == 0 {
return true
}