@@ -879,6 +879,13 @@ describe('mysql', () => {
879879 'SELECT * FROM `test` WHERE `name` LIKE :pattern COLLATE UTF8MB4_GENERAL_CI'
880880 ]
881881 } ,
882+ {
883+ title : 'alter drop index or key' ,
884+ sql : [
885+ 'ALTER TABLE table_name DROP INDEX index_name' ,
886+ 'ALTER TABLE `table_name` DROP INDEX index_name'
887+ ]
888+ } ,
882889 ]
883890 SQL_LIST . forEach ( sqlInfo => {
884891 const { title, sql } = sqlInfo
@@ -890,10 +897,12 @@ describe('mysql', () => {
890897 } )
891898 } )
892899
893- it ( 'should throw error when covert args is not right' , ( ) => {
894- const sql = `select convert(json_unquote(json_extract('{"thing": "252"}', "$.thing")));`
900+ it ( 'should throw error when args is not right' , ( ) => {
901+ let sql = `select convert(json_unquote(json_extract('{"thing": "252"}', "$.thing")));`
895902 expect ( parser . astify . bind ( parser , sql ) ) . to . throw ( 'Expected "!=", "#", "%", "&", "&&", "*", "+", ",", "-", "--", "/", "/*", "<", "<<", "<=", "<>", "=", ">", ">=", ">>", "AND", "BETWEEN", "IN", "IS", "LIKE", "NOT", "ON", "OR", "OVER", "REGEXP", "RLIKE", "USING", "XOR", "^", "div", "|", "||", or [ \\t\\n\\r] but ")" found.' )
896903 expect ( parser . astify . bind ( parser , 'select convert("");' ) ) . to . throw ( 'Expected "!=", "#", "%", "&", "&&", "*", "+", ",", "-", "--", "/", "/*", "<", "<<", "<=", "<>", "=", ">", ">=", ">>", "AND", "BETWEEN", "COLLATE", "IN", "IS", "LIKE", "NOT", "OR", "REGEXP", "RLIKE", "USING", "XOR", "^", "div", "|", "||", or [ \\t\\n\\r] but ")" found.' )
904+ sql = 'SELECT AVG(Quantity,age) FROM table1;'
905+ expect ( parser . astify . bind ( parser , sql ) ) . to . throw ( 'Expected "#", "%", "&", "(", ")", "*", "+", "-", "--", "->", "->>", ".", "/", "/*", "<<", ">>", "^", "div", "|", "||", [ \\t\\n\\r], [A-Za-z0-9_$\\x80-], or [A-Za-z0-9_:] but "," found.' )
897906 } )
898907
899908 it ( 'should join multiple table with comma' , ( ) => {
0 commit comments