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

MySQL support (queries)

Open nene opened this issue 3 years ago • 0 comments

Data types

Basic syntax

  • [ ] comment syntax differences
  • [x] identifier syntax
    • [x] unicode letters: ähhää
    • [x] dollar sign as non-first character foo$bar
    • [x] dollar sign as first character $foo (though it generates a warning)
    • [x] can begin with a number
  • [x] String literals
  • [x] Interval literals
  • [x] Number literals
  • [x] Date/Time literals
  • [x] Hex literals: x'01af' syntax
  • [x] Hex literals: 0x01AF syntax
  • [x] Bit literals: b'01' syntax
  • [x] Bit literals: 0b01 syntax
  • [x] Variables (using @name syntax)
  • [ ] ODBC syntax for date/time literals (e.g. { d 'str' })
  • [ ] Executable comments (like /*! STRAIGHT_JOIN */)

Expressions

  • [x] Operators:
    • [x] Concatenation of strings with space
      • [x] 'foo' 'bar
      • [x] 'foo' "bar"
      • [x] N'foo' 'bar'
      • [x] _utf8 'foo' 'bar'
    • [x] &&, || as equivalent to AND, OR
    • [x] IS [NOT] {TRUE | FALSE}
    • [x] IS [NOT] UNKNOWN
    • [x] >= ANY | SOME | ALL
    • [x] <=>
    • [x] !
    • [x] SOUNDS LIKE
    • [x] COLLATE
    • [x] BINARY
    • [x] MEMBER OF
    • [x] JSON operators
    • [x] := assignment operator
    • [x] Full text search
    • [x] Precedence rules
  • [x] ROW ( ... ) expressions
  • [ ] Function calls:
    • [ ] Built-in function name parsing
    • [x] parenthesis-less function calls: CURRENT_DATE, CURRENT_TIMESTAMP, CURRENT_TIME, CURRENT_USER, LOCALTIME, LOCALTIMESTAMP.
    • [x] EXTRACT(... FROM ...)

Parameters

  • [x] ? syntax.

Query syntax

  • [x] Hints: HIGH_PRIORITY, STRAIGHT_JOIN, SQL_SMALL_RESULT ...
  • [x] Use of hints both before and after DISTINCT, like: SELECT STRAIGHT_JOIN DISTINCT HIGH_PRIORITY
  • [x] DISTINCTROW
  • [x] INTO {OUTFILE | DUMPFILE | var}
  • [x] GROUP BY ... WITH ROLLUP
  • [x] ORDER BY ... WITH ROLLUP
  • [x] FOR {UPDATE | SHARE} clause
  • [x] LOCK IN SHARE MODE
  • [ ] FROM clause:
    • [x] PARTITION selection
    • [x] FROM DUAL
    • [x] LATERAL
    • [x] STRAIGHT_JOIN
    • [x] List of tables inside parens tbl LEFT JOIN (tbl1, tbl2, tbl3) ON tbl.id=tbl1.id AND tbl1.id=tbl2.id
    • [x] Table alias with column list
    • [ ] index hint list:
      • [ ] {USE | IGNORE | FORCE} {INDEX | KEY}
      • [ ] [ FOR {JOIN | ORDER BY | GROUP BY} ]
      • [ ] ([index_name, ...])
    • [ ] ODBC { OJ ... } syntax
  • [x] TABLE statements (shorthand for simple SELECT)
  • [x] VALUES statements

nene avatar Nov 19 '22 19:11 nene