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 @@ 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/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