Merge lp:~mmcm/akiban-server/simple-case into lp:~akiban-technologies/akiban-server/trunk
Status: | Merged |
---|---|
Approved by: | Mike McMahon |
Approved revision: | 2728 |
Merged at revision: | 2729 |
Proposed branch: | lp:~mmcm/akiban-server/simple-case |
Merge into: | lp:~akiban-technologies/akiban-server/trunk |
Diff against target: |
77 lines (+32/-2) 5 files modified
pom.xml (+1/-1) src/main/java/com/akiban/sql/optimizer/rule/ASTStatementLoader.java (+18/-0) src/test/resources/com/akiban/sql/optimizer/rule/parse/README.txt (+3/-1) src/test/resources/com/akiban/sql/optimizer/rule/parse/case-2.expected (+5/-0) src/test/resources/com/akiban/sql/optimizer/rule/parse/case-2.sql (+5/-0) |
To merge this branch: | bzr merge lp:~mmcm/akiban-server/simple-case |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mike McMahon | Approve | ||
Thomas Jones-Low | Needs Fixing | ||
Review via email: mp+177937@code.launchpad.net |
Description of the change
Handle simple CASE added by lp:~mmcm/akiban-sql-parser/simple-case.
Note that this just turns it into the corresponding search case: it does each comparison as a separate expression.
It would be reasonable to have an expression that took a single value and matched it against a list of clauses, possibly with special handling for the common case of constants, which it could hash or binary search. But, in my opinion, the right way to introduce that is from suitable nested IfElseExpression's _after_ constant folding. That way either syntax gets the desired improvements. I didn't do any of this because it might interfere with ripping types2 out, which is enough of a big deal already.
As described