lex.h 31.6 KB
Newer Older
unknown's avatar
unknown committed
1
/* Copyright (C) 2000-2002 MySQL AB
2

unknown's avatar
unknown committed
3 4 5 6
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
7

unknown's avatar
unknown committed
8 9 10 11
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
12

unknown's avatar
unknown committed
13 14 15 16 17 18 19 20 21
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */


/* This file includes all reserved words and functions */

#include "lex_symbol.h"

unknown's avatar
SCRUM  
unknown committed
22 23 24
SYM_GROUP sym_group_common= {"", ""};
SYM_GROUP sym_group_geom= {"Spatial extentions", "HAVE_SPATIAL"};
SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"};
unknown's avatar
unknown committed
25

26
/* We don't want to include sql_yacc.h into gen_lex_hash */
unknown's avatar
unknown committed
27
#ifdef NO_YACC_SYMBOLS
unknown's avatar
unknown committed
28
#define SYM_OR_NULL(A) 0
unknown's avatar
unknown committed
29
#else
unknown's avatar
unknown committed
30 31 32 33 34 35 36 37
#define SYM_OR_NULL(A) A
#endif

#define SYM(A) SYM_OR_NULL(A),0,0,&sym_group_common
#define F_SYM(A) SYM_OR_NULL(A)

#define CREATE_FUNC(A) (void *)(SYM_OR_NULL(A)), &sym_group_common

unknown's avatar
unknown committed
38
#ifdef HAVE_SPATIAL
unknown's avatar
unknown committed
39 40 41
#define CREATE_FUNC_GEOM(A) (void *)(SYM_OR_NULL(A)), &sym_group_geom
#else
#define CREATE_FUNC_GEOM(A) 0, &sym_group_geom
unknown's avatar
unknown committed
42 43 44
#endif

/*
unknown's avatar
unknown committed
45
  Symbols are broken into separated arrays to allow field names with
unknown's avatar
unknown committed
46 47
  same name as functions.
  These are kept sorted for human lookup (the symbols are hashed).
unknown's avatar
unknown committed
48 49 50
*/

