diff --git a/src/Tokenizer.php b/src/Tokenizer.php old mode 100644 new mode 100755 index e211d71..cf992ac --- a/src/Tokenizer.php +++ b/src/Tokenizer.php @@ -31,6 +31,7 @@ final class Tokenizer private $reserved = [ 'ACCESSIBLE', 'ACTION', + 'AFTER', 'AGAINST', 'AGGREGATE', 'ALGORITHM', @@ -174,7 +175,6 @@ final class Tokenizer 'MINUTE_SECOND', 'MIN_ROWS', 'MODE', - 'MODIFY', 'MONTH', 'MRG_MYISAM', 'MYISAM', @@ -319,7 +319,8 @@ final class Tokenizer 'UPDATE', 'HAVING', 'ADD', - 'AFTER', + 'CHANGE', + 'MODIFY', 'ALTER TABLE', 'DELETE FROM', 'UNION ALL', diff --git a/tests/clihighlight.html b/tests/clihighlight.html old mode 100644 new mode 100755 index 701a23b..926a16d --- a/tests/clihighlight.html +++ b/tests/clihighlight.html @@ -454,9 +454,7 @@ [37mALTER TABLE[0m [35;1m`PREFIX_employee`[0m [37mADD[0m - [35;1m`bo_color`[0m varchar[0m([32;1m32[0m) [37mdefault[0m [37mNULL[0m -[37mAFTER[0m - [35;1m`stats_date_to`[0m + [35;1m`bo_color`[0m varchar[0m([32;1m32[0m) [37mdefault[0m [37mNULL[0m [37mAFTER[0m [35;1m`stats_date_to`[0m --- [37mINSERT[0m [37mINTO[0m [35;1m`PREFIX_cms_category_lang`[0m [37mVALUES[0m @@ -477,16 +475,12 @@ [37mALTER TABLE[0m [35;1m`PREFIX_customer`[0m [37mADD[0m - [35;1m`note`[0m text[0m -[37mAFTER[0m - [35;1m`secure_key`[0m + [35;1m`note`[0m text[0m [37mAFTER[0m [35;1m`secure_key`[0m --- [37mALTER TABLE[0m [35;1m`PREFIX_contact`[0m [37mADD[0m - [35;1m`customer_service`[0m tinyint[0m([32;1m1[0m) [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [32;1m0[0m -[37mAFTER[0m - [35;1m`email`[0m + [35;1m`customer_service`[0m tinyint[0m([32;1m1[0m) [37mNOT[0m [37mNULL[0m [37mDEFAULT[0m [32;1m0[0m [37mAFTER[0m [35;1m`email`[0m --- [37mINSERT[0m [37mINTO[0m [35;1m`PREFIX_specific_price`[0m ( [35;1m`id_product`[0m,[0m [35;1m`id_shop`[0m,[0m [35;1m`id_currency`[0m,[0m @@ -757,6 +751,16 @@ (SomeOtherColumn[0m =[0m [32;1m2[0m);[0m [31;1;7mWARNING: unclosed parentheses or section[0m --- +[37mALTER TABLE[0m + [35;1m`test_modify`[0m +[37mMODIFY[0m + [35;1m`id`[0m INT[0m([32;1m11[0m) [37mUNSIGNED[0m [37mNOT[0m [37mNULL[0m;[0m +--- +[37mALTER TABLE[0m + [35;1m`test_change`[0m +[37mCHANGE[0m + [35;1m`id`[0m [35;1m`_id`[0m BIGINT[0m([32;1m20[0m) [37mUNSIGNED[0m [37mNULL[0m;[0m +--- [37mSELECT[0m *[0m [37mLIMIT[0m diff --git a/tests/compress.html b/tests/compress.html old mode 100644 new mode 100755 index fc2f420..e414766 --- a/tests/compress.html +++ b/tests/compress.html @@ -66,6 +66,10 @@ --- SELECT Test FROM Test WHERE ( MyColumn = 1 )) AND ((( SomeOtherColumn = 2); --- +ALTER TABLE `test_modify` MODIFY `id` INT(11) UNSIGNED NOT NULL; +--- +ALTER TABLE `test_change` CHANGE `id` `_id` BIGINT(20) UNSIGNED NULL; +--- SELECT * LIMIT 1; SELECT a,b,c,d FROM e LIMIT 1, 2; SELECT 1,2,3 WHERE a in (1,2,3,4,5) and b=5; --- SELECT count - 50 WHERE a-50 = b WHERE 1 and - 50 WHERE -50 = a WHERE a = -50 WHERE 1 - 50 WHERE 1 and -50; diff --git a/tests/format-highlight.html b/tests/format-highlight.html old mode 100644 new mode 100755 index f852eb1..d305bf8 --- a/tests/format-highlight.html +++ b/tests/format-highlight.html @@ -454,9 +454,7 @@
ALTER TABLE `PREFIX_employee` ADD - `bo_color` varchar(32) default NULL -AFTER - `stats_date_to`+ `bo_color` varchar(32) default NULL AFTER `stats_date_to` ---
INSERT INTO `PREFIX_cms_category_lang` VALUES @@ -477,16 +475,12 @@---ALTER TABLE `PREFIX_customer` ADD - `note` text -AFTER - `secure_key`+ `note` text AFTER `secure_key`
ALTER TABLE `PREFIX_contact` ADD - `customer_service` tinyint(1) NOT NULL DEFAULT 0 -AFTER - `email`+ `customer_service` tinyint(1) NOT NULL DEFAULT 0 AFTER `email` ---
INSERT INTO `PREFIX_specific_price` ( `id_product`, `id_shop`, `id_currency`, @@ -757,6 +751,16 @@ (SomeOtherColumn = 2); WARNING: unclosed parentheses or section--- +
ALTER TABLE + `test_modify` +MODIFY + `id` INT(11) UNSIGNED NOT NULL;+--- +
ALTER TABLE + `test_change` +CHANGE + `id` `_id` BIGINT(20) UNSIGNED NULL;+---
SELECT * LIMIT diff --git a/tests/format.html b/tests/format.html old mode 100644 new mode 100755 index b466717..831a24c --- a/tests/format.html +++ b/tests/format.html @@ -454,9 +454,7 @@ ALTER TABLE `PREFIX_employee` ADD - `bo_color` varchar(32) default NULL -AFTER - `stats_date_to` + `bo_color` varchar(32) default NULL AFTER `stats_date_to` --- INSERT INTO `PREFIX_cms_category_lang` VALUES @@ -477,16 +475,12 @@ ALTER TABLE `PREFIX_customer` ADD - `note` text -AFTER - `secure_key` + `note` text AFTER `secure_key` --- ALTER TABLE `PREFIX_contact` ADD - `customer_service` tinyint(1) NOT NULL DEFAULT 0 -AFTER - `email` + `customer_service` tinyint(1) NOT NULL DEFAULT 0 AFTER `email` --- INSERT INTO `PREFIX_specific_price` ( `id_product`, `id_shop`, `id_currency`, @@ -755,6 +749,16 @@ ( (SomeOtherColumn = 2); WARNING: unclosed parentheses or section --- +ALTER TABLE + `test_modify` +MODIFY + `id` INT(11) UNSIGNED NOT NULL; +--- +ALTER TABLE + `test_change` +CHANGE + `id` `_id` BIGINT(20) UNSIGNED NULL; +--- SELECT * LIMIT diff --git a/tests/highlight.html b/tests/highlight.html old mode 100644 new mode 100755 index 473d349..9592c40 --- a/tests/highlight.html +++ b/tests/highlight.html @@ -245,6 +245,10 @@ ( MyColumn = 1 )) AND ((( SomeOtherColumn = 2);--- +
ALTER TABLE `test_modify` MODIFY `id` INT(11) UNSIGNED NOT NULL;+--- +
ALTER TABLE `test_change` CHANGE `id` `_id` BIGINT(20) UNSIGNED NULL;+---
SELECT * LIMIT 1; SELECT a,b,c,d FROM e LIMIT 1, 2; SELECT 1,2,3 WHERE a in (1,2,3,4,5) and b=5;---
SELECT count - 50 diff --git a/tests/sql.sql b/tests/sql.sql old mode 100644 new mode 100755 index 494add6..20f70f5 --- a/tests/sql.sql +++ b/tests/sql.sql @@ -245,6 +245,10 @@ SELECT Test FROM Test WHERE ( MyColumn = 1 )) AND ((( SomeOtherColumn = 2); --- +ALTER TABLE `test_modify` MODIFY `id` INT(11) UNSIGNED NOT NULL; +--- +ALTER TABLE `test_change` CHANGE `id` `_id` BIGINT(20) UNSIGNED NULL; +--- SELECT * LIMIT 1; SELECT a,b,c,d FROM e LIMIT 1, 2; SELECT 1,2,3 WHERE a in (1,2,3,4,5) and b=5; --- SELECT count - 50