3.2.5
[phpmyadmin/dkf.git] / libraries / sqlparser.data.php
blob7b29453d91b8480aa0126b921395388d9dd83031
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 'DATA',
451 'DATABASE',
452 'DATABASES',
453 'DAY',
454 'DAY_HOUR',
455 'DAY_MINUTE',
456 'DAY_SECOND',
457 'DEFINER',
458 'DELAYED',
459 'DELAY_KEY_WRITE',
460 'DELETE',
461 'DESC',
462 'DESCRIBE',
463 'DETERMINISTIC',
464 'DISTINCT',
465 'DISTINCTROW',
466 'DIV',
467 'DO',
468 'DROP',
469 'DUMPFILE',
470 'DUPLICATE',
471 'DYNAMIC',
472 'ELSE',
473 'ENCLOSED',
474 'END',
475 'ENGINE',
476 'ENGINES',
477 'ESCAPE',
478 'ESCAPED',
479 'EVENTS',
480 'EXECUTE',
481 'EXISTS',
482 'EXPLAIN',
483 'EXTENDED',
484 'FAST',
485 'FIELDS',
486 'FILE',
487 'FIRST',
488 'FIXED',
489 'FLUSH',
490 'FOR',
491 'FORCE',
492 'FOREIGN',
493 'FROM',
494 'FULL',
495 'FULLTEXT',
496 'FUNCTION',
497 'GEMINI',
498 'GEMINI_SPIN_RETRIES',
499 'GLOBAL',
500 'GRANT',
501 'GRANTS',
502 'GROUP',
503 'HAVING',
504 'HEAP',
505 'HIGH_PRIORITY',
506 'HOSTS',
507 'HOUR',
508 'HOUR_MINUTE',
509 'HOUR_SECOND',
510 'IDENTIFIED',
511 'IF',
512 'IGNORE',
513 'IN',
514 'INDEX',
515 'INDEXES',
516 'INFILE',
517 'INNER',
518 'INSERT',
519 'INSERT_ID',
520 'INSERT_METHOD',
521 'INTERVAL',
522 'INTO',
523 'INVOKER',
524 'IS',
525 'ISOLATION',
526 'JOIN',
527 'KEY',
528 'KEYS',
529 'KILL',
530 'LAST_INSERT_ID',
531 'LEADING',
532 'LEFT',
533 'LEVEL',
534 'LIKE',
535 'LIMIT',
536 'LINEAR', // 5.1
537 'LINES',
538 'LOAD',
539 'LOCAL',
540 'LOCK',
541 'LOCKS',
542 'LOGS',
543 'LOW_PRIORITY',
544 'MARIA', // 5.1 ?
545 'MASTER',
546 'MASTER_CONNECT_RETRY',
547 'MASTER_HOST',
548 'MASTER_LOG_FILE',
549 'MASTER_LOG_POS',
550 'MASTER_PASSWORD',
551 'MASTER_PORT',
552 'MASTER_USER',
553 'MATCH',
554 'MAX_CONNECTIONS_PER_HOUR',
555 'MAX_QUERIES_PER_HOUR',
556 'MAX_ROWS',
557 'MAX_UPDATES_PER_HOUR',
558 'MAX_USER_CONNECTIONS',
559 'MEDIUM',
560 'MERGE',
561 'MINUTE',
562 'MINUTE_SECOND',
563 'MIN_ROWS',
564 'MODE',
565 'MODIFY',
566 'MONTH',
567 'MRG_MYISAM',
568 'MYISAM',
569 'NAMES',
570 'NATURAL',
571 // 'NO' is not allowed in SQL-99 but is allowed in MySQL
572 //'NO',
573 'NOT',
574 'NULL',
575 'OFFSET',
576 'ON',
577 'OPEN',
578 'OPTIMIZE',
579 'OPTION',
580 'OPTIONALLY',
581 'OR',
582 'ORDER',
583 'OUTER',
584 'OUTFILE',
585 'PACK_KEYS',
586 'PAGE', // 5.1-maria ?
587 'PARTIAL',
588 'PARTITION', // 5.1
589 'PARTITIONS', // 5.1
590 'PASSWORD',
591 'PRIMARY',
592 'PRIVILEGES',
593 'PROCEDURE',
594 'PROCESS',
595 'PROCESSLIST',
596 'PURGE',
597 'QUICK',
598 'RAID0',
599 'RAID_CHUNKS',
600 'RAID_CHUNKSIZE',
601 'RAID_TYPE',
602 'RANGE', // 5.1
603 'READ',
604 'READ_ONLY', // 5.1
605 'READ_WRITE', // 5.1
606 'REFERENCES',
607 'REGEXP',
608 'RELOAD',
609 'RENAME',
610 'REPAIR',
611 'REPEATABLE',
612 'REPLACE',
613 'REPLICATION',
614 'RESET',
615 'RESTORE',
616 'RESTRICT',
617 'RETURN',
618 'RETURNS',
619 'REVOKE',
620 'RIGHT',
621 'RLIKE',
622 'ROLLBACK',
623 'ROW',
624 'ROWS',
625 'ROW_FORMAT',
626 'SECOND',
627 'SECURITY',
628 'SELECT',
629 'SEPARATOR',
630 'SERIALIZABLE',
631 'SESSION',
632 'SHARE',
633 'SHOW',
634 'SHUTDOWN',
635 'SLAVE',
636 'SONAME',
637 'SOUNDS', // string-functions.html
638 'SQL',
639 'SQL_AUTO_IS_NULL',
640 'SQL_BIG_RESULT',
641 'SQL_BIG_SELECTS',
642 'SQL_BIG_TABLES',
643 'SQL_BUFFER_RESULT',
644 'SQL_CACHE',
645 'SQL_CALC_FOUND_ROWS',
646 'SQL_LOG_BIN',
647 'SQL_LOG_OFF',
648 'SQL_LOG_UPDATE',
649 'SQL_LOW_PRIORITY_UPDATES',
650 'SQL_MAX_JOIN_SIZE',
651 'SQL_NO_CACHE',
652 'SQL_QUOTE_SHOW_CREATE',
653 'SQL_SAFE_UPDATES',
654 'SQL_SELECT_LIMIT',
655 'SQL_SLAVE_SKIP_COUNTER',
656 'SQL_SMALL_RESULT',
657 'SQL_WARNINGS',
658 'START',
659 'STARTING',
660 'STATUS',
661 'STOP',
662 'STORAGE',
663 'STRAIGHT_JOIN',
664 'STRING',
665 'STRIPED',
666 'SUPER',
667 'TABLE',
668 'TABLES',
669 'TEMPORARY',
670 'TERMINATED',
671 'THEN',
672 'TO',
673 'TRAILING',
674 'TRANSACTIONAL', // 5.1 ?
675 'TRUNCATE',
676 'TYPE',
677 'TYPES',
678 'UNCOMMITTED',
679 'UNION',
680 'UNIQUE',
681 'UNLOCK',
682 'UPDATE',
683 'USAGE',
684 'USE',
685 'USING',
686 'VALUES',
687 'VARIABLES',
688 'VIEW',
689 'WHEN',
690 'WHERE',
691 'WITH',
692 'WORK',
693 'WRITE',
694 'XOR',
695 'YEAR_MONTH'
698 * $PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
700 * @global integer MySQL reserved words count
702 $PMA_SQPdata_reserved_word_cnt = 289;
704 * The previous array must be sorted so that the binary search work.
705 * Sometimes a word is not added in the correct order, so
706 * this debugging code shows the problem. The same should be
707 * done for all arrays.
710 $original = $PMA_SQPdata_reserved_word;
711 sort($PMA_SQPdata_reserved_word);
712 $difference = array_diff_assoc($original, $PMA_SQPdata_reserved_word);
713 echo '<pre>';
714 print_r($difference);
715 echo '</pre>';
716 echo '<pre>';
717 print_r($PMA_SQPdata_reserved_word);
718 echo '</pre>';
722 * words forbidden to be used as column or table name wihtout quotes
723 * as seen in http://dev.mysql.com/doc/mysql/en/reserved-words.html
725 * @global array MySQL forbidden words
727 $PMA_SQPdata_forbidden_word = array (
728 'ACCESSIBLE', // 5.1
729 'ACTION',
730 'ADD',
731 'AFTER',
732 'AGAINST',
733 'AGGREGATE',
734 'ALGORITHM',
735 'ALL',
736 'ALTER',
737 'ANALYZE',
738 'AND',
739 'ANY',
740 'AS',
741 'ASC',
742 'ASCII',
743 'ASENSITIVE',
744 'AUTO_INCREMENT',
745 'AVG',
746 'AVG_ROW_LENGTH',
747 'BACKUP',
748 'BDB',
749 'BEFORE',
750 'BEGIN',
751 'BERKELEYDB',
752 'BETWEEN',
753 'BIGINT',
754 'BINARY',
755 'BINLOG',
756 'BIT',
757 'BLOB',
758 'BOOL',
759 'BOOLEAN',
760 'BOTH',
761 'BTREE',
762 'BY',
763 'BYTE',
764 'CACHE',
765 'CALL',
766 'CASCADE',
767 'CASCADED',
768 'CASE',
769 'CHAIN',
770 'CHANGE',
771 'CHANGED',
772 'CHAR',
773 'CHARACTER',
774 'CHARSET',
775 'CHECK',
776 'CHECKSUM',
777 'CIPHER',
778 'CLOSE',
779 'COLLATE',
780 'COLLATION',
781 'COLUMN',
782 'COLUMNS',
783 'COMMENT',
784 'COMMIT',
785 'COMMITTED',
786 'COMPACT',
787 'COMPRESSED',
788 'CONCURRENT',
789 'CONDITION',
790 'CONNECTION',
791 'CONSISTENT',
792 'CONSTRAINT',
793 'CONTAINS',
794 'CONTINUE',
795 'CONVERT',
796 'CREATE',
797 'CROSS',
798 'CUBE',
799 'CURRENT_DATE',
800 'CURRENT_TIME',
801 'CURRENT_TIMESTAMP',
802 'CURRENT_USER',
803 'CURSOR',
804 'DATA',
805 'DATABASE',
806 'DATABASES',
807 'DATE',
808 'DATETIME',
809 'DAY',
810 'DAY_HOUR',
811 'DAY_MICROSECOND',
812 'DAY_MINUTE',
813 'DAY_SECOND',
814 'DEALLOCATE',
815 'DEC',
816 'DECIMAL',
817 'DECLARE',
818 'DEFAULT',
819 'DEFINER',
820 'DELAYED',
821 'DELAY_KEY_WRITE',
822 'DELETE',
823 'DESC',
824 'DESCRIBE',
825 'DES_KEY_FILE',
826 'DETERMINISTIC',
827 'DIRECTORY',
828 'DISABLE',
829 'DISCARD',
830 'DISTINCT',
831 'DISTINCTROW',
832 'DIV',
833 'DO',
834 'DOUBLE',
835 'DROP',
836 'DUAL',
837 'DUMPFILE',
838 'DUPLICATE',
839 'DYNAMIC',
840 'EACH',
841 'ELSE',
842 'ELSEIF',
843 'ENABLE',
844 'ENCLOSED',
845 'END',
846 'ENGINE',
847 'ENGINES',
848 'ENUM',
849 'ERRORS',
850 'ESCAPE',
851 'ESCAPED',
852 'EVENTS',
853 'EXECUTE',
854 'EXISTS',
855 'EXIT',
856 'EXPANSION',
857 'EXPLAIN',
858 'EXTENDED',
859 'FALSE',
860 'FAST',
861 'FETCH',
862 'FIELDS',
863 'FILE',
864 'FIRST',
865 'FIXED',
866 'FLOAT',
867 'FLOAT4',
868 'FLOAT8',
869 'FLUSH',
870 'FOR',
871 'FORCE',
872 'FOREIGN',
873 'FOUND',
874 'FRAC_SECOND',
875 'FROM',
876 'FULL',
877 'FULLTEXT',
878 'FUNCTION',
879 'GEOMETRY',
880 'GEOMETRYCOLLECTION',
881 'GET_FORMAT',
882 'GLOBAL',
883 'GOTO',
884 'GRANT',
885 'GRANTS',
886 'GROUP',
887 'HANDLER',
888 'HASH',
889 'HAVING',
890 'HELP',
891 'HIGH_PRIORITY',
892 'HOSTS',
893 'HOUR',
894 'HOUR_MICROSECOND',
895 'HOUR_MINUTE',
896 'HOUR_SECOND',
897 'IDENTIFIED',
898 'IF',
899 'IGNORE',
900 'IMPORT',
901 'IN',
902 'INDEX',
903 'INDEXES',
904 'INFILE',
905 'INNER',
906 'INNOBASE',
907 'INNODB',
908 'INOUT',
909 'INSENSITIVE',
910 'INSERT',
911 'INSERT_METHOD',
912 'INT',
913 'INT1',
914 'INT2',
915 'INT3',
916 'INT4',
917 'INT8',
918 'INTEGER',
919 'INTERVAL',
920 'INTO',
921 'INVOKER',
922 'IO_THREAD',
923 'IS',
924 'ISOLATION',
925 'ISSUER',
926 'ITERATE',
927 'JOIN',
928 'KEY',
929 'KEYS',
930 'KILL',
931 'LABEL',
932 'LANGUAGE',
933 'LAST',
934 'LEADING',
935 'LEAVE',
936 'LEAVES',
937 'LEFT',
938 'LEVEL',
939 'LIKE',
940 'LIMIT',
941 'LINEAR', // 5.1
942 'LINES',
943 'LINESTRING',
944 'LOAD',
945 'LOCAL',
946 'LOCALTIME',
947 'LOCALTIMESTAMP',
948 'LOCK',
949 'LOCKS',
950 'LOGS',
951 'LONG',
952 'LONGBLOB',
953 'LONGTEXT',
954 'LOOP',
955 'LOW_PRIORITY',
956 'MASTER',
957 'MASTER_CONNECT_RETRY',
958 'MASTER_HOST',
959 'MASTER_LOG_FILE',
960 'MASTER_LOG_POS',
961 'MASTER_PASSWORD',
962 'MASTER_PORT',
963 'MASTER_SERVER_ID',
964 'MASTER_SSL',
965 'MASTER_SSL_CA',
966 'MASTER_SSL_CAPATH',
967 'MASTER_SSL_CERT',
968 'MASTER_SSL_CIPHER',
969 'MASTER_SSL_KEY',
970 'MASTER_USER',
971 'MATCH',
972 'MAX_CONNECTIONS_PER_HOUR',
973 'MAX_QUERIES_PER_HOUR',
974 'MAX_ROWS',
975 'MAX_UPDATES_PER_HOUR',
976 'MAX_USER_CONNECTIONS',
977 'MEDIUM',
978 'MEDIUMBLOB',
979 'MEDIUMINT',
980 'MEDIUMTEXT',
981 'MERGE',
982 'MICROSECOND',
983 'MIDDLEINT',
984 'MIGRATE',
985 'MINUTE',
986 'MINUTE_MICROSECOND',
987 'MINUTE_SECOND',
988 'MIN_ROWS',
989 'MOD',
990 'MODE',
991 'MODIFIES',
992 'MODIFY',
993 'MONTH',
994 'MULTILINESTRING',
995 'MULTIPOINT',
996 'MULTIPOLYGON',
997 'MUTEX',
998 'NAME',
999 'NAMES',
1000 'NATIONAL',
1001 'NATURAL',
1002 'NCHAR',
1003 'NDB',
1004 'NDBCLUSTER',
1005 'NEW',
1006 'NEXT',
1007 'NO',
1008 'NONE',
1009 'NOT',
1010 'NO_WRITE_TO_BINLOG',
1011 'NULL',
1012 'NUMERIC',
1013 'NVARCHAR',
1014 'OFFSET',
1015 'OLD_PASSWORD',
1016 'ON',
1017 'ONE',
1018 'ONE_SHOT',
1019 'OPEN',
1020 'OPTIMIZE',
1021 'OPTION',
1022 'OPTIONALLY',
1023 'OR',
1024 'ORDER',
1025 'OUT',
1026 'OUTER',
1027 'OUTFILE',
1028 'PACK_KEYS',
1029 'PARTIAL',
1030 'PASSWORD',
1031 'PHASE',
1032 'POINT',
1033 'POLYGON',
1034 'PRECISION',
1035 'PREPARE',
1036 'PREV',
1037 'PRIMARY',
1038 'PRIVILEGES',
1039 'PROCEDURE',
1040 'PROCESSLIST',
1041 'PURGE',
1042 'QUARTER',
1043 'QUERY',
1044 'QUICK',
1045 'RAID0',
1046 'RAID_CHUNKS',
1047 'RAID_CHUNKSIZE',
1048 'RAID_TYPE',
1049 'RANGE', // 5.1
1050 'READ',
1051 'READ_ONLY', // 5.1
1052 'READ_WRITE', // 5.1
1053 'READS',
1054 'REAL',
1055 'RECOVER',
1056 'REDUNDANT',
1057 'REFERENCES',
1058 'REGEXP',
1059 'RELAY_LOG_FILE',
1060 'RELAY_LOG_POS',
1061 'RELAY_THREAD',
1062 'RELEASE',
1063 'RELOAD',
1064 'RENAME',
1065 'REPAIR',
1066 'REPEAT',
1067 'REPEATABLE',
1068 'REPLACE',
1069 'REPLICATION',
1070 'REQUIRE',
1071 'RESET',
1072 'RESTORE',
1073 'RESTRICT',
1074 'RESUME',
1075 'RETURN',
1076 'RETURNS',
1077 'REVOKE',
1078 'RIGHT',
1079 'RLIKE',
1080 'ROLLBACK',
1081 'ROLLUP',
1082 'ROUTINE',
1083 'ROW',
1084 'ROWS',
1085 'ROW_FORMAT',
1086 'RTREE',
1087 'SAVEPOINT',
1088 'SCHEMA',
1089 'SCHEMAS',
1090 'SECOND',
1091 'SECOND_MICROSECOND',
1092 'SECURITY',
1093 'SELECT',
1094 'SENSITIVE',
1095 'SEPARATOR',
1096 'SERIAL',
1097 'SERIALIZABLE',
1098 'SESSION',
1099 'SET',
1100 'SHARE',
1101 'SHOW',
1102 'SHUTDOWN',
1103 'SIGNED',
1104 'SIMPLE',
1105 'SLAVE',
1106 'SMALLINT',
1107 'SNAPSHOT',
1108 'SOME',
1109 'SONAME',
1110 'SOUNDS',
1111 'SPATIAL',
1112 'SPECIFIC',
1113 'SQL',
1114 'SQLEXCEPTION',
1115 'SQLSTATE',
1116 'SQLWARNING',
1117 'SQL_BIG_RESULT',
1118 'SQL_BUFFER_RESULT',
1119 'SQL_CACHE',
1120 'SQL_CALC_FOUND_ROWS',
1121 'SQL_NO_CACHE',
1122 'SQL_SMALL_RESULT',
1123 'SQL_THREAD',
1124 'SQL_TSI_DAY',
1125 'SQL_TSI_FRAC_SECOND',
1126 'SQL_TSI_HOUR',
1127 'SQL_TSI_MINUTE',
1128 'SQL_TSI_MONTH',
1129 'SQL_TSI_QUARTER',
1130 'SQL_TSI_SECOND',
1131 'SQL_TSI_WEEK',
1132 'SQL_TSI_YEAR',
1133 'SSL',
1134 'START',
1135 'STARTING',
1136 'STATUS',
1137 'STOP',
1138 'STORAGE',
1139 'STRAIGHT_JOIN',
1140 'STRING',
1141 'STRIPED',
1142 'SUBJECT',
1143 'SUPER',
1144 'SUSPEND',
1145 'TABLE',
1146 'TABLES',
1147 'TABLESPACE',
1148 'TEMPORARY',
1149 'TEMPTABLE',
1150 'TERMINATED',
1151 'TEXT',
1152 'THEN',
1153 'TIME',
1154 'TIMESTAMP',
1155 'TIMESTAMPADD',
1156 'TIMESTAMPDIFF',
1157 'TINYBLOB',
1158 'TINYINT',
1159 'TINYTEXT',
1160 'TO',
1161 'TRAILING',
1162 'TRANSACTION',
1163 'TRIGGER',
1164 'TRIGGERS',
1165 'TRUE',
1166 'TRUNCATE',
1167 'TYPE',
1168 'TYPES',
1169 'UNCOMMITTED',
1170 'UNDEFINED',
1171 'UNDO',
1172 'UNICODE',
1173 'UNION',
1174 'UNIQUE',
1175 'UNKNOWN',
1176 'UNLOCK',
1177 'UNSIGNED',
1178 'UNTIL',
1179 'UPDATE',
1180 'USAGE',
1181 'USE',
1182 'USER',
1183 'USER_RESOURCES',
1184 'USE_FRM',
1185 'USING',
1186 'UTC_DATE',
1187 'UTC_TIME',
1188 'UTC_TIMESTAMP',
1189 'VALUE',
1190 'VALUES',
1191 'VARBINARY',
1192 'VARCHAR',
1193 'VARCHARACTER',
1194 'VARIABLES',
1195 'VARYING',
1196 'VIEW',
1197 'WARNINGS',
1198 'WEEK',
1199 'WHEN',
1200 'WHERE',
1201 'WHILE',
1202 'WITH',
1203 'WORK',
1204 'WRITE',
1205 'X509',
1206 'XA',
1207 'XOR',
1208 'YEAR',
1209 'YEAR_MONTH',
1210 'ZEROFILL'
1213 * count($PMA_SQPdata_forbidden_word);
1215 * @global integer MySQL forbidden words count
1217 $PMA_SQPdata_forbidden_word_cnt = 483;
1220 * the MySQL column/data types
1222 * @see http://dev.mysql.com/doc/refman/5.1/en/data-types.html
1223 * @see http://dev.mysql.com/doc/refman/5.1/en/mysql-spatial-datatypes.html
1225 * @global array MySQL column types
1227 $PMA_SQPdata_column_type = array (
1228 'BIGINT',
1229 'BINARY',
1230 'BIT',
1231 'BLOB',
1232 'BOOL',
1233 'BOOLEAN', // numeric-type-overview.html
1234 'CHAR',
1235 'CHARACTER',
1236 'DATE',
1237 'DATETIME',
1238 'DEC',
1239 'DECIMAL',
1240 'DOUBLE',
1241 'ENUM',
1242 'FLOAT',
1243 'FLOAT4',
1244 'FLOAT8',
1245 'GEOMETRY', // spatial
1246 'GEOMETRYCOLLECTION', // spatial
1247 'INT',
1248 'INT1',
1249 'INT2',
1250 'INT3',
1251 'INT4',
1252 'INT8',
1253 'INTEGER',
1254 'LINESTRING', // spatial
1255 'LONG',
1256 'LONGBLOB',
1257 'LONGTEXT',
1258 'MEDIUMBLOB',
1259 'MEDIUMINT',
1260 'MEDIUMTEXT',
1261 'MIDDLEINT',
1262 'MULTILINESTRING', // spatial
1263 'MULTIPOINT', // spatial
1264 'MULTIPOLYGON', // spatial
1265 'NCHAR',
1266 'NUMERIC',
1267 'POINT', // spatial
1268 'POLYGON', // spatial
1269 'REAL',
1270 'SERIAL', // alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
1271 'SET',
1272 'SMALLINT',
1273 'TEXT',
1274 'TIME',
1275 'TIMESTAMP',
1276 'TINYBLOB',
1277 'TINYINT',
1278 'TINYTEXT',
1279 'VARBINARY',
1280 'VARCHAR',
1281 'YEAR'
1284 * $PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
1286 * @global integer MySQL column types count
1288 $PMA_SQPdata_column_type_cnt = 54;
1291 * check counts
1292 foreach ($GLOBALS as $n => $a) {
1293 echo is_array($a) ? $n . ': ' . count($a) . '<br />' : '';