static SYMBOL symbols[] = {
51
  { "&&",		SYM(AND_AND_SYM)},
unknown's avatar
unknown committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
  { "<",		SYM(LT)},
  { "<=",		SYM(LE)},
  { "<>",		SYM(NE)},
  { "!=",		SYM(NE)},
  { "=",		SYM(EQ)},
  { ">",		SYM(GT_SYM)},
  { ">=",		SYM(GE)},
  { "<<",		SYM(SHIFT_LEFT)},
  { ">>",		SYM(SHIFT_RIGHT)},
  { "<=>",		SYM(EQUAL_SYM)},
  { "ACTION",		SYM(ACTION)},
  { "ADD",		SYM(ADD)},
  { "AFTER",		SYM(AFTER_SYM)},
  { "AGAINST",          SYM(AGAINST)},
  { "AGGREGATE",	SYM(AGGREGATE_SYM)},
  { "ALL",		SYM(ALL)},
68
  { "ALGORITHM",	SYM(ALGORITHM_SYM)},
unknown's avatar
unknown committed
69 70
  { "ALTER",		SYM(ALTER)},
  { "ANALYZE",		SYM(ANALYZE_SYM)},
unknown's avatar
unknown committed
71
  { "AND",		SYM(AND_SYM)},
unknown's avatar
unknown committed
72 73 74 75
  { "ANY",              SYM(ANY_SYM)},
  { "AS",		SYM(AS)},
  { "ASC",		SYM(ASC)},
  { "ASCII",		SYM(ASCII_SYM)},
76
  { "ASENSITIVE",       SYM(ASENSITIVE_SYM)},
unknown's avatar
unknown committed
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
  { "AUTO_INCREMENT",	SYM(AUTO_INC)},
  { "AVG",		SYM(AVG_SYM)},
  { "AVG_ROW_LENGTH",	SYM(AVG_ROW_LENGTH)},
  { "BACKUP",	        SYM(BACKUP_SYM)},
  { "BDB",              SYM(BERKELEY_DB_SYM)},
  { "BEFORE",	        SYM(BEFORE_SYM)},
  { "BEGIN",	        SYM(BEGIN_SYM)},
  { "BERKELEYDB",       SYM(BERKELEY_DB_SYM)},
  { "BETWEEN",		SYM(BETWEEN_SYM)},
  { "BIGINT",		SYM(BIGINT)},
  { "BINARY",		SYM(BINARY)},
  { "BINLOG",		SYM(BINLOG_SYM)},
  { "BIT",		SYM(BIT_SYM)},
  { "BLOB",		SYM(BLOB_SYM)},
  { "BOOL",		SYM(BOOL_SYM)},
  { "BOOLEAN",		SYM(BOOLEAN_SYM)},
  { "BOTH",		SYM(BOTH)},
  { "BTREE",		SYM(BTREE_SYM)},
  { "BY",		SYM(BY)},
  { "BYTE",		SYM(BYTE_SYM)},
  { "CACHE",		SYM(CACHE_SYM)},
98
  { "CALL",             SYM(CALL_SYM)},
unknown's avatar
unknown committed
99
  { "CASCADE",		SYM(CASCADE)},
100
  { "CASCADED",         SYM(CASCADED)},
unknown's avatar
unknown committed
101
  { "CASE",		SYM(CASE_SYM)},
unknown's avatar
unknown committed
102
  { "CHAIN",		SYM(CHAIN_SYM)},
unknown's avatar
unknown committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
  { "CHANGE",		SYM(CHANGE)},
  { "CHANGED",		SYM(CHANGED)},
  { "CHAR",		SYM(CHAR_SYM)},
  { "CHARACTER",	SYM(CHAR_SYM)},
  { "CHARSET",		SYM(CHARSET)},
  { "CHECK",		SYM(CHECK_SYM)},
  { "CHECKSUM",		SYM(CHECKSUM_SYM)},
  { "CIPHER",		SYM(CIPHER_SYM)},
  { "CLIENT",		SYM(CLIENT_SYM)},
  { "CLOSE",		SYM(CLOSE_SYM)},
  { "COLLATE",		SYM(COLLATE_SYM)},
  { "COLLATION",	SYM(COLLATION_SYM)},
  { "COLUMN",		SYM(COLUMN_SYM)},
  { "COLUMNS",		SYM(COLUMNS)},
  { "COMMENT",		SYM(COMMENT_SYM)},
  { "COMMIT",		SYM(COMMIT_SYM)},
  { "COMMITTED",	SYM(COMMITTED_SYM)},
120
  { "COMPACT",		SYM(COMPACT_SYM)},
unknown's avatar
unknown committed
121 122
  { "COMPRESSED",	SYM(COMPRESSED_SYM)},
  { "CONCURRENT",	SYM(CONCURRENT)},
123 124
  { "CONDITION",        SYM(CONDITION_SYM)},
  { "CONNECTION",       SYM(CONNECTION_SYM)},
125
  { "CONSISTENT",	SYM(CONSISTENT_SYM)},
unknown's avatar
unknown committed
126
  { "CONSTRAINT",	SYM(CONSTRAINT)},
127 128
  { "CONTAINS",         SYM(CONTAINS_SYM)},
  { "CONTINUE",         SYM(CONTINUE_SYM)},
129
  { "CONVERT",		SYM(CONVERT_SYM)},
unknown's avatar
unknown committed
130 131 132 133 134 135
  { "CREATE",		SYM(CREATE)},
  { "CROSS",		SYM(CROSS)},
  { "CUBE",		SYM(CUBE_SYM)},
  { "CURRENT_DATE",	SYM(CURDATE)},
  { "CURRENT_TIME",	SYM(CURTIME)},
  { "CURRENT_TIMESTAMP", SYM(NOW_SYM)},
136
  { "CURRENT_USER",	SYM(CURRENT_USER)},
137
  { "CURSOR",           SYM(CURSOR_SYM)},
unknown's avatar
unknown committed
138 139 140 141 142 143 144 145 146 147
  { "DATA",		SYM(DATA_SYM)},
  { "DATABASE",		SYM(DATABASE)},
  { "DATABASES",	SYM(DATABASES)},
  { "DATE",		SYM(DATE_SYM)},
  { "DATETIME",		SYM(DATETIME)},
  { "DAY",		SYM(DAY_SYM)},
  { "DAY_HOUR",		SYM(DAY_HOUR_SYM)},
  { "DAY_MICROSECOND",	SYM(DAY_MICROSECOND_SYM)},
  { "DAY_MINUTE",	SYM(DAY_MINUTE_SYM)},
  { "DAY_SECOND",	SYM(DAY_SECOND_SYM)},
unknown's avatar
unknown committed
148
  { "DEALLOCATE",       SYM(DEALLOCATE_SYM)},     
unknown's avatar
unknown committed
149 150
  { "DEC",		SYM(DECIMAL_SYM)},
  { "DECIMAL",		SYM(DECIMAL_SYM)},
151
  { "DECLARE",          SYM(DECLARE_SYM)},
unknown's avatar
unknown committed
152
  { "DEFAULT",		SYM(DEFAULT)},
153
  { "DEFINER",          SYM(DEFINER_SYM)},
unknown's avatar
unknown committed
154 155 156 157 158 159
  { "DELAYED",		SYM(DELAYED_SYM)},
  { "DELAY_KEY_WRITE",	SYM(DELAY_KEY_WRITE_SYM)},
  { "DELETE",		SYM(DELETE_SYM)},
  { "DESC",		SYM(DESC)},
  { "DESCRIBE",		SYM(DESCRIBE)},
  { "DES_KEY_FILE",	SYM(DES_KEY_FILE)},
160
  { "DETERMINISTIC",    SYM(DETERMINISTIC_SYM)},
unknown's avatar
unknown committed
161 162 163 164 165 166 167 168 169 170 171 172 173
  { "DIRECTORY",	SYM(DIRECTORY_SYM)},
  { "DISABLE",		SYM(DISABLE_SYM)},
  { "DISCARD",		SYM(DISCARD)},
  { "DISTINCT",		SYM(DISTINCT)},
  { "DISTINCTROW",	SYM(DISTINCT)},	/* Access likes this */
  { "DIV",		SYM(DIV_SYM)},
  { "DO",		SYM(DO_SYM)},
  { "DOUBLE",		SYM(DOUBLE_SYM)},
  { "DROP",		SYM(DROP)},
  { "DUAL",		SYM(DUAL_SYM)},
  { "DUMPFILE",		SYM(DUMPFILE)},
  { "DUPLICATE",	SYM(DUPLICATE_SYM)},
  { "DYNAMIC",		SYM(DYNAMIC_SYM)},
174
  { "EACH",             SYM(EACH_SYM)},
unknown's avatar
unknown committed
175
  { "ELSE",             SYM(ELSE)},
176
  { "ELSEIF",           SYM(ELSEIF_SYM)},
unknown's avatar
unknown committed
177 178 179 180 181 182 183 184 185 186 187 188
  { "ENABLE",		SYM(ENABLE_SYM)},
  { "ENCLOSED",		SYM(ENCLOSED)},
  { "END",		SYM(END)},
  { "ENGINE",		SYM(ENGINE_SYM)},
  { "ENGINES",		SYM(ENGINES_SYM)},
  { "ENUM",		SYM(ENUM)},
  { "ERRORS",		SYM(ERRORS)},
  { "ESCAPE",		SYM(ESCAPE_SYM)},
  { "ESCAPED",		SYM(ESCAPED)},
  { "EVENTS",		SYM(EVENTS_SYM)},
  { "EXECUTE",		SYM(EXECUTE_SYM)},
  { "EXISTS",		SYM(EXISTS)},
189
  { "EXIT",             SYM(EXIT_SYM)},
unknown's avatar
unknown committed
190 191 192 193 194
  { "EXPANSION",	SYM(EXPANSION_SYM)},
  { "EXPLAIN",		SYM(DESCRIBE)},
  { "EXTENDED",		SYM(EXTENDED_SYM)},
  { "FALSE",		SYM(FALSE_SYM)},
  { "FAST",		SYM(FAST_SYM)},
195
  { "FETCH",            SYM(FETCH_SYM)},
unknown's avatar
unknown committed
196 197 198 199 200 201 202 203 204 205 206
  { "FIELDS",		SYM(COLUMNS)},
  { "FILE",		SYM(FILE_SYM)},
  { "FIRST",		SYM(FIRST_SYM)},
  { "FIXED",		SYM(FIXED_SYM)},
  { "FLOAT",		SYM(FLOAT_SYM)},
  { "FLOAT4",		SYM(FLOAT_SYM)},
  { "FLOAT8",		SYM(DOUBLE_SYM)},
  { "FLUSH",		SYM(FLUSH_SYM)},
  { "FOR",		SYM(FOR_SYM)},
  { "FORCE",		SYM(FORCE_SYM)},
  { "FOREIGN",		SYM(FOREIGN)},
207 208
  { "FOUND",            SYM(FOUND_SYM)},
  { "FRAC_SECOND",      SYM(FRAC_SECOND_SYM)},
unknown's avatar
unknown committed
209 210 211
  { "FROM",		SYM(FROM)},
  { "FULL",		SYM(FULL)},
  { "FULLTEXT",		SYM(FULLTEXT_SYM)},
212
  { "FUNCTION",		SYM(FUNCTION_SYM)},
unknown's avatar
unknown committed
213 214 215 216
  { "GEOMETRY",		SYM(GEOMETRY_SYM)},
  { "GEOMETRYCOLLECTION",SYM(GEOMETRYCOLLECTION)},
  { "GET_FORMAT",       SYM(GET_FORMAT)},
  { "GLOBAL",		SYM(GLOBAL_SYM)},
217
#ifdef SP_GOTO
218
  { "GOTO",             SYM(GOTO_SYM)},
219
#endif
unknown's avatar
unknown committed
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
  { "GRANT",		SYM(GRANT)},
  { "GRANTS",	        SYM(GRANTS)},
  { "GROUP",		SYM(GROUP)},
  { "HANDLER",		SYM(HANDLER_SYM)},
  { "HASH",		SYM(HASH_SYM)},
  { "HAVING",		SYM(HAVING)},
  { "HELP",		SYM(HELP_SYM)},
  { "HIGH_PRIORITY",	SYM(HIGH_PRIORITY)},
  { "HOSTS",		SYM(HOSTS_SYM)},
  { "HOUR",		SYM(HOUR_SYM)},
  { "HOUR_MICROSECOND",	SYM(HOUR_MICROSECOND_SYM)},
  { "HOUR_MINUTE",	SYM(HOUR_MINUTE_SYM)},
  { "HOUR_SECOND",	SYM(HOUR_SECOND_SYM)},
  { "IDENTIFIED",	SYM(IDENTIFIED_SYM)},
  { "IF",		SYM(IF)},
  { "IGNORE",		SYM(IGNORE_SYM)},
  { "IMPORT",		SYM(IMPORT)},
  { "IN",		SYM(IN_SYM)},
unknown's avatar
unknown committed
238
  { "INDEX",		SYM(INDEX_SYM)},
unknown's avatar
unknown committed
239 240 241 242 243
  { "INDEXES",		SYM(INDEXES)},
  { "INFILE",		SYM(INFILE)},
  { "INNER",		SYM(INNER_SYM)},
  { "INNOBASE",		SYM(INNOBASE_SYM)},
  { "INNODB",		SYM(INNOBASE_SYM)},
244 245
  { "INOUT",            SYM(INOUT_SYM)},
  { "INSENSITIVE",      SYM(INSENSITIVE_SYM)},
unknown's avatar
unknown committed
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
  { "INSERT",		SYM(INSERT)},
  { "INSERT_METHOD",    SYM(INSERT_METHOD)},
  { "INT",		SYM(INT_SYM)},
  { "INT1",		SYM(TINYINT)},
  { "INT2",		SYM(SMALLINT)},
  { "INT3",		SYM(MEDIUMINT)},
  { "INT4",		SYM(INT_SYM)},
  { "INT8",		SYM(BIGINT)},
  { "INTEGER",		SYM(INT_SYM)},
  { "INTERVAL",		SYM(INTERVAL_SYM)},
  { "INTO",		SYM(INTO)},
  { "IO_THREAD",        SYM(RELAY_THREAD)},
  { "IS",		SYM(IS)},
  { "ISOLATION",	SYM(ISOLATION)},
  { "ISSUER",		SYM(ISSUER_SYM)},
261 262
  { "ITERATE",          SYM(ITERATE_SYM)},
  { "INVOKER",          SYM(INVOKER_SYM)},
unknown's avatar
unknown committed
263 264 265 266
  { "JOIN",		SYM(JOIN_SYM)},
  { "KEY",		SYM(KEY_SYM)},
  { "KEYS",		SYM(KEYS)},
  { "KILL",		SYM(KILL_SYM)},
267 268
#ifdef SP_GOTO
  /* QQ This will go away when the GOTO label syntax is fixed */
269
  { "LABEL",            SYM(LABEL_SYM)},
270
#endif
271
  { "LANGUAGE",         SYM(LANGUAGE_SYM)},
unknown's avatar
unknown committed
272 273
  { "LAST",		SYM(LAST_SYM)},
  { "LEADING",		SYM(LEADING)},
274
  { "LEAVE",            SYM(LEAVE_SYM)},
unknown's avatar
unknown committed
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
  { "LEAVES",		SYM(LEAVES)},
  { "LEFT",		SYM(LEFT)},
  { "LEVEL",		SYM(LEVEL_SYM)},
  { "LIKE",		SYM(LIKE)},
  { "LIMIT",		SYM(LIMIT)},
  { "LINES",		SYM(LINES)},
  { "LINESTRING",	SYM(LINESTRING)},
  { "LOAD",		SYM(LOAD)},
  { "LOCAL",		SYM(LOCAL_SYM)},
  { "LOCALTIME",	SYM(NOW_SYM)},
  { "LOCALTIMESTAMP",	SYM(NOW_SYM)},
  { "LOCK",		SYM(LOCK_SYM)},
  { "LOCKS",		SYM(LOCKS_SYM)},
  { "LOGS",		SYM(LOGS_SYM)},
  { "LONG",		SYM(LONG_SYM)},
  { "LONGBLOB",		SYM(LONGBLOB)},
  { "LONGTEXT",		SYM(LONGTEXT)},
292
  { "LOOP",             SYM(LOOP_SYM)},
unknown's avatar
unknown committed
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
  { "LOW_PRIORITY",	SYM(LOW_PRIORITY)},
  { "MASTER",           SYM(MASTER_SYM)},
  { "MASTER_CONNECT_RETRY",           SYM(MASTER_CONNECT_RETRY_SYM)},
  { "MASTER_HOST",           SYM(MASTER_HOST_SYM)},
  { "MASTER_LOG_FILE",           SYM(MASTER_LOG_FILE_SYM)},
  { "MASTER_LOG_POS",           SYM(MASTER_LOG_POS_SYM)},
  { "MASTER_PASSWORD",           SYM(MASTER_PASSWORD_SYM)},
  { "MASTER_PORT",           SYM(MASTER_PORT_SYM)},
  { "MASTER_SERVER_ID",           SYM(MASTER_SERVER_ID_SYM)},
  { "MASTER_SSL",       SYM(MASTER_SSL_SYM)},
  { "MASTER_SSL_CA",    SYM(MASTER_SSL_CA_SYM)},
  { "MASTER_SSL_CAPATH",SYM(MASTER_SSL_CAPATH_SYM)},
  { "MASTER_SSL_CERT",  SYM(MASTER_SSL_CERT_SYM)},
  { "MASTER_SSL_CIPHER",SYM(MASTER_SSL_CIPHER_SYM)},
  { "MASTER_SSL_KEY",   SYM(MASTER_SSL_KEY_SYM)},
  { "MASTER_USER",           SYM(MASTER_USER_SYM)},
  { "MATCH",		SYM(MATCH)},
  { "MAX_CONNECTIONS_PER_HOUR", SYM(MAX_CONNECTIONS_PER_HOUR)},
  { "MAX_QUERIES_PER_HOUR", SYM(MAX_QUERIES_PER_HOUR)},
  { "MAX_ROWS",		SYM(MAX_ROWS)},
  { "MAX_UPDATES_PER_HOUR", SYM(MAX_UPDATES_PER_HOUR)},
314
  { "MAX_USER_CONNECTIONS", SYM(MAX_USER_CONNECTIONS_SYM)},
unknown's avatar
unknown committed
315 316 317 318
  { "MEDIUM",		SYM(MEDIUM_SYM)},
  { "MEDIUMBLOB",	SYM(MEDIUMBLOB)},
  { "MEDIUMINT",	SYM(MEDIUMINT)},
  { "MEDIUMTEXT",	SYM(MEDIUMTEXT)},
319
  { "MERGE",		SYM(MERGE_SYM)},
unknown's avatar
unknown committed
320 321
  { "MICROSECOND",	SYM(MICROSECOND_SYM)},
  { "MIDDLEINT",	SYM(MEDIUMINT)},	/* For powerbuilder */
322
  { "MIGRATE",          SYM(MIGRATE_SYM)},
unknown's avatar
unknown committed
323 324 325 326 327 328
  { "MINUTE",		SYM(MINUTE_SYM)},
  { "MINUTE_MICROSECOND", SYM(MINUTE_MICROSECOND_SYM)},
  { "MINUTE_SECOND",	SYM(MINUTE_SECOND_SYM)},
  { "MIN_ROWS",		SYM(MIN_ROWS)},
  { "MOD",		SYM(MOD_SYM)},
  { "MODE",		SYM(MODE_SYM)},
329
  { "MODIFIES",		SYM(MODIFIES_SYM)},
unknown's avatar
unknown committed
330 331 332 333 334
  { "MODIFY",		SYM(MODIFY_SYM)},
  { "MONTH",		SYM(MONTH_SYM)},
  { "MULTILINESTRING",	SYM(MULTILINESTRING)},
  { "MULTIPOINT",	SYM(MULTIPOINT)},
  { "MULTIPOLYGON",	SYM(MULTIPOLYGON)},
unknown's avatar
unknown committed
335
  { "MUTEX",  SYM(MUTEX_SYM)},
336
  { "NAME",             SYM(NAME_SYM)},
unknown's avatar
unknown committed
337 338 339
  { "NAMES",		SYM(NAMES_SYM)},
  { "NATIONAL",		SYM(NATIONAL_SYM)},
  { "NATURAL",		SYM(NATURAL)},
unknown's avatar
unknown committed
340 341
  { "NDB",              SYM(NDBCLUSTER_SYM)},
  { "NDBCLUSTER",       SYM(NDBCLUSTER_SYM)},
unknown's avatar
unknown committed
342 343 344 345 346
  { "NCHAR",		SYM(NCHAR_SYM)},
  { "NEW",              SYM(NEW_SYM)},
  { "NEXT",		SYM(NEXT_SYM)},
  { "NO",		SYM(NO_SYM)},
  { "NONE",		SYM(NONE_SYM)},
347
  { "NOT",		SYM(NOT_SYM)},
unknown's avatar
unknown committed
348 349 350 351 352 353 354
  { "NO_WRITE_TO_BINLOG",  SYM(NO_WRITE_TO_BINLOG)},
  { "NULL",		SYM(NULL_SYM)},
  { "NUMERIC",		SYM(NUMERIC_SYM)},
  { "NVARCHAR",		SYM(NVARCHAR_SYM)},
  { "OFFSET",		SYM(OFFSET_SYM)},
  { "OLD_PASSWORD",	SYM(OLD_PASSWORD)},
  { "ON",		SYM(ON)},
355
  { "ONE",              SYM(ONE_SYM)},
356
  { "ONE_SHOT",		SYM(ONE_SHOT_SYM)},
unknown's avatar
unknown committed
357 358 359 360
  { "OPEN",		SYM(OPEN_SYM)},
  { "OPTIMIZE",		SYM(OPTIMIZE)},
  { "OPTION",		SYM(OPTION)},
  { "OPTIONALLY",	SYM(OPTIONALLY)},
unknown's avatar
unknown committed
361
  { "OR",		SYM(OR_SYM)},
unknown's avatar
unknown committed
362
  { "ORDER",		SYM(ORDER_SYM)},
363
  { "OUT",              SYM(OUT_SYM)},
unknown's avatar
unknown committed
364 365 366 367 368
  { "OUTER",		SYM(OUTER)},
  { "OUTFILE",		SYM(OUTFILE)},
  { "PACK_KEYS",	SYM(PACK_KEYS_SYM)},
  { "PARTIAL",		SYM(PARTIAL)},
  { "PASSWORD",		SYM(PASSWORD)},
369
  { "PHASE",            SYM(PHASE_SYM)},
unknown's avatar
unknown committed
370 371 372
  { "POINT",		SYM(POINT_SYM)},
  { "POLYGON",		SYM(POLYGON)},
  { "PRECISION",	SYM(PRECISION)},
unknown's avatar
unknown committed
373
  { "PREPARE",          SYM(PREPARE_SYM)},
unknown's avatar
unknown committed
374 375 376 377 378 379 380
  { "PREV",		SYM(PREV_SYM)},
  { "PRIMARY",		SYM(PRIMARY_SYM)},
  { "PRIVILEGES",	SYM(PRIVILEGES)},
  { "PROCEDURE",	SYM(PROCEDURE)},
  { "PROCESS"	,	SYM(PROCESS)},
  { "PROCESSLIST",	SYM(PROCESSLIST_SYM)},
  { "PURGE",		SYM(PURGE)},
381
  { "QUARTER",          SYM(QUARTER_SYM)},
unknown's avatar
unknown committed
382 383 384 385 386 387 388
  { "QUERY",		SYM(QUERY_SYM)},
  { "QUICK",	        SYM(QUICK)},
  { "RAID0",		SYM(RAID_0_SYM)},
  { "RAID_CHUNKS",	SYM(RAID_CHUNKS)},
  { "RAID_CHUNKSIZE",	SYM(RAID_CHUNKSIZE)},
  { "RAID_TYPE",	SYM(RAID_TYPE)},
  { "READ",		SYM(READ_SYM)},
389
  { "READS",		SYM(READS_SYM)},
unknown's avatar
unknown committed
390
  { "REAL",		SYM(REAL)},
391
  { "RECOVER",          SYM(RECOVER_SYM)},
392
  { "REDUNDANT",	SYM(REDUNDANT_SYM)},
unknown's avatar
unknown committed
393 394 395 396 397
  { "REFERENCES",	SYM(REFERENCES)},
  { "REGEXP",		SYM(REGEXP)},
  { "RELAY_LOG_FILE",   SYM(RELAY_LOG_FILE_SYM)},
  { "RELAY_LOG_POS",    SYM(RELAY_LOG_POS_SYM)},
  { "RELAY_THREAD",     SYM(RELAY_THREAD)},
unknown's avatar
unknown committed
398
  { "RELEASE",		SYM(RELEASE_SYM)},
unknown's avatar
unknown committed
399 400 401 402 403 404
  { "RELOAD",		SYM(RELOAD)},
  { "RENAME",		SYM(RENAME)},
  { "REPAIR",		SYM(REPAIR)},
  { "REPEATABLE",	SYM(REPEATABLE_SYM)},
  { "REPLACE",		SYM(REPLACE)},
  { "REPLICATION",	SYM(REPLICATION)},
405
  { "REPEAT",           SYM(REPEAT_SYM)},
unknown's avatar
unknown committed
406 407 408 409
  { "REQUIRE",	        SYM(REQUIRE_SYM)},
  { "RESET",		SYM(RESET_SYM)},
  { "RESTORE",		SYM(RESTORE_SYM)},
  { "RESTRICT",		SYM(RESTRICT)},
410
  { "RESUME",           SYM(RESUME_SYM)},
411 412
  { "RETURN",           SYM(RETURN_SYM)},
  { "RETURNS",		SYM(RETURNS_SYM)},
unknown's avatar
unknown committed
413 414 415 416 417
  { "REVOKE",		SYM(REVOKE)},
  { "RIGHT",		SYM(RIGHT)},
  { "RLIKE",		SYM(REGEXP)},	/* Like in mSQL2 */
  { "ROLLBACK",		SYM(ROLLBACK_SYM)},
  { "ROLLUP",		SYM(ROLLUP_SYM)},
418
  { "ROUTINE",		SYM(ROUTINE_SYM)},
unknown's avatar
unknown committed
419 420 421 422 423
  { "ROW",		SYM(ROW_SYM)},
  { "ROWS",		SYM(ROWS_SYM)},
  { "ROW_FORMAT",	SYM(ROW_FORMAT_SYM)},
  { "RTREE",		SYM(RTREE_SYM)},
  { "SAVEPOINT",	SYM(SAVEPOINT_SYM)},
424 425
  { "SCHEMA",		SYM(DATABASE)},
  { "SCHEMAS",          SYM(DATABASES)},
unknown's avatar
unknown committed
426 427
  { "SECOND",		SYM(SECOND_SYM)},
  { "SECOND_MICROSECOND", SYM(SECOND_MICROSECOND_SYM)},
428
  { "SECURITY",         SYM(SECURITY_SYM)},
unknown's avatar
unknown committed
429
  { "SELECT",		SYM(SELECT_SYM)},
430
  { "SENSITIVE",        SYM(SENSITIVE_SYM)},
unknown's avatar
unknown committed
431 432 433 434 435 436 437 438 439 440 441
  { "SEPARATOR",	SYM(SEPARATOR_SYM)},
  { "SERIAL",		SYM(SERIAL_SYM)},
  { "SERIALIZABLE",	SYM(SERIALIZABLE_SYM)},
  { "SESSION",		SYM(SESSION_SYM)},
  { "SET",		SYM(SET)},
  { "SHARE",		SYM(SHARE_SYM)},
  { "SHOW",		SYM(SHOW)},
  { "SHUTDOWN",		SYM(SHUTDOWN)},
  { "SIGNED",		SYM(SIGNED_SYM)},
  { "SIMPLE",		SYM(SIMPLE_SYM)},
  { "SLAVE",            SYM(SLAVE)},
442
  { "SNAPSHOT",         SYM(SNAPSHOT_SYM)},
unknown's avatar
unknown committed
443 444 445 446 447
  { "SMALLINT",		SYM(SMALLINT)},
  { "SOME",             SYM(ANY_SYM)},
  { "SONAME",		SYM(UDF_SONAME_SYM)},
  { "SOUNDS",		SYM(SOUNDS_SYM)},
  { "SPATIAL",		SYM(SPATIAL_SYM)},
448 449 450 451 452
  { "SPECIFIC",         SYM(SPECIFIC_SYM)},
  { "SQL",              SYM(SQL_SYM)},
  { "SQLEXCEPTION",     SYM(SQLEXCEPTION_SYM)},
  { "SQLSTATE",         SYM(SQLSTATE_SYM)},
  { "SQLWARNING",       SYM(SQLWARNING_SYM)},
unknown's avatar
unknown committed
453 454 455 456 457 458 459
  { "SQL_BIG_RESULT",	SYM(SQL_BIG_RESULT)},
  { "SQL_BUFFER_RESULT", SYM(SQL_BUFFER_RESULT)},
  { "SQL_CACHE",        SYM(SQL_CACHE_SYM)},
  { "SQL_CALC_FOUND_ROWS", SYM(SQL_CALC_FOUND_ROWS)},
  { "SQL_NO_CACHE",	SYM(SQL_NO_CACHE_SYM)},
  { "SQL_SMALL_RESULT", SYM(SQL_SMALL_RESULT)},
  { "SQL_THREAD",	SYM(SQL_THREAD)},
460 461 462 463 464 465 466 467 468
  { "SQL_TSI_FRAC_SECOND", SYM(FRAC_SECOND_SYM)},
  { "SQL_TSI_SECOND",   SYM(SECOND_SYM)},
  { "SQL_TSI_MINUTE",   SYM(MINUTE_SYM)},
  { "SQL_TSI_HOUR",     SYM(HOUR_SYM)},
  { "SQL_TSI_DAY",      SYM(DAY_SYM)},
  { "SQL_TSI_WEEK",     SYM(WEEK_SYM)},
  { "SQL_TSI_MONTH",    SYM(MONTH_SYM)},
  { "SQL_TSI_QUARTER",  SYM(QUARTER_SYM)},
  { "SQL_TSI_YEAR",     SYM(YEAR_SYM)},
unknown's avatar
unknown committed
469 470 471 472 473 474 475 476 477 478 479
  { "SSL",		SYM(SSL_SYM)},
  { "START",		SYM(START_SYM)},
  { "STARTING",		SYM(STARTING)},
  { "STATUS",		SYM(STATUS_SYM)},
  { "STOP",		SYM(STOP_SYM)},
  { "STORAGE",		SYM(STORAGE_SYM)},
  { "STRAIGHT_JOIN",	SYM(STRAIGHT_JOIN)},
  { "STRING",		SYM(STRING_SYM)},
  { "STRIPED",		SYM(RAID_STRIPED_SYM)},
  { "SUBJECT",		SYM(SUBJECT_SYM)},
  { "SUPER",		SYM(SUPER_SYM)},
480
  { "SUSPEND",          SYM(SUSPEND_SYM)},
unknown's avatar
unknown committed
481 482 483 484
  { "TABLE",		SYM(TABLE_SYM)},
  { "TABLES",		SYM(TABLES)},
  { "TABLESPACE",	SYM(TABLESPACE)},
  { "TEMPORARY",	SYM(TEMPORARY)},
485
  { "TEMPTABLE",	SYM(TEMPTABLE_SYM)},
unknown's avatar
unknown committed
486 487 488 489 490
  { "TERMINATED",	SYM(TERMINATED)},
  { "TEXT",		SYM(TEXT_SYM)},
  { "THEN",		SYM(THEN_SYM)},
  { "TIME",		SYM(TIME_SYM)},
  { "TIMESTAMP",	SYM(TIMESTAMP)},
491 492
  { "TIMESTAMPADD",     SYM(TIMESTAMP_ADD)},
  { "TIMESTAMPDIFF",    SYM(TIMESTAMP_DIFF)},
unknown's avatar
unknown committed
493 494 495 496 497 498
  { "TINYBLOB",		SYM(TINYBLOB)},
  { "TINYINT",		SYM(TINYINT)},
  { "TINYTEXT",		SYM(TINYTEXT)},
  { "TO",		SYM(TO_SYM)},
  { "TRAILING",		SYM(TRAILING)},
  { "TRANSACTION",	SYM(TRANSACTION_SYM)},
499
  { "TRIGGER",          SYM(TRIGGER_SYM)},
500
  { "TRIGGERS",         SYM(TRIGGERS_SYM)},
unknown's avatar
unknown committed
501 502 503 504 505
  { "TRUE",		SYM(TRUE_SYM)},
  { "TRUNCATE",		SYM(TRUNCATE_SYM)},
  { "TYPE",		SYM(TYPE_SYM)},
  { "TYPES",		SYM(TYPES_SYM)},
  { "UNCOMMITTED",	SYM(UNCOMMITTED_SYM)},
506 507
  { "UNDEFINED",	SYM(UNDEFINED_SYM)},
  { "UNDO",             SYM(UNDO_SYM)},
unknown's avatar
unknown committed
508 509 510
  { "UNICODE",	        SYM(UNICODE_SYM)},
  { "UNION",	        SYM(UNION_SYM)},
  { "UNIQUE",		SYM(UNIQUE_SYM)},
511
  { "UNKNOWN",		SYM(UNKNOWN_SYM)},
unknown's avatar
unknown committed
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
  { "UNLOCK",		SYM(UNLOCK_SYM)},
  { "UNSIGNED",		SYM(UNSIGNED)},
  { "UNTIL",		SYM(UNTIL_SYM)},
  { "UPDATE",		SYM(UPDATE_SYM)},
  { "USAGE",		SYM(USAGE)},
  { "USE",		SYM(USE_SYM)},
  { "USER",		SYM(USER)},
  { "USER_RESOURCES",	SYM(RESOURCES)},
  { "USE_FRM",		SYM(USE_FRM)},
  { "USING",		SYM(USING)},
  { "UTC_DATE",         SYM(UTC_DATE_SYM)},
  { "UTC_TIME",         SYM(UTC_TIME_SYM)},
  { "UTC_TIMESTAMP",    SYM(UTC_TIMESTAMP_SYM)},
  { "VALUE",		SYM(VALUE_SYM)},
  { "VALUES",		SYM(VALUES)},
  { "VARBINARY",	SYM(VARBINARY)},
  { "VARCHAR",		SYM(VARCHAR)},
  { "VARCHARACTER",	SYM(VARCHAR)},
  { "VARIABLES",	SYM(VARIABLES)},
  { "VARYING",		SYM(VARYING)},
  { "WARNINGS",		SYM(WARNINGS)},
533
  { "WEEK",		SYM(WEEK_SYM)},
unknown's avatar
unknown committed
534 535
  { "WHEN",		SYM(WHEN_SYM)},
  { "WHERE",		SYM(WHERE)},
536 537
  { "WHILE",            SYM(WHILE_SYM)},
  { "VIEW",		SYM(VIEW_SYM)},
unknown's avatar
unknown committed
538 539 540 541 542
  { "WITH",		SYM(WITH)},
  { "WORK",		SYM(WORK_SYM)},
  { "WRITE",		SYM(WRITE_SYM)},
  { "X509",		SYM(X509_SYM)},
  { "XOR",		SYM(XOR)},
543
  { "XA",               SYM(XA_SYM)},
unknown's avatar
unknown committed
544 545 546
  { "YEAR",		SYM(YEAR_SYM)},
  { "YEAR_MONTH",	SYM(YEAR_MONTH_SYM)},
  { "ZEROFILL",		SYM(ZEROFILL)},
547
  { "||",		SYM(OR_OR_SYM)}
unknown's avatar
unknown committed
548 549 550 551
};


