2
/* $Id: sqlparser.data.php 10061 2007-03-04 14:07:42Z lem9 $ */
3
// vim: expandtab sw=4 ts=4 sts=4:
6
/** SQL Parser Matching Data
8
* Copyright 2002 Robin Johnson <robbat2@users.sourceforge.net>
9
* http://www.orbis-terrarum.net/?l=people.robbat2
11
* This data is used by the SQL Parser to recognize keywords
13
* It has been extracted from the lex.h file in the MySQL BK tree
14
* (around 4.0.2) as well as the MySQL documentation.
16
* Note: before adding a value in the arrays, ensure that you respect
17
* proper sorting, especially with underscores. And don't forget to
18
* update the _cnt variable at the end of each array.
19
* (It's slower to have PHP do the count).
21
* It's easier to use only uppercase for proper sorting. In case of
22
* doubt, use the DEBUG code after this function's definition.
25
$PMA_SQPdata_function_name = array (
32
'AREA', // Area() polygon-property-functions.html
33
'ASBINARY', // AsBinary()
40
'BDMPOLYFROMTEXT', // BdMPolyFromText()
41
'BDMPOLYFROMWKB', // BdMPolyFromWKB()
42
'BDPOLYFROMTEXT', // BdPolyFromText()
43
'BDPOLYFROMWKB', // BdPolyFromWKB()
50
'BIT_XOR', // group-by-functions.html
51
'BOUNDARY', // Boundary() general-geometry-property-functions.html
56
'CENTROID', // Centroid() multipolygon-property-functions.html
57
'CHAR', // string-functions.html
59
'CHARSET', // information-functions.html
62
'COERCIBILITY', // information-functions.html
63
'COLLATION', // information-functions.html
64
'COMPRESS', // string-functions.html
68
'CONTAINS', // Contains()
72
'CONVEXHULL', // ConvexHull()
76
'CRC32', // mathematical-functions.html
77
'CROSSES', // Crosses()
85
'DATE', // date-and-time-functions.html
86
'DATEDIFF', // date-and-time-functions.html
97
'DEFAULT', // miscellaneous-functions.html
101
'DIFFERENCE', // Difference()
102
'DIMENSION', // Dimension() general-geometry-property-functions.html
103
'DISJOINT', // Disjoint()
104
'DISTANCE', // Distance()
108
'ENDPOINT', // EndPoint() linestring-property-functions.html
109
'ENVELOPE', // Envelope() general-geometry-property-functions.html
110
'EQUALS', // Equals()
113
'EXTERIORRING', // ExteriorRing() polygon-property-functions.html
115
'EXTRACTVALUE', // ExtractValue() xml-functions.html
123
'GEOMCOLLFROMTEXT', // GeomCollFromText()
124
'GEOMCOLLFROMWKB', // GeomCollFromWKB()
125
'GEOMETRYCOLLECTION', // GeometryCollection()
126
'GEOMETRYCOLLECTIONFROMTEXT', // GeometryCollectionFromText()
127
'GEOMETRYCOLLECTIONFROMWKB', // GeometryCollectionFromWKB()
128
'GEOMETRYFROMTEXT', // GeometryFromText()
129
'GEOMETRYFROMWKB', // GeometryFromWKB()
130
'GEOMETRYN', // GeometryN() geometrycollection-property-functions.html
131
'GEOMETRYTYPE', // GeometryType() general-geometry-property-functions.html
132
'GEOMFROMTEXT', // GeomFromText()
133
'GEOMFROMWKB', // GeomFromWKB()
136
'GLENGTH', // GLength() linestring-property-functions.html
139
'GROUP_UNIQUE_USERS',
142
'IF', //control-flow-functions.html
146
'INSERT', // string-functions.html
148
'INTERIORRINGN', // InteriorRingN() polygon-property-functions.html
149
'INTERSECTION', // Intersection()
150
'INTERSECTS', // Intersects()
152
'ISCLOSED', // IsClosed() multilinestring-property-functions.html
153
'ISEMPTY', // IsEmpty() general-geometry-property-functions.html
155
'ISRING', // IsRing() linestring-property-functions.html
156
'ISSIMPLE', // IsSimple() general-geometry-property-functions.html
158
'IS_USED_LOCK', // miscellaneous-functions.html
165
'LINEFROMTEXT', // LineFromText()
166
'LINEFROMWKB', // LineFromWKB()
167
'LINESTRING', // LineString()
168
'LINESTRINGFROMTEXT', // LineStringFromText()
169
'LINESTRINGFROMWKB', // LineStringFromWKB()
186
'MBRCONTAINS', // MBRContains()
187
'MBRDISJOINT', // MBRDisjoint()
188
'MBREQUAL', // MBREqual()
189
'MBRINTERSECTS', // MBRIntersects()
190
'MBROVERLAPS', // MBROverlaps()
191
'MBRTOUCHES', // MBRTouches()
192
'MBRWITHIN', // MBRWithin()
198
'MLINEFROMTEXT', // MLineFromText()
199
'MLINEFROMWKB', // MLineFromWKB()
204
'MPOINTFROMTEXT', // MPointFromText()
205
'MPOINTFROMWKB', // MPointFromWKB()
206
'MPOLYFROMTEXT', // MPolyFromText()
207
'MPOLYFROMWKB', // MPolyFromWKB()
208
'MULTILINESTRING', // MultiLineString()
209
'MULTILINESTRINGFROMTEXT', // MultiLineStringFromText()
210
'MULTILINESTRINGFROMWKB', // MultiLineStringFromWKB()
211
'MULTIPOINT', // MultiPoint()
212
'MULTIPOINTFROMTEXT', // MultiPointFromText()
213
'MULTIPOINTFROMWKB', // MultiPointFromWKB()
214
'MULTIPOLYGON', // MultiPolygon()
215
'MULTIPOLYGONFROMTEXT', // MultiPolygonFromText()
216
'MULTIPOLYGONFROMWKB', // MultiPolygonFromWKB()
217
'NAME_CONST', // NAME_CONST()
220
'NUMGEOMETRIES', // NumGeometries() geometrycollection-property-functions.html
221
'NUMINTERIORRINGS', // NumInteriorRings() polygon-property-functions.html
222
'NUMPOINTS', // NumPoints() linestring-property-functions.html
227
'OVERLAPS', // Overlaps()
233
'POINTFROMTEXT', // PointFromText()
234
'POINTFROMWKB', // PointFromWKB()
235
'POINTN', // PointN() inestring-property-functions.html
236
'POINTONSURFACE', // PointOnSurface() multipolygon-property-functions.html
237
'POLYFROMTEXT', // PolyFromText()
238
'POLYFROMWKB', // PolyFromWKB()
239
'POLYGON', // Polygon()
240
'POLYGONFROMTEXT', // PolygonFromText()
241
'POLYGONFROMWKB', // PolygonFromWKB()
249
'RELATED', // Related()
252
'REPLACE', // string-functions.html
256
'ROW_COUNT', // information-functions.html
259
'SCHEMA', // information-functions.html
267
'SLEEP', // miscellaneous-functions.html
271
'SRID', // general-geometry-property-functions.html
272
'STARTPOINT', // StartPoint() linestring-property-functions.html
275
'STDDEV_POP', // group-by-functions.html
276
'STDDEV_SAMP', // group-by-functions.html
285
'SYMDIFFERENCE', // SymDifference()
296
'TOUCHES', // Touches()
299
'TRUNCATE', // mathematical-functions.html
301
'UNCOMPRESS', // string-functions.html
302
'UNCOMPRESSED_LENGTH', // string-functions.html
303
'UNHEX', // string-functions.html
306
'UPDATEXML', // UpdateXML() xml-functions.html
312
'UUID', // miscellaneous-functions.html
313
'VARIANCE', // group-by-functions.html
314
'VAR_POP', // group-by-functions.html
315
'VAR_SAMP', // group-by-functions.html
320
'WITHIN', // Within()
321
'X', // point-property-functions.html
322
'Y', // point-property-functions.html
326
//$PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name);
327
$PMA_SQPdata_function_name_cnt = 299;
329
//$test_PMA_SQPdata_function_name = $PMA_SQPdata_function_name;
330
//sort($PMA_SQPdata_function_name);
331
//if ($PMA_SQPdata_function_name != $test_PMA_SQPdata_function_name) {
332
// echo 'sort properly like this<pre>';
333
// print_r($PMA_SQPdata_function_name);
338
$PMA_SQPdata_column_attrib = array (
343
'BERKELEYDB', // Engine alias BDB
345
'BLACKHOLE', // Engine
349
'FEDERATED', // Engine
351
'INNOBASE', // Engine alias InnoDB
352
'INNODB', // Engine InnoDB
354
'MEMORY', // Engine alias HEAP, but preferred
356
'MRG_ISAM', // Engine
357
'MRG_MYISAM', // Engine alias MERGE
358
'MYISAM', // Engine MyISAM
360
'NDB', // Engine alias NDBCLUSTER
361
'NDBCLUSTER', // Engine
369
//$PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib);
370
$PMA_SQPdata_column_attrib_cnt = 29;
372
$PMA_SQPdata_reserved_word = array (
464
'GEMINI_SPIN_RETRIES',
510
'MASTER_CONNECT_RETRY',
518
'MAX_CONNECTIONS_PER_HOUR',
519
'MAX_QUERIES_PER_HOUR',
521
'MAX_UPDATES_PER_HOUR',
522
'MAX_USER_CONNECTIONS',
535
// 'NO' is not allowed in SQL-99 but is allowed in MySQL
597
'SOUNDS', // string-functions.html
604
'SQL_CALC_FOUND_ROWS',
608
'SQL_LOW_PRIORITY_UPDATES',
611
'SQL_QUOTE_SHOW_CREATE',
614
'SQL_SLAVE_SKIP_COUNTER',
655
//$PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
656
$PMA_SQPdata_reserved_word_cnt = 279;
658
// words forbidden to be used as column or table name,
659
// as seen in http://dev.mysql.com/doc/mysql/en/reserved-words.html
660
$PMA_SQPdata_forbidden_word = array (
813
'GEOMETRYCOLLECTION',
890
'MASTER_CONNECT_RETRY',
905
'MAX_CONNECTIONS_PER_HOUR',
906
'MAX_QUERIES_PER_HOUR',
908
'MAX_UPDATES_PER_HOUR',
909
'MAX_USER_CONNECTIONS',
919
'MINUTE_MICROSECOND',
943
'NO_WRITE_TO_BINLOG',
1024
'SECOND_MICROSECOND',
1051
'SQL_BUFFER_RESULT',
1053
'SQL_CALC_FOUND_ROWS',
1058
'SQL_TSI_FRAC_SECOND',
1145
// echo count($PMA_SQPdata_forbidden_word);
1146
$PMA_SQPdata_forbidden_word_cnt = 483;
1148
$PMA_SQPdata_column_type = array (
1154
'BOOLEAN', // numeric-type-overview.html
1166
'GEOMETRY', // spatial
1167
'GEOMETRYCOLLECTION', // spatial
1175
'LINESTRING', // spatial
1183
'MULTILINESTRING', // spatial
1184
'MULTIPOINT', // spatial
1185
'MULTIPOLYGON', // spatial
1189
'POLYGON', // spatial
1191
'SERIAL', // alsias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
1204
//$PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
1205
$PMA_SQPdata_column_type_cnt = 54;
1209
foreach ( $GLOBALS as $n => $a ) {
1210
echo is_array( $a ) ? $n . ': ' . count( $a ) . '<br />' : '';