sql-parser icon indicating copy to clipboard operation
sql-parser copied to clipboard

A validating SQL lexer and parser with a focus on MySQL dialect.

Results 98 sql-parser issues
Sort by recently updated
recently updated
newest added

The validator marks queries with an alias (with or without `AS`) after [window functions](https://mariadb.com/kb/en/library/window-functions/) like `RANK`, `DENSE_RANK`, `ROW_NUMBER`, `CUME_DIST`, etc. as incorrect: ```SELECT RANK() OVER(ORDER BY NULL) rank``` ``` [...

enhancement
kind/support

When use parser to parse the sql like this: update tbl_customer t set t.`description`=:yp where t.id=1; the parser failed.it seems the parser cann't handle sql parameter in the SET sub-clause.

The following query with a bogus `CASE` expression properly fails the linter: ``` ./lint-query --query "SELECT CASE foo FROM bar" #1: Unexpected keyword. (near "FROM" at position 16) #2: Unexpected...

Hello, This query is valid with mysql but not with sql-parser : ```sql select @test:=Auto_increment FROM information_schema.tables WHERE table_name='myTable' ``` The part "Auto_increment" seems to be the problem. Thanks

bug

``` ./bin/lint-query --query "SELECT * FROM table1 JOIN (select * from table2) ON some_column = some_other_column" ``` This passes the linter, but should fail because the subquery does not have...

enhancement

Some queries with keywords in the `SELECT` field list are marked as invalid by the SQL parser. Examples: - `SELECT NULL IS NULL` - `SELECT NOT 1` - `SELECT 1...

Currently the parser does not recognize `CREATE TABLE` statements in the form of `CREATE TABLE tbl AS (SELECT 1)`. Relevant syntax ([link](https://dev.mysql.com/doc/refman/en/create-table.html)): ``` CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name...

bug

See https://github.com/phpmyadmin/phpmyadmin/issues/13595, reproduced with current master: ```console ./bin/lint-query --query "ALTER TABLE posts PARTITION BY LIST COLUMNS (status) ( PARTITION P1 VALUES IN ('public', 'admin', 'moder', 'rec'), PARTITION P2 VALUES IN...

bug

Was using the php-sqllint package (says to report errors here) and got these errors on valid MySQL syntax: Line 1, col 45 at "(": An expression was expected. Line 1,...

bug