static SYMBOL sql_functions[] = {
unknown's avatar
unknown committed
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585
  { "ABS",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_abs)},
  { "ACOS",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_acos)},
  { "ADDDATE",		SYM(ADDDATE_SYM)},
  { "ADDTIME",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_addtime)},
  { "AES_ENCRYPT",      F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_encrypt)},
  { "AES_DECRYPT",      F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_decrypt)},
  { "AREA",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_area)},
  { "ASIN",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_asin)},
  { "ASBINARY",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkb)},
  { "ASTEXT",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkt)},
  { "ASWKB",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkb)},
  { "ASWKT",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkt)},
  { "ATAN",		SYM(ATAN)},
  { "ATAN2",		SYM(ATAN)},
  { "BENCHMARK",	SYM(BENCHMARK_SYM)},
  { "BIN",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bin)},
  { "BIT_COUNT",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_count)},
  { "BIT_OR",		SYM(BIT_OR)},
  { "BIT_AND",		SYM(BIT_AND)},
  { "BIT_XOR",		SYM(BIT_XOR)},
  { "CAST",		SYM(CAST_SYM)},
  { "CEIL",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
  { "CEILING",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
  { "BIT_LENGTH",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_length)},
  { "CENTROID",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_centroid)},
  { "CHAR_LENGTH",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
  { "CHARACTER_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
  { "COALESCE",		SYM(COALESCE)},
  { "COERCIBILITY",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_coercibility)},
  { "COMPRESS",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_compress)},
  { "CONCAT",		SYM(CONCAT)},
  { "CONCAT_WS",	SYM(CONCAT_WS)},
  { "CONNECTION_ID",	F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_connection_id)},
  { "CONV",		F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_conv)},
