Closed xsist10 closed 2 years ago
MySQL has a lot of badly documented aliases for data types.
Example:
CREATE TABLE `test_alias` ( `a` INTEGER, `b` CHARACTER(10), `c` VARCHARACTER(10), `d` INT2, `e` INT3, `f` INT4, `g` INT8, `h` FLOAT4, `i` FLOAT8, `j` MIDDLEINT ); SHOW CREATE TABLE test_alias \G *************************** 1. row *************************** Table: test Create Table: CREATE TABLE `test_alias` ( `a` int DEFAULT NULL, `b` char(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, `d` smallint DEFAULT NULL, `e` mediumint DEFAULT NULL, `f` int DEFAULT NULL, `g` bigint DEFAULT NULL, `h` float DEFAULT NULL, `i` double DEFAULT NULL, `j` mediumint DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
But ColumnDefinitionProcessor.php only supports a subset of them.
Parsing a CREATE TABLE query using one of these aliases results in the specific column being skipped and a warning message:
CREATE TABLE
PHP Notice: Undefined variable: prevCategory in /vendor/greenlion/php-sql-parser/src/PHPSQLParser/processors/ColumnDefinitionProcessor.php on line 370
Working on a MR to fix this.
MySQL has a lot of badly documented aliases for data types.
Example:
But ColumnDefinitionProcessor.php only supports a subset of them.
Parsing a
CREATE TABLE
query using one of these aliases results in the specific column being skipped and a warning message: