zeromicro / ddl-parser

A tool to parse mysql ddl.
MIT License
14 stars 11 forks source link

`CreateTable.Name` parsing issue #2

Closed fynxiu closed 2 years ago

fynxiu commented 2 years ago

When we parse CREATE TABLE statement using antlr v4, the CreateTable.Name field value might be malformed. e.g.,

CREATE TABLE `foo`.`bar` (
    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB default CHARSET=utf8mb4;

The CreateTable.Name could be "foo`.`bar".