{ name: "ORDER BY missing BY and sort spec", statement: "SELECT a FROM tb ORDER", assert: { result: SyntaxFail }, } { name: "ORDER BY missing BY", statement: "SELECT a FROM tb ORDER foo", assert: { result: SyntaxFail }, } { name: "ORDER BY missing sort spec", statement: "SELECT a FROM tb ORDER BY", assert: { result: SyntaxFail }, } { name: "ORDER BY multiple attributes in sort spec missing comma", statement: "SELECT a FROM tb ORDER BY foo bar", assert: { result: SyntaxFail }, } { name: "ORDER BY multiple empty parsed comma list", statement: "SELECT a FROM tb ORDER BY foo, ,", assert: { result: SyntaxFail }, } { name: "ORDER BY missing attribute name", statement: "SELECT a FROM tb ORDER BY ASC, bar", assert: { result: SyntaxFail }, } { name: "ORDER BY invalid punctuation", statement: "SELECT a FROM tb ORDER BY ASC; bar", assert: { result: SyntaxFail }, } { name: "ORDER BY multiple order spec", statement: "SELECT a FROM tb ORDER BY foo ASC DESC", assert: { result: SyntaxFail }, } { name: "ORDER BY unexpected keyword as attribute", statement: "SELECT a FROM tb ORDER BY SELECT", assert: { result: SyntaxFail }, } { name: "ORDER BY missing NULLS type", statement: "SELECT a FROM tb ORDER BY a ASC NULLS", assert: { result: SyntaxFail }, } { name: "ORDER BY missing NULLS keyword with FIRST", statement: "SELECT a FROM tb ORDER BY a ASC FIRST", assert: { result: SyntaxFail }, } { name: "ORDER BY missing NULLS keyword with LAST", statement: "SELECT a FROM tb ORDER BY a ASC LAST", assert: { result: SyntaxFail }, } { name: "ORDER BY NULLS spec before ORDER BY", statement: "SELECT a FROM tb NULLS LAST ORDER BY a ASC", assert: { result: SyntaxFail }, } { name: "ORDER BY unexpected NULLS keyword attribute", statement: "SELECT a FROM tb ORDER BY a NULLS SELECT", assert: { result: SyntaxFail }, } { name: "ORDER BY unexpected keyword", statement: "SELECT a FROM tb ORDER BY a NULLS FIRST SELECT", assert: { result: SyntaxFail }, } { name: "OFFSET before LIMIT", statement: "SELECT a FROM tb OFFSET 5 LIMIT 10", assert: { result: SyntaxFail }, }