2 /* vim: set expandtab sw=4 ts=4 sts=4: */
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 test case to verify.
24 if (! defined('PHPMYADMIN')) {
28 if (! isset($GLOBALS['sql_delimiter'])) {
29 $GLOBALS['sql_delimiter'] = ';';
33 * @global array MySQL function names
35 $PMA_SQPdata_function_name = array (
42 'AREA', // Area() polygon-property-functions.html
43 'ASBINARY', // AsBinary()
50 'BDMPOLYFROMTEXT', // BdMPolyFromText()
51 'BDMPOLYFROMWKB', // BdMPolyFromWKB()
52 'BDPOLYFROMTEXT', // BdPolyFromText()
53 'BDPOLYFROMWKB', // BdPolyFromWKB()
60 'BIT_XOR', // group-by-functions.html
61 'BOUNDARY', // Boundary() general-geometry-property-functions.html
66 'CENTROID', // Centroid() multipolygon-property-functions.html
67 'CHAR', // string-functions.html
69 'CHARSET', // information-functions.html
72 'COERCIBILITY', // information-functions.html
73 'COLLATION', // information-functions.html
74 'COMPRESS', // string-functions.html
78 'CONTAINS', // Contains()
82 'CONVEXHULL', // ConvexHull()
86 'CRC32', // mathematical-functions.html
87 'CROSSES', // Crosses()
95 'DATE', // date-and-time-functions.html
96 'DATEDIFF', // date-and-time-functions.html
107 'DEFAULT', // miscellaneous-functions.html
111 'DIFFERENCE', // Difference()
112 'DIMENSION', // Dimension() general-geometry-property-functions.html
113 'DISJOINT', // Disjoint()
114 'DISTANCE', // Distance()
118 'ENDPOINT', // EndPoint() linestring-property-functions.html
119 'ENVELOPE', // Envelope() general-geometry-property-functions.html
120 'EQUALS', // Equals()
123 'EXTERIORRING', // ExteriorRing() polygon-property-functions.html
125 'EXTRACTVALUE', // ExtractValue() xml-functions.html
133 'GEOMCOLLFROMTEXT', // GeomCollFromText()
134 'GEOMCOLLFROMWKB', // GeomCollFromWKB()
135 'GEOMETRYCOLLECTION', // GeometryCollection()
136 'GEOMETRYCOLLECTIONFROMTEXT', // GeometryCollectionFromText()
137 'GEOMETRYCOLLECTIONFROMWKB', // GeometryCollectionFromWKB()
138 'GEOMETRYFROMTEXT', // GeometryFromText()
139 'GEOMETRYFROMWKB', // GeometryFromWKB()
140 'GEOMETRYN', // GeometryN() geometrycollection-property-functions.html
141 'GEOMETRYTYPE', // GeometryType() general-geometry-property-functions.html
142 'GEOMFROMTEXT', // GeomFromText()
143 'GEOMFROMWKB', // GeomFromWKB()
146 'GLENGTH', // GLength() linestring-property-functions.html
149 'GROUP_UNIQUE_USERS',
152 'IF', //control-flow-functions.html
156 'INSERT', // string-functions.html
158 'INTERIORRINGN', // InteriorRingN() polygon-property-functions.html
159 'INTERSECTION', // Intersection()
160 'INTERSECTS', // Intersects()
162 'ISCLOSED', // IsClosed() multilinestring-property-functions.html
163 'ISEMPTY', // IsEmpty() general-geometry-property-functions.html
165 'ISRING', // IsRing() linestring-property-functions.html
166 'ISSIMPLE', // IsSimple() general-geometry-property-functions.html
168 'IS_USED_LOCK', // miscellaneous-functions.html
175 'LINEFROMTEXT', // LineFromText()
176 'LINEFROMWKB', // LineFromWKB()
177 'LINESTRING', // LineString()
178 'LINESTRINGFROMTEXT', // LineStringFromText()
179 'LINESTRINGFROMWKB', // LineStringFromWKB()
196 'MBRCONTAINS', // MBRContains()
197 'MBRDISJOINT', // MBRDisjoint()
198 'MBREQUAL', // MBREqual()
199 'MBRINTERSECTS', // MBRIntersects()
200 'MBROVERLAPS', // MBROverlaps()
201 'MBRTOUCHES', // MBRTouches()
202 'MBRWITHIN', // MBRWithin()
208 'MLINEFROMTEXT', // MLineFromText()
209 'MLINEFROMWKB', // MLineFromWKB()
213 'MPOINTFROMTEXT', // MPointFromText()
214 'MPOINTFROMWKB', // MPointFromWKB()
215 'MPOLYFROMTEXT', // MPolyFromText()
216 'MPOLYFROMWKB', // MPolyFromWKB()
217 'MULTILINESTRING', // MultiLineString()
218 'MULTILINESTRINGFROMTEXT', // MultiLineStringFromText()
219 'MULTILINESTRINGFROMWKB', // MultiLineStringFromWKB()
220 'MULTIPOINT', // MultiPoint()
221 'MULTIPOINTFROMTEXT', // MultiPointFromText()
222 'MULTIPOINTFROMWKB', // MultiPointFromWKB()
223 'MULTIPOLYGON', // MultiPolygon()
224 'MULTIPOLYGONFROMTEXT', // MultiPolygonFromText()
225 'MULTIPOLYGONFROMWKB', // MultiPolygonFromWKB()
226 'NAME_CONST', // NAME_CONST()
229 'NUMGEOMETRIES', // NumGeometries() geometrycollection-property-functions.html
230 'NUMINTERIORRINGS', // NumInteriorRings() polygon-property-functions.html
231 'NUMPOINTS', // NumPoints() linestring-property-functions.html
236 'OVERLAPS', // Overlaps()
242 'POINTFROMTEXT', // PointFromText()
243 'POINTFROMWKB', // PointFromWKB()
244 'POINTN', // PointN() inestring-property-functions.html
245 'POINTONSURFACE', // PointOnSurface() multipolygon-property-functions.html
246 'POLYFROMTEXT', // PolyFromText()
247 'POLYFROMWKB', // PolyFromWKB()
248 'POLYGON', // Polygon()
249 'POLYGONFROMTEXT', // PolygonFromText()
250 'POLYGONFROMWKB', // PolygonFromWKB()
258 'RELATED', // Related()
261 'REPLACE', // string-functions.html
265 'ROW_COUNT', // information-functions.html
268 'SCHEMA', // information-functions.html
276 'SLEEP', // miscellaneous-functions.html
280 'SRID', // general-geometry-property-functions.html
281 'STARTPOINT', // StartPoint() linestring-property-functions.html
284 'STDDEV_POP', // group-by-functions.html
285 'STDDEV_SAMP', // group-by-functions.html
294 'SYMDIFFERENCE', // SymDifference()
305 'TOUCHES', // Touches()
308 'TRUNCATE', // mathematical-functions.html
310 'UNCOMPRESS', // string-functions.html
311 'UNCOMPRESSED_LENGTH', // string-functions.html
312 'UNHEX', // string-functions.html
315 'UPDATEXML', // UpdateXML() xml-functions.html
321 'UUID', // miscellaneous-functions.html
322 'VARIANCE', // group-by-functions.html
323 'VAR_POP', // group-by-functions.html
324 'VAR_SAMP', // group-by-functions.html
329 'WITHIN', // Within()
330 'X', // point-property-functions.html
331 'Y', // point-property-functions.html
336 * $PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name);
338 * @global integer MySQL attributes count
340 $PMA_SQPdata_function_name_cnt = 298;
343 * @global array MySQL attributes
345 $PMA_SQPdata_column_attrib = array (
350 'BERKELEYDB', // Engine alias BDB
352 'BLACKHOLE', // Engine
356 'FEDERATED', // Engine
358 'INNOBASE', // Engine alias InnoDB
359 'INNODB', // Engine InnoDB
362 'MEMORY', // Engine alias HEAP, but preferred
364 'MRG_ISAM', // Engine
365 'MRG_MYISAM', // Engine alias MERGE
366 'MYISAM', // Engine MyISAM
368 'NDB', // Engine alias NDBCLUSTER
369 'NDBCLUSTER', // Engine
378 * $PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib);
380 * @global integer MySQL attributes count
382 $PMA_SQPdata_column_attrib_cnt = 30;
385 * words that are reserved by MySQL and may not be used as identifiers without quotes
387 * @see http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
389 * @global array MySQL reserved words
391 $PMA_SQPdata_reserved_word = array (
484 'GEMINI_SPIN_RETRIES',
531 'MASTER_CONNECT_RETRY',
539 'MAX_CONNECTIONS_PER_HOUR',
540 'MAX_QUERIES_PER_HOUR',
542 'MAX_UPDATES_PER_HOUR',
543 'MAX_USER_CONNECTIONS',
556 // 'NO' is not allowed in SQL-99 but is allowed in MySQL
571 'PAGE', // 5.1-maria ?
572 'PAGE_CHECKSUM', // 5.1
623 'SOUNDS', // string-functions.html
631 'SQL_CALC_FOUND_ROWS',
635 'SQL_LOW_PRIORITY_UPDATES',
638 'SQL_QUOTE_SHOW_CREATE',
641 'SQL_SLAVE_SKIP_COUNTER',
660 'TRANSACTIONAL', // 5.1 ?
684 * $PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
686 * @global integer MySQL reserved words count
688 $PMA_SQPdata_reserved_word_cnt = 288;
691 * words forbidden to be used as column or table name wihtout quotes
692 * as seen in http://dev.mysql.com/doc/mysql/en/reserved-words.html
694 * @global array MySQL forbidden words
696 $PMA_SQPdata_forbidden_word = array (
849 'GEOMETRYCOLLECTION',
925 'MASTER_CONNECT_RETRY',
940 'MAX_CONNECTIONS_PER_HOUR',
941 'MAX_QUERIES_PER_HOUR',
943 'MAX_UPDATES_PER_HOUR',
944 'MAX_USER_CONNECTIONS',
954 'MINUTE_MICROSECOND',
978 'NO_WRITE_TO_BINLOG',
1021 'READ_WRITE', // 5.1
1059 'SECOND_MICROSECOND',
1086 'SQL_BUFFER_RESULT',
1088 'SQL_CALC_FOUND_ROWS',
1093 'SQL_TSI_FRAC_SECOND',
1181 * count($PMA_SQPdata_forbidden_word);
1183 * @global integer MySQL forbidden words count
1185 $PMA_SQPdata_forbidden_word_cnt = 482;
1188 * the MySQL column/data types
1190 * @see http://dev.mysql.com/doc/refman/5.1/en/data-types.html
1191 * @see http://dev.mysql.com/doc/refman/5.1/en/mysql-spatial-datatypes.html
1193 * @global array MySQL column types
1195 $PMA_SQPdata_column_type = array (
1201 'BOOLEAN', // numeric-type-overview.html
1213 'GEOMETRY', // spatial
1214 'GEOMETRYCOLLECTION', // spatial
1222 'LINESTRING', // spatial
1230 'MULTILINESTRING', // spatial
1231 'MULTIPOINT', // spatial
1232 'MULTIPOLYGON', // spatial
1236 'POLYGON', // spatial
1238 'SERIAL', // alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
1252 * $PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
1254 * @global integer MySQL column types count
1256 $PMA_SQPdata_column_type_cnt = 54;