-
Notifications
You must be signed in to change notification settings - Fork 21
Fix precedence parenthesis #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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\'))', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here and below for the other change. |
||
); | ||
|
||
/** | ||
|
@@ -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)', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would the most parenthesis not need to do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dantleech wdyt? is there more to fix or is that case already handled? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure. Are you implying that the logic is broken and it should be doing what you suggest, or that we should add an additional variation to cover if it is ever handled differently? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i was wondering whether your fix is complete or there are more things to fix for the NOT case. how does the query builder distinguish There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure, but this is about the test not the code?. We should probably create an issue on phpcr-utils There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
); | ||
|
||
/** | ||
* 6.7.16. Comparison | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the line above is correct, so we should not change it here. or add an additional one if you want.