{ name: "SFW without WHERE expression", statement: "SELECT * FROM foo WHERE", assert: { result: SyntaxFail }, } { name: "SELECT without comma between projection items", statement: "SELECT a b data", assert: { result: SyntaxFail }, } { name: "AT before AS alias", statement: "SELECT ord, val FROM table1 AT ord AS val", assert: { result: SyntaxFail }, } { name: "SELECT missing projection", statement: "SELECT FROM table1", assert: { result: SyntaxFail }, } { name: "SELECT list with extra comma", statement: "SELECT a, FROM {'a' : 1}", assert: { result: SyntaxFail }, } { name: "SELECT projection with empty parens", statement: "SELECT () FROM data", assert: { result: SyntaxFail }, } { name: "expected identifier for AS alias", statement: "SELECT a AS true FROM data", assert: { result: SyntaxFail }, } { name: "expected identifier for AT alias", statement: "SELECT a FROM data AT true", assert: { result: SyntaxFail }, } partiql::[ // From the SQL-92 BNF (https://ronsavage.github.io/SQL/sql-92.bnf.html#select%20list), select star with other select // list items is not permitted. PostgreSQL does allow some of the following cases, while others like MySQL gives a // syntax error. The use case in which a user would want select star with other projection items is unclear. It may // be something we want to explicitly disallow in a future spec RFC. 'select-star'::[ { name:"disallowed uses of *, *", statement:"SELECT *, * FROM <<1>>", assert: { result: SyntaxFail }, }, { name:"disallowed uses of *, alias.*", statement:"SELECT *, foo.* FROM <<{ a: 1 }>> as foo", assert: { result: SyntaxFail }, }, { name:"disallowed uses of alias.*, *", statement:"SELECT foo.*, * FROM <<{ a: 1 }>> as foo", assert: { result: SyntaxFail }, }, { name:"disallowed uses of , *", statement:"SELECT 1, * FROM <<{ a: 1 }>>", assert: { result: SyntaxFail }, }, { name:"disallowed uses of *, ", statement:"SELECT *, 1 FROM <<{ a: 1 }>>", assert: { result: SyntaxFail }, } ] ]