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 DEBUG code after this function's definition.
26 * @global array MySQL function names
28 $PMA_SQPdata_function_name = array (
35 'AREA', // Area() polygon-property-functions.html
36 'ASBINARY', // AsBinary()
43 'BDMPOLYFROMTEXT', // BdMPolyFromText()
44 'BDMPOLYFROMWKB', // BdMPolyFromWKB()
45 'BDPOLYFROMTEXT', // BdPolyFromText()
46 'BDPOLYFROMWKB', // BdPolyFromWKB()
53 'BIT_XOR', // group-by-functions.html
54 'BOUNDARY', // Boundary() general-geometry-property-functions.html
59 'CENTROID', // Centroid() multipolygon-property-functions.html
60 'CHAR', // string-functions.html
62 'CHARSET', // information-functions.html
65 'COERCIBILITY', // information-functions.html
66 'COLLATION', // information-functions.html
67 'COMPRESS', // string-functions.html
71 'CONTAINS', // Contains()
75 'CONVEXHULL', // ConvexHull()
79 'CRC32', // mathematical-functions.html
80 'CROSSES', // Crosses()
88 'DATE', // date-and-time-functions.html
89 'DATEDIFF', // date-and-time-functions.html
100 'DEFAULT', // miscellaneous-functions.html
104 'DIFFERENCE', // Difference()
105 'DIMENSION', // Dimension() general-geometry-property-functions.html
106 'DISJOINT', // Disjoint()
107 'DISTANCE', // Distance()
111 'ENDPOINT', // EndPoint() linestring-property-functions.html
112 'ENVELOPE', // Envelope() general-geometry-property-functions.html
113 'EQUALS', // Equals()
116 'EXTERIORRING', // ExteriorRing() polygon-property-functions.html
118 'EXTRACTVALUE', // ExtractValue() xml-functions.html
126 'GEOMCOLLFROMTEXT', // GeomCollFromText()
127 'GEOMCOLLFROMWKB', // GeomCollFromWKB()
128 'GEOMETRYCOLLECTION', // GeometryCollection()
129 'GEOMETRYCOLLECTIONFROMTEXT', // GeometryCollectionFromText()
130 'GEOMETRYCOLLECTIONFROMWKB', // GeometryCollectionFromWKB()
131 'GEOMETRYFROMTEXT', // GeometryFromText()
132 'GEOMETRYFROMWKB', // GeometryFromWKB()
133 'GEOMETRYN', // GeometryN() geometrycollection-property-functions.html
134 'GEOMETRYTYPE', // GeometryType() general-geometry-property-functions.html
135 'GEOMFROMTEXT', // GeomFromText()
136 'GEOMFROMWKB', // GeomFromWKB()
139 'GLENGTH', // GLength() linestring-property-functions.html
142 'GROUP_UNIQUE_USERS',
145 'IF', //control-flow-functions.html
149 'INSERT', // string-functions.html
151 'INTERIORRINGN', // InteriorRingN() polygon-property-functions.html
152 'INTERSECTION', // Intersection()
153 'INTERSECTS', // Intersects()
155 'ISCLOSED', // IsClosed() multilinestring-property-functions.html
156 'ISEMPTY', // IsEmpty() general-geometry-property-functions.html
158 'ISRING', // IsRing() linestring-property-functions.html
159 'ISSIMPLE', // IsSimple() general-geometry-property-functions.html
161 'IS_USED_LOCK', // miscellaneous-functions.html
168 'LINEFROMTEXT', // LineFromText()
169 'LINEFROMWKB', // LineFromWKB()
170 'LINESTRING', // LineString()
171 'LINESTRINGFROMTEXT', // LineStringFromText()
172 'LINESTRINGFROMWKB', // LineStringFromWKB()
189 'MBRCONTAINS', // MBRContains()
190 'MBRDISJOINT', // MBRDisjoint()
191 'MBREQUAL', // MBREqual()
192 'MBRINTERSECTS', // MBRIntersects()
193 'MBROVERLAPS', // MBROverlaps()
194 'MBRTOUCHES', // MBRTouches()
195 'MBRWITHIN', // MBRWithin()
201 'MLINEFROMTEXT', // MLineFromText()
202 'MLINEFROMWKB', // MLineFromWKB()
207 'MPOINTFROMTEXT', // MPointFromText()
208 'MPOINTFROMWKB', // MPointFromWKB()
209 'MPOLYFROMTEXT', // MPolyFromText()
210 'MPOLYFROMWKB', // MPolyFromWKB()
211 'MULTILINESTRING', // MultiLineString()
212 'MULTILINESTRINGFROMTEXT', // MultiLineStringFromText()
213 'MULTILINESTRINGFROMWKB', // MultiLineStringFromWKB()
214 'MULTIPOINT', // MultiPoint()
215 'MULTIPOINTFROMTEXT', // MultiPointFromText()
216 'MULTIPOINTFROMWKB', // MultiPointFromWKB()
217 'MULTIPOLYGON', // MultiPolygon()
218 'MULTIPOLYGONFROMTEXT', // MultiPolygonFromText()
219 'MULTIPOLYGONFROMWKB', // MultiPolygonFromWKB()
220 'NAME_CONST', // NAME_CONST()
223 'NUMGEOMETRIES', // NumGeometries() geometrycollection-property-functions.html
224 'NUMINTERIORRINGS', // NumInteriorRings() polygon-property-functions.html
225 'NUMPOINTS', // NumPoints() linestring-property-functions.html
230 'OVERLAPS', // Overlaps()
236 'POINTFROMTEXT', // PointFromText()
237 'POINTFROMWKB', // PointFromWKB()
238 'POINTN', // PointN() inestring-property-functions.html
239 'POINTONSURFACE', // PointOnSurface() multipolygon-property-functions.html
240 'POLYFROMTEXT', // PolyFromText()
241 'POLYFROMWKB', // PolyFromWKB()
242 'POLYGON', // Polygon()
243 'POLYGONFROMTEXT', // PolygonFromText()
244 'POLYGONFROMWKB', // PolygonFromWKB()
252 'RELATED', // Related()
255 'REPLACE', // string-functions.html
259 'ROW_COUNT', // information-functions.html
262 'SCHEMA', // information-functions.html
270 'SLEEP', // miscellaneous-functions.html
274 'SRID', // general-geometry-property-functions.html
275 'STARTPOINT', // StartPoint() linestring-property-functions.html
278 'STDDEV_POP', // group-by-functions.html
279 'STDDEV_SAMP', // group-by-functions.html
288 'SYMDIFFERENCE', // SymDifference()
299 'TOUCHES', // Touches()
302 'TRUNCATE', // mathematical-functions.html
304 'UNCOMPRESS', // string-functions.html
305 'UNCOMPRESSED_LENGTH', // string-functions.html
306 'UNHEX', // string-functions.html
309 'UPDATEXML', // UpdateXML() xml-functions.html
315 'UUID', // miscellaneous-functions.html
316 'VARIANCE', // group-by-functions.html
317 'VAR_POP', // group-by-functions.html
318 'VAR_SAMP', // group-by-functions.html
323 'WITHIN', // Within()
324 'X', // point-property-functions.html
325 'Y', // point-property-functions.html
330 * $PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name);
332 * @global integer MySQL attributes count
334 $PMA_SQPdata_function_name_cnt = 299;
338 $test_PMA_SQPdata_function_name = $PMA_SQPdata_function_name;
339 sort($PMA_SQPdata_function_name);
340 if ($PMA_SQPdata_function_name != $test_PMA_SQPdata_function_name) {
341 echo 'sort properly like this<pre>';
342 print_r($PMA_SQPdata_function_name);
348 * @global array MySQL attributes
350 $PMA_SQPdata_column_attrib = array (
355 'BERKELEYDB', // Engine alias BDB
357 'BLACKHOLE', // Engine
361 'FEDERATED', // Engine
363 'INNOBASE', // Engine alias InnoDB
364 'INNODB', // Engine InnoDB
366 'MEMORY', // Engine alias HEAP, but preferred
368 'MRG_ISAM', // Engine
369 'MRG_MYISAM', // Engine alias MERGE
370 'MYISAM', // Engine MyISAM
372 'NDB', // Engine alias NDBCLUSTER
373 'NDBCLUSTER', // Engine
382 * $PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib);
384 * @global integer MySQL attributes count
386 $PMA_SQPdata_column_attrib_cnt = 29;
389 * words that are reserved by MySQL and may not be used as identifiers without quotes
391 * @see http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
393 * @global array MySQL reserved words
395 $PMA_SQPdata_reserved_word = array (
487 'GEMINI_SPIN_RETRIES',
533 'MASTER_CONNECT_RETRY',
541 'MAX_CONNECTIONS_PER_HOUR',
542 'MAX_QUERIES_PER_HOUR',
544 'MAX_UPDATES_PER_HOUR',
545 'MAX_USER_CONNECTIONS',
558 // 'NO' is not allowed in SQL-99 but is allowed in MySQL
620 'SOUNDS', // string-functions.html
627 'SQL_CALC_FOUND_ROWS',
631 'SQL_LOW_PRIORITY_UPDATES',
634 'SQL_QUOTE_SHOW_CREATE',
637 'SQL_SLAVE_SKIP_COUNTER',
679 * $PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
681 * @global integer MySQL reserved words count
683 $PMA_SQPdata_reserved_word_cnt = 279;
686 * words forbidden to be used as column or table name wihtout quotes
687 * as seen in http://dev.mysql.com/doc/mysql/en/reserved-words.html
689 * @global array MySQL forbidden words
691 $PMA_SQPdata_forbidden_word = array (
844 'GEOMETRYCOLLECTION',
921 'MASTER_CONNECT_RETRY',
936 'MAX_CONNECTIONS_PER_HOUR',
937 'MAX_QUERIES_PER_HOUR',
939 'MAX_UPDATES_PER_HOUR',
940 'MAX_USER_CONNECTIONS',
950 'MINUTE_MICROSECOND',
974 'NO_WRITE_TO_BINLOG',
1016 'READ_WRITE', // 5.1
1055 'SECOND_MICROSECOND',
1082 'SQL_BUFFER_RESULT',
1084 'SQL_CALC_FOUND_ROWS',
1089 'SQL_TSI_FRAC_SECOND',
1177 * count($PMA_SQPdata_forbidden_word);
1179 * @global integer MySQL forbidden words count
1181 $PMA_SQPdata_forbidden_word_cnt = 483;
1184 * the MySQL column/data types
1186 * @see http://dev.mysql.com/doc/refman/5.1/en/data-types.html
1187 * @see http://dev.mysql.com/doc/refman/5.1/en/mysql-spatial-datatypes.html
1189 * @global array MySQL column types
1191 $PMA_SQPdata_column_type = array (
1197 'BOOLEAN', // numeric-type-overview.html
1209 'GEOMETRY', // spatial
1210 'GEOMETRYCOLLECTION', // spatial
1218 'LINESTRING', // spatial
1226 'MULTILINESTRING', // spatial
1227 'MULTIPOINT', // spatial
1228 'MULTIPOLYGON', // spatial
1232 'POLYGON', // spatial
1234 'SERIAL', // alsias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
1248 * $PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
1250 * @global integer MySQL column types count
1252 $PMA_SQPdata_column_type_cnt = 54;
1256 foreach ($GLOBALS as $n => $a) {
1257 echo is_array($a) ? $n . ': ' . count($a) . '<br />' : '';