├── src ├── test │ ├── resources │ │ └── com │ │ │ └── akiban │ │ │ └── sql │ │ │ ├── parser │ │ │ ├── close-1.sql │ │ │ ├── fetch-1.sql │ │ │ ├── junk-1.sql │ │ │ ├── copy-1.sql │ │ │ ├── delete-2.sql │ │ │ ├── execute-1.sql │ │ │ ├── fetch-2.sql │ │ │ ├── deallocate-1.sql │ │ │ ├── drop-table-1.sql │ │ │ ├── fetch-3.sql │ │ │ ├── mysql-2x.features │ │ │ ├── set-schema-1.sql │ │ │ ├── copy-3.sql │ │ │ ├── create-schema-1.sql │ │ │ ├── drop-table-2.sql │ │ │ ├── execute-2.sql │ │ │ ├── find-depth-2.sql │ │ │ ├── mysql-2.sql │ │ │ ├── mysql-2x.sql │ │ │ ├── copy-2.sql │ │ │ ├── drop-group-2.sql │ │ │ ├── drop-table-3.sql │ │ │ ├── explain-1.sql │ │ │ ├── mysql-1.features │ │ │ ├── mysql-1.sql │ │ │ ├── mysql-3.features │ │ │ ├── rename-1.sql │ │ │ ├── rename-2.sql │ │ │ ├── create-schema-error.sql │ │ │ ├── declare-2.sql │ │ │ ├── delete-1.sql │ │ │ ├── drop-group-1.sql │ │ │ ├── drop-index-1.sql │ │ │ ├── drop-procedure-1.sql │ │ │ ├── drop-schema-1.sql │ │ │ ├── drop-schema-2.sql │ │ │ ├── insert-2.sql │ │ │ ├── insert-3.sql │ │ │ ├── mysql-1x.sql │ │ │ ├── mysql-4.features │ │ │ ├── alter-server-kill-1.sql │ │ │ ├── alter-server-shutdown-1.sql │ │ │ ├── alter-table-2.sql │ │ │ ├── alter-table-rename-1.sql │ │ │ ├── alter-table-rename-2.sql │ │ │ ├── alter-table-rename-3.sql │ │ │ ├── create-index-1.sql │ │ │ ├── create-schema-4.sql │ │ │ ├── create-table-serial.sql │ │ │ ├── declare-1.sql │ │ │ ├── delete-returning-2.sql │ │ │ ├── drop-index-2.sql │ │ │ ├── drop-schema-error.sql │ │ │ ├── insert-1.sql │ │ │ ├── mysql-3.sql │ │ │ ├── rename-index-1.sql │ │ │ ├── rename-index-2.sql │ │ │ ├── rename-table-1.sql │ │ │ ├── select-3.sql │ │ │ ├── select-limit-3.sql │ │ │ ├── select-limit-4.sql │ │ │ ├── select-order-by-1.sql │ │ │ ├── alter-group-drop-1b.sql │ │ │ ├── alter-server-set-1.sql │ │ │ ├── alter-table-add-column-2.sql │ │ │ ├── alter-table-drop-5.sql │ │ │ ├── copy-4.sql │ │ │ ├── create-index-error.sql │ │ │ ├── create-schema-2.sql │ │ │ ├── create-sequence-2.sql │ │ │ ├── create-table-2.sql │ │ │ ├── drop-index-3.sql │ │ │ ├── insert-2c.sql │ │ │ ├── mysql-4.sql │ │ │ ├── select-limit-5.sql │ │ │ ├── alter-server-interrupt-1.sql │ │ │ ├── alter-server-shutdown-2.sql │ │ │ ├── alter-table-drop-1.sql │ │ │ ├── alter-table-drop-2.sql │ │ │ ├── alter-table-drop-3.sql │ │ │ ├── alter-table-drop-4.sql │ │ │ ├── alter-table-drop-6.sql │ │ │ ├── alter-table-rename-4.sql │ │ │ ├── mysql-4x.sql │ │ │ ├── select-1.sql │ │ │ ├── update-1.sql │ │ │ ├── alter-group-drop-1a.sql │ │ │ ├── alter-server-disconnect-1.sql │ │ │ ├── alter-server-set-2.sql │ │ │ ├── alter-table-add-column-8.sql │ │ │ ├── alter-table-update-1.sql │ │ │ ├── alter-table-update-2.sql │ │ │ ├── create-index-4.sql │ │ │ ├── create-index-5.sql │ │ │ ├── drop-sequence-1.sql │ │ │ ├── find-depth-3.sql │ │ │ ├── select-limit-1.sql │ │ │ ├── select-mysql-1.sql │ │ │ ├── alter-group-add-1b.sql │ │ │ ├── alter-table-1.sql │ │ │ ├── alter-table-add-column-1.sql │ │ │ ├── alter-table-add-column-5.sql │ │ │ ├── alter-table-add-column-6.sql │ │ │ ├── alter-table-drop-index-1.sql │ │ │ ├── copy-5.sql │ │ │ ├── create-table-1.sql │ │ │ ├── delete-returning-1.sql │ │ │ ├── drop-sequence-2.sql │ │ │ ├── group-concat-1.sql │ │ │ ├── insert-returning-3.sql │ │ │ ├── prepare-1.sql │ │ │ ├── select-2.sql │ │ │ ├── select-6.sql │ │ │ ├── select-mysql-2.sql │ │ │ ├── update-2.sql │ │ │ ├── alter-table-add-column-7.sql │ │ │ ├── alter-table-constraint-2.sql │ │ │ ├── create-index-6.sql │ │ │ ├── create-table-9.sql │ │ │ ├── insert-returning-2.sql │ │ │ ├── select-4.sql │ │ │ ├── select-limit-2.sql │ │ │ ├── alter-group-add-2b.sql │ │ │ ├── alter-table-constraint-1.sql │ │ │ ├── create-index-2.sql │ │ │ ├── create-table-5.sql │ │ │ ├── create-view-1.sql │ │ │ ├── insert-1m.sql │ │ │ ├── insert-order-by-1.sql │ │ │ ├── find-depth-1.sql │ │ │ ├── select-sequence-1.sql │ │ │ ├── update-returning-2.sql │ │ │ ├── alter-table-add-index-1.sql │ │ │ ├── create-geo-index-1.sql │ │ │ ├── create-index-3.sql │ │ │ ├── create-table-add-index-1.sql │ │ │ ├── insert-sequence-1.sql │ │ │ ├── select-sequence-2.sql │ │ │ ├── alter-table-add-geo-index-1.sql │ │ │ ├── create-schema-3.sql │ │ │ ├── create-table-8.sql │ │ │ ├── create-table-add-index-2.sql │ │ │ ├── create-table-sequence-2.sql │ │ │ ├── create-view-2.sql │ │ │ ├── create-table-sequence-1.sql │ │ │ ├── select-5.sql │ │ │ ├── update-returning-1.sql │ │ │ ├── alter-group-add-1a.sql │ │ │ ├── alter-table-constraint-3.sql │ │ │ ├── close-1.expected │ │ │ ├── create-index-7.sql │ │ │ ├── create-table-error-1.sql │ │ │ ├── insert-returning-1.sql │ │ │ ├── alter-table-add-column-4.error │ │ │ ├── alter-group-add-2a.sql │ │ │ ├── create-table-add-geo-index-1.sql │ │ │ ├── create-table-sequence-3.sql │ │ │ ├── fetch-1.expected │ │ │ ├── fetch-2.expected │ │ │ ├── fetch-3.expected │ │ │ ├── select-mysql-3.sql │ │ │ ├── alter-table-add-column-4.sql │ │ │ ├── create-table-7.sql │ │ │ ├── deallocate-1.expected │ │ │ ├── set-schema-1.expected │ │ │ ├── create-procedure-3.sql │ │ │ ├── alter-server-shutdown-1.expected │ │ │ ├── alter-server-shutdown-2.expected │ │ │ ├── create-procedure-2.sql │ │ │ ├── drop-group-2.expected │ │ │ ├── alter-table-add-column-7.error │ │ │ ├── insert-returning-4.sql │ │ │ ├── alter-table-2.error │ │ │ ├── drop-schema-2.expected │ │ │ ├── insert-returning-5.sql │ │ │ ├── alter-server-kill-1.expected │ │ │ ├── create-procedure-1.sql │ │ │ ├── drop-group-1.expected │ │ │ ├── drop-schema-1.expected │ │ │ ├── rename-2.expected │ │ │ ├── create-sequence-1.sql │ │ │ ├── drop-table-3.expected │ │ │ ├── alter-server-interrupt-1.expected │ │ │ ├── alter-server-set-1.expected │ │ │ ├── drop-index-3.expected │ │ │ ├── drop-procedure-1.expected │ │ │ ├── drop-schema-error.error │ │ │ ├── drop-table-1.expected │ │ │ ├── drop-table-2.expected │ │ │ ├── rename-1.expected │ │ │ ├── rename-index-1.expected │ │ │ ├── rename-index-2.expected │ │ │ ├── alter-server-disconnect-1.expected │ │ │ ├── create-index-error.error │ │ │ ├── create-schema-error.error │ │ │ ├── drop-index-1.expected │ │ │ ├── rename-table-1.expected │ │ │ ├── drop-sequence-2.expected │ │ │ ├── drop-index-2.expected │ │ │ ├── drop-sequence-1.expected │ │ │ ├── execute-1.expected │ │ │ ├── alter-server-set-2.expected │ │ │ ├── create-table-4.sql │ │ │ ├── alter-table-1.error │ │ │ ├── create-schema-1.expected │ │ │ ├── create-schema-4.expected │ │ │ ├── create-schema-2.expected │ │ │ ├── alter-table-add-column-8.error │ │ │ ├── create-sequence-1.expected │ │ │ ├── create-procedure-3.expected │ │ │ ├── create-schema-3.expected │ │ │ ├── create-procedure-2.expected │ │ │ ├── copy-5.expected │ │ │ ├── copy-1.expected │ │ │ ├── create-sequence-2.expected │ │ │ ├── copy-3.expected │ │ │ ├── create-procedure-1.expected │ │ │ ├── declare-2.expected │ │ │ ├── alter-table-update-2.expected │ │ │ ├── alter-table-update-1.expected │ │ │ ├── create-table-serial.expected │ │ │ ├── execute-2.expected │ │ │ ├── create-table-8.expected │ │ │ ├── create-table-6.sql │ │ │ ├── create-index-1.expected │ │ │ ├── delete-2.expected │ │ │ ├── mysql-4x.error │ │ │ ├── create-index-4.expected │ │ │ ├── create-index-5.expected │ │ │ ├── create-index-6.expected │ │ │ ├── mysql-1x.error │ │ │ ├── mysql-2x.error │ │ │ ├── alter-table-rename-1.expected │ │ │ ├── alter-table-rename-2.expected │ │ │ ├── alter-table-rename-3.expected │ │ │ ├── alter-table-add-column-2.expected │ │ │ ├── alter-table-rename-4.expected │ │ │ ├── alter-table-add-column-5.expected │ │ │ ├── alter-table-add-column-6.expected │ │ │ ├── alter-table-drop-index-1.expected │ │ │ ├── create-geo-index-1.expected │ │ │ ├── alter-table-drop-5.expected │ │ │ ├── alter-table-drop-6.expected │ │ │ ├── alter-table-drop-4.expected │ │ │ ├── alter-table-drop-3.expected │ │ │ ├── alter-table-add-column-1.expected │ │ │ ├── create-index-2.expected │ │ │ ├── junk-1.error │ │ │ ├── alter-table-add-index-1.expected │ │ │ ├── create-index-3.expected │ │ │ ├── create-index-7.expected │ │ │ ├── alter-group-drop-1a.expected │ │ │ ├── alter-group-drop-1b.expected │ │ │ ├── alter-table-drop-1.expected │ │ │ ├── alter-table-drop-2.expected │ │ │ ├── delete-returning-2.expected │ │ │ ├── create-table-1.expected │ │ │ ├── alter-table-add-geo-index-1.expected │ │ │ ├── create-table-add-index-1.expected │ │ │ ├── create-table-add-index-2.expected │ │ │ ├── delete-1.expected │ │ │ ├── create-table-2.expected │ │ │ ├── create-table-9.expected │ │ │ ├── create-table-5.expected │ │ │ ├── create-table-sequence-2.expected │ │ │ ├── create-table-sequence-3.expected │ │ │ ├── select-limit-1.expected │ │ │ ├── select-limit-3.expected │ │ │ ├── declare-1.expected │ │ │ ├── find-depth-1.expected │ │ │ ├── find-depth-2.expected │ │ │ ├── find-depth-3.expected │ │ │ ├── alter-table-constraint-2.expected │ │ │ ├── copy-2.expected │ │ │ ├── select-limit-2.expected │ │ │ ├── select-limit-4.expected │ │ │ ├── select-limit-5.expected │ │ │ ├── create-table-7.expected │ │ │ ├── create-table-sequence-1.expected │ │ │ ├── update-2.expected │ │ │ ├── create-table-add-geo-index-1.expected │ │ │ ├── alter-table-constraint-1.expected │ │ │ ├── select-mysql-1.expected │ │ │ ├── alter-group-add-1a.expected │ │ │ ├── alter-group-add-1b.expected │ │ │ ├── alter-group-add-2a.expected │ │ │ ├── alter-group-add-2b.expected │ │ │ ├── alter-table-constraint-3.expected │ │ │ ├── mysql-2.expected │ │ │ ├── select-sequence-1.expected │ │ │ ├── select-sequence-2.expected │ │ │ ├── copy-4.expected │ │ │ ├── insert-returning-2.expected │ │ │ ├── create-table-3.sql │ │ │ ├── delete-returning-1.expected │ │ │ ├── explain-1.expected │ │ │ ├── mysql-3.expected │ │ │ ├── prepare-1.expected │ │ │ ├── create-table-error-1.expected │ │ │ ├── insert-returning-3.expected │ │ │ ├── mysql-1.expected │ │ │ ├── insert-2.expected │ │ │ ├── create-table-4.expected │ │ │ ├── insert-1.expected │ │ │ ├── select-mysql-2.expected │ │ │ ├── select-6.expected │ │ │ ├── insert-sequence-1.expected │ │ │ ├── insert-3.expected │ │ │ ├── select-order-by-1.expected │ │ │ ├── select-3.expected │ │ │ └── update-returning-1.expected │ │ │ ├── unparser │ │ │ ├── fetch-1.sql │ │ │ ├── close-1.sql │ │ │ ├── execute-1.sql │ │ │ ├── close-1.expected │ │ │ ├── deallocate-1.sql │ │ │ ├── execute-1.expected │ │ │ ├── fetch-2.sql │ │ │ ├── fetch-3.sql │ │ │ ├── deallocate-1.expected │ │ │ ├── fetch-1.expected │ │ │ ├── fetch-2.expected │ │ │ ├── fetch-3.expected │ │ │ ├── copy-3.sql │ │ │ ├── execute-2.sql │ │ │ ├── explain-1.sql │ │ │ ├── multiple │ │ │ │ ├── multiple-1.sql │ │ │ │ ├── multiple-2.sql │ │ │ │ ├── multiple-1.expected │ │ │ │ ├── multiple-2.expected │ │ │ │ ├── transactions-1.sql │ │ │ │ ├── transactions-1.expected │ │ │ │ ├── delete-2.sql │ │ │ │ ├── delete-2.expected │ │ │ │ ├── parameters-1.sql │ │ │ │ ├── parameters-1.expected │ │ │ │ ├── multiple-3.sql │ │ │ │ ├── transactions-2.sql │ │ │ │ ├── transactions-2.expected │ │ │ │ ├── multiple-3.expected │ │ │ │ ├── group-2.sql │ │ │ │ └── group-2.expected │ │ │ ├── select-0.sql │ │ │ ├── select-1.sql │ │ │ ├── select-10.expected │ │ │ ├── select-10.sql │ │ │ ├── select-12.sql │ │ │ ├── copy-3.expected │ │ │ ├── declare-2.sql │ │ │ ├── execute-2.expected │ │ │ ├── explain-1.expected │ │ │ ├── select-1.expected │ │ │ ├── explain-2.sql │ │ │ ├── insert-1.sql │ │ │ ├── rename-index-1.expected │ │ │ ├── rename-index-1.sql │ │ │ ├── rename-table-1.expected │ │ │ ├── rename-table-1.sql │ │ │ ├── select-0.expected │ │ │ ├── select-12.expected │ │ │ ├── select-6.sql │ │ │ ├── create-index-1.sql │ │ │ ├── declare-1.sql │ │ │ ├── declare-2.expected │ │ │ ├── explain-2.expected │ │ │ ├── group-concat-1.sql │ │ │ ├── insert-1.expected │ │ │ ├── insert-1c.sql │ │ │ ├── rename-table-2.expected │ │ │ ├── rename-table-2.sql │ │ │ ├── select-4.sql │ │ │ ├── select-8.sql │ │ │ ├── select-9.sql │ │ │ ├── create-index-1.expected │ │ │ ├── declare-1.expected │ │ │ ├── select-4.expected │ │ │ ├── select-6.expected │ │ │ ├── select-8.expected │ │ │ ├── select-9.expected │ │ │ ├── set-configuration-1.sql │ │ │ ├── update-1.sql │ │ │ ├── copy-6.expected │ │ │ ├── copy-6.sql │ │ │ ├── create-table-2.sql │ │ │ ├── insert-1c.expected │ │ │ ├── insert-1r.sql │ │ │ ├── insert-2.sql │ │ │ ├── set-configuration-1.expected │ │ │ ├── update-1.expected │ │ │ ├── create-index-1g.sql │ │ │ ├── create-table-2.expected │ │ │ ├── prepare-1.sql │ │ │ ├── create-index-1g.expected │ │ │ ├── insert-1r.expected │ │ │ ├── insert-2.expected │ │ │ ├── prepare-1.expected │ │ │ ├── select-11.sql │ │ │ ├── create-view-1.sql │ │ │ ├── group-concat-1.expected │ │ │ ├── copy-5.sql │ │ │ ├── create-geo-index-1.sql │ │ │ ├── create-table-1.sql │ │ │ ├── create-view-1.expected │ │ │ ├── select-11.expected │ │ │ ├── select-5.sql │ │ │ ├── create-geo-index-1.expected │ │ │ ├── create-geo-index-2.sql │ │ │ ├── create-geo-index-3.sql │ │ │ ├── create-table-add-index-1.sql │ │ │ ├── create-table-add-index-3.sql │ │ │ ├── select-13.sql │ │ │ ├── copy-5.expected │ │ │ ├── create-geo-index-2.expected │ │ │ ├── create-geo-index-3.expected │ │ │ ├── insert-2m.sql │ │ │ ├── create-geo-index-4.expected │ │ │ ├── create-geo-index-4.sql │ │ │ ├── create-table-1.expected │ │ │ ├── create-table-add-index-1.expected │ │ │ ├── create-table-add-index-3.expected │ │ │ ├── select-5.expected │ │ │ ├── create-table-add-index-2.sql │ │ │ ├── create-table-add-index-2.expected │ │ │ ├── select-13.expected │ │ │ ├── insert-2m.expected │ │ │ ├── select-2.sql │ │ │ ├── delete-1.sql │ │ │ ├── create-geo-index-5.sql │ │ │ ├── create-geo-index-5.expected │ │ │ ├── select-7.sql │ │ │ ├── create-procedure-2.sql │ │ │ ├── select-2.expected │ │ │ ├── delete-1.expected │ │ │ ├── select-7.expected │ │ │ ├── create-procedure-2.expected │ │ │ ├── select-3.sql │ │ │ ├── create-procedure-1.sql │ │ │ ├── select-3.expected │ │ │ ├── create-procedure-1.expected │ │ │ ├── select-14.sql │ │ │ ├── create-table-4.expected │ │ │ ├── select-14.expected │ │ │ ├── create-table-4.sql │ │ │ ├── create-table-3u.expected │ │ │ ├── create-table-3.expected │ │ │ ├── create-table-3u.sql │ │ │ └── create-table-3.sql │ │ │ └── compiler │ │ │ ├── normalize │ │ │ ├── select-1.sql │ │ │ ├── select-1.expected │ │ │ ├── select-5.sql │ │ │ ├── select-6.sql │ │ │ ├── select-6g.sql │ │ │ ├── select-6i.sql │ │ │ ├── select-2.sql │ │ │ ├── select-3.sql │ │ │ ├── select-4.sql │ │ │ ├── select-5.expected │ │ │ ├── select-6.expected │ │ │ ├── select-6g.expected │ │ │ ├── select-6i.expected │ │ │ ├── select-7.sql │ │ │ ├── select-4.expected │ │ │ ├── select-2.expected │ │ │ ├── select-3.expected │ │ │ ├── select-7.expected │ │ │ ├── select-8.sql │ │ │ └── select-8.expected │ │ │ └── clone │ │ │ ├── select-1.sql │ │ │ └── select-1.expected │ └── java │ │ └── com │ │ └── akiban │ │ └── sql │ │ ├── compiler │ │ └── CloneTest.java │ │ └── RegexFilenameFilter.java ├── etc │ └── header.txt └── main │ └── java │ └── com │ └── akiban │ └── sql │ ├── parser │ ├── StorageLocation.java │ ├── IndexHintList.java │ ├── ExistenceCheck.java │ ├── AccessMode.java │ ├── SQLParserException.java │ ├── SQLParserFeature.java │ ├── IsolationLevel.java │ ├── AlterTableRenameNode.java │ ├── UnaryBitOperatorNode.java │ ├── TrimOperatorNode.java │ └── LeftRightFuncOperatorNode.java │ └── IncomparableException.java └── .bzrignore /src/test/resources/com/akiban/sql/parser/close-1.sql: -------------------------------------------------------------------------------- 1 | CLOSE curs -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/fetch-1.sql: -------------------------------------------------------------------------------- 1 | FETCH pc -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/junk-1.sql: -------------------------------------------------------------------------------- 1 | total junk -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/fetch-1.sql: -------------------------------------------------------------------------------- 1 | FETCH pc -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-1.sql: -------------------------------------------------------------------------------- 1 | COPY t1 TO STDOUT -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/delete-2.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/execute-1.sql: -------------------------------------------------------------------------------- 1 | EXECUTE ps -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/fetch-2.sql: -------------------------------------------------------------------------------- 1 | FETCH 2 FROM pc -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/close-1.sql: -------------------------------------------------------------------------------- 1 | CLOSE curs -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/execute-1.sql: -------------------------------------------------------------------------------- 1 | EXECUTE ps -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/deallocate-1.sql: -------------------------------------------------------------------------------- 1 | DEALLOCATE ps -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-table-1.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE test -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/fetch-3.sql: -------------------------------------------------------------------------------- 1 | FETCH ALL FROM pc -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-2x.features: -------------------------------------------------------------------------------- 1 | -INFIX_MOD 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/set-schema-1.sql: -------------------------------------------------------------------------------- 1 | set schema test -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/close-1.expected: -------------------------------------------------------------------------------- 1 | CLOSE curs -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/deallocate-1.sql: -------------------------------------------------------------------------------- 1 | DEALLOCATE ps -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/execute-1.expected: -------------------------------------------------------------------------------- 1 | EXECUTE ps() -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/fetch-2.sql: -------------------------------------------------------------------------------- 1 | FETCH 2 FROM pc -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/fetch-3.sql: -------------------------------------------------------------------------------- 1 | FETCH ALL FROM pc -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-3.sql: -------------------------------------------------------------------------------- 1 | COPY t1 FROM '/tmp/t1.csv' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-1.sql: -------------------------------------------------------------------------------- 1 | create schema test -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-table-2.sql: -------------------------------------------------------------------------------- 1 | drop table test.t1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/execute-2.sql: -------------------------------------------------------------------------------- 1 | EXECUTE ps(100,'Smith') -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/find-depth-2.sql: -------------------------------------------------------------------------------- 1 | SELECT 1 IN (1, 2, 3) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-2.sql: -------------------------------------------------------------------------------- 1 | SELECT x % y FROM ints -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-2x.sql: -------------------------------------------------------------------------------- 1 | SELECT x % y FROM ints -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/deallocate-1.expected: -------------------------------------------------------------------------------- 1 | DEALLOCATE ps -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/fetch-1.expected: -------------------------------------------------------------------------------- 1 | FETCH 1 FROM pc -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/fetch-2.expected: -------------------------------------------------------------------------------- 1 | FETCH 2 FROM pc -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/fetch-3.expected: -------------------------------------------------------------------------------- 1 | FETCH ALL FROM pc -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-2.sql: -------------------------------------------------------------------------------- 1 | COPY t2(c1,c2) TO '/tmp/t2.csv' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-group-2.sql: -------------------------------------------------------------------------------- 1 | DROP GROUP IF EXISTS t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-table-3.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE if exists test -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/explain-1.sql: -------------------------------------------------------------------------------- 1 | EXPLAIN SELECT x,y FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-1.features: -------------------------------------------------------------------------------- 1 | +INFIX_BIT_OPERATORS 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-1.sql: -------------------------------------------------------------------------------- 1 | SELECT z & y | z FROM bits 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-3.features: -------------------------------------------------------------------------------- 1 | +DOUBLE_QUOTED_STRING 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-1.sql: -------------------------------------------------------------------------------- 1 | RENAME TABLE schema1.t1 to t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-2.sql: -------------------------------------------------------------------------------- 1 | RENAME INDEX index1 TO index2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/copy-3.sql: -------------------------------------------------------------------------------- 1 | COPY t1 FROM '/tmp/t1.csv' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/execute-2.sql: -------------------------------------------------------------------------------- 1 | EXECUTE ps(100,'Smith') -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/explain-1.sql: -------------------------------------------------------------------------------- 1 | EXPLAIN SELECT x,y FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/multiple-1.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/multiple-2.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t; -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-0.sql: -------------------------------------------------------------------------------- 1 | SELECT 1 + 1, 'abc' || 'xyz' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-1.sql: -------------------------------------------------------------------------------- 1 | SELECT c1,c2 FROM t1,t2 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-10.expected: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-10.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) FROM t 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-12.sql: -------------------------------------------------------------------------------- 1 | SELECT F1(f2(a),b) FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-error.sql: -------------------------------------------------------------------------------- 1 | create schema if test -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/declare-2.sql: -------------------------------------------------------------------------------- 1 | DECLARE pc CURSOR FOR EXECUTE ps -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/delete-1.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM t WHERE x in (1,2,3) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-group-1.sql: -------------------------------------------------------------------------------- 1 | DROP GROUP test.root_table_1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-index-1.sql: -------------------------------------------------------------------------------- 1 | DROP INDEX table1.bad_index -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-procedure-1.sql: -------------------------------------------------------------------------------- 1 | DROP PROCEDURE test.foo_bar -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-schema-1.sql: -------------------------------------------------------------------------------- 1 | drop schema tjoneslo restrict -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-schema-2.sql: -------------------------------------------------------------------------------- 1 | drop schema tjoneslo cascade -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-2.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1 SELECT x,y,z FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-3.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1 VALUES(0.123),(.123) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-1x.sql: -------------------------------------------------------------------------------- 1 | SELECT z & y | z FROM bits 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-4.features: -------------------------------------------------------------------------------- 1 | +INFIX_LOGICAL_OPERATORS 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/copy-3.expected: -------------------------------------------------------------------------------- 1 | COPY t1 FROM '/tmp/t1.csv' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/declare-2.sql: -------------------------------------------------------------------------------- 1 | DECLARE pc CURSOR FOR EXECUTE ps -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/execute-2.expected: -------------------------------------------------------------------------------- 1 | EXECUTE ps(100, 'Smith') -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/explain-1.expected: -------------------------------------------------------------------------------- 1 | EXPLAIN SELECT x, y FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-1.expected: -------------------------------------------------------------------------------- 1 | SELECT c1, c2 FROM t1, t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-kill-1.sql: -------------------------------------------------------------------------------- 1 | ALTER SERVER KILL SESSION -1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-shutdown-1.sql: -------------------------------------------------------------------------------- 1 | ALTER SERVER SHUTDOWN -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-2.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 RENAME t2, RENAME t3 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-rename-1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 RENAME t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-rename-2.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 RENAME TO t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-rename-3.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 RENAME AS t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-1.sql: -------------------------------------------------------------------------------- 1 | create index idx1 on table1 (c1) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-4.sql: -------------------------------------------------------------------------------- 1 | create schema IF NOT EXISTS test -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-serial.sql: -------------------------------------------------------------------------------- 1 | create table t1 (c1 serial) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/declare-1.sql: -------------------------------------------------------------------------------- 1 | DECLARE pc CURSOR FOR SELECT * FROM t1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/delete-returning-2.sql: -------------------------------------------------------------------------------- 1 | delete from t1 returning * -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-index-2.sql: -------------------------------------------------------------------------------- 1 | DROP INDEX schema1.table1.bad_index -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-schema-error.sql: -------------------------------------------------------------------------------- 1 | drop schema if not exists test -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-1.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1 VALUES(1, 'foo', 3 * 10) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-3.sql: -------------------------------------------------------------------------------- 1 | SELECT CONCAT("hello ", x) FROM names -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-index-1.sql: -------------------------------------------------------------------------------- 1 | RENAME INDEX x.iold TO inew 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-index-2.sql: -------------------------------------------------------------------------------- 1 | RENAME INDEX s.x.iold TO inew 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-table-1.sql: -------------------------------------------------------------------------------- 1 | RENAME TABLE x.told TO tnew 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-3.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM (SELECT z,y FROM t1) AS s -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-3.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 LIMIT 10 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-4.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 LIMIT 1,2 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-order-by-1.sql: -------------------------------------------------------------------------------- 1 | select x,y,z from t order by x -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/explain-2.sql: -------------------------------------------------------------------------------- 1 | EXPLAIN VERBOSE SELECT x,y FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-1.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1 SELECT x,y,z FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/multiple-1.expected: -------------------------------------------------------------------------------- 1 | [0]: SELECT * FROM t; -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/multiple-2.expected: -------------------------------------------------------------------------------- 1 | [0]: SELECT * FROM t; -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/rename-index-1.expected: -------------------------------------------------------------------------------- 1 | RENAME INDEX x.iold TO inew -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/rename-index-1.sql: -------------------------------------------------------------------------------- 1 | RENAME INDEX x.iold TO inew 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/rename-table-1.expected: -------------------------------------------------------------------------------- 1 | RENAME TABLE x.told TO tnew -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/rename-table-1.sql: -------------------------------------------------------------------------------- 1 | RENAME TABLE x.told TO tnew 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-0.expected: -------------------------------------------------------------------------------- 1 | SELECT (1 + 1), ('abc' || 'xyz') -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-12.expected: -------------------------------------------------------------------------------- 1 | SELECT (f1(f2(a), b)) FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-6.sql: -------------------------------------------------------------------------------- 1 | SELECT CAST(x AS DECIMAL(4,2)) FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-1.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE a = 1 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-drop-1b.sql: -------------------------------------------------------------------------------- 1 | 2 | ALTER GROUP DROP TABLE t1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-set-1.sql: -------------------------------------------------------------------------------- 1 | ALTER SERVER SET cbo to default -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-2.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t add c double -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-5.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t3 DROP CHECK chk 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-4.sql: -------------------------------------------------------------------------------- 1 | COPY (SELECT * FROM t1,t2) TO '/tmp/t12.txt' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-error.sql: -------------------------------------------------------------------------------- 1 | create index if idx1 on table1 (c1) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-2.sql: -------------------------------------------------------------------------------- 1 | create schema authorization tjoneslo -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-sequence-2.sql: -------------------------------------------------------------------------------- 1 | CREATE SEQUENCE test.new_sequence -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-2.sql: -------------------------------------------------------------------------------- 1 | create table t1 (col1 int primary key) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-index-3.sql: -------------------------------------------------------------------------------- 1 | DROP INDEX if EXISTS table1.bad_index -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-2c.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1(a,b,c) SELECT x,y,z FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-4.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE x > y || y < z && x <> z -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-5.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 LIMIT 2 OFFSET 1 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-index-1.sql: -------------------------------------------------------------------------------- 1 | CREATE INDEX idx1 ON t1(c1, c2 DESC) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/declare-1.sql: -------------------------------------------------------------------------------- 1 | DECLARE pc CURSOR FOR SELECT * FROM t1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/declare-2.expected: -------------------------------------------------------------------------------- 1 | DECLARE pc CURSOR FOR EXECUTE ps() -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/explain-2.expected: -------------------------------------------------------------------------------- 1 | EXPLAIN VERBOSE SELECT x, y FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/group-concat-1.sql: -------------------------------------------------------------------------------- 1 | SELECT GROUP_CONCAT(c1, c2) from t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-1.expected: -------------------------------------------------------------------------------- 1 | INSERT INTO t1 SELECT x, y, z FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-1c.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1(a,b,c) SELECT x,y,z FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/rename-table-2.expected: -------------------------------------------------------------------------------- 1 | RENAME TABLE x.told TO y.tnew -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/rename-table-2.sql: -------------------------------------------------------------------------------- 1 | RENAME TABLE x.told TO y.tnew 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-4.sql: -------------------------------------------------------------------------------- 1 | SELECT x,y FROM t WHERE z BETWEEN 1 AND 10 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-8.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM (SELECT z,y FROM t1) AS s -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-9.sql: -------------------------------------------------------------------------------- 1 | SELECT X + $2, Z FROM T1 WHERE Y <> $1 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-interrupt-1.sql: -------------------------------------------------------------------------------- 1 | ALTER SERVER INTERRUPT SESSION 42 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-shutdown-2.sql: -------------------------------------------------------------------------------- 1 | ALTER SERVER SHUTDOWN IMMEDIATE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t3 DROP FOREIGN KEY gfk1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-2.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t3 DROP GROUPING FOREIGN KEY -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-3.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t3 DROP PRIMARY KEY 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-4.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t3 DROP UNIQUE ukey 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-6.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t3 DROP CONSTRAINT con 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-rename-4.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE test.t1 RENAME test.t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-4x.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE x > y || y < z && x <> z -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-1.sql: -------------------------------------------------------------------------------- 1 | SELECT x,y FROM t WHERE z > 3.14 AND w IS NOT NULL -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/update-1.sql: -------------------------------------------------------------------------------- 1 | UPDATE t SET f = f + 1, g = 2 WHERE x > 10 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-index-1.expected: -------------------------------------------------------------------------------- 1 | CREATE INDEX idx1 ON t1(c1, c2 DESC) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/declare-1.expected: -------------------------------------------------------------------------------- 1 | DECLARE pc CURSOR FOR SELECT * FROM t1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-4.expected: -------------------------------------------------------------------------------- 1 | SELECT x, y FROM t WHERE z BETWEEN 1 AND 10 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-6.expected: -------------------------------------------------------------------------------- 1 | SELECT (CAST(x AS DECIMAL(4,2))) FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-8.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM (SELECT z, y FROM t1) AS s -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-9.expected: -------------------------------------------------------------------------------- 1 | SELECT (x + $2), z FROM t1 WHERE y <> $1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/set-configuration-1.sql: -------------------------------------------------------------------------------- 1 | SET client_encoding TO 'ISO-8859-1' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/update-1.sql: -------------------------------------------------------------------------------- 1 | UPDATE t SET x = null, y = y + 1 WHERE x <= 4 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-1.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE (a = 1) AND TRUE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-drop-1a.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 DROP GROUPING FOREIGN KEY -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-disconnect-1.sql: -------------------------------------------------------------------------------- 1 | alter server disconnect session all -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-set-2.sql: -------------------------------------------------------------------------------- 1 | ALTER SERVER SET instrumentation = 'true' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-8.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t ADD COLUMN (c1 integer) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-update-1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE test.t1 ALL UPDATE statistics -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-update-2.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 UPDATE statistics "PRIMARY" -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-4.sql: -------------------------------------------------------------------------------- 1 | create index if not exists idx1 on table1 (c1) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-5.sql: -------------------------------------------------------------------------------- 1 | create index if not exists idx1 on table1 (c1) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-sequence-1.sql: -------------------------------------------------------------------------------- 1 | DROP SEQUENCE test.bad_sequence RESTRICT 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/find-depth-3.sql: -------------------------------------------------------------------------------- 1 | SELECT (1, (2,3)) IN ( 1 , 2 , 3 , (1, (2, 3)) ) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-1.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-mysql-1.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 USE INDEX (idx_1, idx_2), t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/copy-6.expected: -------------------------------------------------------------------------------- 1 | COPY t1 FROM 't1.csv' WITH (COMMIT 10000 ROWS) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/copy-6.sql: -------------------------------------------------------------------------------- 1 | COPY t1 FROM 't1.csv' WITH (HEADER false, COMMIT 10000) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-2.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t2 AS (SELECT * FROM t1) WITH DATA -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-1c.expected: -------------------------------------------------------------------------------- 1 | INSERT INTO t1(a, b, c) SELECT x, y, z FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-1r.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1 SELECT x,y,z FROM t RETURNING k1,k2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-2.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1(x,y,z) VALUES(1, X'DEADBEEF', 3 * 10) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/transactions-1.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | COMMIT; 3 | ROLLBACK; 4 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/set-configuration-1.expected: -------------------------------------------------------------------------------- 1 | SET client_encoding = 'ISO-8859-1' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/update-1.expected: -------------------------------------------------------------------------------- 1 | UPDATE t SET x = NULL, y = (y + 1) WHERE x <= 4 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/clone/select-1.sql: -------------------------------------------------------------------------------- 1 | SELECT x + y + z FROM t1 WHERE x > 0 AND y > 'foo' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-add-1b.sql: -------------------------------------------------------------------------------- 1 | ALTER GROUP ADD TABLE t1 ( c1, c2 ) 2 | TO t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 DROP COLUMN c4, ADD COLUMN c1 INTEGER -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 add column c double, d bigint -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-5.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t ADD without_column INTEGER -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-6.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t ADD COLUMN with_column INTEGER -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-index-1.sql: -------------------------------------------------------------------------------- 1 | alter table netbeans1 drop index netbeansIDX -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-5.sql: -------------------------------------------------------------------------------- 1 | COPY t1 TO STDOUT (FORMAT CSV, DELIMITER '|', NULL 'null') -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-1.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t2 AS (SELECT * FROM t1) WITH NO DATA -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/delete-returning-1.sql: -------------------------------------------------------------------------------- 1 | delete from t1 where name = 'fred' returning id -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-sequence-2.sql: -------------------------------------------------------------------------------- 1 | DROP SEQUENCE IF EXISTS test.new_sequence RESTRICT -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/group-concat-1.sql: -------------------------------------------------------------------------------- 1 | SELECT GROUP_CONCAT(c1, c2, c3 SEPARATOR 'x') from t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-returning-3.sql: -------------------------------------------------------------------------------- 1 | insert into t1 select * from t2 RETURNING id, name -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/prepare-1.sql: -------------------------------------------------------------------------------- 1 | PREPARE ps AS SELECT name FROM customers WHERE cid = $1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-2.sql: -------------------------------------------------------------------------------- 1 | SELECT x,y FROM t WHERE z IN (SELECT z FROM w WHERE q > 10) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-6.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1,t2 NATURAL LEFT JOIN (t3 CROSS JOIN t4) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-mysql-2.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 STRAIGHT_JOIN t2 ON t1.id = t2.id -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/update-2.sql: -------------------------------------------------------------------------------- 1 | UPDATE customers SET name='new' WHERE CURRENT OF customer -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-index-1g.sql: -------------------------------------------------------------------------------- 1 | CREATE INDEX group_index ON gct(p.c1, c.c2, c3) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-2.expected: -------------------------------------------------------------------------------- 1 | CREATE TABLE t2 AS (SELECT * FROM t1) WITH DATA -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/prepare-1.sql: -------------------------------------------------------------------------------- 1 | PREPARE ps AS SELECT name FROM customers WHERE cid = $1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-5.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE NOT (a < 100 OR a > 200) 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-6.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE NOT EXISTS (select * FROM u) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-6g.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE NOT c > ALL (SELECT c FROM u) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-6i.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE NOT (c IN (SELECT c FROM u)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-7.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t ADD COLUMN c1 INTEGER, RENAME t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-constraint-2.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t2 ADD CONSTRAINT P PRIMARY KEY (c3) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-6.sql: -------------------------------------------------------------------------------- 1 | create index if not exists idx1 on table1 (c1) AS BTREE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-9.sql: -------------------------------------------------------------------------------- 1 | create table IF NOT EXISTS t1(col1 int primary key) 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-returning-2.sql: -------------------------------------------------------------------------------- 1 | insert into t1 values (default, 'fred') returning * -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-4.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 WHERE EXISTS ((VALUES 1) INTERSECT (VALUES 2)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-2.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 OFFSET 1 ROW FETCH FIRST 2 ROWS ONLY 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-index-1g.expected: -------------------------------------------------------------------------------- 1 | CREATE INDEX group_index ON gct(p.c1, c.c2, c3) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-1r.expected: -------------------------------------------------------------------------------- 1 | INSERT INTO t1 SELECT x, y, z FROM t RETURNING k1, k2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-2.expected: -------------------------------------------------------------------------------- 1 | INSERT INTO t1(x, y, z) VALUES(1, X'DEADBEEF', (3 * 10)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/prepare-1.expected: -------------------------------------------------------------------------------- 1 | PREPARE ps AS SELECT name FROM customers WHERE cid = $1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-11.sql: -------------------------------------------------------------------------------- 1 | SELECT x IS NULL, x IS TRUE, x IS FALSE, x IS UNKNOWN FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-2.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE ((a AND b) AND c) AND NOT d 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-3.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE (d OR e) OR ((a AND b) AND c) 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-4.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 LEFT OUTER JOIN t2 ON t1.id = t2.pid 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-add-2b.sql: -------------------------------------------------------------------------------- 1 | ALTER GROUP ADD TABLE t1 ( c1, c2 ) 2 | TO t2 (a1, a2) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-constraint-1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 ADD CONSTRAINT ux1 UNIQUE (c1, c2) 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-2.sql: -------------------------------------------------------------------------------- 1 | create Unique index idx2 on table2 (c1 asc, c2 desc, c3 asc) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-5.sql: -------------------------------------------------------------------------------- 1 | create table test.t1 (col1 integer not null, primary key (col1)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-view-1.sql: -------------------------------------------------------------------------------- 1 | CREATE VIEW v1(x,y) AS (SELECT y,z FROM t1 WHERE y IS NOT NULL) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-1m.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1 VALUES(1, 'foo', 3 * 10),(2, 'bar', -1),(3, 'baz', 42) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-order-by-1.sql: -------------------------------------------------------------------------------- 1 | insert into t (x, y, z) select a, b, c from t2 order by a -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-view-1.sql: -------------------------------------------------------------------------------- 1 | CREATE VIEW v1(x,y) AS (SELECT y,z FROM t1 WHERE y IS NOT NULL) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/transactions-1.expected: -------------------------------------------------------------------------------- 1 | [0]: BEGIN; 2 | [1]: COMMIT; 3 | [2]: ROLLBACK; -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/clone/select-1.expected: -------------------------------------------------------------------------------- 1 | SELECT ((x + y) + z) FROM t1 WHERE (x > 0) AND (y > 'foo') -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-5.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE (a >= 100) AND ((a <= 200) AND TRUE) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/find-depth-1.sql: -------------------------------------------------------------------------------- 1 | SELECT (1, (2, (4, (6, 7)))) IN ( (1, (2, (4, (6, 7)))) , (1, 2, 3) ) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-sequence-1.sql: -------------------------------------------------------------------------------- 1 | SELECT id, next value for test.new_sequence 2 | FROM customers -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/update-returning-2.sql: -------------------------------------------------------------------------------- 1 | update t1 set g = x * 2, f = 1 WHERE CURRENT OF t1 RETURNING g, f -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/group-concat-1.expected: -------------------------------------------------------------------------------- 1 | SELECT (GROUP_CONCAT(type: null 2 | SEPARATOR ',')) FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-6.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE (NOT EXISTS (SELECT * FROM u)) AND TRUE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-6g.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE (c <= ANY (SELECT c FROM u)) AND TRUE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-6i.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE (c NOT IN (SELECT c FROM u)) AND TRUE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-7.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE NOT ( (1, 2) IN ((1, 2), (3, 4), (5, 6) )) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-index-1.sql: -------------------------------------------------------------------------------- 1 | alter table t1 add Unique index idx2 (c1 asc, c2 desc, c3 asc) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-geo-index-1.sql: -------------------------------------------------------------------------------- 1 | create index if not exists idx1 on table1 (z_order_lat_lon(c1, c2)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-3.sql: -------------------------------------------------------------------------------- 1 | CREATE INDEX G1 ON group_table (schema1.t1.c1, t2.c2, c3) USING LEFT JOIN -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-add-index-1.sql: -------------------------------------------------------------------------------- 1 | create table t1 (c1 int, c2 double, index indx1 (c1 ASC, c2)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-sequence-1.sql: -------------------------------------------------------------------------------- 1 | insert into t1 (cid, iid) values (1, next value for test.new_sequence) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-sequence-2.sql: -------------------------------------------------------------------------------- 1 | SELECT id, current value for test.new_sequence 2 | FROM customers 3 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/copy-5.sql: -------------------------------------------------------------------------------- 1 | COPY t1(c1,c2) TO 'file' (FORMAT csv, null 'null', delimiter '|', HEADER true) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-1.sql: -------------------------------------------------------------------------------- 1 | create index if not exists idx1 on table1 (z_order_lat_lon(c1, c2)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-1.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1 (i int PRIMARY KEY, s char(30) NOT NULL, z VARCHAR(128)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-view-1.expected: -------------------------------------------------------------------------------- 1 | CREATE VIEW v1(x, y) AS (SELECT y, z FROM t1 WHERE NOT (y IS NULL)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/delete-2.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM t1; 2 | DELETE FROM t2 WHERE x > 10; 3 | DELETE FROM t3 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-11.expected: -------------------------------------------------------------------------------- 1 | SELECT (x IS NULL), (x IS TRUE), (x IS FALSE), (x IS UNKNOWN) FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-5.sql: -------------------------------------------------------------------------------- 1 | SELECT CASE WHEN x = y OR x = z THEN x WHEN y = z THEN y ELSE w END FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-4.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 LEFT OUTER JOIN t2 ON ((t1.id = t2.pid) AND TRUE) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-geo-index-1.sql: -------------------------------------------------------------------------------- 1 | alter table t1 add Unique index idx2 (z_order_lat_lon(c1, c2)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-3.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA stringy DEFAULT CHARACTER SET latin1 DEFAULT COLLATION "fr_FR" -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-8.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t8 (s varchar(10) character set latin1 collate "en_GB" not null) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-add-index-2.sql: -------------------------------------------------------------------------------- 1 | create table t1 (c1 int, c2 double, index indx1 (c1 DESC) AS BTREE) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-sequence-2.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t7 (c1 integer primary key generated always as identity) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-view-2.sql: -------------------------------------------------------------------------------- 1 | CREATE VIEW if Not Exists v1(x,y) AS (SELECT y,z FROM t1 WHERE y IS NOT NULL) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-1.expected: -------------------------------------------------------------------------------- 1 | CREATE INDEX IF NOT EXISTS idx1 ON table1(Z_ORDER_LAT_LON(c1, c2)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-2.sql: -------------------------------------------------------------------------------- 1 | create index if not exists idx1 on table1 (a, z_order_lat_lon(c1, c2)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-3.sql: -------------------------------------------------------------------------------- 1 | create index if not exists idx1 on table1 (z_order_lat_lon(c1, c2), b, c) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-add-index-1.sql: -------------------------------------------------------------------------------- 1 | create table t1 (c1 int, c2 double, index indx1 (c1 DESC) AS BTREE) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-add-index-3.sql: -------------------------------------------------------------------------------- 1 | create table t1 (c1 int, c2 double, index indx1 (c1 ASC), c3 int) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-13.sql: -------------------------------------------------------------------------------- 1 | SELECT a, NULL, b = 'B' OR b IS NULL, IF(c = 'C' OR c = 'c', 'YES', 'NO') FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-sequence-1.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t7 (c1 integer primary key generated by default as identity) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-5.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1,t2 LEFT OUTER JOIN t3 ON t2.x = t3.x RIGHT OUTER JOIN t4 ON t3.x = t4.x -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/update-returning-1.sql: -------------------------------------------------------------------------------- 1 | UPDATE t1 SET id = next value for sequence1 where name = 'fred' returning id -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/copy-5.expected: -------------------------------------------------------------------------------- 1 | COPY t1(c1, c2) TO 'file' WITH (FORMAT CSV, DELIMITER '|', NULL 'null', HEADER TRUE) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-2.expected: -------------------------------------------------------------------------------- 1 | CREATE INDEX IF NOT EXISTS idx1 ON table1(a, Z_ORDER_LAT_LON(c1, c2)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-3.expected: -------------------------------------------------------------------------------- 1 | CREATE INDEX IF NOT EXISTS idx1 ON table1(Z_ORDER_LAT_LON(c1, c2), b, c) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-2m.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO t1(x,y,z) VALUES(1, X'DEADBEEF', 3 * 10), (2, 3.14, 1.0e6), (3, NULL, TRUE) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-add-1a.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 2 | ADD GROUPING FOREIGN KEY ( c1, c2 ) 3 | REFERENCES t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-constraint-3.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t3 ADD CONSTRAINT gfk1 GROUPING FOREIGN KEY (c2, c3) references t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/close-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CloseStatementNode@6baa9f99 2 | name: curs 3 | statementType: CLOSE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-7.sql: -------------------------------------------------------------------------------- 1 | CREATE INDEX G1 ON group_table (schema1.t1.c1, t2.c2, c3) USING LEFT JOIN AS IN_MEMORY -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-error-1.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE T1 (c1 int primary key, 2 | c2 int not null, 3 | primary key (c2)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-returning-1.sql: -------------------------------------------------------------------------------- 1 | insert into t1 (id, name, last_value) values (DEFAULT, 'fred', 'last') RETURNING id -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-4.expected: -------------------------------------------------------------------------------- 1 | CREATE INDEX IF NOT EXISTS idx1 ON table1(a, b, Z_ORDER_LAT_LON(c1, c2), d, e) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-4.sql: -------------------------------------------------------------------------------- 1 | create index if not exists idx1 on table1 (a, b, z_order_lat_lon(c1, c2), d, e) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-1.expected: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1(PRIMARY KEY(i), i INTEGER, s CHAR(30) NOT NULL, z VARCHAR(128)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-add-index-1.expected: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1(c1 INTEGER, c2 DOUBLE, INDEX indx1 (c1 DESC) AS BTREE) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-add-index-3.expected: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1(c1 INTEGER, c2 DOUBLE, INDEX indx1 (c1), c3 INTEGER) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-5.expected: -------------------------------------------------------------------------------- 1 | SELECT (CASE WHEN ((x = y) OR (x = z)) THEN x WHEN (y = z) THEN y ELSE w END) FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-4.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.StandardException: Auto increment column not allowed in ALTER TABLE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-add-index-2.sql: -------------------------------------------------------------------------------- 1 | create table t1 (c1 int, c2 double, index indx1 (c1 ASC) AS IN_MEMORY, c3 int) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/delete-2.expected: -------------------------------------------------------------------------------- 1 | [0]: DELETE FROM t1; 2 | [1]: DELETE FROM t2 WHERE x > 10; 3 | [2]: DELETE FROM t3; -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-add-2a.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 2 | ADD GROUPING FOREIGN KEY ( c1, c2 ) 3 | REFERENCES t2 (a1, a2) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-add-geo-index-1.sql: -------------------------------------------------------------------------------- 1 | create table t1 (c1 int, c2 double, c3 bigint, index indx1 (z_order_lat_lon(c1, c2))) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-sequence-3.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t7 (c1 integer primary key generated always as identity (increment by 0)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/fetch-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.FetchStatementNode@f5e0873 2 | name: pc 3 | count: 1 4 | statementType: FETCH -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/fetch-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.FetchStatementNode@667cbde6 2 | name: pc 3 | count: 2 4 | statementType: FETCH -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/fetch-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.FetchStatementNode@7977b9b 2 | name: pc 3 | count: ALL 4 | statementType: FETCH -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-mysql-3.sql: -------------------------------------------------------------------------------- 1 | SELECT STRAIGHT_JOIN a,b,c FROM t1 INNER JOIN t2 ON t1.id = t2.pid INNER JOIN t3 ON p2.id = t3.pid -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-add-index-2.expected: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1(c1 INTEGER, c2 DOUBLE, INDEX indx1 (c1) AS IN_MEMORY, c3 INTEGER) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-13.expected: -------------------------------------------------------------------------------- 1 | SELECT a, NULL, ((b = 'B') OR (b IS NULL)), (if(((c = 'C') OR (c = 'c')), 'YES', 'NO')) FROM t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-2.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE (a = TRUE) AND ((b = TRUE) AND ((c = TRUE) AND ((d = FALSE) AND TRUE))) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-4.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE t1 add d integer generated by default as identity (start with 1, increment by 5) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-7.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t7 (c1 integer primary key generated by default as identity (start with 1, increment by 5)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/deallocate-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DeallocateStatementNode@7dce784b 2 | name: ps 3 | statementType: DEALLOCATE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/set-schema-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SetSchemaNode@97494c8 2 | statementType: SET SCHEMA 3 | schemaName: 4 | test -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/insert-2m.expected: -------------------------------------------------------------------------------- 1 | INSERT INTO t1(x, y, z) VALUES(1, X'DEADBEEF', (3 * 10)), (2, 3.14, 1.000000e+06), (3, NULL, TRUE) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-2.sql: -------------------------------------------------------------------------------- 1 | SELECT x,y||y AS yy FROM t WHERE z > 3.14 AND w IS NOT NULL OR y LIKE 'f%' OR y LIKE '_%%' ESCAPE '%' 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/delete-1.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM t t1 WHERE x in (1,2,?) AND EXISTS (SELECT * FROM t t2 WHERE t1.id <> t2.id AND t1.name = t2.name) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/parameters-1.sql: -------------------------------------------------------------------------------- 1 | EXPLAIN SELECT * FROM t1 WHERE ID = ?; 2 | EXPLAIN SELECT * FROM t1 WHERE ID BETWEEN ? AND ?; 3 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-procedure-3.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE test.foo_too(IN x INT, OUT y DOUBLE) LANGUAGE SQL PARAMETER STYLE ROW AS 'SELECT $1 * 3.0' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-5.sql: -------------------------------------------------------------------------------- 1 | create index if not exists idx1 on table1(p.a, p.b, z_order_lat_lon(c.c1, c.c2), c.d, c.e) using left join -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-geo-index-5.expected: -------------------------------------------------------------------------------- 1 | CREATE INDEX IF NOT EXISTS idx1 ON table1(p.a, p.b, Z_ORDER_LAT_LON(c.c1, c.c2), c.d, c.e) USING LEFT JOIN -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-7.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 LEFT OUTER JOIN t2 on t1.id = t2.xid RIGHT OUTER JOIN t3 on t1.id = t3.yid INNER JOIN t4 USING (a,b,c) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-shutdown-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterServerNode@2321ab80 2 | statementType: ALTER SERVER 3 | shutdown immediate: false -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-shutdown-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterServerNode@46e45076 2 | statementType: ALTER SERVER 3 | shutdown immediate: true -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-procedure-2.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE test.foo_baz() LANGUAGE JAVA PARAMETER STYLE AKIBAN_LOADABLE_PLAN EXTERNAL NAME 'com.akiban.PlanTest' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-group-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropGroupNode@47d62270 2 | name: t2 3 | statementType: DROP GROUP 4 | existenceCheck: IF_EXISTS -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-procedure-2.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE test.foo_too(IN x INT, OUT y DOUBLE) LANGUAGE JAVASCRIPT PARAMETER STYLE VARIABLES AS 'y = x;' NO SQL -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/parameters-1.expected: -------------------------------------------------------------------------------- 1 | [0]: EXPLAIN SELECT * FROM t1 WHERE id = $1; 2 | [1]: EXPLAIN SELECT * FROM t1 WHERE id BETWEEN $1 AND $2; -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-2.expected: -------------------------------------------------------------------------------- 1 | SELECT x, (y || y) AS yy FROM t WHERE (((z > 3.14) AND (NOT (w IS NULL))) OR (y LIKE 'f%')) OR (y LIKE '_%%' ESCAPE '%') -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-7.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered "" at line 1, column 39. 2 | Was expecting one of: 3 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-returning-4.sql: -------------------------------------------------------------------------------- 1 | insert into t1 (id, name, last_value) values 2 | (select id, name, last_value from t2 3 | order by name) 4 | returning id -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/delete-1.expected: -------------------------------------------------------------------------------- 1 | DELETE FROM t AS t1 WHERE (x IN (1, 2, $1)) AND (EXISTS (SELECT * FROM t AS t2 WHERE (t1.id <> t2.id) AND (t1.name = t2.name))) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-7.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t1 LEFT OUTER JOIN t2 ON (t1.id = t2.xid) RIGHT OUTER JOIN t3 ON (t1.id = t3.yid) INNER JOIN t4 USING (a, b, c) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-2.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "," ", "" at line 1, column 25. 2 | Was expecting: 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-schema-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropSchemaNode@24f9fdc 2 | statementType: DROP SCHEMA 3 | schemaName: 4 | tjoneslo 5 | dropBehavior: 6 | 0 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-returning-5.sql: -------------------------------------------------------------------------------- 1 | insert into t (id, name, last_value) values (NEXT VALUE FOR sequence_1, 'fred', 'last') 2 | returning id+1000, name || last_value -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-procedure-2.expected: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE test.foo_too(IN x INTEGER, OUT y DOUBLE) LANGUAGE javascript PARAMETER STYLE variables NO SQL AS 'y = x;' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-kill-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterServerNode@46e45076 2 | statementType: ALTER SERVER 3 | sessionType: KILL_SESSION 4 | sessionID: -1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-procedure-1.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE test.foo_bar(IN x INT, OUT y DOUBLE) LANGUAGE JAVA PARAMETER STYLE JAVA EXTERNAL NAME 'com.akiban.ProcTest.fooBar' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-group-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropGroupNode@7776cad3 2 | name: test.root_table_1 3 | statementType: DROP GROUP 4 | existenceCheck: NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-schema-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropSchemaNode@626f50a8 2 | statementType: DROP SCHEMA 3 | schemaName: 4 | tjoneslo 5 | dropBehavior: 6 | 1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.RenameNode@162200d5 2 | statementType: RENAME INDEX 3 | oldIndexName: 4 | index1 5 | newIndexName: 6 | index2 7 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-3.sql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT MAX(x),y||y AS yy FROM t WHERE z > 3.14 AND w IS NOT NULL OR y LIKE 'f%' GROUP BY yy HAVING yy > 'z' ORDER BY yyo NULLS FIRST -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-3.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE ((d = TRUE) OR ((e = TRUE) OR (((a = TRUE) AND ((b = TRUE) AND ((c = TRUE) AND TRUE))) OR FALSE))) AND TRUE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-sequence-1.sql: -------------------------------------------------------------------------------- 1 | CREATE SEQUENCE newSequence 2 | AS INTEGER 3 | START WITH 1 4 | INCREMENT BY 2 5 | MAXVALUE 1000 6 | MINVALUE 1 7 | CYCLE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-table-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropTableNode@2d04faf8 2 | name: test 3 | statementType: DROP TABLE 4 | dropBehavior: 2 5 | existenceCheck: IF_EXISTS -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/multiple-3.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1(id INT PRIMARY KEY, name VARCHAR(10) NOT NULL); INSERT INTO t1 VALUES(1, 'foo'); INSERT INTO t1 VALUES(2, 'bar'); 2 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-interrupt-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterServerNode@3934f69a 2 | statementType: ALTER SERVER 3 | sessionType: INTERRUPT_SESSION 4 | sessionID: 42 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-set-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterServerNode@46e45076 2 | statementType: ALTER SERVER 3 | variable: cbo 4 | value: null 5 | statementType: SET cbo -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-index-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropIndexNode@4ac9131c 2 | name: table1 3 | statementType: DROP INDEX 4 | indexName: bad_index 5 | existenceCheck: IF_EXISTS -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-procedure-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropAliasNode@476020ed 2 | name: test.foo_bar 3 | statementType: DROP PROCEDURE 4 | existenceCheck: NO_CONDITION 5 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-schema-error.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "not" "not "" at line 1, column 16. 2 | Was expecting: 3 | "exists" ... 4 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-table-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropTableNode@2d04faf8 2 | name: test 3 | statementType: DROP TABLE 4 | dropBehavior: 2 5 | existenceCheck: NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-table-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropTableNode@b23b25c 2 | name: test.t1 3 | statementType: DROP TABLE 4 | dropBehavior: 2 5 | existenceCheck: NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.RenameNode@2d8941f7 2 | name: schema1.t1 3 | statementType: RENAME TABLE 4 | oldTableName: 5 | t1 6 | newTableName: 7 | t2 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-index-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.RenameNode@7f70888e 2 | name: x 3 | statementType: RENAME INDEX 4 | oldIndexName: 5 | iold 6 | newIndexName: 7 | inew -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-index-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.RenameNode@151ca803 2 | name: s.x 3 | statementType: RENAME INDEX 4 | oldIndexName: 5 | iold 6 | newIndexName: 7 | inew -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-disconnect-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterServerNode@442a15cd 2 | statementType: ALTER SERVER 3 | sessionType: DISCONNECT_SESSION 4 | sessionID: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-error.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "idx1 "" at line 1, column 17. 2 | Was expecting: 3 | "not" ... 4 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-error.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "test "" at line 1, column 18. 2 | Was expecting: 3 | "not" ... 4 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-index-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropIndexNode@4ac9131c 2 | name: table1 3 | statementType: DROP INDEX 4 | indexName: bad_index 5 | existenceCheck: NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/rename-table-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.RenameNode@7f70888e 2 | name: x.told 3 | statementType: RENAME TABLE 4 | oldTableName: 5 | told 6 | newTableName: 7 | tnew -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-procedure-1.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE test.foo_bar(IN x INT, OUT y DOUBLE) LANGUAGE JAVA PARAMETER STYLE JAVA EXTERNAL NAME 'com.akiban.ProcTest.fooBar(int,double[])' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/transactions-2.sql: -------------------------------------------------------------------------------- 1 | SET TRANSACTION ISOLATION LEVEL READ COMMITTED; 2 | SET TRANSACTION READ ONLY; 3 | SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY; 4 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-7.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE ((1 <> 5) OR ((2 <> 6) OR FALSE)) AND (((1 <> 3) OR ((2 <> 4) OR FALSE)) AND (((1 <> 1) OR ((2 <> 2) OR FALSE)) AND TRUE)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-sequence-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropSequenceNode@62c09554 2 | name: test.new_sequence 3 | statementType: DROP SEQUENCE new_sequence 4 | existenceCheck: IF_EXISTS -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-3.expected: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT MAX(x), (y || y) AS yy FROM t WHERE ((z > 3.14) AND (NOT (w IS NULL))) OR (y LIKE 'f%') GROUP BY yy HAVING yy > 'z' ORDER BY yyo NULLS FIRST -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-index-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropIndexNode@2b313906 2 | name: schema1.table1 3 | statementType: DROP INDEX 4 | indexName: bad_index 5 | existenceCheck: NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/drop-sequence-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DropSequenceNode@16bdb503 2 | name: test.bad_sequence 3 | statementType: DROP SEQUENCE bad_sequence 4 | existenceCheck: NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/execute-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.ExecuteStatementNode@788ab708 2 | name: ps 3 | statementType: EXECUTE 4 | parameterList: 5 | com.akiban.sql.parser.ValueNodeList@5af6ac0b -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-procedure-1.expected: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE test.foo_bar(IN x INTEGER, OUT y DOUBLE) LANGUAGE java PARAMETER STYLE java EXTERNAL NAME 'com.akiban.ProcTest.fooBar(int,double[])' -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/transactions-2.expected: -------------------------------------------------------------------------------- 1 | [0]: SET TRANSACTION ISOLATION READ COMMITTED; 2 | [1]: SET TRANSACTION READ ONLY; 3 | [2]: SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY; -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-server-set-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterServerNode@375e9756 2 | statementType: ALTER SERVER 3 | variable: instrumentation 4 | value: true 5 | statementType: SET instrumentation -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/multiple-3.expected: -------------------------------------------------------------------------------- 1 | [0]: CREATE TABLE t1(PRIMARY KEY(id), id INTEGER, name VARCHAR(10) NOT NULL); 2 | [1]: INSERT INTO t1 VALUES(1, 'foo'); 3 | [2]: INSERT INTO t1 VALUES(2, 'bar'); -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-4.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1 (c1 integer unsigned primary key, 2 | c2 smallint unsigned, 3 | c3 bigint unsigned, 4 | c4 decimal unsigned, 5 | c5 double unsigned, 6 | c6 float unsigned) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-1.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "," ", "" at line 1, column 30. 2 | Was expecting one of: 3 | 4 | "cascade" ... 5 | "restrict" ... 6 | -------------------------------------------------------------------------------- /.bzrignore: -------------------------------------------------------------------------------- 1 | ./classes 2 | ./target 3 | ./.classpath 4 | ./.project 5 | build.properties.local 6 | ParseException.java 7 | SQLGrammar.java 8 | SQLGrammarConstants.java 9 | SQLGrammarTokenManager.java 10 | Token.java 11 | *.iml 12 | *.ipr 13 | *.iws 14 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateSchemaNode@52b2a2d8 2 | statementType: CREATE SCHEMA 3 | schemaName: 4 | test 5 | authorizationId: 6 | null 7 | defaultChar: 8 | null 9 | existenceCheck: 10 | NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-4.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateSchemaNode@52b2a2d8 2 | statementType: CREATE SCHEMA 3 | schemaName: 4 | test 5 | authorizationId: 6 | null 7 | defaultChar: 8 | null 9 | existenceCheck: 10 | IF_NOT_EXISTS -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateSchemaNode@6f34a7d8 2 | statementType: CREATE SCHEMA 3 | schemaName: 4 | tjoneslo 5 | authorizationId: 6 | tjoneslo 7 | defaultChar: 8 | null 9 | existenceCheck: 10 | NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-8.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "(" "( "" at line 1, column 26. 2 | Was expecting one of: 3 | ... 4 | ... 5 | ... 6 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-sequence-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateSequenceNode@244aeb52 2 | name: newsequence 3 | statementType: CREATE SEQUENCE 4 | sequenceName: newsequence 5 | initial value: 1 6 | step value: 2 7 | maxValue: 1000 8 | minValue:1 9 | cycle: true -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-procedure-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateAliasNode@258b678c 2 | aliasType: PROCEDURE 3 | aliasInfo: (IN x INTEGER, OUT y DOUBLE) LANGUAGE SQL PARAMETER STYLE row 4 | definition: SELECT $1 * 3.0 5 | name: test.foo_too 6 | statementType: CREATE PROCEDURE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-schema-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateSchemaNode@44f53eb 2 | statementType: CREATE SCHEMA 3 | schemaName: 4 | stringy 5 | authorizationId: 6 | null 7 | defaultChar: 8 | CHARACTER SET latin1 COLLATE fr_FR 9 | existenceCheck: 10 | NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-14.sql: -------------------------------------------------------------------------------- 1 | SELECT DATE('2011-01'||'-01'), 2 | DATE '2011-04-01', 3 | DATE '2011-03-01' + INTERVAL '2' MONTH, 4 | TIMESTAMP '2010-03-01' + INTERVAL '10-3' YEAR TO MONTH, 5 | DATE '2011-01-01' + INTERVAL 4 WEEK, 6 | INTERVAL '1 1:1:1' DAY_SECOND 7 | FROM dual -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-procedure-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateAliasNode@114beb40 2 | aliasType: PROCEDURE 3 | aliasInfo: () LANGUAGE java PARAMETER STYLE akiban_loadable_plan 4 | javaClassName: com.akiban 5 | methodName: PlanTest 6 | name: test.foo_baz 7 | statementType: CREATE PROCEDURE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-5.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CopyStatementNode@24f9fdc 2 | mode: FROM_TABLE 3 | tableName: t1 4 | filename: null 5 | format: CSV 6 | delimiter: | 7 | nullString: null 8 | quote: null 9 | escape: null 10 | encoding: null 11 | commitFrequency: 0 12 | statementType: COPY -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CopyStatementNode@5bbf3d87 2 | mode: FROM_TABLE 3 | tableName: t1 4 | filename: null 5 | format: null 6 | delimiter: null 7 | nullString: null 8 | quote: null 9 | escape: null 10 | encoding: null 11 | commitFrequency: 0 12 | statementType: COPY -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-sequence-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateSequenceNode@244aeb52 2 | name: test.new_sequence 3 | statementType: CREATE SEQUENCE 4 | sequenceName: test.new_sequence 5 | initial value: -2147483648 6 | step value: 1 7 | maxValue: 2147483647 8 | minValue:-2147483648 9 | cycle: false -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-4.expected: -------------------------------------------------------------------------------- 1 | CREATE TABLE intervals(y INTERVAL YEAR, y_4 INTERVAL YEAR(4), y_m INTERVAL YEAR TO MONTH, m INTERVAL MONTH, d INTERVAL DAY, d_s INTERVAL DAY TO SECOND, d_2_h INTERVAL DAY(2) TO HOUR, d_s_9 INTERVAL DAY TO SECOND(9), s INTERVAL SECOND, s_6_3 INTERVAL SECOND(6, 3)) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CopyStatementNode@16b8f8eb 2 | mode: TO_TABLE 3 | tableName: t1 4 | filename: /tmp/t1.csv 5 | format: null 6 | delimiter: null 7 | nullString: null 8 | quote: null 9 | escape: null 10 | encoding: null 11 | commitFrequency: 0 12 | statementType: COPY -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-procedure-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateAliasNode@77925ae 2 | aliasType: PROCEDURE 3 | aliasInfo: (IN x INTEGER, OUT y DOUBLE) LANGUAGE java PARAMETER STYLE java 4 | javaClassName: com.akiban.ProcTest 5 | methodName: fooBar 6 | name: test.foo_bar 7 | statementType: CREATE PROCEDURE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/declare-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DeclareStatementNode@739e8329 2 | name: pc 3 | statementType: DECLARE 4 | statement: 5 | com.akiban.sql.parser.ExecuteStatementNode@2bb5340c 6 | name: ps 7 | statementType: EXECUTE 8 | parameterList: 9 | com.akiban.sql.parser.ValueNodeList@56c163f -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/group-2.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE P(id INT PRIMARY KEY, name VARCHAR(10) NOT NULL); 2 | CREATE TABLE C(id INT PRIMARY KEY, name VARCHAR(10) NOT NULL, pid INT GROUPING REFERENCES P(id)); 3 | CREATE TABLE G(id INT PRIMARY KEY, value DECIMAL(10,2), cid INT, GROUPING FOREIGN KEY(cid) REFERENCES C(id)); 4 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/select-14.expected: -------------------------------------------------------------------------------- 1 | SELECT (DATE('2011-01' || '-01')), (CAST('2011-04-01' AS DATE)), ((CAST('2011-03-01' AS DATE)) + (CAST('2' AS INTERVAL MONTH))), ((CAST('2010-03-01' AS TIMESTAMP)) + (CAST('10-3' AS INTERVAL YEAR TO MONTH))), ((CAST('2011-01-01' AS DATE)) + ((CAST(4 AS INTERVAL DAY)) * 7)), (CAST('1 1:1:1' AS INTERVAL DAY TO SECOND)) FROM dual -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-4.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE intervals ( 2 | y INTERVAL YEAR, 3 | y_4 INTERVAL YEAR(4), 4 | y_m INTERVAL YEAR TO MONTH, 5 | m INTERVAL MONTH, 6 | d INTERVAL DAY, 7 | d_s INTERVAL DAY TO SECOND, 8 | d_2_h INTERVAL DAY(2) TO HOUR, 9 | d_s_9 INTERVAL DAY TO SECOND(9), 10 | s INTERVAL SECOND, 11 | s_6_3 INTERVAL SECOND(6,3) 12 | ) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/multiple/group-2.expected: -------------------------------------------------------------------------------- 1 | [0]: CREATE TABLE p(PRIMARY KEY(id), id INTEGER, name VARCHAR(10) NOT NULL); 2 | [1]: CREATE TABLE c(PRIMARY KEY(id), id INTEGER, name VARCHAR(10) NOT NULL, GROUPING FOREIGN KEY(pid) REFERENCES p(pid), pid INTEGER); 3 | [2]: CREATE TABLE g(PRIMARY KEY(id), id INTEGER, value DECIMAL(10,2), cid INTEGER, GROUPING FOREIGN KEY(cid) REFERENCES c(cid)); -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-update-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@53ad085 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: true 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: PRIMARY -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-update-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@68861f24 2 | name: test.t1 3 | statementType: ALTER TABLE 4 | objectName: test.t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: true 12 | updateStatisticsAll: true 13 | indexNameForUpdateStatistics: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-serial.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@303020ad 2 | name: t1 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@27b15692 8 | 9 | [0]: 10 | com.akiban.sql.parser.ColumnDefinitionNode@6baa9f99 11 | type: serial 12 | name: c1 13 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/execute-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.ExecuteStatementNode@789934d4 2 | name: ps 3 | statementType: EXECUTE 4 | parameterList: 5 | com.akiban.sql.parser.ValueNodeList@125b8827 6 | 7 | [0]: 8 | com.akiban.sql.parser.NumericConstantNode@3747c1db 9 | value: 100 10 | type: INTEGER NOT NULL 11 | [1]: 12 | com.akiban.sql.parser.CharConstantNode@48082d37 13 | value: Smith 14 | type: CHAR(5) NOT NULL -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-8.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@43f46f3b 2 | name: t8 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@64b2ad57 8 | 9 | [0]: 10 | com.akiban.sql.parser.ColumnDefinitionNode@e925e67 11 | type: VARCHAR(10) CHARACTER SET latin1 COLLATE en_GB NOT NULL 12 | name: s 13 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-6.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1 (c1 integer primary key, 2 | c2 integer not null, 3 | c3 integer not null, 4 | c4 integer not null, 5 | c5 integer not null, 6 | c6 integer not null, 7 | unique (c2), 8 | constraint key_c3 unique (c3), 9 | foreign key (c4) references t3, 10 | grouping foreign key (c2) references t2 (c1), 11 | constraint fk_c5 foreign key (c5) references other.t5, 12 | constraint fk_c6 grouping foreign key (c6) references t6) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateIndexNode@68e6ff0d 2 | name: idx1 3 | statementType: CREATE INDEX 4 | unique: false 5 | indexType: null 6 | indexName: idx1 7 | tableName: table1 8 | joinType: null 9 | properties: null 10 | existenceCheck: NO_CONDITION 11 | storageLocation: null 12 | 13 | com.akiban.sql.parser.IndexColumnList@1572e449 14 | 15 | [0]: 16 | com.akiban.sql.parser.IndexColumn@29e97f9f 17 | columnName: c1 18 | tableName: null 19 | ascending -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/delete-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DeleteNode@3c76ced6 2 | statementType: DELETE 3 | resultSet: 4 | com.akiban.sql.parser.SelectNode@1c05629d 5 | isDistinct: false 6 | fromList: 7 | com.akiban.sql.parser.FromList@258d3fca 8 | 9 | [0]: 10 | com.akiban.sql.parser.FromBaseTable@5c56fa08 11 | tableName: t 12 | updateOrDelete: DELETE 13 | null 14 | correlation Name: null 15 | null 16 | targetTableName: 17 | com.akiban.sql.parser.TableName@74 18 | t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-4x.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "&&" "&& "" at line 1, column 38. 2 | Was expecting one of: 3 | 4 | "and" ... 5 | "collate" ... 6 | "except" ... 7 | "fetch" ... 8 | "for" ... 9 | "group" ... 10 | "having" ... 11 | "intersect" ... 12 | "is" ... 13 | "or" ... 14 | "order" ... 15 | "union" ... 16 | "window" ... 17 | "with" ... 18 | "offset" ... 19 | "limit" ... 20 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-4.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateIndexNode@68e6ff0d 2 | name: idx1 3 | statementType: CREATE INDEX 4 | unique: false 5 | indexType: null 6 | indexName: idx1 7 | tableName: table1 8 | joinType: null 9 | properties: null 10 | existenceCheck: IF_NOT_EXISTS 11 | storageLocation: null 12 | 13 | com.akiban.sql.parser.IndexColumnList@1572e449 14 | 15 | [0]: 16 | com.akiban.sql.parser.IndexColumn@29e97f9f 17 | columnName: c1 18 | tableName: null 19 | ascending -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-5.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateIndexNode@68e6ff0d 2 | name: idx1 3 | statementType: CREATE INDEX 4 | unique: false 5 | indexType: null 6 | indexName: idx1 7 | tableName: table1 8 | joinType: null 9 | properties: null 10 | existenceCheck: IF_NOT_EXISTS 11 | storageLocation: null 12 | 13 | com.akiban.sql.parser.IndexColumnList@1572e449 14 | 15 | [0]: 16 | com.akiban.sql.parser.IndexColumn@29e97f9f 17 | columnName: c1 18 | tableName: null 19 | ascending -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-6.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateIndexNode@68e6ff0d 2 | name: idx1 3 | statementType: CREATE INDEX 4 | unique: false 5 | indexType: null 6 | indexName: idx1 7 | tableName: table1 8 | joinType: null 9 | properties: null 10 | existenceCheck: IF_NOT_EXISTS 11 | storageLocation: BTREE 12 | 13 | com.akiban.sql.parser.IndexColumnList@1572e449 14 | 15 | [0]: 16 | com.akiban.sql.parser.IndexColumn@29e97f9f 17 | columnName: c1 18 | tableName: null 19 | ascending -------------------------------------------------------------------------------- /src/etc/header.txt: -------------------------------------------------------------------------------- 1 | Copyright © __YEAR_SECTION__ Akiban Technologies, Inc. All rights 2 | reserved. 3 | 4 | This program and the accompanying materials are made available 5 | under the terms of the Eclipse Public License v1.0 which 6 | accompanies this distribution, and is available at 7 | http://www.eclipse.org/legal/epl-v10.html 8 | 9 | This program may also be available under different license terms. 10 | For more information, see www.akiban.com or contact 11 | licensing@akiban.com. 12 | 13 | Contributors: 14 | Akiban Technologies, Inc. 15 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-1x.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "&" "& "" at line 1, column 10. 2 | Was expecting one of: 3 | 4 | "and" ... 5 | "collate" ... 6 | "except" ... 7 | "fetch" ... 8 | "for" ... 9 | "from" ... 10 | "group" ... 11 | "having" ... 12 | "intersect" ... 13 | "is" ... 14 | "or" ... 15 | "order" ... 16 | "union" ... 17 | "where" ... 18 | "window" ... 19 | "with" ... 20 | "offset" ... 21 | "limit" ... 22 | "," ... 23 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-2x.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "%" "% "" at line 1, column 10. 2 | Was expecting one of: 3 | 4 | "and" ... 5 | "collate" ... 6 | "except" ... 7 | "fetch" ... 8 | "for" ... 9 | "from" ... 10 | "group" ... 11 | "having" ... 12 | "intersect" ... 13 | "is" ... 14 | "or" ... 15 | "order" ... 16 | "union" ... 17 | "where" ... 18 | "window" ... 19 | "with" ... 20 | "offset" ... 21 | "limit" ... 22 | "," ... 23 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-rename-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@4dd849ae 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@32cd666f 16 | 17 | [0]: 18 | com.akiban.sql.parser.AlterTableRenameNode@4b001b77 19 | name: t2 20 | elementType: AT_RENAME -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-rename-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@4dd849ae 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@32cd666f 16 | 17 | [0]: 18 | com.akiban.sql.parser.AlterTableRenameNode@4b001b77 19 | name: t2 20 | elementType: AT_RENAME -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-rename-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@4dd849ae 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@32cd666f 16 | 17 | [0]: 18 | com.akiban.sql.parser.AlterTableRenameNode@4b001b77 19 | name: t2 20 | elementType: AT_RENAME -------------------------------------------------------------------------------- /src/test/java/com/akiban/sql/compiler/CloneTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@267fbe19 2 | name: t 3 | statementType: ALTER TABLE 4 | objectName: t 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@c996f0e 16 | 17 | [0]: 18 | com.akiban.sql.parser.ColumnDefinitionNode@2d4a0698 19 | type: DOUBLE 20 | name: c 21 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-rename-4.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@6d75ae09 2 | name: test.t1 3 | statementType: ALTER TABLE 4 | objectName: test.t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@48f50903 16 | 17 | [0]: 18 | com.akiban.sql.parser.AlterTableRenameNode@4f22c960 19 | name: test.t2 20 | elementType: AT_RENAME -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-5.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@55f66f50 2 | name: t 3 | statementType: ALTER TABLE 4 | objectName: t 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@26061947 16 | 17 | [0]: 18 | com.akiban.sql.parser.ColumnDefinitionNode@5a6597d1 19 | type: INTEGER 20 | name: without_column 21 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-6.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@cd30557 2 | name: t 3 | statementType: ALTER TABLE 4 | objectName: t 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@72039954 16 | 17 | [0]: 18 | com.akiban.sql.parser.ColumnDefinitionNode@4a479446 19 | type: INTEGER 20 | name: with_column 21 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-index-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@3b362ca8 2 | name: netbeans1 3 | statementType: ALTER TABLE 4 | objectName: netbeans1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@61ade7f6 16 | 17 | [0]: 18 | com.akiban.sql.parser.AlterDropIndexNode@6057f993 19 | name: netbeansidx 20 | elementType: AT_DROP_INDEX 21 | 22 | existenceCheck: NO_CONDITION -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-geo-index-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateIndexNode@32e4445e 2 | name: idx1 3 | statementType: CREATE INDEX 4 | unique: false 5 | indexType: null 6 | indexName: idx1 7 | tableName: table1 8 | joinType: null 9 | properties: null 10 | existenceCheck: IF_NOT_EXISTS 11 | storageLocation: null 12 | 13 | com.akiban.sql.parser.IndexColumnList@2844916c 14 | 15 | methodName: Z_ORDER_LAT_LON 16 | firstArg: 0 17 | lastArg: 1 18 | [0]: 19 | com.akiban.sql.parser.IndexColumn@2da75e1b 20 | columnName: c1 21 | tableName: null 22 | ascending 23 | [1]: 24 | com.akiban.sql.parser.IndexColumn@47135607 25 | columnName: c2 26 | tableName: null 27 | ascending -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/StorageLocation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql.parser; 19 | 20 | public enum StorageLocation { IN_MEMORY, BTREE }; 21 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-5.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@1327b0d2 2 | name: t3 3 | statementType: ALTER TABLE 4 | objectName: t3 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@12c9b4d1 16 | 17 | [0]: 18 | com.akiban.sql.parser.ConstraintDefinitionNode@787e0ef9 19 | constraintName: chk 20 | constraintType: DROP 21 | verifyType: CHECK 22 | properties: null 23 | name: chk 24 | elementType: AT_DROP_CONSTRAINT 25 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-6.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@1327b0d2 2 | name: t3 3 | statementType: ALTER TABLE 4 | objectName: t3 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@12c9b4d1 16 | 17 | [0]: 18 | com.akiban.sql.parser.ConstraintDefinitionNode@787e0ef9 19 | constraintName: con 20 | constraintType: DROP 21 | verifyType: DROP 22 | properties: null 23 | name: con 24 | elementType: AT_DROP_CONSTRAINT 25 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-4.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@1327b0d2 2 | name: t3 3 | statementType: ALTER TABLE 4 | objectName: t3 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@12c9b4d1 16 | 17 | [0]: 18 | com.akiban.sql.parser.ConstraintDefinitionNode@787e0ef9 19 | constraintName: ukey 20 | constraintType: DROP 21 | verifyType: UNIQUE 22 | properties: null 23 | name: ukey 24 | elementType: AT_DROP_CONSTRAINT 25 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@1327b0d2 2 | name: t3 3 | statementType: ALTER TABLE 4 | objectName: t3 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@12c9b4d1 16 | 17 | [0]: 18 | com.akiban.sql.parser.ConstraintDefinitionNode@787e0ef9 19 | constraintName: null 20 | constraintType: DROP 21 | verifyType: PRIMARY_KEY 22 | properties: null 23 | name: null 24 | elementType: AT_DROP_CONSTRAINT 25 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-column-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@7fe3f2e5 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@4e5fd9fb 16 | 17 | [0]: 18 | com.akiban.sql.parser.ColumnDefinitionNode@76e015ef 19 | type: DOUBLE 20 | name: c 21 | elementType: null 22 | [1]: 23 | com.akiban.sql.parser.ColumnDefinitionNode@7a5ad0f0 24 | type: BIGINT 25 | name: d 26 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateIndexNode@5289cf1e 2 | name: idx2 3 | statementType: CREATE INDEX 4 | unique: true 5 | indexType: null 6 | indexName: idx2 7 | tableName: table2 8 | joinType: null 9 | properties: null 10 | existenceCheck: NO_CONDITION 11 | storageLocation: null 12 | 13 | com.akiban.sql.parser.IndexColumnList@557ce4e7 14 | 15 | [0]: 16 | com.akiban.sql.parser.IndexColumn@7a982589 17 | columnName: c1 18 | tableName: null 19 | ascending 20 | [1]: 21 | com.akiban.sql.parser.IndexColumn@1ac88440 22 | columnName: c2 23 | tableName: null 24 | descending 25 | [2]: 26 | com.akiban.sql.parser.IndexColumn@6262937c 27 | columnName: c3 28 | tableName: null 29 | ascending -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/junk-1.error: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.SQLParserException: Encountered " "total "" at line 1, column 1. 2 | Was expecting one of: 3 | "alter" ... 4 | "begin" ... 5 | "close" ... 6 | "commit" ... 7 | "create" ... 8 | "deallocate" ... 9 | "declare" ... 10 | "delete" ... 11 | "drop" ... 12 | "execute" ... 13 | "fetch" ... 14 | "insert" ... 15 | "prepare" ... 16 | "rollback" ... 17 | "select" ... 18 | "update" ... 19 | "values" ... 20 | "truncate" ... 21 | "call" ... 22 | "explain" ... 23 | "copy" ... 24 | "lock" ... 25 | "rename" ... 26 | "{" ... 27 | "(" ... 28 | "?" ... 29 | ... 30 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-index-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@67d374be 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@6b959b32 16 | 17 | [0]: 18 | com.akiban.sql.parser.AlterAddIndexNode@2b0026cc 19 | name: idx2 20 | elementType: AT_ADD_INDEX 21 | 22 | existenceCheck: NO_CONDITION 23 | unique: true 24 | indexColumnList: 25 | joinType: null 26 | properties: null 27 | location: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateIndexNode@26fd68b1 2 | name: g1 3 | statementType: CREATE INDEX 4 | unique: false 5 | indexType: null 6 | indexName: g1 7 | tableName: group_table 8 | joinType: LEFT_OUTER 9 | properties: null 10 | existenceCheck: NO_CONDITION 11 | storageLocation: null 12 | 13 | com.akiban.sql.parser.IndexColumnList@46e45076 14 | 15 | [0]: 16 | com.akiban.sql.parser.IndexColumn@375e9756 17 | columnName: c1 18 | tableName: schema1.t1 19 | ascending 20 | [1]: 21 | com.akiban.sql.parser.IndexColumn@2321ab80 22 | columnName: c2 23 | tableName: t2 24 | ascending 25 | [2]: 26 | com.akiban.sql.parser.IndexColumn@77827284 27 | columnName: c3 28 | tableName: null 29 | ascending -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-index-7.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateIndexNode@26fd68b1 2 | name: g1 3 | statementType: CREATE INDEX 4 | unique: false 5 | indexType: null 6 | indexName: g1 7 | tableName: group_table 8 | joinType: LEFT_OUTER 9 | properties: null 10 | existenceCheck: NO_CONDITION 11 | storageLocation: IN_MEMORY 12 | 13 | com.akiban.sql.parser.IndexColumnList@46e45076 14 | 15 | [0]: 16 | com.akiban.sql.parser.IndexColumn@375e9756 17 | columnName: c1 18 | tableName: schema1.t1 19 | ascending 20 | [1]: 21 | com.akiban.sql.parser.IndexColumn@2321ab80 22 | columnName: c2 23 | tableName: t2 24 | ascending 25 | [2]: 26 | com.akiban.sql.parser.IndexColumn@77827284 27 | columnName: c3 28 | tableName: null 29 | ascending -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-drop-1a.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@1a1c1f5 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@22c4bca9 16 | 17 | [0]: 18 | com.akiban.sql.parser.FKConstraintDefinitionNode@223e0d14 19 | refTable name : null 20 | grouping: true 21 | constraintName: null 22 | constraintType: DROP 23 | verifyType: FOREIGN_KEY 24 | properties: null 25 | name: null 26 | elementType: AT_DROP_CONSTRAINT 27 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-drop-1b.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@1a1c1f5 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@22c4bca9 16 | 17 | [0]: 18 | com.akiban.sql.parser.FKConstraintDefinitionNode@223e0d14 19 | refTable name : null 20 | grouping: true 21 | constraintName: null 22 | constraintType: DROP 23 | verifyType: FOREIGN_KEY 24 | properties: null 25 | name: null 26 | elementType: AT_DROP_CONSTRAINT 27 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@1327b0d2 2 | name: t3 3 | statementType: ALTER TABLE 4 | objectName: t3 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@12c9b4d1 16 | 17 | [0]: 18 | com.akiban.sql.parser.FKConstraintDefinitionNode@787e0ef9 19 | refTable name : null 20 | grouping: false 21 | constraintName: gfk1 22 | constraintType: DROP 23 | verifyType: FOREIGN_KEY 24 | properties: null 25 | name: gfk1 26 | elementType: AT_DROP_CONSTRAINT 27 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-drop-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@1327b0d2 2 | name: t3 3 | statementType: ALTER TABLE 4 | objectName: t3 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@12c9b4d1 16 | 17 | [0]: 18 | com.akiban.sql.parser.FKConstraintDefinitionNode@787e0ef9 19 | refTable name : null 20 | grouping: true 21 | constraintName: null 22 | constraintType: DROP 23 | verifyType: FOREIGN_KEY 24 | properties: null 25 | name: null 26 | elementType: AT_DROP_CONSTRAINT 27 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/delete-returning-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DeleteNode@2d8941f7 2 | statementType: DELETE 3 | resultSet: 4 | com.akiban.sql.parser.SelectNode@e49d67c 5 | isDistinct: false 6 | fromList: 7 | com.akiban.sql.parser.FromList@11a06e38 8 | 9 | [0]: 10 | com.akiban.sql.parser.FromBaseTable@3ba42792 11 | tableName: t1 12 | updateOrDelete: DELETE 13 | null 14 | correlation Name: null 15 | null 16 | targetTableName: 17 | com.akiban.sql.parser.TableName@e3d 18 | t1 19 | returningList: 20 | com.akiban.sql.parser.ResultColumnList@162200d5 21 | 22 | [0]: 23 | com.akiban.sql.parser.AllResultColumn@1264ab4d 24 | tableName: null 25 | exposedName: null 26 | name: null 27 | tableName: null 28 | isDefaultColumn: false 29 | type: null -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/IndexHintList.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql.parser; 19 | 20 | /** 21 | * MySQL's index hints. 22 | */ 23 | public class IndexHintList extends QueryTreeNodeList 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@199836ed 2 | name: t2 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | queryExpression: 7 | com.akiban.sql.parser.SelectNode@583e0ebb 8 | isDistinct: false 9 | resultColumns: 10 | com.akiban.sql.parser.ResultColumnList@5239443f 11 | 12 | [0]: 13 | com.akiban.sql.parser.AllResultColumn@2dafae45 14 | tableName: null 15 | exposedName: null 16 | name: null 17 | tableName: null 18 | isDefaultColumn: false 19 | type: null 20 | fromList: 21 | com.akiban.sql.parser.FromList@68da4b71 22 | 23 | [0]: 24 | com.akiban.sql.parser.FromBaseTable@538f1d7e 25 | tableName: t1 26 | updateOrDelete: null 27 | null 28 | correlation Name: null 29 | null 30 | -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/IncomparableException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql; 19 | 20 | public class IncomparableException extends StandardException 21 | { 22 | public IncomparableException(String msg) 23 | { 24 | super(msg); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-add-geo-index-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@15fd309 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@3a17f493 16 | 17 | [0]: 18 | com.akiban.sql.parser.AlterAddIndexNode@7ab9fcb0 19 | name: idx2 20 | elementType: AT_ADD_INDEX 21 | 22 | existenceCheck: NO_CONDITION 23 | unique: true 24 | indexColumnList: 25 | methodName: Z_ORDER_LAT_LON 26 | firstArg: 0 27 | lastArg: 1 28 | 29 | joinType: null 30 | properties: null 31 | location: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-add-index-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@62892cc5 2 | name: t1 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@1bda6c0d 8 | 9 | [0]: 10 | com.akiban.sql.parser.ColumnDefinitionNode@20ebd7c4 11 | type: INTEGER 12 | name: c1 13 | elementType: null 14 | [1]: 15 | com.akiban.sql.parser.ColumnDefinitionNode@5ba295be 16 | type: DOUBLE 17 | name: c2 18 | elementType: null 19 | [2]: 20 | com.akiban.sql.parser.IndexConstraintDefinitionNode@f151bf2 21 | constraintName: null 22 | constraintType: INDEX 23 | properties: null 24 | name: null 25 | elementType: AT_DROP_CONSTRAINT 26 | 27 | indexName: indx1 28 | indexColumnList: 29 | joinType: null 30 | location: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-add-index-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@6f86e8cb 2 | name: t1 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@21da0a1 8 | 9 | [0]: 10 | com.akiban.sql.parser.ColumnDefinitionNode@671cab1c 11 | type: INTEGER 12 | name: c1 13 | elementType: null 14 | [1]: 15 | com.akiban.sql.parser.ColumnDefinitionNode@b25f027 16 | type: DOUBLE 17 | name: c2 18 | elementType: null 19 | [2]: 20 | com.akiban.sql.parser.IndexConstraintDefinitionNode@67b99628 21 | constraintName: null 22 | constraintType: INDEX 23 | properties: null 24 | name: null 25 | elementType: AT_DROP_CONSTRAINT 26 | 27 | indexName: indx1 28 | indexColumnList: 29 | joinType: null 30 | location: BTREE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/delete-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DeleteNode@29b6c909 2 | statementType: DELETE 3 | resultSet: 4 | com.akiban.sql.parser.SelectNode@1f488344 5 | isDistinct: false 6 | fromList: 7 | com.akiban.sql.parser.FromList@51a1f567 8 | 9 | [0]: 10 | com.akiban.sql.parser.FromBaseTable@5ff6670f 11 | tableName: t 12 | updateOrDelete: DELETE 13 | null 14 | correlation Name: null 15 | null 16 | whereClause: 17 | com.akiban.sql.parser.InListOperatorNode@29e83b01 18 | operator: IN 19 | methodName: in 20 | type: null 21 | leftOperand: 22 | com.akiban.sql.parser.RowConstructorNode@4d79d425 23 | depth: 0 24 | rightOperandList: 25 | com.akiban.sql.parser.RowConstructorNode@7956f0df 26 | depth: 1 27 | targetTableName: 28 | com.akiban.sql.parser.TableName@74 29 | t -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@35c0e45a 2 | name: t1 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@acfec48 8 | 9 | [0]: 10 | com.akiban.sql.parser.ConstraintDefinitionNode@58a17083 11 | constraintName: null 12 | constraintType: PRIMARY_KEY 13 | properties: null 14 | name: null 15 | elementType: AT_DROP_CONSTRAINT 16 | columnList: 17 | com.akiban.sql.parser.ResultColumnList@4ca31e1b 18 | 19 | [0]: 20 | com.akiban.sql.parser.ResultColumn@690da5eb 21 | exposedName: col1 22 | name: col1 23 | tableName: null 24 | isDefaultColumn: false 25 | type: null 26 | [1]: 27 | com.akiban.sql.parser.ColumnDefinitionNode@7f081d2e 28 | type: INTEGER 29 | name: col1 30 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-9.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@35c0e45a 2 | name: t1 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: IF_NOT_EXISTS 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@acfec48 8 | 9 | [0]: 10 | com.akiban.sql.parser.ConstraintDefinitionNode@58a17083 11 | constraintName: null 12 | constraintType: PRIMARY_KEY 13 | properties: null 14 | name: null 15 | elementType: AT_DROP_CONSTRAINT 16 | columnList: 17 | com.akiban.sql.parser.ResultColumnList@4ca31e1b 18 | 19 | [0]: 20 | com.akiban.sql.parser.ResultColumn@690da5eb 21 | exposedName: col1 22 | name: col1 23 | tableName: null 24 | isDefaultColumn: false 25 | type: null 26 | [1]: 27 | com.akiban.sql.parser.ColumnDefinitionNode@7f081d2e 28 | type: INTEGER 29 | name: col1 30 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-5.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@7f5663a2 2 | name: test.t1 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@a761fe 8 | 9 | [0]: 10 | com.akiban.sql.parser.ColumnDefinitionNode@6d126b07 11 | type: INTEGER NOT NULL 12 | name: col1 13 | elementType: null 14 | [1]: 15 | com.akiban.sql.parser.ConstraintDefinitionNode@5430d082 16 | constraintName: null 17 | constraintType: PRIMARY_KEY 18 | properties: null 19 | name: null 20 | elementType: AT_DROP_CONSTRAINT 21 | columnList: 22 | com.akiban.sql.parser.ResultColumnList@50c931fc 23 | 24 | [0]: 25 | com.akiban.sql.parser.ResultColumn@48f0c0d3 26 | exposedName: col1 27 | name: col1 28 | tableName: null 29 | isDefaultColumn: false 30 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-sequence-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@47315d34 2 | name: t7 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@79de256f 8 | 9 | [0]: 10 | com.akiban.sql.parser.ConstraintDefinitionNode@676bd8ea 11 | constraintName: null 12 | constraintType: PRIMARY_KEY 13 | properties: null 14 | name: null 15 | elementType: AT_DROP_CONSTRAINT 16 | columnList: 17 | com.akiban.sql.parser.ResultColumnList@596e1fb1 18 | 19 | [0]: 20 | com.akiban.sql.parser.ResultColumn@4ce2cb55 21 | exposedName: c1 22 | name: c1 23 | tableName: null 24 | isDefaultColumn: false 25 | type: null 26 | [1]: 27 | com.akiban.sql.parser.ColumnDefinitionNode@3d9360e2 28 | type: INTEGER NOT NULL 29 | name: c1 30 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-sequence-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@52c05d3b 2 | name: t7 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@5328f6ee 8 | 9 | [0]: 10 | com.akiban.sql.parser.ConstraintDefinitionNode@266bade9 11 | constraintName: null 12 | constraintType: PRIMARY_KEY 13 | properties: null 14 | name: null 15 | elementType: AT_DROP_CONSTRAINT 16 | columnList: 17 | com.akiban.sql.parser.ResultColumnList@6766afb3 18 | 19 | [0]: 20 | com.akiban.sql.parser.ResultColumn@69945ce 21 | exposedName: c1 22 | name: c1 23 | tableName: null 24 | isDefaultColumn: false 25 | type: null 26 | [1]: 27 | com.akiban.sql.parser.ColumnDefinitionNode@38b5dac4 28 | type: INTEGER NOT NULL 29 | name: c1 30 | elementType: null -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/ExistenceCheck.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql.parser; 19 | 20 | public enum ExistenceCheck 21 | { 22 | NO_CONDITION, // [if [not] exists] statement is not specified 23 | IF_EXISTS, // [if exists] is specified 24 | IF_NOT_EXISTS // [if not exists] is specified 25 | } 26 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@2c006765 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@4e842e74 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@4805e9f1 10 | 11 | [0]: 12 | com.akiban.sql.parser.AllResultColumn@7c41f227 13 | tableName: null 14 | exposedName: null 15 | name: null 16 | tableName: null 17 | isDefaultColumn: false 18 | type: null 19 | fromList: 20 | com.akiban.sql.parser.FromList@4d811e2c 21 | 22 | [0]: 23 | com.akiban.sql.parser.FromBaseTable@57e40274 24 | tableName: t1 25 | updateOrDelete: null 26 | null 27 | correlation Name: null 28 | null 29 | fetchFirst: 30 | com.akiban.sql.parser.NumericConstantNode@3a5d3ac0 31 | value: 10 32 | type: INTEGER NOT NULL -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@2c006765 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@4e842e74 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@4805e9f1 10 | 11 | [0]: 12 | com.akiban.sql.parser.AllResultColumn@7c41f227 13 | tableName: null 14 | exposedName: null 15 | name: null 16 | tableName: null 17 | isDefaultColumn: false 18 | type: null 19 | fromList: 20 | com.akiban.sql.parser.FromList@4d811e2c 21 | 22 | [0]: 23 | com.akiban.sql.parser.FromBaseTable@57e40274 24 | tableName: t1 25 | updateOrDelete: null 26 | null 27 | correlation Name: null 28 | null 29 | fetchFirst: 30 | com.akiban.sql.parser.NumericConstantNode@3a5d3ac0 31 | value: 10 32 | type: INTEGER NOT NULL -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/declare-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DeclareStatementNode@5de9ac4 2 | name: pc 3 | statementType: DECLARE 4 | statement: 5 | com.akiban.sql.parser.CursorNode@5982bcde 6 | name: null 7 | updateMode: UNSPECIFIED 8 | statementType: SELECT 9 | resultSet: 10 | com.akiban.sql.parser.SelectNode@163dc0bb 11 | isDistinct: false 12 | resultColumns: 13 | com.akiban.sql.parser.ResultColumnList@30384065 14 | 15 | [0]: 16 | com.akiban.sql.parser.AllResultColumn@3d0bbf9e 17 | tableName: null 18 | exposedName: null 19 | name: null 20 | tableName: null 21 | isDefaultColumn: false 22 | type: null 23 | fromList: 24 | com.akiban.sql.parser.FromList@4e513d61 25 | 26 | [0]: 27 | com.akiban.sql.parser.FromBaseTable@3794d372 28 | tableName: t1 29 | updateOrDelete: null 30 | null 31 | correlation Name: null 32 | null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-3u.expected: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1(col1 INTEGER UNSIGNED NOT NULL, col2 INTEGER UNSIGNED, col3 SMALLINT UNSIGNED NOT NULL, col4 SMALLINT UNSIGNED, col5 BIGINT UNSIGNED NOT NULL, col6 BIGINT UNSIGNED, col20 DOUBLE UNSIGNED NOT NULL, col21 DOUBLE UNSIGNED, col22 REAL UNSIGNED NOT NULL, col23 REAL UNSIGNED, col24 DOUBLE UNSIGNED NOT NULL, col25 DOUBLE UNSIGNED, col50 DECIMAL(5,0) UNSIGNED NOT NULL, col51 DECIMAL(5,0) UNSIGNED, col52 DECIMAL(1,0) UNSIGNED NOT NULL, col53 DECIMAL(1,0) UNSIGNED, col54 DECIMAL(10,0) UNSIGNED NOT NULL, col55 DECIMAL(10,0) UNSIGNED, col56 DECIMAL(1,1) UNSIGNED NOT NULL, col57 DECIMAL(1,1) UNSIGNED, col58 DECIMAL(10,1) UNSIGNED NOT NULL, col59 DECIMAL(10,1) UNSIGNED, col60 DECIMAL(10,10) UNSIGNED NOT NULL, col61 DECIMAL(10,10) UNSIGNED, col62 DECIMAL(30,10) UNSIGNED NOT NULL, col63 DECIMAL(30,10) UNSIGNED, col70 NUMERIC UNSIGNED NOT NULL, col71 NUMERIC UNSIGNED) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/find-depth-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@4c63c68 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@72a7d24a 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@67df3314 10 | 11 | [0]: 12 | com.akiban.sql.parser.ResultColumn@6e929b52 13 | exposedName: null 14 | name: null 15 | tableName: null 16 | isDefaultColumn: false 17 | type: null 18 | expression: 19 | com.akiban.sql.parser.InListOperatorNode@5b135d34 20 | operator: IN 21 | methodName: in 22 | type: null 23 | leftOperand: 24 | com.akiban.sql.parser.RowConstructorNode@544c2fa2 25 | depth: 4 26 | rightOperandList: 27 | com.akiban.sql.parser.RowConstructorNode@55cb5fea 28 | depth: 5 29 | fromList: 30 | com.akiban.sql.parser.FromList@1b0627a7 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/find-depth-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@bf3fd22 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@3f6fc94f 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@44098212 10 | 11 | [0]: 12 | com.akiban.sql.parser.ResultColumn@4c3a8ea3 13 | exposedName: null 14 | name: null 15 | tableName: null 16 | isDefaultColumn: false 17 | type: null 18 | expression: 19 | com.akiban.sql.parser.InListOperatorNode@186a966e 20 | operator: IN 21 | methodName: in 22 | type: null 23 | leftOperand: 24 | com.akiban.sql.parser.RowConstructorNode@7dba1c47 25 | depth: 0 26 | rightOperandList: 27 | com.akiban.sql.parser.RowConstructorNode@4596b9cd 28 | depth: 1 29 | fromList: 30 | com.akiban.sql.parser.FromList@2a80656c -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/find-depth-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@6b4bd192 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@3eabff46 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@e046ccf 10 | 11 | [0]: 12 | com.akiban.sql.parser.ResultColumn@44839139 13 | exposedName: null 14 | name: null 15 | tableName: null 16 | isDefaultColumn: false 17 | type: null 18 | expression: 19 | com.akiban.sql.parser.InListOperatorNode@19b35853 20 | operator: IN 21 | methodName: in 22 | type: null 23 | leftOperand: 24 | com.akiban.sql.parser.RowConstructorNode@4d6bbe53 25 | depth: 2 26 | rightOperandList: 27 | com.akiban.sql.parser.RowConstructorNode@5c9c62da 28 | depth: 3 29 | fromList: 30 | com.akiban.sql.parser.FromList@1f1e05b6 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-constraint-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@5289cf1e 2 | name: t2 3 | statementType: ALTER TABLE 4 | objectName: t2 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@557ce4e7 16 | 17 | [0]: 18 | com.akiban.sql.parser.ConstraintDefinitionNode@7a982589 19 | constraintName: p 20 | constraintType: PRIMARY_KEY 21 | properties: null 22 | name: p 23 | elementType: AT_DROP_CONSTRAINT 24 | columnList: 25 | com.akiban.sql.parser.ResultColumnList@1ac88440 26 | 27 | [0]: 28 | com.akiban.sql.parser.ResultColumn@6262937c 29 | exposedName: c3 30 | name: c3 31 | tableName: null 32 | isDefaultColumn: false 33 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-8.sql: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE c NOT IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/compiler/normalize/select-8.expected: -------------------------------------------------------------------------------- 1 | SELECT * FROM t WHERE (c NOT IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200)) AND TRUE -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CopyStatementNode@44c9d92c 2 | mode: FROM_TABLE 3 | tableName: t2 4 | filename: /tmp/t2.csv 5 | format: null 6 | delimiter: null 7 | nullString: null 8 | quote: null 9 | escape: null 10 | encoding: null 11 | commitFrequency: 0 12 | statementType: COPY 13 | columnList: 14 | com.akiban.sql.parser.ResultColumnList@1fd0fafc 15 | 16 | [0]: 17 | com.akiban.sql.parser.ResultColumn@510dc6b5 18 | exposedName: c1 19 | name: c1 20 | tableName: null 21 | isDefaultColumn: false 22 | type: null 23 | reference: 24 | com.akiban.sql.parser.ColumnReference@5f70bea5 25 | columnName: c1 26 | tableName: null 27 | type: null 28 | [1]: 29 | com.akiban.sql.parser.ResultColumn@62f47396 30 | exposedName: c2 31 | name: c2 32 | tableName: null 33 | isDefaultColumn: false 34 | type: null 35 | reference: 36 | com.akiban.sql.parser.ColumnReference@1ed0af9b 37 | columnName: c2 38 | tableName: null 39 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@47d978ea 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@16916f80 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@262f4813 10 | 11 | [0]: 12 | com.akiban.sql.parser.AllResultColumn@6a24eafa 13 | tableName: null 14 | exposedName: null 15 | name: null 16 | tableName: null 17 | isDefaultColumn: false 18 | type: null 19 | fromList: 20 | com.akiban.sql.parser.FromList@1dbef987 21 | 22 | [0]: 23 | com.akiban.sql.parser.FromBaseTable@64f01d52 24 | tableName: t1 25 | updateOrDelete: null 26 | null 27 | correlation Name: null 28 | null 29 | offset: 30 | com.akiban.sql.parser.NumericConstantNode@50152643 31 | value: 1 32 | type: INTEGER NOT NULL 33 | fetchFirst: 34 | com.akiban.sql.parser.NumericConstantNode@1c8321c8 35 | value: 2 36 | type: INTEGER NOT NULL -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-4.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@47d978ea 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@16916f80 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@262f4813 10 | 11 | [0]: 12 | com.akiban.sql.parser.AllResultColumn@6a24eafa 13 | tableName: null 14 | exposedName: null 15 | name: null 16 | tableName: null 17 | isDefaultColumn: false 18 | type: null 19 | fromList: 20 | com.akiban.sql.parser.FromList@1dbef987 21 | 22 | [0]: 23 | com.akiban.sql.parser.FromBaseTable@64f01d52 24 | tableName: t1 25 | updateOrDelete: null 26 | null 27 | correlation Name: null 28 | null 29 | offset: 30 | com.akiban.sql.parser.NumericConstantNode@50152643 31 | value: 1 32 | type: INTEGER NOT NULL 33 | fetchFirst: 34 | com.akiban.sql.parser.NumericConstantNode@1c8321c8 35 | value: 2 36 | type: INTEGER NOT NULL -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-limit-5.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@47d978ea 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@16916f80 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@262f4813 10 | 11 | [0]: 12 | com.akiban.sql.parser.AllResultColumn@6a24eafa 13 | tableName: null 14 | exposedName: null 15 | name: null 16 | tableName: null 17 | isDefaultColumn: false 18 | type: null 19 | fromList: 20 | com.akiban.sql.parser.FromList@1dbef987 21 | 22 | [0]: 23 | com.akiban.sql.parser.FromBaseTable@64f01d52 24 | tableName: t1 25 | updateOrDelete: null 26 | null 27 | correlation Name: null 28 | null 29 | offset: 30 | com.akiban.sql.parser.NumericConstantNode@50152643 31 | value: 1 32 | type: INTEGER NOT NULL 33 | fetchFirst: 34 | com.akiban.sql.parser.NumericConstantNode@1c8321c8 35 | value: 2 36 | type: INTEGER NOT NULL -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-7.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@36b8bef7 2 | name: t7 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@1b016632 8 | 9 | [0]: 10 | com.akiban.sql.parser.ConstraintDefinitionNode@78dc6a77 11 | constraintName: null 12 | constraintType: PRIMARY_KEY 13 | properties: null 14 | name: null 15 | elementType: AT_DROP_CONSTRAINT 16 | columnList: 17 | com.akiban.sql.parser.ResultColumnList@4ed1e89e 18 | 19 | [0]: 20 | com.akiban.sql.parser.ResultColumn@36ff057f 21 | exposedName: c1 22 | name: c1 23 | tableName: null 24 | isDefaultColumn: false 25 | type: null 26 | [1]: 27 | com.akiban.sql.parser.ColumnDefinitionNode@20c1f10e 28 | type: INTEGER NOT NULL 29 | name: c1 30 | elementType: null 31 | default: 32 | com.akiban.sql.parser.DefaultNode@1cb8deef 33 | columnName: null 34 | defaultText: null 35 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-sequence-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@1f4384c2 2 | name: t7 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@9c0ec97 8 | 9 | [0]: 10 | com.akiban.sql.parser.ConstraintDefinitionNode@58ecb281 11 | constraintName: null 12 | constraintType: PRIMARY_KEY 13 | properties: null 14 | name: null 15 | elementType: AT_DROP_CONSTRAINT 16 | columnList: 17 | com.akiban.sql.parser.ResultColumnList@1bbb60c3 18 | 19 | [0]: 20 | com.akiban.sql.parser.ResultColumn@2acdb06e 21 | exposedName: c1 22 | name: c1 23 | tableName: null 24 | isDefaultColumn: false 25 | type: null 26 | [1]: 27 | com.akiban.sql.parser.ColumnDefinitionNode@25fa1bb6 28 | type: INTEGER NOT NULL 29 | name: c1 30 | elementType: null 31 | default: 32 | com.akiban.sql.parser.DefaultNode@47315d34 33 | columnName: null 34 | defaultText: null 35 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-3.expected: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1(col1 INTEGER NOT NULL, col2 INTEGER, col3 SMALLINT NOT NULL, col4 SMALLINT, col5 BIGINT NOT NULL, col6 BIGINT, col10 CHAR(1) NOT NULL, col11 CHAR(1), col12 VARCHAR(1) NOT NULL, col13 VARCHAR(1), col14 LONG VARCHAR NOT NULL, col15 LONG VARCHAR, col20 DOUBLE NOT NULL, col21 DOUBLE, col22 REAL NOT NULL, col23 REAL, col24 DOUBLE NOT NULL, col25 DOUBLE, col30 DATE NOT NULL, col31 DATE, col32 TIME NOT NULL, col33 TIME, col34 TIMESTAMP NOT NULL, col35 TIMESTAMP, col40 CLOB(2147483647) NOT NULL, col41 CLOB(2147483647), col42 BLOB(2147483647) NOT NULL, col43 BLOB(2147483647), col50 DECIMAL(5,0) NOT NULL, col51 DECIMAL(5,0), col52 DECIMAL(1,0) NOT NULL, col53 DECIMAL(1,0), col54 DECIMAL(10,0) NOT NULL, col55 DECIMAL(10,0), col56 DECIMAL(1,1) NOT NULL, col57 DECIMAL(1,1), col58 DECIMAL(10,1) NOT NULL, col59 DECIMAL(10,1), col60 DECIMAL(10,10) NOT NULL, col61 DECIMAL(10,10), col62 DECIMAL(30,10) NOT NULL, col63 DECIMAL(30,10), col70 NUMERIC NOT NULL, col71 NUMERIC) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/update-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.UpdateNode@716925b0 2 | statementType: UPDATE 3 | resultSet: 4 | com.akiban.sql.parser.SelectNode@2e297ffb 5 | isDistinct: false 6 | resultColumns: 7 | com.akiban.sql.parser.ResultColumnList@26914f6a 8 | 9 | [0]: 10 | com.akiban.sql.parser.ResultColumn@df4cbee 11 | exposedName: name 12 | name: name 13 | tableName: null 14 | isDefaultColumn: false 15 | type: null 16 | expression: 17 | com.akiban.sql.parser.CharConstantNode@42787d6a 18 | value: new 19 | type: CHAR(3) NOT NULL 20 | reference: 21 | com.akiban.sql.parser.ColumnReference@7471dc3d 22 | columnName: name 23 | tableName: null 24 | type: null 25 | fromList: 26 | com.akiban.sql.parser.FromList@5f326484 27 | 28 | [0]: 29 | com.akiban.sql.parser.CurrentOfNode@656546ef 30 | preparedStatement: customer 31 | correlation Name: null 32 | null 33 | cursor: targetTableName: 34 | com.akiban.sql.parser.TableName@600e7c55 35 | customers -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-add-geo-index-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@1b609803 2 | name: t1 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@629bfaff 8 | 9 | [0]: 10 | com.akiban.sql.parser.ColumnDefinitionNode@6e7badec 11 | type: INTEGER 12 | name: c1 13 | elementType: null 14 | [1]: 15 | com.akiban.sql.parser.ColumnDefinitionNode@79d7999e 16 | type: DOUBLE 17 | name: c2 18 | elementType: null 19 | [2]: 20 | com.akiban.sql.parser.ColumnDefinitionNode@39a69290 21 | type: BIGINT 22 | name: c3 23 | elementType: null 24 | [3]: 25 | com.akiban.sql.parser.IndexConstraintDefinitionNode@66e04981 26 | constraintName: null 27 | constraintType: INDEX 28 | properties: null 29 | name: null 30 | elementType: AT_DROP_CONSTRAINT 31 | 32 | indexName: indx1 33 | indexColumnList: 34 | methodName: Z_ORDER_LAT_LON 35 | firstArg: 0 36 | lastArg: 1 37 | 38 | joinType: null 39 | location: null -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/AccessMode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | /** 19 | * Transaction access modes. 20 | * 21 | */ 22 | 23 | package com.akiban.sql.parser; 24 | 25 | public enum AccessMode { 26 | READ_ONLY_ACCESS_MODE("READ ONLY"), 27 | READ_WRITE_ACCESS_MODE("READ WRITE"); 28 | 29 | private String syntax; 30 | AccessMode(String syntax) { 31 | this.syntax = syntax; 32 | } 33 | 34 | public String getSyntax() { 35 | return syntax; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-3u.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1 ( 2 | col1 INTEGER UNSIGNED NOT NULL, 3 | col2 INTEGER UNSIGNED, 4 | col3 smallint UNSIGNED NOT NULL, 5 | col4 smallint UNSIGNED, 6 | col5 bigint UNSIGNED NOT NULL, 7 | col6 bigint UNSIGNED, 8 | 9 | col20 FLOAT UNSIGNED NOT NULL, 10 | col21 FLOAT UNSIGNED, 11 | col22 REAL UNSIGNED NOT NULL, 12 | col23 REAL UNSIGNED, 13 | col24 DOUBLE UNSIGNED NOT NULL, 14 | col25 DOUBLE UNSIGNED, 15 | 16 | col50 DECIMAL UNSIGNED NOT NULL, 17 | col51 DECIMAL UNSIGNED, 18 | col52 DECIMAL (1) UNSIGNED NOT NULL, 19 | col53 DECIMAL (1) UNSIGNED, 20 | col54 DECIMAL (10) UNSIGNED NOT NULL, 21 | col55 DECIMAL (10) UNSIGNED, 22 | col56 DECIMAL (1,1) UNSIGNED NOT NULL, 23 | col57 DECIMAL (1,1) UNSIGNED, 24 | col58 DECIMAL (10,1) UNSIGNED NOT NULL, 25 | col59 DECIMAL (10,1) UNSIGNED, 26 | col60 DECIMAL (10,10) UNSIGNED NOT NULL, 27 | col61 DECIMAL (10,10) UNSIGNED, 28 | col62 DECIMAL (30,10) UNSIGNED NOT NULL, 29 | col63 DECIMAL (30,10) UNSIGNED, 30 | 31 | col70 NUMERIC UNSIGNED NOT NULL, 32 | col71 NUMERIC UNSIGNED 33 | ) -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/SQLParserException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql.parser; 19 | 20 | import com.akiban.sql.StandardException; 21 | 22 | public class SQLParserException extends StandardException 23 | { 24 | private int errorPosition; 25 | 26 | public SQLParserException(String msg, Throwable cause, int errorPosition) { 27 | super(msg, cause); 28 | this.errorPosition = errorPosition; 29 | } 30 | 31 | public int getErrorPosition() { 32 | return errorPosition; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/akiban/sql/RegexFilenameFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql; 19 | 20 | import java.io.File; 21 | import java.io.FilenameFilter; 22 | import java.util.regex.Pattern; 23 | 24 | public class RegexFilenameFilter implements FilenameFilter 25 | { 26 | Pattern pattern; 27 | 28 | public RegexFilenameFilter(String regex) { 29 | this.pattern = Pattern.compile(regex); 30 | } 31 | 32 | @Override 33 | public boolean accept(File dir, String name) { 34 | return pattern.matcher(name).matches(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-constraint-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@4bdb699b 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@31f26605 16 | 17 | [0]: 18 | com.akiban.sql.parser.ConstraintDefinitionNode@2107ebe1 19 | constraintName: ux1 20 | constraintType: UNIQUE 21 | properties: null 22 | name: ux1 23 | elementType: AT_DROP_CONSTRAINT 24 | columnList: 25 | com.akiban.sql.parser.ResultColumnList@26544ec1 26 | 27 | [0]: 28 | com.akiban.sql.parser.ResultColumn@68fe748f 29 | exposedName: c1 30 | name: c1 31 | tableName: null 32 | isDefaultColumn: false 33 | type: null 34 | [1]: 35 | com.akiban.sql.parser.ResultColumn@19968e23 36 | exposedName: c2 37 | name: c2 38 | tableName: null 39 | isDefaultColumn: false 40 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-mysql-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@33aae94f 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@19bb5c09 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@5b976011 10 | 11 | [0]: 12 | com.akiban.sql.parser.AllResultColumn@2f242b11 13 | tableName: null 14 | exposedName: null 15 | name: null 16 | tableName: null 17 | isDefaultColumn: false 18 | type: null 19 | fromList: 20 | com.akiban.sql.parser.FromList@6f878144 21 | 22 | [0]: 23 | com.akiban.sql.parser.FromBaseTable@2937d090 24 | tableName: t1 25 | updateOrDelete: null 26 | null 27 | correlation Name: null 28 | null 29 | indexHints: 30 | com.akiban.sql.parser.IndexHintList@f5db314 31 | 32 | [0]: 33 | com.akiban.sql.parser.IndexHintNode@5097eded 34 | hintType: USE 35 | hintScope: null 36 | indexes: [idx_1, idx_2] 37 | [1]: 38 | com.akiban.sql.parser.FromBaseTable@26858bf1 39 | tableName: t2 40 | updateOrDelete: null 41 | null 42 | correlation Name: null 43 | null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-add-1a.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@27aed7c1 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@47d6d441 16 | 17 | [0]: 18 | com.akiban.sql.parser.FKConstraintDefinitionNode@69091c3f 19 | refTable name : t2 20 | grouping: true 21 | constraintName: null 22 | constraintType: FOREIGN_KEY 23 | properties: null 24 | name: null 25 | elementType: AT_DROP_CONSTRAINT 26 | columnList: 27 | com.akiban.sql.parser.ResultColumnList@75a5555a 28 | 29 | [0]: 30 | com.akiban.sql.parser.ResultColumn@3986c40d 31 | exposedName: c1 32 | name: c1 33 | tableName: null 34 | isDefaultColumn: false 35 | type: null 36 | [1]: 37 | com.akiban.sql.parser.ResultColumn@3eb14efc 38 | exposedName: c2 39 | name: c2 40 | tableName: null 41 | isDefaultColumn: false 42 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-add-1b.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@27aed7c1 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@47d6d441 16 | 17 | [0]: 18 | com.akiban.sql.parser.FKConstraintDefinitionNode@69091c3f 19 | refTable name : t2 20 | grouping: true 21 | constraintName: null 22 | constraintType: FOREIGN_KEY 23 | properties: null 24 | name: null 25 | elementType: AT_DROP_CONSTRAINT 26 | columnList: 27 | com.akiban.sql.parser.ResultColumnList@75a5555a 28 | 29 | [0]: 30 | com.akiban.sql.parser.ResultColumn@3986c40d 31 | exposedName: c1 32 | name: c1 33 | tableName: null 34 | isDefaultColumn: false 35 | type: null 36 | [1]: 37 | com.akiban.sql.parser.ResultColumn@3eb14efc 38 | exposedName: c2 39 | name: c2 40 | tableName: null 41 | isDefaultColumn: false 42 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-add-2a.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@60f4ffd8 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@74c8efa2 16 | 17 | [0]: 18 | com.akiban.sql.parser.FKConstraintDefinitionNode@33ecb094 19 | refTable name : t2 20 | grouping: true 21 | constraintName: null 22 | constraintType: FOREIGN_KEY 23 | properties: null 24 | name: null 25 | elementType: AT_DROP_CONSTRAINT 26 | columnList: 27 | com.akiban.sql.parser.ResultColumnList@783cdf2d 28 | 29 | [0]: 30 | com.akiban.sql.parser.ResultColumn@64604106 31 | exposedName: c1 32 | name: c1 33 | tableName: null 34 | isDefaultColumn: false 35 | type: null 36 | [1]: 37 | com.akiban.sql.parser.ResultColumn@6b4d2465 38 | exposedName: c2 39 | name: c2 40 | tableName: null 41 | isDefaultColumn: false 42 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-group-add-2b.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@60f4ffd8 2 | name: t1 3 | statementType: ALTER TABLE 4 | objectName: t1 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@74c8efa2 16 | 17 | [0]: 18 | com.akiban.sql.parser.FKConstraintDefinitionNode@33ecb094 19 | refTable name : t2 20 | grouping: true 21 | constraintName: null 22 | constraintType: FOREIGN_KEY 23 | properties: null 24 | name: null 25 | elementType: AT_DROP_CONSTRAINT 26 | columnList: 27 | com.akiban.sql.parser.ResultColumnList@783cdf2d 28 | 29 | [0]: 30 | com.akiban.sql.parser.ResultColumn@64604106 31 | exposedName: c1 32 | name: c1 33 | tableName: null 34 | isDefaultColumn: false 35 | type: null 36 | [1]: 37 | com.akiban.sql.parser.ResultColumn@6b4d2465 38 | exposedName: c2 39 | name: c2 40 | tableName: null 41 | isDefaultColumn: false 42 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/alter-table-constraint-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.AlterTableNode@1d5a0305 2 | name: t3 3 | statementType: ALTER TABLE 4 | objectName: t3 5 | compressTable: false 6 | sequential: false 7 | truncateTable: false 8 | purge: false 9 | defragment: false 10 | truncateEndOfTable: false 11 | updateStatistics: false 12 | updateStatisticsAll: false 13 | indexNameForUpdateStatistics: null 14 | tableElementList: 15 | com.akiban.sql.parser.TableElementList@7c4c51 16 | 17 | [0]: 18 | com.akiban.sql.parser.FKConstraintDefinitionNode@60765a16 19 | refTable name : t2 20 | grouping: true 21 | constraintName: gfk1 22 | constraintType: FOREIGN_KEY 23 | properties: null 24 | name: gfk1 25 | elementType: AT_DROP_CONSTRAINT 26 | columnList: 27 | com.akiban.sql.parser.ResultColumnList@7a148bd3 28 | 29 | [0]: 30 | com.akiban.sql.parser.ResultColumn@5ae80842 31 | exposedName: c2 32 | name: c2 33 | tableName: null 34 | isDefaultColumn: false 35 | type: null 36 | [1]: 37 | com.akiban.sql.parser.ResultColumn@377653ae 38 | exposedName: c3 39 | name: c3 40 | tableName: null 41 | isDefaultColumn: false 42 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@682bc3f5 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@114e3f41 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@281acd47 10 | 11 | [0]: 12 | com.akiban.sql.parser.ResultColumn@779b04e2 13 | exposedName: null 14 | name: null 15 | tableName: null 16 | isDefaultColumn: false 17 | type: null 18 | expression: 19 | com.akiban.sql.parser.BinaryArithmeticOperatorNode@625dcec6 20 | operator: mod 21 | methodName: mod 22 | type: null 23 | leftOperand: 24 | com.akiban.sql.parser.ColumnReference@7cb25b9d 25 | columnName: x 26 | tableName: null 27 | type: null 28 | rightOperand: 29 | com.akiban.sql.parser.ColumnReference@219ce060 30 | columnName: y 31 | tableName: null 32 | type: null 33 | fromList: 34 | com.akiban.sql.parser.FromList@424ecfdd 35 | 36 | [0]: 37 | com.akiban.sql.parser.FromBaseTable@4430d82d 38 | tableName: ints 39 | updateOrDelete: null 40 | null 41 | correlation Name: null 42 | null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-sequence-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@37fd6bea 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@5eb7ec5d 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@7cfefe3f 10 | 11 | [0]: 12 | com.akiban.sql.parser.ResultColumn@48e61a35 13 | exposedName: id 14 | name: id 15 | tableName: null 16 | isDefaultColumn: false 17 | type: null 18 | expression: 19 | com.akiban.sql.parser.ColumnReference@7ac2b2f6 20 | columnName: id 21 | tableName: null 22 | type: null 23 | [1]: 24 | com.akiban.sql.parser.ResultColumn@4737371 25 | exposedName: null 26 | name: null 27 | tableName: null 28 | isDefaultColumn: false 29 | type: null 30 | expression: 31 | com.akiban.sql.parser.NextSequenceNode@37a001ff 32 | type: null 33 | Sequence: test.new_sequence 34 | fromList: 35 | com.akiban.sql.parser.FromList@5f49d886 36 | 37 | [0]: 38 | com.akiban.sql.parser.FromBaseTable@69267649 39 | tableName: customers 40 | updateOrDelete: null 41 | null 42 | correlation Name: null 43 | null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-sequence-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@37fd6bea 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@5eb7ec5d 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@7cfefe3f 10 | 11 | [0]: 12 | com.akiban.sql.parser.ResultColumn@48e61a35 13 | exposedName: id 14 | name: id 15 | tableName: null 16 | isDefaultColumn: false 17 | type: null 18 | expression: 19 | com.akiban.sql.parser.ColumnReference@7ac2b2f6 20 | columnName: id 21 | tableName: null 22 | type: null 23 | [1]: 24 | com.akiban.sql.parser.ResultColumn@4737371 25 | exposedName: null 26 | name: null 27 | tableName: null 28 | isDefaultColumn: false 29 | type: null 30 | expression: 31 | com.akiban.sql.parser.CurrentSequenceNode@37a001ff 32 | type: null 33 | Sequence: test.new_sequence 34 | fromList: 35 | com.akiban.sql.parser.FromList@5f49d886 36 | 37 | [0]: 38 | com.akiban.sql.parser.FromBaseTable@69267649 39 | tableName: customers 40 | updateOrDelete: null 41 | null 42 | correlation Name: null 43 | null 44 | -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/SQLParserFeature.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | /** Features of the parser grammar. 19 | * In particular, dialect-specific constructs that can be turned off for use with 20 | * ordinary databases. 21 | */ 22 | 23 | package com.akiban.sql.parser; 24 | 25 | public enum SQLParserFeature 26 | { 27 | GEO_INDEX_DEF_FUNC, 28 | MYSQL_COLUMN_AS_FUNCS, 29 | MYSQL_LEFT_RIGHT_FUNC, 30 | DIV_OPERATOR, // integer division 31 | GROUPING, 32 | MYSQL_HINTS, 33 | MYSQL_INTERVAL, 34 | UNSIGNED, 35 | INFIX_MOD, 36 | INFIX_BIT_OPERATORS, 37 | INFIX_LOGICAL_OPERATORS, 38 | DOUBLE_QUOTED_STRING 39 | } 40 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/unparser/create-table-3.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1 ( 2 | col1 INTEGER NOT NULL, 3 | col2 INTEGER, 4 | col3 smallint NOT NULL, 5 | col4 smallint, 6 | col5 bigint NOT NULL, 7 | col6 bigint, 8 | 9 | col10 CHAR(1) NOT NULL, 10 | col11 CHAR(1), 11 | col12 VARCHAR(1) NOT NULL, 12 | col13 VARCHAR(1), 13 | col14 LONG VARCHAR NOT NULL, 14 | col15 LONG VARCHAR, 15 | 16 | col20 FLOAT NOT NULL, 17 | col21 FLOAT, 18 | col22 REAL NOT NULL, 19 | col23 REAL, 20 | col24 DOUBLE NOT NULL, 21 | col25 DOUBLE, 22 | 23 | col30 DATE NOT NULL, 24 | col31 DATE, 25 | col32 TIME NOT NULL, 26 | col33 time, 27 | col34 timestamp NOT NULL, 28 | col35 timestamp, 29 | 30 | col40 CLOB NOT NULL, 31 | col41 CLOB, 32 | col42 BLOB NOT NULL, 33 | col43 BLOB, 34 | 35 | col50 DECIMAL NOT NULL, 36 | col51 DECIMAL, 37 | col52 DECIMAL (1) NOT NULL, 38 | col53 DECIMAL (1) , 39 | col54 DECIMAL (10) NOT NULL, 40 | col55 DECIMAL (10), 41 | col56 DECIMAL (1,1) NOT NULL, 42 | col57 DECIMAL (1,1), 43 | col58 DECIMAL (10,1) NOT NULL, 44 | col59 DECIMAL (10,1), 45 | col60 DECIMAL (10,10) NOT NULL, 46 | col61 DECIMAL (10,10), 47 | col62 DECIMAL (30,10) NOT NULL, 48 | col63 DECIMAL (30,10), 49 | 50 | col70 NUMERIC NOT NULL, 51 | col71 NUMERIC 52 | ) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/copy-4.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CopyStatementNode@49de17f4 2 | mode: FROM_SUBQUERY 3 | tableName: null 4 | filename: /tmp/t12.txt 5 | format: null 6 | delimiter: null 7 | nullString: null 8 | quote: null 9 | escape: null 10 | encoding: null 11 | commitFrequency: 0 12 | statementType: COPY 13 | subquery: 14 | com.akiban.sql.parser.SubqueryNode@13f6ba0f 15 | subqueryType: FROM 16 | type: null 17 | resultSet: 18 | com.akiban.sql.parser.SelectNode@2b313906 19 | isDistinct: false 20 | resultColumns: 21 | com.akiban.sql.parser.ResultColumnList@2c96cf11 22 | 23 | [0]: 24 | com.akiban.sql.parser.AllResultColumn@60f47bf5 25 | tableName: null 26 | exposedName: null 27 | name: null 28 | tableName: null 29 | isDefaultColumn: false 30 | type: null 31 | fromList: 32 | com.akiban.sql.parser.FromList@52f6438d 33 | 34 | [0]: 35 | com.akiban.sql.parser.FromBaseTable@25cd0888 36 | tableName: t1 37 | updateOrDelete: null 38 | null 39 | correlation Name: null 40 | null 41 | [1]: 42 | com.akiban.sql.parser.FromBaseTable@37eb2c1b 43 | tableName: t2 44 | updateOrDelete: null 45 | null 46 | correlation Name: null 47 | null -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/IsolationLevel.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | /** 19 | * Isolation levels. 20 | */ 21 | 22 | package com.akiban.sql.parser; 23 | 24 | public enum IsolationLevel { 25 | UNSPECIFIED_ISOLATION_LEVEL("UNSPECIFIED"), 26 | READ_UNCOMMITTED_ISOLATION_LEVEL("READ UNCOMMITTED"), 27 | READ_COMMITTED_ISOLATION_LEVEL("READ COMMITTED"), 28 | REPEATABLE_READ_ISOLATION_LEVEL("REPEATABLE READ"), 29 | SERIALIZABLE_ISOLATION_LEVEL("SERIALIZABLE"); 30 | 31 | private String syntax; 32 | IsolationLevel(String syntax) { 33 | this.syntax = syntax; 34 | } 35 | 36 | public String getSyntax() { 37 | return syntax; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-returning-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.InsertNode@31884174 2 | statementType: INSERT 3 | resultSet: 4 | com.akiban.sql.parser.RowResultSetNode@48cbdb20 5 | correlation Name: null 6 | null 7 | resultColumns: 8 | com.akiban.sql.parser.ResultColumnList@3f9f3736 9 | 10 | [0]: 11 | com.akiban.sql.parser.ResultColumn@6de1dadb 12 | exposedName: null 13 | name: null 14 | tableName: null 15 | isDefaultColumn: true 16 | type: null 17 | expression: 18 | com.akiban.sql.parser.DefaultNode@6e79839 19 | columnName: null 20 | defaultText: null 21 | type: null 22 | [1]: 23 | com.akiban.sql.parser.ResultColumn@4ebac9b9 24 | exposedName: null 25 | name: null 26 | tableName: null 27 | isDefaultColumn: false 28 | type: null 29 | expression: 30 | com.akiban.sql.parser.CharConstantNode@4911b910 31 | value: fred 32 | type: CHAR(4) NOT NULL 33 | targetTableName: 34 | com.akiban.sql.parser.TableName@e3d 35 | t1 36 | returningList: 37 | com.akiban.sql.parser.ResultColumnList@2a8ceeea 38 | 39 | [0]: 40 | com.akiban.sql.parser.AllResultColumn@a995a79 41 | tableName: null 42 | exposedName: null 43 | name: null 44 | tableName: null 45 | isDefaultColumn: false 46 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-3.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE t1 ( 2 | col1 INTEGER NOT NULL, 3 | col2 INTEGER, 4 | col3 smallint NOT NULL, 5 | col4 smallint, 6 | col5 bigint NOT NULL, 7 | col6 bigint, 8 | 9 | col10 CHAR(1) NOT NULL, 10 | col11 CHAR(1), 11 | col12 VARCHAR(1) NOT NULL, 12 | col13 VARCHAR(1), 13 | col14 LONG VARCHAR NOT NULL, 14 | col15 LONG VARCHAR, 15 | 16 | col20 FLOAT NOT NULL, 17 | col21 FLOAT, 18 | col22 REAL NOT NULL, 19 | col23 REAL, 20 | col24 DOUBLE NOT NULL, 21 | col25 DOUBLE, 22 | 23 | col30 DATE NOT NULL, 24 | col31 DATE, 25 | col32 TIME NOT NULL, 26 | col33 time, 27 | col34 timestamp NOT NULL, 28 | col35 timestamp, 29 | col36 datetime, 30 | col37 datetime NOT NULL, 31 | col38 year, 32 | col39 year NOT NULL, 33 | 34 | col40 CLOB NOT NULL, 35 | col41 CLOB, 36 | col42 BLOB NOT NULL, 37 | col43 BLOB, 38 | 39 | col50 DECIMAL NOT NULL, 40 | col51 DECIMAL, 41 | col52 DECIMAL (1) NOT NULL, 42 | col53 DECIMAL (1) , 43 | col54 DECIMAL (10) NOT NULL, 44 | col55 DECIMAL (10), 45 | col56 DECIMAL (1,1) NOT NULL, 46 | col57 DECIMAL (1,1), 47 | col58 DECIMAL (10,1) NOT NULL, 48 | col59 DECIMAL (10,1), 49 | col60 DECIMAL (10,10) NOT NULL, 50 | col61 DECIMAL (10,10), 51 | col62 DECIMAL (30,10) NOT NULL, 52 | col63 DECIMAL (30,10), 53 | 54 | col70 NUMERIC NOT NULL, 55 | col71 NUMERIC 56 | ) -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/delete-returning-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.DeleteNode@6b359c1b 2 | statementType: DELETE 3 | resultSet: 4 | com.akiban.sql.parser.SelectNode@c9be79a 5 | isDistinct: false 6 | fromList: 7 | com.akiban.sql.parser.FromList@4f8235ed 8 | 9 | [0]: 10 | com.akiban.sql.parser.FromBaseTable@6da28362 11 | tableName: t1 12 | updateOrDelete: DELETE 13 | null 14 | correlation Name: null 15 | null 16 | whereClause: 17 | com.akiban.sql.parser.BinaryRelationalOperatorNode@485fcf29 18 | operator: = 19 | methodName: equals 20 | type: null 21 | leftOperand: 22 | com.akiban.sql.parser.ColumnReference@a19b1de 23 | columnName: name 24 | tableName: null 25 | type: null 26 | rightOperand: 27 | com.akiban.sql.parser.CharConstantNode@1cec6b00 28 | value: fred 29 | type: CHAR(4) NOT NULL 30 | targetTableName: 31 | com.akiban.sql.parser.TableName@e3d 32 | t1 33 | returningList: 34 | com.akiban.sql.parser.ResultColumnList@6564dbd5 35 | 36 | [0]: 37 | com.akiban.sql.parser.ResultColumn@409cb0f4 38 | exposedName: id 39 | name: id 40 | tableName: null 41 | isDefaultColumn: false 42 | type: null 43 | expression: 44 | com.akiban.sql.parser.ColumnReference@6f25844f 45 | columnName: id 46 | tableName: null 47 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/explain-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.ExplainStatementNode@20c1f10e 2 | statementType: EXPLAIN 3 | statement: 4 | com.akiban.sql.parser.CursorNode@1cb8deef 5 | name: null 6 | updateMode: UNSPECIFIED 7 | statementType: SELECT 8 | resultSet: 9 | com.akiban.sql.parser.SelectNode@2d342ba4 10 | isDistinct: false 11 | resultColumns: 12 | com.akiban.sql.parser.ResultColumnList@3c1d332b 13 | 14 | [0]: 15 | com.akiban.sql.parser.ResultColumn@210a6ae2 16 | exposedName: x 17 | name: x 18 | tableName: null 19 | isDefaultColumn: false 20 | type: null 21 | expression: 22 | com.akiban.sql.parser.ColumnReference@32ef2c60 23 | columnName: x 24 | tableName: null 25 | type: null 26 | [1]: 27 | com.akiban.sql.parser.ResultColumn@744a6cbf 28 | exposedName: y 29 | name: y 30 | tableName: null 31 | isDefaultColumn: false 32 | type: null 33 | expression: 34 | com.akiban.sql.parser.ColumnReference@4229ab3e 35 | columnName: y 36 | tableName: null 37 | type: null 38 | fromList: 39 | com.akiban.sql.parser.FromList@3da99561 40 | 41 | [0]: 42 | com.akiban.sql.parser.FromBaseTable@488e32e7 43 | tableName: t 44 | updateOrDelete: null 45 | null 46 | correlation Name: null 47 | null -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/AlterTableRenameNode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql.parser; 19 | 20 | import com.akiban.sql.StandardException; 21 | 22 | public class AlterTableRenameNode extends TableElementNode 23 | { 24 | private TableName newName; 25 | 26 | @Override 27 | public void init(Object newTableName) 28 | { 29 | newName = (TableName)newTableName; 30 | super.init(newName.getFullTableName(), ElementType.AT_RENAME); 31 | } 32 | 33 | @Override 34 | public void copyFrom(QueryTreeNode node) throws StandardException 35 | { 36 | super.copyFrom(node); 37 | 38 | newName = ((AlterTableRenameNode)node).newName; 39 | } 40 | 41 | public TableName newName() 42 | { 43 | return newName; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/UnaryBitOperatorNode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql.parser; 19 | 20 | import com.akiban.sql.StandardException; 21 | 22 | /** 23 | * This node represents a unary bit operator 24 | * As of now, there is only one such operator: BITNOT. 25 | * 26 | */ 27 | 28 | public class UnaryBitOperatorNode extends UnaryOperatorNode 29 | { 30 | /** 31 | * Initializer for a UnaryBitOperatorNode 32 | * 33 | * @param operand The operand of the node 34 | */ 35 | public void init(Object operand) throws StandardException { 36 | init(operand, "~", "bitnot"); 37 | } 38 | 39 | /** 40 | * Fill this node with a deep copy of the given node. 41 | */ 42 | public void copyFrom(QueryTreeNode node) throws StandardException { 43 | super.copyFrom(node); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@424ecfdd 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@4430d82d 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@62c09554 10 | 11 | [0]: 12 | com.akiban.sql.parser.ResultColumn@518bf072 13 | exposedName: null 14 | name: null 15 | tableName: null 16 | isDefaultColumn: false 17 | type: null 18 | expression: 19 | com.akiban.sql.parser.JavaToSQLValueNode@3a56f631 20 | type: null 21 | javaNode: 22 | com.akiban.sql.parser.StaticMethodCallNode@233d28e3 23 | javaClassName: null 24 | methodName: concat 25 | methodParms[0] : 26 | com.akiban.sql.parser.SQLToJavaValueNode@4476128 27 | 28 | value: 29 | com.akiban.sql.parser.CharConstantNode@6a3b8b49 30 | value: hello 31 | type: CHAR(6) NOT NULL 32 | methodParms[1] : 33 | com.akiban.sql.parser.SQLToJavaValueNode@6b359c1b 34 | 35 | value: 36 | com.akiban.sql.parser.ColumnReference@c9be79a 37 | columnName: x 38 | tableName: null 39 | type: null 40 | fromList: 41 | com.akiban.sql.parser.FromList@4f8235ed 42 | 43 | [0]: 44 | com.akiban.sql.parser.FromBaseTable@6da28362 45 | tableName: names 46 | updateOrDelete: null 47 | null 48 | correlation Name: null 49 | null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/prepare-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.PrepareStatementNode@46edf730 2 | name: ps 3 | statementType: PREPARE 4 | statement: 5 | com.akiban.sql.parser.CursorNode@30ff94b1 6 | name: null 7 | updateMode: UNSPECIFIED 8 | statementType: SELECT 9 | resultSet: 10 | com.akiban.sql.parser.SelectNode@5b7b0998 11 | isDistinct: false 12 | resultColumns: 13 | com.akiban.sql.parser.ResultColumnList@6ab30913 14 | 15 | [0]: 16 | com.akiban.sql.parser.ResultColumn@1018f51f 17 | exposedName: name 18 | name: name 19 | tableName: null 20 | isDefaultColumn: false 21 | type: null 22 | expression: 23 | com.akiban.sql.parser.ColumnReference@5684ce7a 24 | columnName: name 25 | tableName: null 26 | type: null 27 | fromList: 28 | com.akiban.sql.parser.FromList@290fd7f6 29 | 30 | [0]: 31 | com.akiban.sql.parser.FromBaseTable@4f2b6c89 32 | tableName: customers 33 | updateOrDelete: null 34 | null 35 | correlation Name: null 36 | null 37 | whereClause: 38 | com.akiban.sql.parser.BinaryRelationalOperatorNode@2be2befa 39 | operator: = 40 | methodName: equals 41 | type: null 42 | leftOperand: 43 | com.akiban.sql.parser.ColumnReference@33682598 44 | columnName: cid 45 | tableName: null 46 | type: null 47 | rightOperand: 48 | com.akiban.sql.parser.ParameterNode@7a7c3885 49 | number: 0 50 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-error-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@3603820e 2 | name: t1 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@204f80d6 8 | 9 | [0]: 10 | com.akiban.sql.parser.ConstraintDefinitionNode@4393722c 11 | constraintName: null 12 | constraintType: PRIMARY_KEY 13 | properties: null 14 | name: null 15 | elementType: AT_DROP_CONSTRAINT 16 | columnList: 17 | com.akiban.sql.parser.ResultColumnList@52cc95d 18 | 19 | [0]: 20 | com.akiban.sql.parser.ResultColumn@3f57fb52 21 | exposedName: c1 22 | name: c1 23 | tableName: null 24 | isDefaultColumn: false 25 | type: null 26 | [1]: 27 | com.akiban.sql.parser.ColumnDefinitionNode@2934e4fb 28 | type: INTEGER 29 | name: c1 30 | elementType: null 31 | [2]: 32 | com.akiban.sql.parser.ColumnDefinitionNode@4fa52fdf 33 | type: INTEGER NOT NULL 34 | name: c2 35 | elementType: null 36 | [3]: 37 | com.akiban.sql.parser.ConstraintDefinitionNode@65ea0252 38 | constraintName: null 39 | constraintType: PRIMARY_KEY 40 | properties: null 41 | name: null 42 | elementType: AT_DROP_CONSTRAINT 43 | columnList: 44 | com.akiban.sql.parser.ResultColumnList@663e89c3 45 | 46 | [0]: 47 | com.akiban.sql.parser.ResultColumn@13c695a6 48 | exposedName: c2 49 | name: c2 50 | tableName: null 51 | isDefaultColumn: false 52 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-returning-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.InsertNode@f9da4fc 2 | statementType: INSERT 3 | resultSet: 4 | com.akiban.sql.parser.SelectNode@36baa466 5 | isDistinct: false 6 | resultColumns: 7 | com.akiban.sql.parser.ResultColumnList@177f409c 8 | 9 | [0]: 10 | com.akiban.sql.parser.AllResultColumn@236acdd1 11 | tableName: null 12 | exposedName: null 13 | name: null 14 | tableName: null 15 | isDefaultColumn: false 16 | type: null 17 | fromList: 18 | com.akiban.sql.parser.FromList@38ee6681 19 | 20 | [0]: 21 | com.akiban.sql.parser.FromBaseTable@2b8bbc5a 22 | tableName: t2 23 | updateOrDelete: null 24 | null 25 | correlation Name: null 26 | null 27 | targetTableName: 28 | com.akiban.sql.parser.TableName@e3d 29 | t1 30 | returningList: 31 | com.akiban.sql.parser.ResultColumnList@62facf0b 32 | 33 | [0]: 34 | com.akiban.sql.parser.ResultColumn@402f0df1 35 | exposedName: id 36 | name: id 37 | tableName: null 38 | isDefaultColumn: false 39 | type: null 40 | expression: 41 | com.akiban.sql.parser.ColumnReference@513c6a22 42 | columnName: id 43 | tableName: null 44 | type: null 45 | [1]: 46 | com.akiban.sql.parser.ResultColumn@555c07d8 47 | exposedName: name 48 | name: name 49 | tableName: null 50 | isDefaultColumn: false 51 | type: null 52 | expression: 53 | com.akiban.sql.parser.ColumnReference@d0721b0 54 | columnName: name 55 | tableName: null 56 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/mysql-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@424ecfdd 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@4430d82d 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@62c09554 10 | 11 | [0]: 12 | com.akiban.sql.parser.ResultColumn@518bf072 13 | exposedName: null 14 | name: null 15 | tableName: null 16 | isDefaultColumn: false 17 | type: null 18 | expression: 19 | com.akiban.sql.parser.BinaryBitOperatorNode@3a56f631 20 | operator: | 21 | methodName: bitor 22 | type: null 23 | leftOperand: 24 | com.akiban.sql.parser.BinaryBitOperatorNode@233d28e3 25 | operator: & 26 | methodName: bitand 27 | type: null 28 | leftOperand: 29 | com.akiban.sql.parser.ColumnReference@4476128 30 | columnName: z 31 | tableName: null 32 | type: null 33 | rightOperand: 34 | com.akiban.sql.parser.ColumnReference@6a3b8b49 35 | columnName: y 36 | tableName: null 37 | type: null 38 | rightOperand: 39 | com.akiban.sql.parser.ColumnReference@6b359c1b 40 | columnName: z 41 | tableName: null 42 | type: null 43 | fromList: 44 | com.akiban.sql.parser.FromList@c9be79a 45 | 46 | [0]: 47 | com.akiban.sql.parser.FromBaseTable@4f8235ed 48 | tableName: bits 49 | updateOrDelete: null 50 | null 51 | correlation Name: null 52 | null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.InsertNode@3abc8e1e 2 | statementType: INSERT 3 | resultSet: 4 | com.akiban.sql.parser.SelectNode@3f829e6f 5 | isDistinct: false 6 | resultColumns: 7 | com.akiban.sql.parser.ResultColumnList@186fa9fc 8 | 9 | [0]: 10 | com.akiban.sql.parser.ResultColumn@4b00ebec 11 | exposedName: x 12 | name: x 13 | tableName: null 14 | isDefaultColumn: false 15 | type: null 16 | expression: 17 | com.akiban.sql.parser.ColumnReference@2980f96c 18 | columnName: x 19 | tableName: null 20 | type: null 21 | [1]: 22 | com.akiban.sql.parser.ResultColumn@527736bd 23 | exposedName: y 24 | name: y 25 | tableName: null 26 | isDefaultColumn: false 27 | type: null 28 | expression: 29 | com.akiban.sql.parser.ColumnReference@10aadc97 30 | columnName: y 31 | tableName: null 32 | type: null 33 | [2]: 34 | com.akiban.sql.parser.ResultColumn@4178460d 35 | exposedName: z 36 | name: z 37 | tableName: null 38 | isDefaultColumn: false 39 | type: null 40 | expression: 41 | com.akiban.sql.parser.ColumnReference@3f3f210f 42 | columnName: z 43 | tableName: null 44 | type: null 45 | fromList: 46 | com.akiban.sql.parser.FromList@49938039 47 | 48 | [0]: 49 | com.akiban.sql.parser.FromBaseTable@72c743eb 50 | tableName: t 51 | updateOrDelete: null 52 | null 53 | correlation Name: null 54 | null 55 | targetTableName: 56 | com.akiban.sql.parser.TableName@e3d 57 | t1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/create-table-4.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CreateTableNode@603b1d04 2 | name: t1 3 | statementType: CREATE TABLE 4 | lockGranularity: R 5 | existenceCheck: NO_CONDITION 6 | tableElementList: 7 | com.akiban.sql.parser.TableElementList@48ee22f7 8 | 9 | [0]: 10 | com.akiban.sql.parser.ConstraintDefinitionNode@a39ab89 11 | constraintName: null 12 | constraintType: PRIMARY_KEY 13 | properties: null 14 | name: null 15 | elementType: AT_DROP_CONSTRAINT 16 | columnList: 17 | com.akiban.sql.parser.ResultColumnList@502cb49d 18 | 19 | [0]: 20 | com.akiban.sql.parser.ResultColumn@2705d88a 21 | exposedName: c1 22 | name: c1 23 | tableName: null 24 | isDefaultColumn: false 25 | type: null 26 | [1]: 27 | com.akiban.sql.parser.ColumnDefinitionNode@70cb6009 28 | type: INTEGER UNSIGNED 29 | name: c1 30 | elementType: null 31 | [2]: 32 | com.akiban.sql.parser.ColumnDefinitionNode@380e28b9 33 | type: SMALLINT UNSIGNED 34 | name: c2 35 | elementType: null 36 | [3]: 37 | com.akiban.sql.parser.ColumnDefinitionNode@2993a66f 38 | type: BIGINT UNSIGNED 39 | name: c3 40 | elementType: null 41 | [4]: 42 | com.akiban.sql.parser.ColumnDefinitionNode@1c93d6bc 43 | type: DECIMAL(5,0) UNSIGNED 44 | name: c4 45 | elementType: null 46 | [5]: 47 | com.akiban.sql.parser.ColumnDefinitionNode@2df6df4c 48 | type: DOUBLE UNSIGNED 49 | name: c5 50 | elementType: null 51 | [6]: 52 | com.akiban.sql.parser.ColumnDefinitionNode@2abe0e27 53 | type: DOUBLE UNSIGNED 54 | name: c6 55 | elementType: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.InsertNode@4e76fba0 2 | statementType: INSERT 3 | resultSet: 4 | com.akiban.sql.parser.RowResultSetNode@60491c4c 5 | correlation Name: null 6 | null 7 | resultColumns: 8 | com.akiban.sql.parser.ResultColumnList@5fe0f2f6 9 | 10 | [0]: 11 | com.akiban.sql.parser.ResultColumn@296f25a7 12 | exposedName: null 13 | name: null 14 | tableName: null 15 | isDefaultColumn: false 16 | type: null 17 | expression: 18 | com.akiban.sql.parser.NumericConstantNode@40110c31 19 | value: 1 20 | type: INTEGER NOT NULL 21 | [1]: 22 | com.akiban.sql.parser.ResultColumn@1f3785d3 23 | exposedName: null 24 | name: null 25 | tableName: null 26 | isDefaultColumn: false 27 | type: null 28 | expression: 29 | com.akiban.sql.parser.CharConstantNode@7632efa7 30 | value: foo 31 | type: CHAR(3) NOT NULL 32 | [2]: 33 | com.akiban.sql.parser.ResultColumn@a13f991 34 | exposedName: null 35 | name: null 36 | tableName: null 37 | isDefaultColumn: false 38 | type: null 39 | expression: 40 | com.akiban.sql.parser.BinaryArithmeticOperatorNode@2565a3c2 41 | operator: * 42 | methodName: times 43 | type: null 44 | leftOperand: 45 | com.akiban.sql.parser.NumericConstantNode@33e228bc 46 | value: 3 47 | type: INTEGER NOT NULL 48 | rightOperand: 49 | com.akiban.sql.parser.NumericConstantNode@44e06940 50 | value: 10 51 | type: INTEGER NOT NULL 52 | targetTableName: 53 | com.akiban.sql.parser.TableName@e3d 54 | t1 -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-mysql-2.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@77d2b01b 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@2927fa12 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@7f92c8d9 10 | 11 | [0]: 12 | com.akiban.sql.parser.AllResultColumn@7dc05ffd 13 | tableName: null 14 | exposedName: null 15 | name: null 16 | tableName: null 17 | isDefaultColumn: false 18 | type: null 19 | fromList: 20 | com.akiban.sql.parser.FromList@60de1b8a 21 | 22 | [0]: 23 | com.akiban.sql.parser.JoinNode@15e232b5 24 | joinOrderStrategyProperties: {STRAIGHT=TRUE} 25 | nestedInParens: false 26 | correlation Name: null 27 | null 28 | leftResultSet: 29 | com.akiban.sql.parser.FromBaseTable@356f144c 30 | tableName: t1 31 | updateOrDelete: null 32 | null 33 | correlation Name: null 34 | null 35 | rightResultSet: 36 | com.akiban.sql.parser.FromBaseTable@f9da4fc 37 | tableName: t2 38 | updateOrDelete: null 39 | null 40 | correlation Name: null 41 | null 42 | joinClause: 43 | com.akiban.sql.parser.BinaryRelationalOperatorNode@36baa466 44 | operator: = 45 | methodName: equals 46 | type: null 47 | leftOperand: 48 | com.akiban.sql.parser.ColumnReference@177f409c 49 | columnName: id 50 | tableName: t1 51 | type: null 52 | rightOperand: 53 | com.akiban.sql.parser.ColumnReference@236acdd1 54 | columnName: id 55 | tableName: t2 56 | type: null -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/TrimOperatorNode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql.parser; 19 | 20 | import com.akiban.sql.types.ValueClassName; 21 | 22 | public class TrimOperatorNode extends BinaryOperatorNode 23 | { 24 | @Override 25 | public void init(Object trimSource, Object trimChar, Object operatorType) 26 | { 27 | BinaryOperatorNode.OperatorType optype = (BinaryOperatorNode.OperatorType)operatorType; 28 | switch(optype) 29 | { 30 | default: assert false : "TrimOperatorNode.init(trimSource, trimChar, operatorType) called with wrong OperatoryType: " + operatorType; 31 | case LTRIM: 32 | case TRIM: 33 | case RTRIM: super.init(trimSource, 34 | trimChar, 35 | "TRIM", 36 | optype.name().toLowerCase(), 37 | ValueClassName.StringDataValue, 38 | ValueClassName.StringDataValue); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-6.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@3d0bbf9e 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@4e513d61 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@3794d372 10 | 11 | [0]: 12 | com.akiban.sql.parser.AllResultColumn@bc5fde0 13 | tableName: null 14 | exposedName: null 15 | name: null 16 | tableName: null 17 | isDefaultColumn: false 18 | type: null 19 | fromList: 20 | com.akiban.sql.parser.FromList@739e8329 21 | 22 | [0]: 23 | com.akiban.sql.parser.FromBaseTable@2bb5340c 24 | tableName: t1 25 | updateOrDelete: null 26 | null 27 | correlation Name: null 28 | null 29 | [1]: 30 | com.akiban.sql.parser.HalfOuterJoinNode@56c163f 31 | rightOuterJoin: false 32 | naturalJoin: true 33 | nestedInParens: false 34 | correlation Name: null 35 | null 36 | leftResultSet: 37 | com.akiban.sql.parser.FromBaseTable@7b2884e0 38 | tableName: t2 39 | updateOrDelete: null 40 | null 41 | correlation Name: null 42 | null 43 | rightResultSet: 44 | com.akiban.sql.parser.JoinNode@212bcd4b 45 | nestedInParens: false 46 | correlation Name: null 47 | null 48 | leftResultSet: 49 | com.akiban.sql.parser.FromBaseTable@42b307f0 50 | tableName: t3 51 | updateOrDelete: null 52 | null 53 | correlation Name: null 54 | null 55 | rightResultSet: 56 | com.akiban.sql.parser.FromBaseTable@77ce3fc5 57 | tableName: t4 58 | updateOrDelete: null 59 | null 60 | correlation Name: null 61 | null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-sequence-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.InsertNode@f581593 2 | statementType: INSERT 3 | resultSet: 4 | com.akiban.sql.parser.RowResultSetNode@5ff06dc3 5 | correlation Name: null 6 | null 7 | resultColumns: 8 | com.akiban.sql.parser.ResultColumnList@21b64e6a 9 | 10 | [0]: 11 | com.akiban.sql.parser.ResultColumn@47d62270 12 | exposedName: null 13 | name: null 14 | tableName: null 15 | isDefaultColumn: false 16 | type: null 17 | expression: 18 | com.akiban.sql.parser.NumericConstantNode@3b6f0be8 19 | value: 1 20 | type: INTEGER NOT NULL 21 | [1]: 22 | com.akiban.sql.parser.ResultColumn@7776cad3 23 | exposedName: null 24 | name: null 25 | tableName: null 26 | isDefaultColumn: false 27 | type: null 28 | expression: 29 | com.akiban.sql.parser.NextSequenceNode@17fe1feb 30 | type: null 31 | Sequence: test.new_sequence 32 | targetTableName: 33 | com.akiban.sql.parser.TableName@e3d 34 | t1 35 | targetColumnList: 36 | com.akiban.sql.parser.ResultColumnList@2ce1899b 37 | 38 | [0]: 39 | com.akiban.sql.parser.ResultColumn@b113622 40 | exposedName: cid 41 | name: cid 42 | tableName: null 43 | isDefaultColumn: false 44 | type: null 45 | reference: 46 | com.akiban.sql.parser.ColumnReference@16f8f7db 47 | columnName: cid 48 | tableName: null 49 | type: null 50 | [1]: 51 | com.akiban.sql.parser.ResultColumn@335856a5 52 | exposedName: iid 53 | name: iid 54 | tableName: null 55 | isDefaultColumn: false 56 | type: null 57 | reference: 58 | com.akiban.sql.parser.ColumnReference@6ca084f8 59 | columnName: iid 60 | tableName: null 61 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/insert-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.InsertNode@fd49c56 2 | statementType: INSERT 3 | resultSet: 4 | com.akiban.sql.parser.RowsResultSetNode@4f63da38 5 | correlation Name: null 6 | null 7 | resultColumns: 8 | com.akiban.sql.parser.ResultColumnList@248bbb40 9 | 10 | [0]: 11 | com.akiban.sql.parser.ResultColumn@51b2797e 12 | exposedName: null 13 | name: null 14 | tableName: null 15 | isDefaultColumn: false 16 | type: null 17 | expression: 18 | com.akiban.sql.parser.NumericConstantNode@1c466919 19 | value: 0.123 20 | type: DECIMAL(4,3) NOT NULL 21 | [0]: 22 | com.akiban.sql.parser.RowResultSetNode@529df6cf 23 | correlation Name: null 24 | null 25 | resultColumns: 26 | com.akiban.sql.parser.ResultColumnList@b6ba69 27 | 28 | [0]: 29 | com.akiban.sql.parser.ResultColumn@5c8843dc 30 | exposedName: null 31 | name: null 32 | tableName: null 33 | isDefaultColumn: false 34 | type: null 35 | expression: 36 | com.akiban.sql.parser.NumericConstantNode@761f4ff9 37 | value: 0.123 38 | type: DECIMAL(4,3) NOT NULL 39 | [1]: 40 | com.akiban.sql.parser.RowResultSetNode@1bba105 41 | correlation Name: null 42 | null 43 | resultColumns: 44 | com.akiban.sql.parser.ResultColumnList@45485026 45 | 46 | [0]: 47 | com.akiban.sql.parser.ResultColumn@e861253 48 | exposedName: null 49 | name: null 50 | tableName: null 51 | isDefaultColumn: false 52 | type: null 53 | expression: 54 | com.akiban.sql.parser.NumericConstantNode@41d0e98 55 | value: 0.123 56 | type: DECIMAL(3,3) NOT NULL 57 | targetTableName: 58 | com.akiban.sql.parser.TableName@e3d 59 | t1 -------------------------------------------------------------------------------- /src/main/java/com/akiban/sql/parser/LeftRightFuncOperatorNode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2012 Akiban Technologies, Inc. All rights 3 | * reserved. 4 | * 5 | * This program and the accompanying materials are made available 6 | * under the terms of the Eclipse Public License v1.0 which 7 | * accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This program may also be available under different license terms. 11 | * For more information, see www.akiban.com or contact 12 | * licensing@akiban.com. 13 | * 14 | * Contributors: 15 | * Akiban Technologies, Inc. 16 | */ 17 | 18 | package com.akiban.sql.parser; 19 | 20 | import com.akiban.sql.types.ValueClassName; 21 | 22 | public class LeftRightFuncOperatorNode extends BinaryOperatorNode 23 | { 24 | @Override 25 | public void init (Object leftOperand, Object rightOperand) 26 | { 27 | super.init(leftOperand, rightOperand, 28 | ValueClassName.StringDataValue, ValueClassName.NumberDataValue); 29 | } 30 | 31 | @Override 32 | public void setNodeType(int nodeType) 33 | { 34 | String op = null; 35 | String method = null; 36 | 37 | switch(nodeType) 38 | { 39 | case NodeTypes.LEFT_FN_NODE: 40 | op = "getLeft"; 41 | method = "getLeft"; 42 | break; 43 | case NodeTypes.RIGHT_FN_NODE: 44 | op = "getRight"; 45 | method = "getRight"; 46 | break; 47 | default: 48 | assert false : "Unexpected nodeType: " + nodeType; 49 | } 50 | setOperator(op); 51 | setMethodName(method); 52 | super.setNodeType(nodeType); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-order-by-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@d576e70 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@671381e7 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@31b5998f 10 | 11 | [0]: 12 | com.akiban.sql.parser.ResultColumn@97494c8 13 | exposedName: x 14 | name: x 15 | tableName: null 16 | isDefaultColumn: false 17 | type: null 18 | expression: 19 | com.akiban.sql.parser.ColumnReference@44d3db51 20 | columnName: x 21 | tableName: null 22 | type: null 23 | [1]: 24 | com.akiban.sql.parser.ResultColumn@30e3c624 25 | exposedName: y 26 | name: y 27 | tableName: null 28 | isDefaultColumn: false 29 | type: null 30 | expression: 31 | com.akiban.sql.parser.ColumnReference@39e57e8f 32 | columnName: y 33 | tableName: null 34 | type: null 35 | [2]: 36 | com.akiban.sql.parser.ResultColumn@9d7fbfb 37 | exposedName: z 38 | name: z 39 | tableName: null 40 | isDefaultColumn: false 41 | type: null 42 | expression: 43 | com.akiban.sql.parser.ColumnReference@42e020c9 44 | columnName: z 45 | tableName: null 46 | type: null 47 | fromList: 48 | com.akiban.sql.parser.FromList@8888e6c 49 | 50 | [0]: 51 | com.akiban.sql.parser.FromBaseTable@3d3e58d4 52 | tableName: t 53 | updateOrDelete: null 54 | null 55 | correlation Name: null 56 | null 57 | orderByList: 58 | com.akiban.sql.parser.OrderByList@4839e5b5 59 | allAscending: true 60 | [0]: 61 | com.akiban.sql.parser.OrderByColumn@5117f31e 62 | columnPosition: -1 63 | expression: 64 | com.akiban.sql.parser.ColumnReference@7b5a6029 65 | columnName: x 66 | tableName: null 67 | type: null -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/select-3.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.CursorNode@7f70888e 2 | name: null 3 | updateMode: UNSPECIFIED 4 | statementType: SELECT 5 | resultSet: 6 | com.akiban.sql.parser.SelectNode@351563ff 7 | isDistinct: false 8 | resultColumns: 9 | com.akiban.sql.parser.ResultColumnList@f581593 10 | 11 | [0]: 12 | com.akiban.sql.parser.AllResultColumn@5ff06dc3 13 | tableName: null 14 | exposedName: null 15 | name: null 16 | tableName: null 17 | isDefaultColumn: false 18 | type: null 19 | fromList: 20 | com.akiban.sql.parser.FromList@21b64e6a 21 | 22 | [0]: 23 | com.akiban.sql.parser.FromSubquery@47d62270 24 | correlation Name: s 25 | s 26 | subquery: 27 | com.akiban.sql.parser.SelectNode@3b6f0be8 28 | isDistinct: false 29 | resultColumns: 30 | com.akiban.sql.parser.ResultColumnList@7776cad3 31 | 32 | [0]: 33 | com.akiban.sql.parser.ResultColumn@17fe1feb 34 | exposedName: z 35 | name: z 36 | tableName: null 37 | isDefaultColumn: false 38 | type: null 39 | expression: 40 | com.akiban.sql.parser.ColumnReference@2ce1899b 41 | columnName: z 42 | tableName: null 43 | type: null 44 | [1]: 45 | com.akiban.sql.parser.ResultColumn@b113622 46 | exposedName: y 47 | name: y 48 | tableName: null 49 | isDefaultColumn: false 50 | type: null 51 | expression: 52 | com.akiban.sql.parser.ColumnReference@16f8f7db 53 | columnName: y 54 | tableName: null 55 | type: null 56 | fromList: 57 | com.akiban.sql.parser.FromList@335856a5 58 | 59 | [0]: 60 | com.akiban.sql.parser.FromBaseTable@6ca084f8 61 | tableName: t1 62 | updateOrDelete: null 63 | null 64 | correlation Name: null 65 | null 66 | -------------------------------------------------------------------------------- /src/test/resources/com/akiban/sql/parser/update-returning-1.expected: -------------------------------------------------------------------------------- 1 | com.akiban.sql.parser.UpdateNode@73c6641 2 | statementType: UPDATE 3 | resultSet: 4 | com.akiban.sql.parser.SelectNode@e5d391d 5 | isDistinct: false 6 | resultColumns: 7 | com.akiban.sql.parser.ResultColumnList@a50a649 8 | 9 | [0]: 10 | com.akiban.sql.parser.ResultColumn@34d507e9 11 | exposedName: id 12 | name: id 13 | tableName: null 14 | isDefaultColumn: false 15 | type: null 16 | expression: 17 | com.akiban.sql.parser.NextSequenceNode@dfa6d18 18 | type: null 19 | Sequence: sequence1 20 | reference: 21 | com.akiban.sql.parser.ColumnReference@341049d3 22 | columnName: id 23 | tableName: null 24 | type: null 25 | fromList: 26 | com.akiban.sql.parser.FromList@195ed659 27 | 28 | [0]: 29 | com.akiban.sql.parser.FromBaseTable@214a7a12 30 | tableName: t1 31 | updateOrDelete: UPDATE 32 | null 33 | correlation Name: null 34 | null 35 | whereClause: 36 | com.akiban.sql.parser.BinaryRelationalOperatorNode@209444d1 37 | operator: = 38 | methodName: equals 39 | type: null 40 | leftOperand: 41 | com.akiban.sql.parser.ColumnReference@6632060c 42 | columnName: name 43 | tableName: null 44 | type: null 45 | rightOperand: 46 | com.akiban.sql.parser.CharConstantNode@5e2b323e 47 | value: fred 48 | type: CHAR(4) NOT NULL 49 | targetTableName: 50 | com.akiban.sql.parser.TableName@e3d 51 | t1 52 | returningList: 53 | com.akiban.sql.parser.ResultColumnList@65efb4be 54 | 55 | [0]: 56 | com.akiban.sql.parser.ResultColumn@5c435a3a 57 | exposedName: id 58 | name: id 59 | tableName: null 60 | isDefaultColumn: false 61 | type: null 62 | expression: 63 | com.akiban.sql.parser.ColumnReference@49d8c528 64 | columnName: id 65 | tableName: null 66 | type: null --------------------------------------------------------------------------------