586
  { "CONVERT_TZ",	SYM(CONVERT_TZ_SYM)},
unknown's avatar
unknown committed
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
  { "COUNT",		SYM(COUNT_SYM)},
  { "COS",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cos)},
  { "COT",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cot)},
  { "CRC32",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_crc32)},
  { "CROSSES",		F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_crosses)},
  { "CURDATE",		SYM(CURDATE)},
  { "CURTIME",		SYM(CURTIME)},
  { "DATE_ADD",		SYM(DATE_ADD_INTERVAL)},
  { "DATEDIFF",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_datediff)},
  { "DATE_FORMAT",	F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_date_format)},
  { "DATE_SUB",		SYM(DATE_SUB_INTERVAL)},
  { "DAYNAME",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayname)},
  { "DAYOFMONTH",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofmonth)},
  { "DAYOFWEEK",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofweek)},
  { "DAYOFYEAR",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofyear)},
  { "DECODE",		SYM(DECODE_SYM)},
  { "DEGREES",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_degrees)},
  { "DES_ENCRYPT",	SYM(DES_ENCRYPT_SYM)},
  { "DES_DECRYPT",	SYM(DES_DECRYPT_SYM)},
  { "DIMENSION",	F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_dimension)},
  { "DISJOINT",		F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_disjoint)},
  { "ELT",		SYM(ELT_FUNC)},
  { "ENCODE",		SYM(ENCODE_SYM)},
  { "ENCRYPT",		SYM(ENCRYPT)},
  { "ENDPOINT",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_endpoint)},
  { "ENVELOPE",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_envelope)},
  { "EQUALS",		F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_equals)},
  { "EXTERIORRING",	F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_exteriorring)},
  { "EXTRACT",		SYM(EXTRACT_SYM)},
  { "EXP",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_exp)},
  { "EXPORT_SET",	SYM(EXPORT_SET)},
  { "FIELD",		SYM(FIELD_FUNC)},	/* For compability */
  { "FIND_IN_SET",	F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_find_in_set)},
  { "FLOOR",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_floor)},
  { "FORMAT",		SYM(FORMAT_SYM)},
  { "FOUND_ROWS",	F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_found_rows)},
  { "FROM_DAYS",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_from_days)},
  { "FROM_UNIXTIME",	SYM(FROM_UNIXTIME)},
  { "GET_LOCK",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_get_lock)},
  { "GEOMETRYN",	F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_geometryn)},
