@@ -1340,6 +1340,13 @@ describe('mysql', () => {
13401340 "SELECT * FROM `T1` EXCEPT SELECT * FROM `T2`"
13411341 ]
13421342 } ,
1343+ {
1344+ title : 'or and expr in aggr_fun_smma' ,
1345+ sql : [
1346+ "SELECT SUM(a = 'a' AND b = 1) as foo FROM bar;" ,
1347+ "SELECT SUM(`a` = 'a' AND `b` = 1) AS `foo` FROM `bar`"
1348+ ]
1349+ } ,
13431350 ]
13441351 SQL_LIST . forEach ( sqlInfo => {
13451352 const { title, sql } = sqlInfo
@@ -1356,7 +1363,7 @@ describe('mysql', () => {
13561363 expect ( parser . astify . bind ( parser , sql ) ) . to . throw ( 'Expected "!=", "#", "#-", "#>", "#>>", "%", "&", "&&", "*", "+", ",", "-", "--", "->", "->>", "/", "/*", "<", "<<", "<=", "<>", "<@", "=", ">", ">=", ">>", "?", "?&", "?|", "@>", "AND", "BETWEEN", "IN", "IS", "LIKE", "NOT", "ON", "OR", "OVER", "REGEXP", "RLIKE", "USING", "XOR", "^", "div", "mod", "|", "||", or [ \\t\\n\\r] but ")" found.' )
13571364 expect ( parser . astify . bind ( parser , 'select convert("");' ) ) . to . throw ( 'Expected "!=", "#", "#-", "#>", "#>>", "%", "&", "&&", "*", "+", ",", "-", "--", "->", "->>", "/", "/*", "<", "<<", "<=", "<>", "<@", "=", ">", ">=", ">>", "?", "?&", "?|", "@>", "AND", "BETWEEN", "COLLATE", "IN", "IS", "LIKE", "NOT", "OR", "REGEXP", "RLIKE", "USING", "XOR", "^", "div", "mod", "|", "||", or [ \\t\\n\\r] but ")" found.' )
13581365 sql = 'SELECT AVG(Quantity,age) FROM table1;'
1359- expect ( parser . astify . bind ( parser , sql ) ) . to . throw ( 'Expected "!=", "#", "#-", "#>", "#>>", "%", "&", "&&", "(", ")", "*", "+", "-", "--", "->", "->>", ".", "/", "/*", "<", "<<", "<=", "<>", "<@", "=", ">", ">=", ">>", "?", "?&", "?|", "@>", "BETWEEN", "COLLATE", "IN", "IS", "LIKE", "NOT", "REGEXP", "RLIKE", "XOR", "^", "div", "mod", "|", "||", [ \\t\\n\\r], [A-Za-z0-9_$\\x80-], or [A-Za-z0-9_:一-龥À-ſ] but "," found' )
1366+ expect ( parser . astify . bind ( parser , sql ) ) . to . throw ( 'Expected "!=", "#", "#-", "#>", "#>>", "%", "&", "&&", "(", ")", "*", "+", "-", "--", "->", "->>", ".", "/", "/*", "<", "<<", "<=", "<>", "<@", "=", ">", ">=", ">>", "?", "?&", "?|", "@>", "AND", " BETWEEN", "COLLATE", "IN", "IS", "LIKE", "NOT", "OR ", "REGEXP", "RLIKE", "XOR", "^", "div", "mod", "|", "||", [ \\t\\n\\r], [A-Za-z0-9_$\\x80-], or [A-Za-z0-9_:一-龥À-ſ] but "," found' )
13601367 } )
13611368
13621369 it ( 'should join multiple table with comma' , ( ) => {
0 commit comments