From ffbb4e2fa03f15ffc52e160ef6102ac50bd85f59 Mon Sep 17 00:00:00 2001 From: John Ed Quinn Date: Thu, 8 Aug 2024 11:53:18 -0700 Subject: [PATCH] Fixes undefined variable behavior tests --- .../eval/query/group-by/group-by.ion | 32 ++++++++----------- .../eval/query/select/select-mysql.ion | 4 +-- .../query/undefined-variable-behavior.ion | 9 ++---- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/partiql-tests-data/eval/query/group-by/group-by.ion b/partiql-tests-data/eval/query/group-by/group-by.ion index b5a4232..b59be33 100644 --- a/partiql-tests-data/eval/query/group-by/group-by.ion +++ b/partiql-tests-data/eval/query/group-by/group-by.ion @@ -982,9 +982,8 @@ result:EvaluationFail }, { - result:EvaluationSuccess, + result:EvaluationFail, evalMode:EvalModeCoerce, - output:$bag::[] } ] }, @@ -997,9 +996,8 @@ result:EvaluationFail }, { - result:EvaluationSuccess, + result:EvaluationFail, evalMode:EvalModeCoerce, - output:$bag::[] } ] }, @@ -1012,9 +1010,8 @@ result:EvaluationFail }, { - result:EvaluationSuccess, + result:EvaluationFail, evalMode:EvalModeCoerce, - output:$bag::[] } ] }, @@ -1027,9 +1024,8 @@ result:EvaluationFail }, { - result:EvaluationSuccess, + result:EvaluationFail, evalMode:EvalModeCoerce, - output:$bag::[] } ] } @@ -7530,8 +7526,8 @@ } }, { - name:"GROUP BY with JOIN : SELECT supplierName, COUNT(*) as the_count FROM suppliers AS s INNER JOIN products AS p ON s.supplierId = p.supplierId GROUP BY supplierName", - statement:"SELECT supplierName, COUNT(*) as the_count FROM suppliers AS s INNER JOIN products AS p ON s.supplierId = p.supplierId GROUP BY supplierName", + name:"GROUP BY with JOIN : SELECT supplierName, COUNT(*) as the_count FROM suppliers AS s INNER JOIN products AS p ON s.supplierId = p.supplierId GROUP BY s.supplierName", + statement:"SELECT supplierName, COUNT(*) as the_count FROM suppliers AS s INNER JOIN products AS p ON s.supplierId = p.supplierId GROUP BY s.supplierName", assert:{ result:EvaluationSuccess, evalMode:[ @@ -8166,8 +8162,8 @@ } }, { - name:"SELECT col1, g FROM simple_1_col_1_group, join_me GROUP BY col1 GROUP AS g", - statement:"SELECT col1, g FROM simple_1_col_1_group, join_me GROUP BY col1 GROUP AS g", + name:"SELECT col1, g FROM simple_1_col_1_group, join_me GROUP BY simple_1_col_1_group.col1 GROUP AS g", + statement:"SELECT col1, g FROM simple_1_col_1_group, join_me GROUP BY simple_1_col_1_group.col1 GROUP AS g", assert:{ result:EvaluationSuccess, evalMode:[ @@ -8216,8 +8212,8 @@ } }, { - name:"SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, join_me GROUP BY col1 GROUP AS g", - statement:"SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, join_me GROUP BY col1 GROUP AS g", + name:"SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, join_me GROUP BY simple_1_col_1_group.col1 GROUP AS g", + statement:"SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, join_me GROUP BY simple_1_col_1_group.col1 GROUP AS g", assert:{ result:EvaluationSuccess, evalMode:[ @@ -8266,8 +8262,8 @@ } }, { - name:"SELECT col1, g FROM simple_1_col_1_group, different_types_per_row GROUP BY col1 GROUP AS g", - statement:"SELECT col1, g FROM simple_1_col_1_group, different_types_per_row GROUP BY col1 GROUP AS g", + name:"SELECT col1, g FROM simple_1_col_1_group, different_types_per_row GROUP BY simple_1_col_1_group.col1 GROUP AS g", + statement:"SELECT col1, g FROM simple_1_col_1_group, different_types_per_row GROUP BY simple_1_col_1_group.col1 GROUP AS g", assert:{ result:EvaluationSuccess, evalMode:[ @@ -8324,8 +8320,8 @@ } }, { - name:"SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, different_types_per_row GROUP BY col1 GROUP AS g", - statement:"SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, different_types_per_row GROUP BY col1 GROUP AS g", + name:"SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, different_types_per_row GROUP BY simple_1_col_1_group.col1 GROUP AS g", + statement:"SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, different_types_per_row GROUP BY simple_1_col_1_group.col1 GROUP AS g", assert:{ result:EvaluationSuccess, evalMode:[ diff --git a/partiql-tests-data/eval/query/select/select-mysql.ion b/partiql-tests-data/eval/query/select/select-mysql.ion index cd3b070..6c6b902 100644 --- a/partiql-tests-data/eval/query/select/select-mysql.ion +++ b/partiql-tests-data/eval/query/select/select-mysql.ion @@ -11373,7 +11373,7 @@ select::[ }, { name:"MYSQL_SELECT_20", - statement:"select fld3,period from t1,t2 where fld1 = 011401", + statement:"select t2.fld3,t1.period from t1,t2 where t2.fld1 = 011401", assert:{ result:EvaluationSuccess, evalMode:[ @@ -11390,7 +11390,7 @@ select::[ }, { name:"MYSQL_SELECT_21", - statement:"select fld3,period from t2,t1 where companynr*10 = 37*10", + statement:"select t2.fld3,t1.period from t2,t1 where t2.companynr*10 = 37*10", assert:{ result:EvaluationSuccess, evalMode:[ diff --git a/partiql-tests-data/eval/query/undefined-variable-behavior.ion b/partiql-tests-data/eval/query/undefined-variable-behavior.ion index 7ea66cb..834fa52 100644 --- a/partiql-tests-data/eval/query/undefined-variable-behavior.ion +++ b/partiql-tests-data/eval/query/undefined-variable-behavior.ion @@ -9,8 +9,7 @@ undefined_variable_behavior::[ assert:[ { evalMode:EvalModeCoerce, - result:EvaluationSuccess, - output:$missing::null + result:EvaluationFail, }, { evalMode:EvalModeError, @@ -24,8 +23,7 @@ undefined_variable_behavior::[ assert:[ { evalMode:EvalModeCoerce, - result:EvaluationSuccess, - output:true + result:EvaluationFail, }, { evalMode:EvalModeError, @@ -39,8 +37,7 @@ undefined_variable_behavior::[ assert:[ { evalMode:EvalModeCoerce, - result:EvaluationSuccess, - output:true + result:EvaluationFail, }, { evalMode:EvalModeError,