unknown's avatar
SCRUM  
unknown committed
627
  { "GEOMETRYTYPE",	F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_geometry_type)},
unknown's avatar
unknown committed
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726
  { "GEOMCOLLFROMTEXT",	SYM(GEOMCOLLFROMTEXT)},
  { "GEOMCOLLFROMWKB",	SYM(GEOMFROMWKB)},
  { "GEOMETRYCOLLECTIONFROMTEXT",SYM(GEOMCOLLFROMTEXT)},
  { "GEOMETRYCOLLECTIONFROMWKB",SYM(GEOMFROMWKB)},
  { "GEOMETRYFROMTEXT", SYM(GEOMFROMTEXT)},
  { "GEOMETRYFROMWKB",	SYM(GEOMFROMWKB)},
  { "GEOMFROMTEXT",	SYM(GEOMFROMTEXT)},
  { "GEOMFROMWKB",	SYM(GEOMFROMWKB)},
  { "GLENGTH",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_glength)},
  { "GREATEST",		SYM(GREATEST_SYM)},
  { "GROUP_CONCAT",	SYM(GROUP_CONCAT_SYM)},
  { "GROUP_UNIQUE_USERS",	SYM(GROUP_UNIQUE_USERS)},
  { "HEX",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_hex)},
  { "IFNULL",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_ifnull)},
  { "INET_ATON",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_aton)},
  { "INET_NTOA",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_ntoa)},
  { "INSTR",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_instr)},
  { "INTERIORRINGN",	F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_interiorringn)},
  { "INTERSECTS",	F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_intersects)},
  { "ISCLOSED",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_isclosed)},
  { "ISEMPTY",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_isempty)},
  { "ISNULL",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isnull)},
  { "IS_FREE_LOCK",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_free_lock)},
  { "IS_USED_LOCK",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_used_lock)},
  { "LAST_INSERT_ID",	SYM(LAST_INSERT_ID)},
  { "ISSIMPLE",         F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_issimple)},
  { "LAST_DAY",         F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_last_day)},
  { "LCASE",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
  { "LEAST",		SYM(LEAST_SYM)},
  { "LENGTH",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
  { "LN",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ln)},
  { "LINEFROMTEXT",	SYM(LINEFROMTEXT)},
  { "LINEFROMWKB",	SYM(GEOMFROMWKB)},
  { "LINESTRINGFROMTEXT",SYM(LINEFROMTEXT)},
  { "LINESTRINGFROMWKB",SYM(GEOMFROMWKB)},
  { "LOAD_FILE",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_load_file)},
  { "LOCATE",		SYM(LOCATE)},
  { "LOG",		SYM(LOG_SYM)},
  { "LOG2",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log2)},
  { "LOG10",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log10)},
  { "LOWER",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
  { "LPAD",		F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_lpad)},
  { "LTRIM",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ltrim)},
  { "MAKE_SET",		SYM(MAKE_SET_SYM)},
  { "MAKEDATE",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_makedate)},
  { "MAKETIME",		F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_maketime)},
  { "MASTER_POS_WAIT",	SYM(MASTER_POS_WAIT)},
  { "MAX",		SYM(MAX_SYM)},
  { "MBRCONTAINS",	F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_contains)},
  { "MBRDISJOINT",	F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_disjoint)},
  { "MBREQUAL",		F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_equals)},
  { "MBRINTERSECTS",	F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_intersects)},
  { "MBROVERLAPS",	F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_overlaps)},
  { "MBRTOUCHES",	F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_touches)},
  { "MBRWITHIN",	F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_within)},
  { "MD5",              F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_md5)},
  { "MID",		SYM(SUBSTRING)},	/* unireg function */
  { "MIN",		SYM(MIN_SYM)},
  { "MLINEFROMTEXT",	SYM(MLINEFROMTEXT)},
  { "MLINEFROMWKB",	SYM(GEOMFROMWKB)},
  { "MPOINTFROMTEXT",	SYM(MPOINTFROMTEXT)},
  { "MPOINTFROMWKB",	SYM(GEOMFROMWKB)},
  { "MPOLYFROMTEXT",	SYM(MPOLYFROMTEXT)},
  { "MPOLYFROMWKB",	SYM(GEOMFROMWKB)},
  { "MONTHNAME",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_monthname)},
  { "MULTILINESTRINGFROMTEXT",SYM(MLINEFROMTEXT)},
  { "MULTILINESTRINGFROMWKB",SYM(GEOMFROMWKB)},
  { "MULTIPOINTFROMTEXT",SYM(MPOINTFROMTEXT)},
  { "MULTIPOINTFROMWKB",SYM(GEOMFROMWKB)},
  { "MULTIPOLYGONFROMTEXT",SYM(MPOLYFROMTEXT)},
  { "MULTIPOLYGONFROMWKB",SYM(GEOMFROMWKB)},
  { "NOW",		SYM(NOW_SYM)},
  { "NULLIF",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_nullif)},
  { "NUMGEOMETRIES",	F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_numgeometries)},
  { "NUMINTERIORRINGS",	F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_numinteriorring)},
  { "NUMPOINTS",	F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_numpoints)},
  { "OCTET_LENGTH",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
  { "OCT",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_oct)},
  { "ORD",              F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ord)},
  { "OVERLAPS",		F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_overlaps)},
  { "PERIOD_ADD",	F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_add)},
  { "PERIOD_DIFF",	F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_diff)},
  { "PI",		F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_pi)},
  { "POINTFROMTEXT",	SYM(POINTFROMTEXT)},
  { "POINTFROMWKB",	SYM(GEOMFROMWKB)},
  { "POINTN",		F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_pointn)},
  { "POLYFROMTEXT",	SYM(POLYFROMTEXT)},
  { "POLYFROMWKB",	SYM(GEOMFROMWKB)},
  { "POLYGONFROMTEXT",	SYM(POLYFROMTEXT)},
  { "POLYGONFROMWKB",	SYM(GEOMFROMWKB)},
  { "POSITION",		SYM(POSITION_SYM)},
  { "POW",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
  { "POWER",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
  { "QUOTE",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quote)},
  { "RADIANS",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_radians)},
  { "RAND",		SYM(RAND)},
  { "RELEASE_LOCK",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_release_lock)},
  { "REVERSE",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_reverse)},
  { "ROUND",		SYM(ROUND)},
