lex.h 27.4 KB
Newer Older
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
1
/* Copyright (C) 2000-2002 MySQL AB
2

bk@work.mysql.com's avatar
bk@work.mysql.com 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

bk@work.mysql.com's avatar
bk@work.mysql.com 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

bk@work.mysql.com's avatar
bk@work.mysql.com committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
   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"

/* We don't want to include sql_yacc.h into gen_lex_hash */

#ifdef NO_YACC_SYMBOLS
#define SYM(A) 0
#define CREATE_FUNC(A) 0
#else
#define SYM(A) A
#define CREATE_FUNC(A) (void*) (A)
#endif

/*
monty@mashka.mysql.fi's avatar
monty@mashka.mysql.fi committed
33
  Symbols are broken into separated arrays to allow field names with
34 35
  same name as functions.
  These are kept sorted for human lookup (the symbols are hashed).
bk@work.mysql.com's avatar
bk@work.mysql.com committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
*/

static SYMBOL symbols[] = {
  { "&&",		SYM(AND),0,0},
  { "<",		SYM(LT),0,0},
  { "<=",		SYM(LE),0,0},
  { "<>",		SYM(NE),0,0},
  { "!=",		SYM(NE),0,0},
  { "=",		SYM(EQ),0,0},
  { ">",		SYM(GT_SYM),0,0},
  { ">=",		SYM(GE),0,0},
  { "<<",		SYM(SHIFT_LEFT),0,0},
  { ">>",		SYM(SHIFT_RIGHT),0,0},
  { "<=>",		SYM(EQUAL_SYM),0,0},
  { "ACTION",		SYM(ACTION),0,0},
  { "ADD",		SYM(ADD),0,0},
  { "AGGREGATE",	SYM(AGGREGATE_SYM),0,0},
  { "ALL",		SYM(ALL),0,0},
  { "ALTER",		SYM(ALTER),0,0},
  { "AFTER",		SYM(AFTER_SYM),0,0},
  { "AGAINST",          SYM(AGAINST),0,0},
  { "ANALYZE",		SYM(ANALYZE_SYM),0,0},
  { "AND",		SYM(AND),0,0},
bell@sanja.is.com.ua's avatar
bell@sanja.is.com.ua committed
59
  { "ANY",              SYM(ANY_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
60 61
  { "AS",		SYM(AS),0,0},
  { "ASC",		SYM(ASC),0,0},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
62
  { "ASCII",		SYM(ASCII_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
63 64 65
  { "AVG",		SYM(AVG_SYM),0,0},
  { "AVG_ROW_LENGTH",	SYM(AVG_ROW_LENGTH),0,0},
  { "AUTO_INCREMENT",	SYM(AUTO_INC),0,0},
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
66
  { "BACKUP",	        SYM(BACKUP_SYM),0,0},
67
  { "BEFORE",	        SYM(BEFORE_SYM),0,0},
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
68
  { "BEGIN",	        SYM(BEGIN_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
69 70 71 72 73 74
  { "BERKELEYDB",       SYM(BERKELEY_DB_SYM),0,0},
  { "BDB",              SYM(BERKELEY_DB_SYM),0,0},
  { "BETWEEN",		SYM(BETWEEN_SYM),0,0},
  { "BIGINT",		SYM(BIGINT),0,0},
  { "BIT",		SYM(BIT_SYM),0,0},
  { "BINARY",		SYM(BINARY),0,0},
75
  { "BINLOG",		SYM(BINLOG_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
76 77
  { "BLOB",		SYM(BLOB_SYM),0,0},
  { "BOOL",		SYM(BOOL_SYM),0,0},
78
  { "BOOLEAN",		SYM(BOOLEAN_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
79
  { "BOTH",		SYM(BOTH),0,0},
80
  { "BTREE",		SYM(BTREE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
81
  { "BY",		SYM(BY),0,0},
82
  { "BYTE",		SYM(BYTE_SYM), 0, 0},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
83
  { "CACHE",		SYM(CACHE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
84 85 86 87
  { "CASCADE",		SYM(CASCADE),0,0},
  { "CASE",		SYM(CASE_SYM),0,0},
  { "CHAR",		SYM(CHAR_SYM),0,0},
  { "CHARACTER",	SYM(CHAR_SYM),0,0},
88
  { "CHARSET",		SYM(CHARSET),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
89
  { "CHANGE",		SYM(CHANGE),0,0},
90
  { "CHANGED",		SYM(CHANGED),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
91 92
  { "CHECK",		SYM(CHECK_SYM),0,0},
  { "CHECKSUM",		SYM(CHECKSUM_SYM),0,0},
tonu@volk.internalnet's avatar
tonu@volk.internalnet committed
93
  { "CIPHER",		SYM(CIPHER_SYM),0,0},
94
  { "CLIENT",		SYM(CLIENT_SYM),0,0},
95
  { "CLOSE",		SYM(CLOSE_SYM),0,0},
96
  { "COLLATE",		SYM(COLLATE_SYM),0,0},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
97
  { "COLLATION",	SYM(COLLATION_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
98 99 100 101
  { "COLUMN",		SYM(COLUMN_SYM),0,0},
  { "COLUMNS",		SYM(COLUMNS),0,0},
  { "COMMENT",		SYM(COMMENT_SYM),0,0},
  { "COMMIT",		SYM(COMMIT_SYM),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
102
  { "COMMITTED",	SYM(COMMITTED_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
103
  { "COMPRESSED",	SYM(COMPRESSED_SYM),0,0},
104
  { "CONCURRENT",	SYM(CONCURRENT),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
105 106 107
  { "CONSTRAINT",	SYM(CONSTRAINT),0,0},
  { "CREATE",		SYM(CREATE),0,0},
  { "CROSS",		SYM(CROSS),0,0},
108
  { "CUBE",		SYM(CUBE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122
  { "CURRENT_DATE",	SYM(CURDATE),0,0},
  { "CURRENT_TIME",	SYM(CURTIME),0,0},
  { "CURRENT_TIMESTAMP", SYM(NOW_SYM),0,0},
  { "DATA",		SYM(DATA_SYM),0,0},
  { "DATABASE",		SYM(DATABASE),0,0},
  { "DATABASES",	SYM(DATABASES),0,0},
  { "DATE",		SYM(DATE_SYM),0,0},
  { "DATETIME",		SYM(DATETIME),0,0},
  { "DAY",		SYM(DAY_SYM),0,0},
  { "DAY_HOUR",		SYM(DAY_HOUR_SYM),0,0},
  { "DAY_MINUTE",	SYM(DAY_MINUTE_SYM),0,0},
  { "DAY_SECOND",	SYM(DAY_SECOND_SYM),0,0},
  { "DEC",		SYM(DECIMAL_SYM),0,0},
  { "DECIMAL",		SYM(DECIMAL_SYM),0,0},
123
  { "DES_KEY_FILE",	SYM(DES_KEY_FILE),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
124 125 126 127 128 129
  { "DEFAULT",		SYM(DEFAULT),0,0},
  { "DELAYED",		SYM(DELAYED_SYM),0,0},
  { "DELAY_KEY_WRITE",	SYM(DELAY_KEY_WRITE_SYM),0,0},
  { "DELETE",		SYM(DELETE_SYM),0,0},
  { "DESC",		SYM(DESC),0,0},
  { "DESCRIBE",		SYM(DESCRIBE),0,0},
130
  { "DIRECTORY",	SYM(DIRECTORY_SYM),0,0},
131
  { "DISABLE",		SYM(DISABLE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
132 133
  { "DISTINCT",		SYM(DISTINCT),0,0},
  { "DISTINCTROW",	SYM(DISTINCT),0,0},	/* Access likes this */
134
  { "DIV",		SYM(DIV_SYM),0,0},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
135
  { "DO",		SYM(DO_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
136
  { "DOUBLE",		SYM(DOUBLE_SYM),0,0},
137
  { "DUAL",		SYM(DUAL_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
138 139 140
  { "DROP",		SYM(DROP),0,0},
  { "DUMPFILE",		SYM(DUMPFILE),0,0},
  { "DYNAMIC",		SYM(DYNAMIC_SYM),0,0},
141
  { "DUPLICATE",	SYM(DUPLICATE_SYM),0,0},
142
  { "ERRORS",		SYM(ERRORS),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
143 144 145 146
  { "END",		SYM(END),0,0},
  { "ELSE",             SYM(ELSE),0,0},
  { "ESCAPE",		SYM(ESCAPE_SYM),0,0},
  { "ESCAPED",		SYM(ESCAPED),0,0},
147
  { "ENABLE",		SYM(ENABLE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
148 149
  { "ENCLOSED",		SYM(ENCLOSED),0,0},
  { "ENUM",		SYM(ENUM),0,0},
150
  { "EVENTS",		SYM(EVENTS_SYM),0,0},
151
  { "EXECUTE",		SYM(EXECUTE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
152 153 154
  { "EXPLAIN",		SYM(DESCRIBE),0,0},
  { "EXISTS",		SYM(EXISTS),0,0},
  { "EXTENDED",		SYM(EXTENDED_SYM),0,0},
155
  { "FAST",		SYM(FAST_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
156 157 158 159 160 161 162 163
  { "FIELDS",		SYM(COLUMNS),0,0},
  { "FILE",		SYM(FILE_SYM),0,0},
  { "FIRST",		SYM(FIRST_SYM),0,0},
  { "FIXED",		SYM(FIXED_SYM),0,0},
  { "FLOAT",		SYM(FLOAT_SYM),0,0},
  { "FLOAT4",		SYM(FLOAT_SYM),0,0},
  { "FLOAT8",		SYM(DOUBLE_SYM),0,0},
  { "FLUSH",		SYM(FLUSH_SYM),0,0},
164
  { "FALSE",		SYM(FALSE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
165
  { "FOREIGN",		SYM(FOREIGN),0,0},
166
  { "FORCE",		SYM(FORCE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
167 168 169 170 171 172 173
  { "RAID_TYPE",	SYM(RAID_TYPE),0,0},
  { "RAID_CHUNKS",	SYM(RAID_CHUNKS),0,0},
  { "RAID_CHUNKSIZE",	SYM(RAID_CHUNKSIZE),0,0},
  { "ROW_FORMAT",	SYM(ROW_FORMAT_SYM),0,0},
  { "FROM",		SYM(FROM),0,0},
  { "FOR",		SYM(FOR_SYM),0,0},
  { "FULL",		SYM(FULL),0,0},
174
  { "FULLTEXT",		SYM(FULLTEXT_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
175
  { "FUNCTION",		SYM(UDF_SYM),0,0},
176
  { "GEOMETRY",		SYM(GEOMETRY_SYM),0,0},
177
  { "GEOMETRYCOLLECTION",SYM(GEOMETRYCOLLECTION),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
178
  { "GLOBAL",		SYM(GLOBAL_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
179 180 181 182
  { "GRANT",		SYM(GRANT),0,0},
  { "GRANTS",	        SYM(GRANTS),0,0},
  { "GROUP",		SYM(GROUP),0,0},
  { "HAVING",		SYM(HAVING),0,0},
183
  { "HANDLER",		SYM(HANDLER_SYM),0,0},
184
  { "HASH",		SYM(HASH_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
185
  { "HEAP",		SYM(HEAP_SYM),0,0},
186
  { "HELP",		SYM(HELP_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
187 188 189 190 191 192 193 194 195
  { "HIGH_PRIORITY",	SYM(HIGH_PRIORITY),0,0},
  { "HOUR",		SYM(HOUR_SYM),0,0},
  { "HOUR_MINUTE",	SYM(HOUR_MINUTE_SYM),0,0},
  { "HOUR_SECOND",	SYM(HOUR_SECOND_SYM),0,0},
  { "HOSTS",		SYM(HOSTS_SYM),0,0},
  { "IDENTIFIED",	SYM(IDENTIFIED_SYM),0,0},
  { "IGNORE",		SYM(IGNORE_SYM),0,0},
  { "IN",		SYM(IN_SYM),0,0},
  { "INDEX",		SYM(INDEX),0,0},
196
  { "INDEXES",		SYM(INDEXES),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
197 198
  { "INFILE",		SYM(INFILE),0,0},
  { "INNER",		SYM(INNER_SYM),0,0},
199
  { "INNOBASE",		SYM(INNOBASE_SYM),0,0},
200
  { "INNODB",		SYM(INNOBASE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
201
  { "INSERT",		SYM(INSERT),0,0},
202
  { "INSERT_METHOD",    SYM(INSERT_METHOD),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
203 204 205 206 207 208 209 210 211
  { "INT",		SYM(INT_SYM),0,0},
  { "INTEGER",		SYM(INT_SYM),0,0},
  { "INTERVAL",		SYM(INTERVAL_SYM),0,0},
  { "INT1",		SYM(TINYINT),0,0},
  { "INT2",		SYM(SMALLINT),0,0},
  { "INT3",		SYM(MEDIUMINT),0,0},
  { "INT4",		SYM(INT_SYM),0,0},
  { "INT8",		SYM(BIGINT),0,0},
  { "INTO",		SYM(INTO),0,0},
212
  { "IO_THREAD",        SYM(RELAY_THREAD),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
213 214
  { "IF",		SYM(IF),0,0},
  { "IS",		SYM(IS),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
215
  { "ISOLATION",	SYM(ISOLATION),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
216
  { "ISAM",		SYM(ISAM_SYM),0,0},
217
  { "ISSUER",		SYM(ISSUER_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
218 219 220 221
  { "JOIN",		SYM(JOIN_SYM),0,0},
  { "KEY",		SYM(KEY_SYM),0,0},
  { "KEYS",		SYM(KEYS),0,0},
  { "KILL",		SYM(KILL_SYM),0,0},
222
  { "LAST",		SYM(LAST_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
223 224
  { "LEADING",		SYM(LEADING),0,0},
  { "LEFT",		SYM(LEFT),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
225
  { "LEVEL",		SYM(LEVEL_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
226 227
  { "LIKE",		SYM(LIKE),0,0},
  { "LINES",		SYM(LINES),0,0},
228
  { "LINESTRING",	SYM(LINESTRING),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
229 230 231
  { "LIMIT",		SYM(LIMIT),0,0},
  { "LOAD",		SYM(LOAD),0,0},
  { "LOCAL",		SYM(LOCAL_SYM),0,0},
232 233
  { "LOCALTIME",	SYM(NOW_SYM),0,0},
  { "LOCALTIMESTAMP",	SYM(NOW_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
234
  { "LOCK",		SYM(LOCK_SYM),0,0},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
235
  { "LOCKS",		SYM(LOCKS_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
236 237 238 239 240
  { "LOGS",		SYM(LOGS_SYM),0,0},
  { "LONG",		SYM(LONG_SYM),0,0},
  { "LONGBLOB",		SYM(LONGBLOB),0,0},
  { "LONGTEXT",		SYM(LONGTEXT),0,0},
  { "LOW_PRIORITY",	SYM(LOW_PRIORITY),0,0},
241 242 243 244 245 246 247
  { "MASTER",           SYM(MASTER_SYM),0,0},
  { "MASTER_CONNECT_RETRY",           SYM(MASTER_CONNECT_RETRY_SYM),0,0},
  { "MASTER_HOST",           SYM(MASTER_HOST_SYM),0,0},
  { "MASTER_LOG_FILE",           SYM(MASTER_LOG_FILE_SYM),0,0},
  { "MASTER_LOG_POS",           SYM(MASTER_LOG_POS_SYM),0,0},
  { "MASTER_PASSWORD",           SYM(MASTER_PASSWORD_SYM),0,0},
  { "MASTER_PORT",           SYM(MASTER_PORT_SYM),0,0},
248
  { "MASTER_SERVER_ID",           SYM(MASTER_SERVER_ID_SYM),0,0},
249
  { "MASTER_USER",           SYM(MASTER_USER_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
250
  { "MAX_ROWS",		SYM(MAX_ROWS),0,0},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
251
  { "MAX_QUERIES_PER_HOUR", SYM(MAX_QUERIES_PER_HOUR), 0,0},
252 253
  { "MAX_UPDATES_PER_HOUR", SYM(MAX_UPDATES_PER_HOUR), 0,0},
  { "MAX_CONNECTIONS_PER_HOUR", SYM(MAX_CONNECTIONS_PER_HOUR), 0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
254 255 256 257 258
  { "MATCH",		SYM(MATCH),0,0},
  { "MEDIUMBLOB",	SYM(MEDIUMBLOB),0,0},
  { "MEDIUMTEXT",	SYM(MEDIUMTEXT),0,0},
  { "MEDIUMINT",	SYM(MEDIUMINT),0,0},
  { "MERGE",		SYM(MERGE_SYM),0,0},
259
  { "MEDIUM",		SYM(MEDIUM_SYM),0,0},
260
  { "MEMORY",		SYM(MEMORY_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
261 262 263 264
  { "MIDDLEINT",	SYM(MEDIUMINT),0,0},	/* For powerbuilder */
  { "MIN_ROWS",		SYM(MIN_ROWS),0,0},
  { "MINUTE",		SYM(MINUTE_SYM),0,0},
  { "MINUTE_SECOND",	SYM(MINUTE_SECOND_SYM),0,0},
265
  { "MOD",		SYM(MOD_SYM),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
266
  { "MODE",		SYM(MODE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
267 268
  { "MODIFY",		SYM(MODIFY_SYM),0,0},
  { "MONTH",		SYM(MONTH_SYM),0,0},
269 270 271
  { "MULTILINESTRING",	SYM(MULTILINESTRING),0,0},
  { "MULTIPOINT",	SYM(MULTIPOINT),0,0},
  { "MULTIPOLYGON",	SYM(MULTIPOLYGON),0,0},
272
  { "MRG_MYISAM",	SYM(MERGE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
273
  { "MYISAM",		SYM(MYISAM_SYM),0,0},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
274
  { "NAMES",		SYM(NAMES_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
275 276
  { "NATURAL",		SYM(NATURAL),0,0},
  { "NATIONAL",		SYM(NATIONAL_SYM),0,0},
277
  { "NEXT",		SYM(NEXT_SYM),0,0},
278
  { "NEW",              SYM(NEW_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
279 280
  { "NCHAR",		SYM(NCHAR_SYM),0,0},
  { "NO",		SYM(NO_SYM),0,0},
281
  { "NONE",		SYM(NONE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
282 283
  { "NOT",		SYM(NOT),0,0},
  { "NULL",		SYM(NULL_SYM),0,0},
284
  { "NUMERIC",		SYM(NUMERIC_SYM),0,0},
285
  { "OFFSET",		SYM(OFFSET_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
286
  { "ON",		SYM(ON),0,0},
287
  { "OPEN",		SYM(OPEN_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
288 289 290 291 292 293 294 295 296 297
  { "OPTIMIZE",		SYM(OPTIMIZE),0,0},
  { "OPTION",		SYM(OPTION),0,0},
  { "OPTIONALLY",	SYM(OPTIONALLY),0,0},
  { "OR",		SYM(OR),0,0},
  { "ORDER",		SYM(ORDER_SYM),0,0},
  { "OUTER",		SYM(OUTER),0,0},
  { "OUTFILE",		SYM(OUTFILE),0,0},
  { "PACK_KEYS",	SYM(PACK_KEYS_SYM),0,0},
  { "PARTIAL",		SYM(PARTIAL),0,0},
  { "PASSWORD",		SYM(PASSWORD),0,0},
298
  { "POINT",		SYM(POINT_SYM),0,0},
299
  { "POLYGON",		SYM(POLYGON),0,0},
300
  { "PURGE",		SYM(PURGE),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
301
  { "PRECISION",	SYM(PRECISION),0,0},
302
  { "PREV",		SYM(PREV_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
303 304 305 306 307
  { "PRIMARY",		SYM(PRIMARY_SYM),0,0},
  { "PROCEDURE",	SYM(PROCEDURE),0,0},
  { "PROCESS"	,	SYM(PROCESS),0,0},
  { "PROCESSLIST",	SYM(PROCESSLIST_SYM),0,0},
  { "PRIVILEGES",	SYM(PRIVILEGES),0,0},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
308
  { "QUERY",		SYM(QUERY_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
309 310 311 312 313
  { "QUICK",	        SYM(QUICK),0,0},
  { "RAID0",		SYM(RAID_0_SYM),0,0},
  { "READ",		SYM(READ_SYM),0,0},
  { "REAL",		SYM(REAL),0,0},
  { "REFERENCES",	SYM(REFERENCES),0,0},
314 315
  { "RELAY_LOG_FILE",   SYM(RELAY_LOG_FILE_SYM),0,0},
  { "RELAY_LOG_POS",    SYM(RELAY_LOG_POS_SYM),0,0},
316
  { "RELAY_THREAD",     SYM(RELAY_THREAD),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
317 318 319 320 321
  { "RELOAD",		SYM(RELOAD),0,0},
  { "REGEXP",		SYM(REGEXP),0,0},
  { "RENAME",		SYM(RENAME),0,0},
  { "REPAIR",		SYM(REPAIR),0,0},
  { "REPLACE",		SYM(REPLACE),0,0},
322
  { "REPLICATION",	SYM(REPLICATION),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
323
  { "REPEATABLE",	SYM(REPEATABLE_SYM),0,0},
324
  { "REQUIRE",	        SYM(REQUIRE_SYM),0,0},
monty@donna.mysql.com's avatar
monty@donna.mysql.com committed
325
  { "RESET",		SYM(RESET_SYM),0,0},
326
  { "USER_RESOURCES",	SYM(RESOURCES),0,0},
327
  { "RESTORE",		SYM(RESTORE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
328 329 330
  { "RESTRICT",		SYM(RESTRICT),0,0},
  { "RETURNS",		SYM(UDF_RETURNS_SYM),0,0},
  { "REVOKE",		SYM(REVOKE),0,0},
331
  { "RIGHT",		SYM(RIGHT),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
332 333
  { "RLIKE",		SYM(REGEXP),0,0},	/* Like in mSQL2 */
  { "ROLLBACK",		SYM(ROLLBACK_SYM),0,0},
334
  { "ROLLUP",		SYM(ROLLUP_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
335 336
  { "ROW",		SYM(ROW_SYM),0,0},
  { "ROWS",		SYM(ROWS_SYM),0,0},
337
  { "RTREE",		SYM(RTREE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
338
  { "SECOND",		SYM(SECOND_SYM),0,0},
339
  { "SEPARATOR",	SYM(SEPARATOR_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
340
  { "SELECT",		SYM(SELECT_SYM),0,0},
341
  { "SERIAL",		SYM(SERIAL_SYM),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
342 343
  { "SERIALIZABLE",	SYM(SERIALIZABLE_SYM),0,0},
  { "SESSION",		SYM(SESSION_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
344
  { "SET",		SYM(SET),0,0},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
345
  { "SIGNED",		SYM(SIGNED_SYM),0,0},
346
  { "SIMPLE",		SYM(SIMPLE_SYM),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
347
  { "SHARE",		SYM(SHARE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
348 349 350 351
  { "SHOW",		SYM(SHOW),0,0},
  { "SHUTDOWN",		SYM(SHUTDOWN),0,0},
  { "SLAVE",            SYM(SLAVE),0,0},
  { "SMALLINT",		SYM(SMALLINT),0,0},
bell@sanja.is.com.ua's avatar
bell@sanja.is.com.ua committed
352
  { "SOME",             SYM(ANY_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
353
  { "SONAME",		SYM(UDF_SONAME_SYM),0,0},
354
  { "SPATIAL",		SYM(SPATIAL_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
355 356
  { "SQL_BIG_RESULT",	SYM(SQL_BIG_RESULT),0,0},
  { "SQL_BUFFER_RESULT", SYM(SQL_BUFFER_RESULT),0,0},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
357
  { "SQL_CACHE",        SYM(SQL_CACHE_SYM), 0, 0},
358
  { "SQL_CALC_FOUND_ROWS", SYM(SQL_CALC_FOUND_ROWS),0,0},
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
359
  { "SQL_NO_CACHE",	SYM(SQL_NO_CACHE_SYM), 0, 0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
360
  { "SQL_SMALL_RESULT", SYM(SQL_SMALL_RESULT),0,0},
361
  { "SQL_THREAD",	SYM(SQL_THREAD),0,0},
362
  { "SOUNDS",		SYM(SOUNDS_SYM),0,0},
363
  { "SSL",		SYM(SSL_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
364 365 366 367 368 369 370
  { "STRAIGHT_JOIN",	SYM(STRAIGHT_JOIN),0,0},
  { "START",		SYM(START_SYM),0,0},
  { "STARTING",		SYM(STARTING),0,0},
  { "STATUS",		SYM(STATUS_SYM),0,0},
  { "STRING",		SYM(STRING_SYM),0,0},
  { "STOP",		SYM(STOP_SYM),0,0},
  { "STRIPED",		SYM(RAID_STRIPED_SYM),0,0},
371
  { "SUBJECT",		SYM(SUBJECT_SYM),0,0},
372
  { "SUPER",		SYM(SUPER_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
373 374 375 376 377 378 379 380 381 382 383 384
  { "TABLE",		SYM(TABLE_SYM),0,0},
  { "TABLES",		SYM(TABLES),0,0},
  { "TEMPORARY",	SYM(TEMPORARY),0,0},
  { "TERMINATED",	SYM(TERMINATED),0,0},
  { "TEXT",		SYM(TEXT_SYM),0,0},
  { "THEN",		SYM(THEN_SYM),0,0},
  { "TIME",		SYM(TIME_SYM),0,0},
  { "TIMESTAMP",	SYM(TIMESTAMP),0,0},
  { "TINYBLOB",		SYM(TINYBLOB),0,0},
  { "TINYTEXT",		SYM(TINYTEXT),0,0},
  { "TINYINT",		SYM(TINYINT),0,0},
  { "TRAILING",		SYM(TRAILING),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
385
  { "TRANSACTION",	SYM(TRANSACTION_SYM),0,0},
386
  { "TRUNCATE",		SYM(TRUNCATE_SYM),0,0},
387
  { "TRUE",		SYM(TRUE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
388 389
  { "TO",		SYM(TO_SYM),0,0},
  { "TYPE",		SYM(TYPE_SYM),0,0},
390
  { "TYPES",		SYM(TYPES_SYM),0,0},
monty@tik.mysql.fi's avatar
monty@tik.mysql.fi committed
391
  { "UNCOMMITTED",	SYM(UNCOMMITTED_SYM),0,0},
392
  { "UNICODE",	        SYM(UNICODE_SYM),0,0},
393
  { "UNION",	        SYM(UNION_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
394 395 396
  { "UNIQUE",		SYM(UNIQUE_SYM),0,0},
  { "UNLOCK",		SYM(UNLOCK_SYM),0,0},
  { "UNSIGNED",		SYM(UNSIGNED),0,0},
397
  { "USE",		SYM(USE_SYM),0,0},
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
398
  { "USE_FRM",		SYM(USE_FRM),0,0},
399
  { "USING",		SYM(USING),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
400 401
  { "UPDATE",		SYM(UPDATE_SYM),0,0},
  { "USAGE",		SYM(USAGE),0,0},
402
  { "VALUE",		SYM(VALUE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
403 404
  { "VALUES",		SYM(VALUES),0,0},
  { "VARCHAR",		SYM(VARCHAR),0,0},
405
  { "VARCHARACTER",	SYM(VARCHAR),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
406 407 408
  { "VARIABLES",	SYM(VARIABLES),0,0},
  { "VARYING",		SYM(VARYING),0,0},
  { "VARBINARY",	SYM(VARBINARY),0,0},
409
  { "WARNINGS",		SYM(WARNINGS),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
410 411 412 413 414
  { "WITH",		SYM(WITH),0,0},
  { "WORK",		SYM(WORK_SYM),0,0},
  { "WRITE",		SYM(WRITE_SYM),0,0},
  { "WHEN",		SYM(WHEN_SYM),0,0},
  { "WHERE",		SYM(WHERE),0,0},
415
  { "NO_WRITE_TO_BINLOG",  SYM(NO_WRITE_TO_BINLOG),0,0},
416
  { "XOR",		SYM(XOR),0,0},
417
  { "X509",		SYM(X509_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
418 419 420 421 422 423 424 425 426 427 428
  { "YEAR",		SYM(YEAR_SYM),0,0},
  { "YEAR_MONTH",	SYM(YEAR_MONTH_SYM),0,0},
  { "ZEROFILL",		SYM(ZEROFILL),0,0},
  { "||",		SYM(OR_OR_CONCAT),0,0}
};


static SYMBOL sql_functions[] = {
  { "ABS",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_abs)},
  { "ACOS",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_acos)},
  { "ADDDATE",		SYM(DATE_ADD_INTERVAL),0,0},
429 430
  { "AES_ENCRYPT",      SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_encrypt)},
  { "AES_DECRYPT",      SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_decrypt)},
431
  { "AREA",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_area)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
432
  { "ASIN",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_asin)},
433
  { "ASBINARY",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_as_wkb)},
434
  { "ASTEXT",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_as_text)},
435
  { "ASWKB",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_as_wkb)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
436 437 438 439 440 441 442
  { "ATAN",		SYM(ATAN),0,0},
  { "ATAN2",		SYM(ATAN),0,0},
  { "BENCHMARK",	SYM(BENCHMARK_SYM),0,0},
  { "BIN",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bin)},
  { "BIT_COUNT",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_count)},
  { "BIT_OR",		SYM(BIT_OR),0,0},
  { "BIT_AND",		SYM(BIT_AND),0,0},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
443
  { "CAST",		SYM(CAST_SYM),0,0},
444
  { "CEIL",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
445
  { "CEILING",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
446
  { "CURRENT_USER",	SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_current_user)},
447
  { "BIT_LENGTH",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_length)},
448
  { "CENTROID",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_centroid)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
449 450 451
  { "CHAR_LENGTH",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
  { "CHARACTER_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
  { "COALESCE",		SYM(COALESCE),0,0},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
452
  { "COERCIBILITY",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_coercibility)},
453
  { "COMPRESS",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_compress)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
454 455 456
  { "CONCAT",		SYM(CONCAT),0,0},
  { "CONCAT_WS",	SYM(CONCAT_WS),0,0},
  { "CONNECTION_ID",	SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_connection_id)},
457
  { "CONTAINS",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_contains)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
458
  { "CONV",		SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_conv)},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
459
  { "CONVERT",		SYM(CONVERT_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
460 461 462
  { "COUNT",		SYM(COUNT_SYM),0,0},
  { "COS",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cos)},
  { "COT",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cot)},
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
463
#ifdef HAVE_COMPRESS
464
  { "CRC32",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_crc32)},
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
465
#endif
466
  { "CROSSES",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_crosses)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
467 468 469 470 471 472 473 474 475 476 477
  { "CURDATE",		SYM(CURDATE),0,0},
  { "CURTIME",		SYM(CURTIME),0,0},
  { "DATE_ADD",		SYM(DATE_ADD_INTERVAL),0,0},
  { "DATE_FORMAT",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_date_format)},
  { "DATE_SUB",		SYM(DATE_SUB_INTERVAL),0,0},
  { "DAYNAME",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayname)},
  { "DAYOFMONTH",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofmonth)},
  { "DAYOFWEEK",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofweek)},
  { "DAYOFYEAR",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofyear)},
  { "DECODE",		SYM(DECODE_SYM),0,0},
  { "DEGREES",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_degrees)},
478 479
  { "DES_ENCRYPT",	SYM(DES_ENCRYPT_SYM),0,0},
  { "DES_DECRYPT",	SYM(DES_DECRYPT_SYM),0,0},
480 481
  { "DIMENSION",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dimension)},
  { "DISJOINT",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_disjoint)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
482 483 484
  { "ELT",		SYM(ELT_FUNC),0,0},
  { "ENCODE",		SYM(ENCODE_SYM),0,0},
  { "ENCRYPT",		SYM(ENCRYPT),0,0},
485 486 487 488
  { "ENDPOINT",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_endpoint)},
  { "ENVELOPE",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_envelope)},
  { "EQUALS",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_equals)},
  { "EXTERIORRING",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_exteriorring)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
489 490 491 492 493 494 495
  { "EXTRACT",		SYM(EXTRACT_SYM),0,0},
  { "EXP",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_exp)},
  { "EXPORT_SET",	SYM(EXPORT_SET),0,0},
  { "FIELD",		SYM(FIELD_FUNC),0,0},	/* For compability */
  { "FIND_IN_SET",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_find_in_set)},
  { "FLOOR",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_floor)},
  { "FORMAT",		SYM(FORMAT_SYM),0,0},
496
  { "FOUND_ROWS",	SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_found_rows)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
497 498 499
  { "FROM_DAYS",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_from_days)},
  { "FROM_UNIXTIME",	SYM(FROM_UNIXTIME),0,0},
  { "GET_LOCK",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_get_lock)},
500 501
  { "GEOMETRYN",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_geometryn)},
  { "GEOMETRYTYPE",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_geometry_type)},
502
  { "GEOMCOLLFROMTEXT",	SYM(GEOMCOLLFROMTEXT),0,0},
503
  { "GEOMCOLLFROMWKB",	SYM(GEOMFROMWKB),0,0},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
504
  { "GEOMETRYCOLLECTIONFROMTEXT",SYM(GEOMCOLLFROMTEXT),0,0},
505
  { "GEOMETRYCOLLECTIONFROMWKB",SYM(GEOMFROMWKB),0,0},
506
  { "GEOMETRYFROMTEXT", SYM(GEOMFROMTEXT),0,0},
ram@mysql.r18.ru's avatar
ram@mysql.r18.ru committed
507
  { "GEOMETRYFROMWKB",	SYM(GEOMFROMWKB),0,0},
508 509
  { "GEOMFROMTEXT",	SYM(GEOMFROMTEXT),0,0},
  { "GEOMFROMWKB",	SYM(GEOMFROMWKB),0,0},
ram@mysql.r18.ru's avatar
ram@mysql.r18.ru committed
510
    { "GLENGTH",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_glength)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
511
  { "GREATEST",		SYM(GREATEST_SYM),0,0},
512
  { "GROUP_CONCAT",	SYM(GROUP_CONCAT_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
513 514 515 516 517 518
  { "GROUP_UNIQUE_USERS",	SYM(GROUP_UNIQUE_USERS),0,0},
  { "HEX",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_hex)},
  { "IFNULL",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_ifnull)},
  { "INET_ATON",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_aton)},
  { "INET_NTOA",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_ntoa)},
  { "INSTR",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_instr)},
519 520 521 522
  { "INTERIORRINGN",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_interiorringn)},
  { "INTERSECTS",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_intersects)},
  { "ISCLOSED",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isclosed)},
  { "ISEMPTY",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isempty)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
523
  { "ISNULL",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isnull)},
524
  { "IS_FREE_LOCK",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_free_lock)},
hf@genie.(none)'s avatar
SCRUM  
hf@genie.(none) committed
525
  { "IS_USED_LOCK",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_used_lock)},
526
  { "LAST_INSERT_ID",	SYM(LAST_INSERT_ID),0,0},
527
  { "ISSIMPLE",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_issimple)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
528 529 530
  { "LCASE",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
  { "LEAST",		SYM(LEAST_SYM),0,0},
  { "LENGTH",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
531
  { "LN",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ln)},
532
  { "LINEFROMTEXT",	SYM(LINEFROMTEXT),0,0},
533
  { "LINEFROMWKB",	SYM(GEOMFROMWKB),0,0},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
534
  { "LINESTRINGFROMTEXT",SYM(LINEFROMTEXT),0,0},
535
  { "LINESTRINGFROMWKB",SYM(GEOMFROMWKB),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
536 537
  { "LOAD_FILE",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_load_file)},
  { "LOCATE",		SYM(LOCATE),0,0},
538 539
  { "LOG",		SYM(LOG_SYM),0,0},
  { "LOG2",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log2)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
540 541 542 543 544
  { "LOG10",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log10)},
  { "LOWER",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
  { "LPAD",		SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_lpad)},
  { "LTRIM",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ltrim)},
  { "MAKE_SET",		SYM(MAKE_SET_SYM),0,0},
545
  { "MASTER_POS_WAIT",	SYM(MASTER_POS_WAIT),0,0},
546
  { "MAX",		SYM(MAX_SYM),0,0},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
547 548 549 550 551 552 553
  { "MBRCONTAINS",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_contains)},
  { "MBRDISJOINT",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_disjoint)},
  { "MBREQUAL",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_equals)},
  { "MBRINTERSECTS",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_intersects)},
  { "MBROVERLAPS",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_overlaps)},
  { "MBRTOUCHES",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_touches)},
  { "MBRWITHIN",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_within)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
554 555 556
  { "MD5",              SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_md5)},
  { "MID",		SYM(SUBSTRING),0,0},	/* unireg function */
  { "MIN",		SYM(MIN_SYM),0,0},
557
  { "MLINEFROMTEXT",	SYM(MLINEFROMTEXT),0,0},
558
  { "MLINEFROMWKB",	SYM(GEOMFROMWKB),0,0},
559
  { "MPOINTFROMTEXT",	SYM(MPOINTFROMTEXT),0,0},
560
  { "MPOINTFROMWKB",	SYM(GEOMFROMWKB),0,0},
561
  { "MPOLYFROMTEXT",	SYM(MPOLYFROMTEXT),0,0},
562
  { "MPOLYFROMWKB",	SYM(GEOMFROMWKB),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
563
  { "MONTHNAME",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_monthname)},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
564
  { "MULTILINESTRINGFROMTEXT",SYM(MLINEFROMTEXT),0,0},
565
  { "MULTILINESTRINGFROMWKB",SYM(GEOMFROMWKB),0,0},
566
  { "MULTIPOINTFROMTEXT",SYM(MPOINTFROMTEXT),0,0},
567
  { "MULTIPOINTFROMWKB",SYM(GEOMFROMWKB),0,0},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
568
  { "MULTIPOLYGONFROMTEXT",SYM(MPOLYFROMTEXT),0,0},
569
  { "MULTIPOLYGONFROMWKB",SYM(GEOMFROMWKB),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
570 571
  { "NOW",		SYM(NOW_SYM),0,0},
  { "NULLIF",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_nullif)},
572
  { "NUMGEOMETRIES",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_numgeometries)},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
573
  { "NUMINTERIORRINGS",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_numinteriorring)},
574
  { "NUMPOINTS",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_numpoints)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
575 576
  { "OCTET_LENGTH",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
  { "OCT",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_oct)},
577
  { "OLD_PASSWORD",     SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_old_password)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
578
  { "ORD",              SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ord)},
579
  { "OVERLAPS",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_overlaps)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
580 581 582
  { "PERIOD_ADD",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_add)},
  { "PERIOD_DIFF",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_diff)},
  { "PI",		SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_pi)},
583
  { "POINTFROMTEXT",	SYM(POINTFROMTEXT),0,0},
584
  { "POINTFROMWKB",	SYM(GEOMFROMWKB),0,0},
585
  { "POINTN",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pointn)},
586
  { "POLYFROMTEXT",	SYM(POLYFROMTEXT),0,0},
587
  { "POLYFROMWKB",	SYM(GEOMFROMWKB),0,0},
bar@bar.mysql.r18.ru's avatar
bar@bar.mysql.r18.ru committed
588
  { "POLYGONFROMTEXT",	SYM(POLYFROMTEXT),0,0},
589
  { "POLYGONFROMWKB",	SYM(GEOMFROMWKB),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
590 591 592 593
  { "POSITION",		SYM(POSITION_SYM),0,0},
  { "POW",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
  { "POWER",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
  { "QUARTER",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quarter)},
594
  { "QUOTE",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quote)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
595 596 597 598 599 600 601 602 603 604 605 606 607
  { "RADIANS",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_radians)},
  { "RAND",		SYM(RAND),0,0},
  { "RELEASE_LOCK",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_release_lock)},
  { "REPEAT",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_repeat)},
  { "REVERSE",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_reverse)},
  { "ROUND",		SYM(ROUND),0,0},
  { "RPAD",		SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_rpad)},
  { "RTRIM",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_rtrim)},
  { "SEC_TO_TIME",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sec_to_time)},
  { "SESSION_USER",	SYM(USER),0,0},
  { "SUBDATE",		SYM(DATE_SUB_INTERVAL),0,0},
  { "SIGN",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sign)},
  { "SIN",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sin)},
608 609
  { "SHA",              SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
  { "SHA1",             SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
610 611 612
  { "SOUNDEX",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_soundex)},
  { "SPACE",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_space)},
  { "SQRT",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sqrt)},
ram@mysql.r18.ru's avatar
ram@mysql.r18.ru committed
613
  { "SRID",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_srid)},
614
  { "STARTPOINT",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_startpoint)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
615 616 617 618 619 620 621 622 623 624 625 626
  { "STD",		SYM(STD_SYM),0,0},
  { "STDDEV",		SYM(STD_SYM),0,0},
  { "STRCMP",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_strcmp)},
  { "SUBSTRING",	SYM(SUBSTRING),0,0},
  { "SUBSTRING_INDEX",	SYM(SUBSTRING_INDEX),0,0},
  { "SUM",		SYM(SUM_SYM),0,0},
  { "SYSDATE",		SYM(NOW_SYM),0,0},
  { "SYSTEM_USER",	SYM(USER),0,0},
  { "TAN",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_tan)},
  { "TIME_FORMAT",	SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_time_format)},
  { "TIME_TO_SEC",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_time_to_sec)},
  { "TO_DAYS",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_to_days)},
627
  { "TOUCHES",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_touches)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
628 629
  { "TRIM",		SYM(TRIM),0,0},
  { "UCASE",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
630 631
  { "UNCOMPRESS",	SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompress)},
  { "UNCOMPRESSED_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompressed_length)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
632 633
  { "UNIQUE_USERS",	SYM(UNIQUE_USERS),0,0},
  { "UNIX_TIMESTAMP",	SYM(UNIX_TIMESTAMP),0,0},
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
634
  { "UPPER",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
635
  { "USER",		SYM(USER),0,0},
636
  { "VARIANCE",		SYM(VARIANCE_SYM),0,0},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
637 638 639
  { "VERSION",		SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_version)},
  { "WEEK",		SYM(WEEK_SYM),0,0},
  { "WEEKDAY",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekday)},
640 641 642
  { "WITHIN",		SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_within)},
  { "X",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_x)},
  { "Y",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_y)},
bk@work.mysql.com's avatar
bk@work.mysql.com committed
643 644
  { "YEARWEEK",		SYM(YEARWEEK),0,0}
};