From 71f2ad5eaec361a693539215513ef53193d922ea Mon Sep 17 00:00:00 2001 From: dantleech Date: Thu, 16 Oct 2014 07:23:02 +0200 Subject: [PATCH 1/2] Fixed parenthesis --- tests/06_Query/QOM/Sql2TestQueries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/06_Query/QOM/Sql2TestQueries.php b/tests/06_Query/QOM/Sql2TestQueries.php index a77c6c95..c1b57364 100644 --- a/tests/06_Query/QOM/Sql2TestQueries.php +++ b/tests/06_Query/QOM/Sql2TestQueries.php @@ -99,7 +99,7 @@ public static function getQueries() /** * 6.7.15. NotConstraint */ - $queries['6.7.15.Not'] = 'SELECT * FROM [nt:file] AS file WHERE NOT file.prop1 IS NOT NULL'; + $queries['6.7.15.Not'] = 'SELECT * FROM [nt:file] AS file WHERE (NOT file.prop1 IS NOT NULL)'; /** * 6.7.16. Comparison From 2fc26b9d54607b470969af7bfeb931ad583bb38a Mon Sep 17 00:00:00 2001 From: dantleech Date: Thu, 16 Oct 2014 07:43:56 +0200 Subject: [PATCH 2/2] Fixed precedence parenthesis --- tests/06_Query/QOM/Sql2TestQueries.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/06_Query/QOM/Sql2TestQueries.php b/tests/06_Query/QOM/Sql2TestQueries.php index c1b57364..5f482049 100644 --- a/tests/06_Query/QOM/Sql2TestQueries.php +++ b/tests/06_Query/QOM/Sql2TestQueries.php @@ -60,6 +60,7 @@ public static function getQueries() $queries['6.7.12.Constraint.Precedence.3'] = array( 'SELECT * FROM [nt:file] AS file WHERE NOT file.prop1 = \'1\' OR file.prop2 = \'2\' AND NOT file.prop3 = \'3\'', 'SELECT * FROM [nt:file] AS file WHERE (NOT file.prop1 = \'1\' OR (file.prop2 = \'2\' AND NOT file.prop3 = \'3\'))', + 'SELECT * FROM [nt:file] AS file WHERE ((NOT file.prop1 = \'1\') OR (file.prop2 = \'2\' AND (NOT file.prop3 = \'3\')))', ); $queries['6.7.12.Constraint.Precedence.4'] = array( @@ -76,8 +77,8 @@ public static function getQueries() 'SELECT * FROM [nt:file] AS file WHERE NOT file.prop1 IS NOT NULL AND NOT NOT file.prop2 IS NOT NULL OR NOT file.prop3 = \'hello\' AND file.prop4 <> \'hello\'', - 'SELECT * FROM [nt:file] AS file WHERE ((NOT file.prop1 IS NOT NULL AND NOT NOT file.prop2 IS NOT NULL) OR (NOT file.prop3 = \'hello\' AND file.prop4 <> \'hello\'))', + 'SELECT * FROM [nt:file] AS file WHERE (((NOT file.prop1 IS NOT NULL) AND (NOT (NOT file.prop2 IS NOT NULL))) OR ((NOT file.prop3 = \'hello\') AND file.prop4 <> \'hello\'))', ); /** @@ -99,7 +100,10 @@ public static function getQueries() /** * 6.7.15. NotConstraint */ - $queries['6.7.15.Not'] = 'SELECT * FROM [nt:file] AS file WHERE (NOT file.prop1 IS NOT NULL)'; + $queries['6.7.15.Not'] = array( + 'SELECT * FROM [nt:file] AS file WHERE NOT file.prop1 IS NOT NULL', + 'SELECT * FROM [nt:file] AS file WHERE (NOT file.prop1 IS NOT NULL)', + ); /** * 6.7.16. Comparison