727
  { "ROW_COUNT",	SYM(ROW_COUNT_SYM)},
unknown's avatar
unknown committed
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743
  { "RPAD",		F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_rpad)},
  { "RTRIM",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_rtrim)},
  { "SEC_TO_TIME",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sec_to_time)},
  { "SESSION_USER",	SYM(USER)},
  { "SUBDATE",		SYM(SUBDATE_SYM)},
  { "SIGN",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sign)},
  { "SIN",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sin)},
  { "SHA",              F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
  { "SHA1",             F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
  { "SOUNDEX",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_soundex)},
  { "SPACE",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_space)},
  { "SQRT",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sqrt)},
  { "SRID",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_srid)},
  { "STARTPOINT",	F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_startpoint)},
  { "STD",		SYM(STD_SYM)},
  { "STDDEV",		SYM(STD_SYM)},
744 745
  { "STDDEV_POP",	SYM(STD_SYM)},
  { "STDDEV_SAMP",	SYM(STDDEV_SAMP_SYM)},
unknown's avatar
unknown committed
746 747
  { "STR_TO_DATE",	F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_str_to_date)},
  { "STRCMP",		F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_strcmp)},
unknown's avatar
unknown committed
748
  { "SUBSTR",		SYM(SUBSTRING)},
unknown's avatar
unknown committed
749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764
  { "SUBSTRING",	SYM(SUBSTRING)},
  { "SUBSTRING_INDEX",	SYM(SUBSTRING_INDEX)},
  { "SUBTIME",          F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_subtime)},
  { "SUM",		SYM(SUM_SYM)},
  { "SYSDATE",		SYM(NOW_SYM)},
  { "SYSTEM_USER",	SYM(USER)},
  { "TAN",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_tan)},
  { "TIME_FORMAT",	F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_time_format)},
  { "TIME_TO_SEC",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_time_to_sec)},
  { "TIMEDIFF",         F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_timediff)},
  { "TO_DAYS",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_to_days)},
  { "TOUCHES",		F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_touches)},
  { "TRIM",		SYM(TRIM)},
  { "UCASE",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
  { "UNCOMPRESS",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompress)},
  { "UNCOMPRESSED_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompressed_length)},
unknown's avatar
unknown committed
765
  { "UNHEX",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_unhex)},
unknown's avatar
unknown committed
766 767 768
  { "UNIQUE_USERS",	SYM(UNIQUE_USERS)},
  { "UNIX_TIMESTAMP",	SYM(UNIX_TIMESTAMP)},
  { "UPPER",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
unknown's avatar
unknown committed
769
  { "UUID",		F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_uuid)},
unknown's avatar
unknown committed
770
  { "VARIANCE",		SYM(VARIANCE_SYM)},
771 772
  { "VAR_POP",		SYM(VARIANCE_SYM)},
  { "VAR_SAMP",		SYM(VAR_SAMP_SYM)},
unknown's avatar
unknown committed
773 774 775 776 777 778 779
  { "VERSION",		F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_version)},
  { "WEEKDAY",		F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekday)},
  { "WEEKOFYEAR",	F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekofyear)},
  { "WITHIN",		F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_within)},
  { "X",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_x)},
  { "Y",		F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_y)},
  { "YEARWEEK",		SYM(YEARWEEK)}
unknown's avatar
unknown committed
780
};