@@ -35,7 +35,7 @@ public static function fixColumnComments($theSourceCode)
3535 {
3636 if (isset ($ table_name ))
3737 {
38- if (preg_match ('/^ `( \w+)` / ' , $ source_lines [$ i ], $ matches ))
38+ if (preg_match ('/^ (`? \w+`?) / ' , $ source_lines [$ i ], $ matches ))
3939 {
4040 $ map [$ table_name ][$ matches [1 ]] = $ i ;
4141 }
@@ -45,7 +45,7 @@ public static function fixColumnComments($theSourceCode)
4545 }
4646 }
4747
48- if ($ table_name ===null && preg_match ('/^CREATE TABLE `( \w+)` / ' , $ line , $ matches ))
48+ if ($ table_name ===null && preg_match ('/^CREATE TABLE (`? \w+`?) / ' , $ line , $ matches ))
4949 {
5050 $ table_name = $ matches [1 ];
5151 }
@@ -55,7 +55,7 @@ public static function fixColumnComments($theSourceCode)
5555 $ comments = [];
5656 foreach ($ source_lines as $ i => $ line )
5757 {
58- if (preg_match ('/^COMMENT ON COLUMN `( \w+)`.`( \w+)` / ' , $ line , $ matches ))
58+ if (preg_match ('/^COMMENT ON COLUMN (`? \w+`?).(`? \w+`?) / ' , $ line , $ matches ))
5959 {
6060 $ comments [$ matches [1 ]][$ matches [2 ]] = trim ($ source_lines [$ i + 1 ]);
6161 }
@@ -117,7 +117,7 @@ public static function fixIndexComments($theSourceCode)
117117 $ index_name = null ;
118118 foreach ($ source_lines as $ i => $ line )
119119 {
120- if (preg_match ('/^CREATE INDEX `( \w+)` (\s*\()?/ ' , $ line , $ matches ))
120+ if (preg_match ('/^CREATE INDEX (`? \w+`?) (\s*\()?/ ' , $ line , $ matches ))
121121 {
122122 $ map [$ matches [1 ]] = $ i ;
123123 }
@@ -127,7 +127,7 @@ public static function fixIndexComments($theSourceCode)
127127 $ comments = [];
128128 foreach ($ source_lines as $ i => $ line )
129129 {
130- if (preg_match ('/^COMMENT ON INDEX `( \w+)` / ' , $ line , $ matches ))
130+ if (preg_match ('/^COMMENT ON INDEX (`? \w+`?) / ' , $ line , $ matches ))
131131 {
132132 $ comments [$ matches [1 ]] = trim ($ source_lines [$ i + 1 ]);
133133 }
@@ -195,7 +195,7 @@ public static function fixTableComments($theSourceCode)
195195 }
196196 }
197197
198- if ($ table_name ===null && preg_match ('/^CREATE TABLE `( \w+)` (\s*\()?/ ' , $ line , $ matches ))
198+ if ($ table_name ===null && preg_match ('/^CREATE TABLE (`? \w+`?) (\s*\()?/ ' , $ line , $ matches ))
199199 {
200200 $ table_name = $ matches [1 ];
201201 if ($ matches [2 ]) $ level = 1 ;
@@ -206,7 +206,7 @@ public static function fixTableComments($theSourceCode)
206206 $ comments = [];
207207 foreach ($ source_lines as $ i => $ line )
208208 {
209- if (preg_match ('/^COMMENT ON TABLE `( \w+)` / ' , $ line , $ matches ))
209+ if (preg_match ('/^COMMENT ON TABLE (`? \w+`?) / ' , $ line , $ matches ))
210210 {
211211 $ comments [$ matches [1 ]] = trim ($ source_lines [$ i + 1 ]);
212212 }
0 commit comments