tarqd / mysqlpop

MySQL Parser based on SQLPop (SQLite Parser).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MySQLPop

screenshot

MySQL parser (based on SQLPop, a SQLite query parser)

Goal

Provide enough support for MySQL-flavored SQL to provide a base for higher level tooling (query fingerprints, read write splitting proxies, intrusion detection, etc).

MySQL Flavor

  • Set Variable statements (set @foo = 1)
  • MySQL-style variables (@@global.read_only)
  • Variable assignment in expressions (select @id := @id +1)
  • MySQL-style backslash escapes in strings ('foo\'bar')
  • Removed SQLite specific variable syntax
  • Parameters/Placeholders (select foo from bar where baz > ?)
  • Prepared statements
  • Procedures
  • Transactions
  • XA Transactions
  • SHOW statements
  • Change autoincrement keyword
  • MySQL style create table (UNIQUE/FOREIGN key etc)
  • SELECT into variables/dumpfiles/procedures
  • DO statements
  • CALL statements
  • CHECK statements
  • FLUSH statements
  • GRANT/REVOKE statements
  • HANDLER statements
  • LOAD DATA statements
  • LOCK/UNLOCK statements
  • RENAME statement
  • USE statement
  • TRUNCATE statement

And maybe some other differences we'll run into after we've knocked out this list.

Currenly, only the lexer is complete and tested. The parser is almost complete (see LARLPOP issues).

About

MySQL Parser based on SQLPop (SQLite Parser).


Languages

Language:Rust 100.0%