Convert Excel column name correctly
[phpmyadmin/arisferyanto.git] / libraries / sqlparser.data.php
blob41bf096c797071574a87dcb77a0454928c0714d5
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * SQL Parser Matching Data
6 * Copyright 2002 Robin Johnson <robbat2@users.sourceforge.net>
7 * http://www.orbis-terrarum.net/?l=people.robbat2
9 * This data is used by the SQL Parser to recognize keywords
11 * It has been extracted from the lex.h file in the MySQL BK tree
12 * (around 4.0.2) as well as the MySQL documentation.
14 * Note: before adding a value in the arrays, ensure that you respect
15 * proper sorting, especially with underscores. And don't forget to
16 * update the _cnt variable at the end of each array.
17 * (It's slower to have PHP do the count).
19 * It's easier to use only uppercase for proper sorting. In case of
20 * doubt, use the DEBUG code after this function's definition.
22 * @version $Id$
23 * @package phpMyAdmin
25 if (! defined('PHPMYADMIN')) {
26 exit;
29 if (! isset($GLOBALS['sql_delimiter'])) {
30 $GLOBALS['sql_delimiter'] = ';';
33 /**
34 * @global array MySQL function names
36 $PMA_SQPdata_function_name = array (
37 'ABS',
38 'ACOS',
39 'ADDDATE',
40 'ADDTIME',
41 'AES_DECRYPT',
42 'AES_ENCRYPT',
43 'AREA', // Area() polygon-property-functions.html
44 'ASBINARY', // AsBinary()
45 'ASCII',
46 'ASIN',
47 'ASTEXT', // AsText()
48 'ATAN',
49 'ATAN2',
50 'AVG',
51 'BDMPOLYFROMTEXT', // BdMPolyFromText()
52 'BDMPOLYFROMWKB', // BdMPolyFromWKB()
53 'BDPOLYFROMTEXT', // BdPolyFromText()
54 'BDPOLYFROMWKB', // BdPolyFromWKB()
55 'BENCHMARK',
56 'BIN',
57 'BIT_AND',
58 'BIT_COUNT',
59 'BIT_LENGTH',
60 'BIT_OR',
61 'BIT_XOR', // group-by-functions.html
62 'BOUNDARY', // Boundary() general-geometry-property-functions.html
63 'BUFFER', // Buffer()
64 'CAST',
65 'CEIL',
66 'CEILING',
67 'CENTROID', // Centroid() multipolygon-property-functions.html
68 'CHAR', // string-functions.html
69 'CHARACTER_LENGTH',
70 'CHARSET', // information-functions.html
71 'CHAR_LENGTH',
72 'COALESCE',
73 'COERCIBILITY', // information-functions.html
74 'COLLATION', // information-functions.html
75 'COMPRESS', // string-functions.html
76 'CONCAT',
77 'CONCAT_WS',
78 'CONNECTION_ID',
79 'CONTAINS', // Contains()
80 'CONV',
81 'CONVERT',
82 'CONVERT_TZ',
83 'CONVEXHULL', // ConvexHull()
84 'COS',
85 'COT',
86 'COUNT',
87 'CRC32', // mathematical-functions.html
88 'CROSSES', // Crosses()
89 'CURDATE',
90 'CURRENT_DATE',
91 'CURRENT_TIME',
92 'CURRENT_TIMESTAMP',
93 'CURRENT_USER',
94 'CURTIME',
95 'DATABASE',
96 'DATE', // date-and-time-functions.html
97 'DATEDIFF', // date-and-time-functions.html
98 'DATE_ADD',
99 'DATE_DIFF',
100 'DATE_FORMAT',
101 'DATE_SUB',
102 'DAY',
103 'DAYNAME',
104 'DAYOFMONTH',
105 'DAYOFWEEK',
106 'DAYOFYEAR',
107 'DECODE',
108 'DEFAULT', // miscellaneous-functions.html
109 'DEGREES',
110 'DES_DECRYPT',
111 'DES_ENCRYPT',
112 'DIFFERENCE', // Difference()
113 'DIMENSION', // Dimension() general-geometry-property-functions.html
114 'DISJOINT', // Disjoint()
115 'DISTANCE', // Distance()
116 'ELT',
117 'ENCODE',
118 'ENCRYPT',
119 'ENDPOINT', // EndPoint() linestring-property-functions.html
120 'ENVELOPE', // Envelope() general-geometry-property-functions.html
121 'EQUALS', // Equals()
122 'EXP',
123 'EXPORT_SET',
124 'EXTERIORRING', // ExteriorRing() polygon-property-functions.html
125 'EXTRACT',
126 'EXTRACTVALUE', // ExtractValue() xml-functions.html
127 'FIELD',
128 'FIND_IN_SET',
129 'FLOOR',
130 'FORMAT',
131 'FOUND_ROWS',
132 'FROM_DAYS',
133 'FROM_UNIXTIME',
134 'GEOMCOLLFROMTEXT', // GeomCollFromText()
135 'GEOMCOLLFROMWKB', // GeomCollFromWKB()
136 'GEOMETRYCOLLECTION', // GeometryCollection()
137 'GEOMETRYCOLLECTIONFROMTEXT', // GeometryCollectionFromText()
138 'GEOMETRYCOLLECTIONFROMWKB', // GeometryCollectionFromWKB()
139 'GEOMETRYFROMTEXT', // GeometryFromText()
140 'GEOMETRYFROMWKB', // GeometryFromWKB()
141 'GEOMETRYN', // GeometryN() geometrycollection-property-functions.html
142 'GEOMETRYTYPE', // GeometryType() general-geometry-property-functions.html
143 'GEOMFROMTEXT', // GeomFromText()
144 'GEOMFROMWKB', // GeomFromWKB()
145 'GET_FORMAT',
146 'GET_LOCK',
147 'GLENGTH', // GLength() linestring-property-functions.html
148 'GREATEST',
149 'GROUP_CONCAT',
150 'GROUP_UNIQUE_USERS',
151 'HEX',
152 'HOUR',
153 'IF', //control-flow-functions.html
154 'IFNULL',
155 'INET_ATON',
156 'INET_NTOA',
157 'INSERT', // string-functions.html
158 'INSTR',
159 'INTERIORRINGN', // InteriorRingN() polygon-property-functions.html
160 'INTERSECTION', // Intersection()
161 'INTERSECTS', // Intersects()
162 'INTERVAL',
163 'ISCLOSED', // IsClosed() multilinestring-property-functions.html
164 'ISEMPTY', // IsEmpty() general-geometry-property-functions.html
165 'ISNULL',
166 'ISRING', // IsRing() linestring-property-functions.html
167 'ISSIMPLE', // IsSimple() general-geometry-property-functions.html
168 'IS_FREE_LOCK',
169 'IS_USED_LOCK', // miscellaneous-functions.html
170 'LAST_DAY',
171 'LAST_INSERT_ID',
172 'LCASE',
173 'LEAST',
174 'LEFT',
175 'LENGTH',
176 'LINEFROMTEXT', // LineFromText()
177 'LINEFROMWKB', // LineFromWKB()
178 'LINESTRING', // LineString()
179 'LINESTRINGFROMTEXT', // LineStringFromText()
180 'LINESTRINGFROMWKB', // LineStringFromWKB()
181 'LN',
182 'LOAD_FILE',
183 'LOCALTIME',
184 'LOCALTIMESTAMP',
185 'LOCATE',
186 'LOG',
187 'LOG10',
188 'LOG2',
189 'LOWER',
190 'LPAD',
191 'LTRIM',
192 'MAKEDATE',
193 'MAKETIME',
194 'MAKE_SET',
195 'MASTER_POS_WAIT',
196 'MAX',
197 'MBRCONTAINS', // MBRContains()
198 'MBRDISJOINT', // MBRDisjoint()
199 'MBREQUAL', // MBREqual()
200 'MBRINTERSECTS', // MBRIntersects()
201 'MBROVERLAPS', // MBROverlaps()
202 'MBRTOUCHES', // MBRTouches()
203 'MBRWITHIN', // MBRWithin()
204 'MD5',
205 'MICROSECOND',
206 'MID',
207 'MIN',
208 'MINUTE',
209 'MLINEFROMTEXT', // MLineFromText()
210 'MLINEFROMWKB', // MLineFromWKB()
211 'MOD',
212 'MONTH',
213 'MONTHNAME',
214 'NOW',
215 'MPOINTFROMTEXT', // MPointFromText()
216 'MPOINTFROMWKB', // MPointFromWKB()
217 'MPOLYFROMTEXT', // MPolyFromText()
218 'MPOLYFROMWKB', // MPolyFromWKB()
219 'MULTILINESTRING', // MultiLineString()
220 'MULTILINESTRINGFROMTEXT', // MultiLineStringFromText()
221 'MULTILINESTRINGFROMWKB', // MultiLineStringFromWKB()
222 'MULTIPOINT', // MultiPoint()
223 'MULTIPOINTFROMTEXT', // MultiPointFromText()
224 'MULTIPOINTFROMWKB', // MultiPointFromWKB()
225 'MULTIPOLYGON', // MultiPolygon()
226 'MULTIPOLYGONFROMTEXT', // MultiPolygonFromText()
227 'MULTIPOLYGONFROMWKB', // MultiPolygonFromWKB()
228 'NAME_CONST', // NAME_CONST()
229 'NOW', // NOW()
230 'NULLIF',
231 'NUMGEOMETRIES', // NumGeometries() geometrycollection-property-functions.html
232 'NUMINTERIORRINGS', // NumInteriorRings() polygon-property-functions.html
233 'NUMPOINTS', // NumPoints() linestring-property-functions.html
234 'OCT',
235 'OCTET_LENGTH',
236 'OLD_PASSWORD',
237 'ORD',
238 'OVERLAPS', // Overlaps()
239 'PASSWORD',
240 'PERIOD_ADD',
241 'PERIOD_DIFF',
242 'PI',
243 'POINT', // Point()
244 'POINTFROMTEXT', // PointFromText()
245 'POINTFROMWKB', // PointFromWKB()
246 'POINTN', // PointN() inestring-property-functions.html
247 'POINTONSURFACE', // PointOnSurface() multipolygon-property-functions.html
248 'POLYFROMTEXT', // PolyFromText()
249 'POLYFROMWKB', // PolyFromWKB()
250 'POLYGON', // Polygon()
251 'POLYGONFROMTEXT', // PolygonFromText()
252 'POLYGONFROMWKB', // PolygonFromWKB()
253 'POSITION',
254 'POW',
255 'POWER',
256 'QUARTER',
257 'QUOTE',
258 'RADIANS',
259 'RAND',
260 'RELATED', // Related()
261 'RELEASE_LOCK',
262 'REPEAT',
263 'REPLACE', // string-functions.html
264 'REVERSE',
265 'RIGHT',
266 'ROUND',
267 'ROW_COUNT', // information-functions.html
268 'RPAD',
269 'RTRIM',
270 'SCHEMA', // information-functions.html
271 'SECOND',
272 'SEC_TO_TIME',
273 'SESSION_USER',
274 'SHA',
275 'SHA1',
276 'SIGN',
277 'SIN',
278 'SLEEP', // miscellaneous-functions.html
279 'SOUNDEX',
280 'SPACE',
281 'SQRT',
282 'SRID', // general-geometry-property-functions.html
283 'STARTPOINT', // StartPoint() linestring-property-functions.html
284 'STD',
285 'STDDEV',
286 'STDDEV_POP', // group-by-functions.html
287 'STDDEV_SAMP', // group-by-functions.html
288 'STRCMP',
289 'STR_TO_DATE',
290 'SUBDATE',
291 'SUBSTR',
292 'SUBSTRING',
293 'SUBSTRING_INDEX',
294 'SUBTIME',
295 'SUM',
296 'SYMDIFFERENCE', // SymDifference()
297 'SYSDATE',
298 'SYSTEM_USER',
299 'TAN',
300 'TIME',
301 'TIMEDIFF',
302 'TIMESTAMP',
303 'TIMESTAMPADD',
304 'TIMESTAMPDIFF',
305 'TIME_FORMAT',
306 'TIME_TO_SEC',
307 'TOUCHES', // Touches()
308 'TO_DAYS',
309 'TRIM',
310 'TRUNCATE', // mathematical-functions.html
311 'UCASE',
312 'UNCOMPRESS', // string-functions.html
313 'UNCOMPRESSED_LENGTH', // string-functions.html
314 'UNHEX', // string-functions.html
315 'UNIQUE_USERS',
316 'UNIX_TIMESTAMP',
317 'UPDATEXML', // UpdateXML() xml-functions.html
318 'UPPER',
319 'USER',
320 'UTC_DATE',
321 'UTC_TIME',
322 'UTC_TIMESTAMP',
323 'UUID', // miscellaneous-functions.html
324 'VARIANCE', // group-by-functions.html
325 'VAR_POP', // group-by-functions.html
326 'VAR_SAMP', // group-by-functions.html
327 'VERSION',
328 'WEEK',
329 'WEEKDAY',
330 'WEEKOFYEAR',
331 'WITHIN', // Within()
332 'X', // point-property-functions.html
333 'Y', // point-property-functions.html
334 'YEAR',
335 'YEARWEEK'
338 * $PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name);
340 * @global integer MySQL attributes count
342 $PMA_SQPdata_function_name_cnt = 299;
345 * DEBUG
346 $test_PMA_SQPdata_function_name = $PMA_SQPdata_function_name;
347 sort($PMA_SQPdata_function_name);
348 if ($PMA_SQPdata_function_name != $test_PMA_SQPdata_function_name) {
349 echo 'sort properly like this<pre>';
350 print_r($PMA_SQPdata_function_name);
351 echo '</pre>';
356 * @global array MySQL attributes
358 $PMA_SQPdata_column_attrib = array (
359 'ARCHIVE', // Engine
360 'ASCII',
361 'AUTO_INCREMENT',
362 'BDB', // Engine
363 'BERKELEYDB', // Engine alias BDB
364 'BINARY',
365 'BLACKHOLE', // Engine
366 'CSV', // Engine
367 'DEFAULT',
368 'EXAMPLE', // Engine
369 'FEDERATED', // Engine
370 'HEAP', // Engine
371 'INNOBASE', // Engine alias InnoDB
372 'INNODB', // Engine InnoDB
373 'ISAM', // Engine
374 'MARIA', // Engine
375 'MEMORY', // Engine alias HEAP, but preferred
376 'MERGE', // Engine
377 'MRG_ISAM', // Engine
378 'MRG_MYISAM', // Engine alias MERGE
379 'MYISAM', // Engine MyISAM
380 'NATIONAL',
381 'NDB', // Engine alias NDBCLUSTER
382 'NDBCLUSTER', // Engine
383 'PRECISION',
384 'UNDEFINED',
385 'UNICODE',
386 'UNSIGNED',
387 'VARYING',
388 'ZEROFILL'
391 * $PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib);
393 * @global integer MySQL attributes count
395 $PMA_SQPdata_column_attrib_cnt = 30;
398 * words that are reserved by MySQL and may not be used as identifiers without quotes
400 * @see http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
402 * @global array MySQL reserved words
404 $PMA_SQPdata_reserved_word = array (
405 'ACCESSIBLE', // 5.1
406 'ACTION',
407 'ADD',
408 'AFTER',
409 'AGAINST',
410 'AGGREGATE',
411 'ALGORITHM',
412 'ALL',
413 'ALTER',
414 'ANALYSE',
415 'ANALYZE',
416 'AND',
417 'AS',
418 'ASC',
419 'AUTOCOMMIT',
420 'AUTO_INCREMENT',
421 'AVG_ROW_LENGTH',
422 'BACKUP',
423 'BEGIN',
424 'BETWEEN',
425 'BINLOG',
426 'BOTH',
427 'BY',
428 'CASCADE',
429 'CASE',
430 'CHANGE',
431 'CHANGED',
432 'CHARSET',
433 'CHECK',
434 'CHECKSUM',
435 'COLLATE',
436 'COLLATION',
437 'COLUMN',
438 'COLUMNS',
439 'COMMENT',
440 'COMMIT',
441 'COMMITTED',
442 'COMPRESSED',
443 'CONCURRENT',
444 'CONSTRAINT',
445 'CONTAINS',
446 'CONVERT',
447 'CREATE',
448 'CROSS',
449 'CURRENT_TIMESTAMP',
450 'DATABASE',
451 'DATABASES',
452 'DAY',
453 'DAY_HOUR',
454 'DAY_MINUTE',
455 'DAY_SECOND',
456 'DEFINER',
457 'DELAYED',
458 'DELAY_KEY_WRITE',
459 'DELETE',
460 'DESC',
461 'DESCRIBE',
462 'DETERMINISTIC',
463 'DISTINCT',
464 'DISTINCTROW',
465 'DIV',
466 'DO',
467 'DROP',
468 'DUMPFILE',
469 'DUPLICATE',
470 'DYNAMIC',
471 'ELSE',
472 'ENCLOSED',
473 'END',
474 'ENGINE',
475 'ENGINES',
476 'ESCAPE',
477 'ESCAPED',
478 'EVENTS',
479 'EXECUTE',
480 'EXISTS',
481 'EXPLAIN',
482 'EXTENDED',
483 'FAST',
484 'FIELDS',
485 'FILE',
486 'FIRST',
487 'FIXED',
488 'FLUSH',
489 'FOR',
490 'FORCE',
491 'FOREIGN',
492 'FROM',
493 'FULL',
494 'FULLTEXT',
495 'FUNCTION',
496 'GEMINI',
497 'GEMINI_SPIN_RETRIES',
498 'GLOBAL',
499 'GRANT',
500 'GRANTS',
501 'GROUP',
502 'HAVING',
503 'HEAP',
504 'HIGH_PRIORITY',
505 'HOSTS',
506 'HOUR',
507 'HOUR_MINUTE',
508 'HOUR_SECOND',
509 'IDENTIFIED',
510 'IF',
511 'IGNORE',
512 'IN',
513 'INDEX',
514 'INDEXES',
515 'INFILE',
516 'INNER',
517 'INSERT',
518 'INSERT_ID',
519 'INSERT_METHOD',
520 'INTERVAL',
521 'INTO',
522 'INVOKER',
523 'IS',
524 'ISOLATION',
525 'JOIN',
526 'KEY',
527 'KEYS',
528 'KILL',
529 'LAST_INSERT_ID',
530 'LEADING',
531 'LEFT',
532 'LEVEL',
533 'LIKE',
534 'LIMIT',
535 'LINEAR', // 5.1
536 'LINES',
537 'LOAD',
538 'LOCAL',
539 'LOCK',
540 'LOCKS',
541 'LOGS',
542 'LOW_PRIORITY',
543 'MARIA', // 5.1 ?
544 'MASTER',
545 'MASTER_CONNECT_RETRY',
546 'MASTER_HOST',
547 'MASTER_LOG_FILE',
548 'MASTER_LOG_POS',
549 'MASTER_PASSWORD',
550 'MASTER_PORT',
551 'MASTER_USER',
552 'MATCH',
553 'MAX_CONNECTIONS_PER_HOUR',
554 'MAX_QUERIES_PER_HOUR',
555 'MAX_ROWS',
556 'MAX_UPDATES_PER_HOUR',
557 'MAX_USER_CONNECTIONS',
558 'MEDIUM',
559 'MERGE',
560 'MINUTE',
561 'MINUTE_SECOND',
562 'MIN_ROWS',
563 'MODE',
564 'MODIFY',
565 'MONTH',
566 'MRG_MYISAM',
567 'MYISAM',
568 'NAMES',
569 'NATURAL',
570 // 'NO' is not allowed in SQL-99 but is allowed in MySQL
571 //'NO',
572 'NOT',
573 'NULL',
574 'OFFSET',
575 'ON',
576 'OPEN',
577 'OPTIMIZE',
578 'OPTION',
579 'OPTIONALLY',
580 'OR',
581 'ORDER',
582 'OUTER',
583 'OUTFILE',
584 'PACK_KEYS',
585 'PAGE', // 5.1-maria ?
586 'PARTIAL',
587 'PARTITION', // 5.1
588 'PARTITIONS', // 5.1
589 'PASSWORD',
590 'PRIMARY',
591 'PRIVILEGES',
592 'PROCEDURE',
593 'PROCESS',
594 'PROCESSLIST',
595 'PURGE',
596 'QUICK',
597 'RAID0',
598 'RAID_CHUNKS',
599 'RAID_CHUNKSIZE',
600 'RAID_TYPE',
601 'RANGE', // 5.1
602 'READ',
603 'READ_ONLY', // 5.1
604 'READ_WRITE', // 5.1
605 'REFERENCES',
606 'REGEXP',
607 'RELOAD',
608 'RENAME',
609 'REPAIR',
610 'REPEATABLE',
611 'REPLACE',
612 'REPLICATION',
613 'RESET',
614 'RESTORE',
615 'RESTRICT',
616 'RETURN',
617 'RETURNS',
618 'REVOKE',
619 'RIGHT',
620 'RLIKE',
621 'ROLLBACK',
622 'ROW',
623 'ROWS',
624 'ROW_FORMAT',
625 'SECOND',
626 'SECURITY',
627 'SELECT',
628 'SEPARATOR',
629 'SERIALIZABLE',
630 'SESSION',
631 'SHARE',
632 'SHOW',
633 'SHUTDOWN',
634 'SLAVE',
635 'SONAME',
636 'SOUNDS', // string-functions.html
637 'SQL',
638 'SQL_AUTO_IS_NULL',
639 'SQL_BIG_RESULT',
640 'SQL_BIG_SELECTS',
641 'SQL_BIG_TABLES',
642 'SQL_BUFFER_RESULT',
643 'SQL_CACHE',
644 'SQL_CALC_FOUND_ROWS',
645 'SQL_LOG_BIN',
646 'SQL_LOG_OFF',
647 'SQL_LOG_UPDATE',
648 'SQL_LOW_PRIORITY_UPDATES',
649 'SQL_MAX_JOIN_SIZE',
650 'SQL_NO_CACHE',
651 'SQL_QUOTE_SHOW_CREATE',
652 'SQL_SAFE_UPDATES',
653 'SQL_SELECT_LIMIT',
654 'SQL_SLAVE_SKIP_COUNTER',
655 'SQL_SMALL_RESULT',
656 'SQL_WARNINGS',
657 'START',
658 'STARTING',
659 'STATUS',
660 'STOP',
661 'STORAGE',
662 'STRAIGHT_JOIN',
663 'STRING',
664 'STRIPED',
665 'SUPER',
666 'TABLE',
667 'TABLES',
668 'TEMPORARY',
669 'TERMINATED',
670 'THEN',
671 'TO',
672 'TRAILING',
673 'TRANSACTIONAL', // 5.1 ?
674 'TRUNCATE',
675 'TYPE',
676 'TYPES',
677 'UNCOMMITTED',
678 'UNION',
679 'UNIQUE',
680 'UNLOCK',
681 'UPDATE',
682 'USAGE',
683 'USE',
684 'USING',
685 'VALUES',
686 'VARIABLES',
687 'VIEW',
688 'WHEN',
689 'WHERE',
690 'WITH',
691 'WORK',
692 'WRITE',
693 'XOR',
694 'YEAR_MONTH'
697 * $PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
699 * @global integer MySQL reserved words count
701 $PMA_SQPdata_reserved_word_cnt = 288;
703 * The previous array must be sorted so that the binary search work.
704 * Sometimes a word is not added in the correct order, so
705 * this debugging code shows the problem. The same should be
706 * done for all arrays.
709 $original = $PMA_SQPdata_reserved_word;
710 sort($PMA_SQPdata_reserved_word);
711 $difference = array_diff_assoc($original, $PMA_SQPdata_reserved_word);
712 echo '<pre>';
713 print_r($difference);
714 echo '</pre>';
715 echo '<pre>';
716 print_r($PMA_SQPdata_reserved_word);
717 echo '</pre>';
721 * words forbidden to be used as column or table name wihtout quotes
722 * as seen in http://dev.mysql.com/doc/mysql/en/reserved-words.html
724 * @global array MySQL forbidden words
726 $PMA_SQPdata_forbidden_word = array (
727 'ACCESSIBLE', // 5.1
728 'ACTION',
729 'ADD',
730 'AFTER',
731 'AGAINST',
732 'AGGREGATE',
733 'ALGORITHM',
734 'ALL',
735 'ALTER',
736 'ANALYZE',
737 'AND',
738 'ANY',
739 'AS',
740 'ASC',
741 'ASCII',
742 'ASENSITIVE',
743 'AUTO_INCREMENT',
744 'AVG',
745 'AVG_ROW_LENGTH',
746 'BACKUP',
747 'BDB',
748 'BEFORE',
749 'BEGIN',
750 'BERKELEYDB',
751 'BETWEEN',
752 'BIGINT',
753 'BINARY',
754 'BINLOG',
755 'BIT',
756 'BLOB',
757 'BOOL',
758 'BOOLEAN',
759 'BOTH',
760 'BTREE',
761 'BY',
762 'BYTE',
763 'CACHE',
764 'CALL',
765 'CASCADE',
766 'CASCADED',
767 'CASE',
768 'CHAIN',
769 'CHANGE',
770 'CHANGED',
771 'CHAR',
772 'CHARACTER',
773 'CHARSET',
774 'CHECK',
775 'CHECKSUM',
776 'CIPHER',
777 'CLOSE',
778 'COLLATE',
779 'COLLATION',
780 'COLUMN',
781 'COLUMNS',
782 'COMMENT',
783 'COMMIT',
784 'COMMITTED',
785 'COMPACT',
786 'COMPRESSED',
787 'CONCURRENT',
788 'CONDITION',
789 'CONNECTION',
790 'CONSISTENT',
791 'CONSTRAINT',
792 'CONTAINS',
793 'CONTINUE',
794 'CONVERT',
795 'CREATE',
796 'CROSS',
797 'CUBE',
798 'CURRENT_DATE',
799 'CURRENT_TIME',
800 'CURRENT_TIMESTAMP',
801 'CURRENT_USER',
802 'CURSOR',
803 'DATA',
804 'DATABASE',
805 'DATABASES',
806 'DATE',
807 'DATETIME',
808 'DAY',
809 'DAY_HOUR',
810 'DAY_MICROSECOND',
811 'DAY_MINUTE',
812 'DAY_SECOND',
813 'DEALLOCATE',
814 'DEC',
815 'DECIMAL',
816 'DECLARE',
817 'DEFAULT',
818 'DEFINER',
819 'DELAYED',
820 'DELAY_KEY_WRITE',
821 'DELETE',
822 'DESC',
823 'DESCRIBE',
824 'DES_KEY_FILE',
825 'DETERMINISTIC',
826 'DIRECTORY',
827 'DISABLE',
828 'DISCARD',
829 'DISTINCT',
830 'DISTINCTROW',
831 'DIV',
832 'DO',
833 'DOUBLE',
834 'DROP',
835 'DUAL',
836 'DUMPFILE',
837 'DUPLICATE',
838 'DYNAMIC',
839 'EACH',
840 'ELSE',
841 'ELSEIF',
842 'ENABLE',
843 'ENCLOSED',
844 'END',
845 'ENGINE',
846 'ENGINES',
847 'ENUM',
848 'ERRORS',
849 'ESCAPE',
850 'ESCAPED',
851 'EVENTS',
852 'EXECUTE',
853 'EXISTS',
854 'EXIT',
855 'EXPANSION',
856 'EXPLAIN',
857 'EXTENDED',
858 'FALSE',
859 'FAST',
860 'FETCH',
861 'FIELDS',
862 'FILE',
863 'FIRST',
864 'FIXED',
865 'FLOAT',
866 'FLOAT4',
867 'FLOAT8',
868 'FLUSH',
869 'FOR',
870 'FORCE',
871 'FOREIGN',
872 'FOUND',
873 'FRAC_SECOND',
874 'FROM',
875 'FULL',
876 'FULLTEXT',
877 'FUNCTION',
878 'GEOMETRY',
879 'GEOMETRYCOLLECTION',
880 'GET_FORMAT',
881 'GLOBAL',
882 'GOTO',
883 'GRANT',
884 'GRANTS',
885 'GROUP',
886 'HANDLER',
887 'HASH',
888 'HAVING',
889 'HELP',
890 'HIGH_PRIORITY',
891 'HOSTS',
892 'HOUR',
893 'HOUR_MICROSECOND',
894 'HOUR_MINUTE',
895 'HOUR_SECOND',
896 'IDENTIFIED',
897 'IF',
898 'IGNORE',
899 'IMPORT',
900 'IN',
901 'INDEX',
902 'INDEXES',
903 'INFILE',
904 'INNER',
905 'INNOBASE',
906 'INNODB',
907 'INOUT',
908 'INSENSITIVE',
909 'INSERT',
910 'INSERT_METHOD',
911 'INT',
912 'INT1',
913 'INT2',
914 'INT3',
915 'INT4',
916 'INT8',
917 'INTEGER',
918 'INTERVAL',
919 'INTO',
920 'INVOKER',
921 'IO_THREAD',
922 'IS',
923 'ISOLATION',
924 'ISSUER',
925 'ITERATE',
926 'JOIN',
927 'KEY',
928 'KEYS',
929 'KILL',
930 'LABEL',
931 'LANGUAGE',
932 'LAST',
933 'LEADING',
934 'LEAVE',
935 'LEAVES',
936 'LEFT',
937 'LEVEL',
938 'LIKE',
939 'LIMIT',
940 'LINEAR', // 5.1
941 'LINES',
942 'LINESTRING',
943 'LOAD',
944 'LOCAL',
945 'LOCALTIME',
946 'LOCALTIMESTAMP',
947 'LOCK',
948 'LOCKS',
949 'LOGS',
950 'LONG',
951 'LONGBLOB',
952 'LONGTEXT',
953 'LOOP',
954 'LOW_PRIORITY',
955 'MASTER',
956 'MASTER_CONNECT_RETRY',
957 'MASTER_HOST',
958 'MASTER_LOG_FILE',
959 'MASTER_LOG_POS',
960 'MASTER_PASSWORD',
961 'MASTER_PORT',
962 'MASTER_SERVER_ID',
963 'MASTER_SSL',
964 'MASTER_SSL_CA',
965 'MASTER_SSL_CAPATH',
966 'MASTER_SSL_CERT',
967 'MASTER_SSL_CIPHER',
968 'MASTER_SSL_KEY',
969 'MASTER_USER',
970 'MATCH',
971 'MAX_CONNECTIONS_PER_HOUR',
972 'MAX_QUERIES_PER_HOUR',
973 'MAX_ROWS',
974 'MAX_UPDATES_PER_HOUR',
975 'MAX_USER_CONNECTIONS',
976 'MEDIUM',
977 'MEDIUMBLOB',
978 'MEDIUMINT',
979 'MEDIUMTEXT',
980 'MERGE',
981 'MICROSECOND',
982 'MIDDLEINT',
983 'MIGRATE',
984 'MINUTE',
985 'MINUTE_MICROSECOND',
986 'MINUTE_SECOND',
987 'MIN_ROWS',
988 'MOD',
989 'MODE',
990 'MODIFIES',
991 'MODIFY',
992 'MONTH',
993 'MULTILINESTRING',
994 'MULTIPOINT',
995 'MULTIPOLYGON',
996 'MUTEX',
997 'NAME',
998 'NAMES',
999 'NATIONAL',
1000 'NATURAL',
1001 'NCHAR',
1002 'NDB',
1003 'NDBCLUSTER',
1004 'NEW',
1005 'NEXT',
1006 'NO',
1007 'NONE',
1008 'NOT',
1009 'NO_WRITE_TO_BINLOG',
1010 'NULL',
1011 'NUMERIC',
1012 'NVARCHAR',
1013 'OFFSET',
1014 'OLD_PASSWORD',
1015 'ON',
1016 'ONE',
1017 'ONE_SHOT',
1018 'OPEN',
1019 'OPTIMIZE',
1020 'OPTION',
1021 'OPTIONALLY',
1022 'OR',
1023 'ORDER',
1024 'OUT',
1025 'OUTER',
1026 'OUTFILE',
1027 'PACK_KEYS',
1028 'PARTIAL',
1029 'PASSWORD',
1030 'PHASE',
1031 'POINT',
1032 'POLYGON',
1033 'PRECISION',
1034 'PREPARE',
1035 'PREV',
1036 'PRIMARY',
1037 'PRIVILEGES',
1038 'PROCEDURE',
1039 'PROCESSLIST',
1040 'PURGE',
1041 'QUARTER',
1042 'QUERY',
1043 'QUICK',
1044 'RAID0',
1045 'RAID_CHUNKS',
1046 'RAID_CHUNKSIZE',
1047 'RAID_TYPE',
1048 'RANGE', // 5.1
1049 'READ',
1050 'READ_ONLY', // 5.1
1051 'READ_WRITE', // 5.1
1052 'READS',
1053 'REAL',
1054 'RECOVER',
1055 'REDUNDANT',
1056 'REFERENCES',
1057 'REGEXP',
1058 'RELAY_LOG_FILE',
1059 'RELAY_LOG_POS',
1060 'RELAY_THREAD',
1061 'RELEASE',
1062 'RELOAD',
1063 'RENAME',
1064 'REPAIR',
1065 'REPEAT',
1066 'REPEATABLE',
1067 'REPLACE',
1068 'REPLICATION',
1069 'REQUIRE',
1070 'RESET',
1071 'RESTORE',
1072 'RESTRICT',
1073 'RESUME',
1074 'RETURN',
1075 'RETURNS',
1076 'REVOKE',
1077 'RIGHT',
1078 'RLIKE',
1079 'ROLLBACK',
1080 'ROLLUP',
1081 'ROUTINE',
1082 'ROW',
1083 'ROWS',
1084 'ROW_FORMAT',
1085 'RTREE',
1086 'SAVEPOINT',
1087 'SCHEMA',
1088 'SCHEMAS',
1089 'SECOND',
1090 'SECOND_MICROSECOND',
1091 'SECURITY',
1092 'SELECT',
1093 'SENSITIVE',
1094 'SEPARATOR',
1095 'SERIAL',
1096 'SERIALIZABLE',
1097 'SESSION',
1098 'SET',
1099 'SHARE',
1100 'SHOW',
1101 'SHUTDOWN',
1102 'SIGNED',
1103 'SIMPLE',
1104 'SLAVE',
1105 'SMALLINT',
1106 'SNAPSHOT',
1107 'SOME',
1108 'SONAME',
1109 'SOUNDS',
1110 'SPATIAL',
1111 'SPECIFIC',
1112 'SQL',
1113 'SQLEXCEPTION',
1114 'SQLSTATE',
1115 'SQLWARNING',
1116 'SQL_BIG_RESULT',
1117 'SQL_BUFFER_RESULT',
1118 'SQL_CACHE',
1119 'SQL_CALC_FOUND_ROWS',
1120 'SQL_NO_CACHE',
1121 'SQL_SMALL_RESULT',
1122 'SQL_THREAD',
1123 'SQL_TSI_DAY',
1124 'SQL_TSI_FRAC_SECOND',
1125 'SQL_TSI_HOUR',
1126 'SQL_TSI_MINUTE',
1127 'SQL_TSI_MONTH',
1128 'SQL_TSI_QUARTER',
1129 'SQL_TSI_SECOND',
1130 'SQL_TSI_WEEK',
1131 'SQL_TSI_YEAR',
1132 'SSL',
1133 'START',
1134 'STARTING',
1135 'STATUS',
1136 'STOP',
1137 'STORAGE',
1138 'STRAIGHT_JOIN',
1139 'STRING',
1140 'STRIPED',
1141 'SUBJECT',
1142 'SUPER',
1143 'SUSPEND',
1144 'TABLE',
1145 'TABLES',
1146 'TABLESPACE',
1147 'TEMPORARY',
1148 'TEMPTABLE',
1149 'TERMINATED',
1150 'TEXT',
1151 'THEN',
1152 'TIME',
1153 'TIMESTAMP',
1154 'TIMESTAMPADD',
1155 'TIMESTAMPDIFF',
1156 'TINYBLOB',
1157 'TINYINT',
1158 'TINYTEXT',
1159 'TO',
1160 'TRAILING',
1161 'TRANSACTION',
1162 'TRIGGER',
1163 'TRIGGERS',
1164 'TRUE',
1165 'TRUNCATE',
1166 'TYPE',
1167 'TYPES',
1168 'UNCOMMITTED',
1169 'UNDEFINED',
1170 'UNDO',
1171 'UNICODE',
1172 'UNION',
1173 'UNIQUE',
1174 'UNKNOWN',
1175 'UNLOCK',
1176 'UNSIGNED',
1177 'UNTIL',
1178 'UPDATE',
1179 'USAGE',
1180 'USE',
1181 'USER',
1182 'USER_RESOURCES',
1183 'USE_FRM',
1184 'USING',
1185 'UTC_DATE',
1186 'UTC_TIME',
1187 'UTC_TIMESTAMP',
1188 'VALUE',
1189 'VALUES',
1190 'VARBINARY',
1191 'VARCHAR',
1192 'VARCHARACTER',
1193 'VARIABLES',
1194 'VARYING',
1195 'VIEW',
1196 'WARNINGS',
1197 'WEEK',
1198 'WHEN',
1199 'WHERE',
1200 'WHILE',
1201 'WITH',
1202 'WORK',
1203 'WRITE',
1204 'X509',
1205 'XA',
1206 'XOR',
1207 'YEAR',
1208 'YEAR_MONTH',
1209 'ZEROFILL'
1212 * count($PMA_SQPdata_forbidden_word);
1214 * @global integer MySQL forbidden words count
1216 $PMA_SQPdata_forbidden_word_cnt = 483;
1219 * the MySQL column/data types
1221 * @see http://dev.mysql.com/doc/refman/5.1/en/data-types.html
1222 * @see http://dev.mysql.com/doc/refman/5.1/en/mysql-spatial-datatypes.html
1224 * @global array MySQL column types
1226 $PMA_SQPdata_column_type = array (
1227 'BIGINT',
1228 'BINARY',
1229 'BIT',
1230 'BLOB',
1231 'BOOL',
1232 'BOOLEAN', // numeric-type-overview.html
1233 'CHAR',
1234 'CHARACTER',
1235 'DATE',
1236 'DATETIME',
1237 'DEC',
1238 'DECIMAL',
1239 'DOUBLE',
1240 'ENUM',
1241 'FLOAT',
1242 'FLOAT4',
1243 'FLOAT8',
1244 'GEOMETRY', // spatial
1245 'GEOMETRYCOLLECTION', // spatial
1246 'INT',
1247 'INT1',
1248 'INT2',
1249 'INT3',
1250 'INT4',
1251 'INT8',
1252 'INTEGER',
1253 'LINESTRING', // spatial
1254 'LONG',
1255 'LONGBLOB',
1256 'LONGTEXT',
1257 'MEDIUMBLOB',
1258 'MEDIUMINT',
1259 'MEDIUMTEXT',
1260 'MIDDLEINT',
1261 'MULTILINESTRING', // spatial
1262 'MULTIPOINT', // spatial
1263 'MULTIPOLYGON', // spatial
1264 'NCHAR',
1265 'NUMERIC',
1266 'POINT', // spatial
1267 'POLYGON', // spatial
1268 'REAL',
1269 'SERIAL', // alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
1270 'SET',
1271 'SMALLINT',
1272 'TEXT',
1273 'TIME',
1274 'TIMESTAMP',
1275 'TINYBLOB',
1276 'TINYINT',
1277 'TINYTEXT',
1278 'VARBINARY',
1279 'VARCHAR',
1280 'YEAR'
1283 * $PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
1285 * @global integer MySQL column types count
1287 $PMA_SQPdata_column_type_cnt = 54;
1290 * check counts
1291 foreach ($GLOBALS as $n => $a) {
1292 echo is_array($a) ? $n . ': ' . count($a) . '<br />' : '';