This is a tracking issue for introducing a new MySQL query parser and an AST-based SQLite driver to significantly improve MySQL compatibility and expand WordPress plugin support.
I think the project can be represented in roughly the following phases:
- Initial version of the MySQL parser — reasonably fast, small, and correct ("make it work").
- Initial version of the SQLite driver — reach parity with the current test suite ("make it work").
- Advanced MySQL support in the SQLite driver — see also test suites below ("make it right").
- Advanced MySQL parser — add version support, verify against MySQL server grammar, fix edge cases ("make it right").
- Advanced tooling — implement a custom parser for ANTLR or ENBF, add custom grammar tooling ("make it right").
- Performance optimizations — explore possibilities to further optimize the new parser ("make it fast").
Here's a list of tasks and issues:
Core
Test suites
Advanced parser and tooling
Supported MySQL constructs
CREATE TABLE
ALTER TABLE
Supported MySQL INFORMATION_SCHEMA tables
INFORMATION_SCHEMA.TABLES
Related issues
Here's a list of issues that are likely related. This may need further review and triage:
This is a tracking issue for introducing a new MySQL query parser and an AST-based SQLite driver to significantly improve MySQL compatibility and expand WordPress plugin support.
I think the project can be represented in roughly the following phases:
Here's a list of tasks and issues:
Core
Test suites
Advanced parser and tooling
Supported MySQL constructs
CREATE TABLE
CREATE TABLE t (id INT)CREATE TABLE t (id INT NOT NULL)CREATE TABLE t (id INT) DEFAULT 0CREATE TABLE t (...) ENGINE=InnoDBCREATE TABLE t (id INT) COLLATE utf8mb4_czech_ciCREATE TABLE t (id INT PRIMARY KEY)CREATE TABLE t (id INT PRIMARY KEY AUTOINCREMENT)CREATE TABLE t (id INT AUTOINCREMENT, PRIMARY KEY(id))CREATE TABLE t (a INT AUTOINCREMENT, b INT, c INT, PRIMARY KEY(a, b, c))CREATE TABLE t (id INT, UNIQUE(id))CREATE TABLE t LIKE ttCREATE TABLE t [AS] SELECT * FROM ttCREATE TABLE t (...) [AS] SELECT * FROM ttCREATE TABLE t (...) ENGINE=InnoDB [AS] SELECT * FROM ttCREATE TEMPORARY TABLE t (...)CREATE TEMPORARY TABLE t LIKE ttCREATE TABLE IF NOT EXISTS t LIKE ttCREATE TABLE IF NOT EXISTS t (...)CREATE TEMPORARY TABLE IF NOT EXISTS t (...)CREATE TEMPORARY TABLE IF NOT EXISTS t LIKE ttALTER TABLE
ALTER TABLE t ADD [COLUMN] c INTALTER TABLE t ADD [COLUMN] c1 INT, c2 TEXT, ...ALTER TABLE t ADD [COLUMN] c INT NOT NULLALTER TABLE t ADD [COLUMN] c INT DEFAULT 0ALTER TABLE t ADD [COLUMN] c INT NOT NULL DEFAULT 0ALTER TABLE t ADD [COLUMN] c INT [PRIMARY] KEYALTER TABLE t ADD [COLUMN] c INT UNIQUE [KEY]ALTER TABLE t ADD [COLUMN] c INT AUTO_INCREMENTALTER TABLE t ADD [COLUMN] c INT COMMENT 'abc'ALTER TABLE t ADD [COLUMN] c TEXT COLLATE 'utf8mb4_0900_ai_ci'ALTER TABLE t ADD [COLUMN] c INT [GENERATED ALWAYS] AS (...)ALTER TABLE t ADD [COLUMN] c INT VIRTUALALTER TABLE t ADD [COLUMN] c INT STOREDALTER TABLE t ADD [COLUMN] c INT FIRSTALTER TABLE t ADD [COLUMN] c INT AFTER ccALTER TABLE t ADD [COLUMN] c INT VISIBLEALTER TABLE t ADD [COLUMN] c INT INVISIBLEALTER TABLE t ADD [COLUMN] c INT COLUMN_FORMAT DEFAULTALTER TABLE t ADD [COLUMN] c INT COLUMN_FORMAT FIXEDALTER TABLE t ADD [COLUMN] c INT COLUMN_FORMAT DYNAMICALTER TABLE t ADD [COLUMN] c INT ENGINE_ATTRIBUTE = '...'ALTER TABLE t ADD [COLUMN] c INT SECONDARY_ENGINE_ATTRIBUTE = '...'ALTER TABLE t ADD [COLUMN] c INT STORAGE DISKALTER TABLE t ADD [COLUMN] c INT STORAGE MEMORYALTER TABLE t ADD [COLUMN] c REFERENCES tt (id)ALTER TABLE t ADD [COLUMN] c REFERENCES tt (id) MATCH FULLALTER TABLE t ADD [COLUMN] c REFERENCES tt (id) MATCH PARTIALALTER TABLE t ADD [COLUMN] c REFERENCES tt (id) MATCH SIMPLEALTER TABLE t ADD [COLUMN] c REFERENCES tt (id) ON UPDATE ...ALTER TABLE t ADD [COLUMN] c REFERENCES tt (id) ON DELETE ...ALTER TABLE t ADD [COLUMN] c [CONSTRAINT chck] CHECK (...)ALTER TABLE t ADD [COLUMN] c [CONSTRAINT chck] CHECK (...) ENFORCEDALTER TABLE t ADD [COLUMN] c [CONSTRAINT chck] CHECK (...) NOT ENFORCEDALTER TABLE t DROP [COLUMN] cALTER TABLE t DROP [COLUMN] c1, c2, ...ALTER TABLE t DROP INDEX idxALTER TABLE t DROP KEY idxALTER TABLE t DROP PRIMARY KEYALTER TABLE t DROP FOREIGN KEY fkALTER TABLE t DROP CHECK chckALTER TABLE t DROP CONSTRAINT chckALTER TABLE t ADD [COLUMN] c1 INT, DROP [COLUMN] c2Supported MySQL
INFORMATION_SCHEMAtablesINFORMATION_SCHEMA.TABLESTABLE_CATALOGTABLE_SCHEMATABLE_NAMETABLE_TYPEENGINEVERSIONROW_FORMATTABLE_ROWSĄVG_ROW_LENGTHDATA_LENGTHMAX_DATA_LENGTHINDEX_LENGTHDATA_FREEAUTO_INCREMENTCREATE_TIMEUPDATE_TIME— should be easy to addCHECK_TIMETABLE_COLLATIONCHECKSUMCREATE_OPTIONSTABLE_COMMENTRelated issues
Here's a list of issues that are likely related. This may need further review and triage:
information_schematables #146AUTO_INCREMENTsequence toshow createstatements #140show creategenerates invalid default values for columns #125CREATE TABLE wp_posts_2 LIKE wp_posts#115ALTER TABLE x AUTO_INCREMENT = 100#114DELETEwithLIMITandORDER BY#100BINARYcompare e.g.ON BINARY wp_user_meta.meta_value = mollie_customer.mollie_id#80INSERT INGOREare not working? #79post_datewith SQLite #52