Commit 6dcda515 authored by hf@deer.(none)'s avatar hf@deer.(none)

SCRUM:

WL#1163 (Making spatial code optional)
Pack of changes to do in sql/ code.
parent ecf8118c
...@@ -4470,7 +4470,7 @@ Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, ...@@ -4470,7 +4470,7 @@ Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
:Field_str(ptr_arg, (1L << min(blob_pack_length,3)*8)-1L, :Field_str(ptr_arg, (1L << min(blob_pack_length,3)*8)-1L,
null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg,
table_arg, cs), table_arg, cs),
geom_flag(true), packlength(blob_pack_length) packlength(blob_pack_length)
{ {
flags|= BLOB_FLAG; flags|= BLOB_FLAG;
if (table) if (table)
...@@ -4705,6 +4705,7 @@ void Field_blob::get_key_image(char *buff,uint length, ...@@ -4705,6 +4705,7 @@ void Field_blob::get_key_image(char *buff,uint length,
uint32 blob_length= get_length(ptr); uint32 blob_length= get_length(ptr);
char *blob; char *blob;
#ifdef HAVE_SPATIAL
if (type == itMBR) if (type == itMBR)
{ {
if (!blob_length) if (!blob_length)
...@@ -4721,6 +4722,7 @@ void Field_blob::get_key_image(char *buff,uint length, ...@@ -4721,6 +4722,7 @@ void Field_blob::get_key_image(char *buff,uint length,
float8store(buff+24, mbr.ymax); float8store(buff+24, mbr.ymax);
return; return;
} }
#endif /*HAVE_SPATIAL*/
if ((uint32) length > blob_length) if ((uint32) length > blob_length)
{ {
...@@ -4930,6 +4932,7 @@ uint Field_blob::max_packed_col_length(uint max_length) ...@@ -4930,6 +4932,7 @@ uint Field_blob::max_packed_col_length(uint max_length)
return (max_length > 255 ? 2 : 1)+max_length; return (max_length > 255 ? 2 : 1)+max_length;
} }
#ifdef HAVE_SPATIAL
void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs, void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs,
imagetype type) imagetype type)
...@@ -5013,6 +5016,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs) ...@@ -5013,6 +5016,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
return 0; return 0;
} }
#endif /*HAVE_SPATIAL*/
/**************************************************************************** /****************************************************************************
** enum type. ** enum type.
...@@ -5488,10 +5492,12 @@ Field *make_field(char *ptr, uint32 field_length, ...@@ -5488,10 +5492,12 @@ Field *make_field(char *ptr, uint32 field_length,
f_packtype(pack_flag), f_packtype(pack_flag),
field_length); field_length);
#ifdef HAVE_SPATIAL
if (f_is_geom(pack_flag)) if (f_is_geom(pack_flag))
return new Field_geom(ptr,null_pos,null_bit, return new Field_geom(ptr,null_pos,null_bit,
unireg_check, field_name, table, unireg_check, field_name, table,
pack_length, geom_type); pack_length, geom_type);
#endif
if (f_is_blob(pack_flag)) if (f_is_blob(pack_flag))
return new Field_blob(ptr,null_pos,null_bit, return new Field_blob(ptr,null_pos,null_bit,
unireg_check, field_name, table, unireg_check, field_name, table,
...@@ -5651,10 +5657,12 @@ create_field::create_field(Field *old_field,Field *orig_field) ...@@ -5651,10 +5657,12 @@ create_field::create_field(Field *old_field,Field *orig_field)
def=new Item_string(pos,tmp.length(), charset); def=new Item_string(pos,tmp.length(), charset);
} }
} }
#ifdef HAVE_SPATIAL
if (sql_type == FIELD_TYPE_GEOMETRY) if (sql_type == FIELD_TYPE_GEOMETRY)
{ {
geom_type= ((Field_geom*)old_field)->geom_type; geom_type= ((Field_geom*)old_field)->geom_type;
} }
#endif
} }
......
...@@ -913,7 +913,6 @@ public: ...@@ -913,7 +913,6 @@ public:
class Field_blob :public Field_str { class Field_blob :public Field_str {
bool geom_flag;
protected: protected:
uint packlength; uint packlength;
String value; // For temporaries String value; // For temporaries
...@@ -926,7 +925,7 @@ public: ...@@ -926,7 +925,7 @@ public:
struct st_table *table_arg, CHARSET_INFO *cs) struct st_table *table_arg, CHARSET_INFO *cs)
:Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0, :Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, table_arg, cs), NONE, field_name_arg, table_arg, cs),
geom_flag(true), packlength(4) packlength(4)
{ {
flags|= BLOB_FLAG; flags|= BLOB_FLAG;
} }
...@@ -1001,7 +1000,7 @@ public: ...@@ -1001,7 +1000,7 @@ public:
field_cast_enum field_cast_type() { return FIELD_CAST_BLOB; } field_cast_enum field_cast_type() { return FIELD_CAST_BLOB; }
}; };
#ifdef HAVE_SPATIAL
class Field_geom :public Field_blob { class Field_geom :public Field_blob {
public: public:
enum geometry_type geom_type; enum geometry_type geom_type;
...@@ -1029,7 +1028,7 @@ public: ...@@ -1029,7 +1028,7 @@ public:
void set_key_image(char *buff,uint length, CHARSET_INFO *cs); void set_key_image(char *buff,uint length, CHARSET_INFO *cs);
field_cast_enum field_cast_type() { return FIELD_CAST_GEOM; } field_cast_enum field_cast_type() { return FIELD_CAST_GEOM; }
}; };
#endif /*HAVE_SPATIAL*/
class Field_enum :public Field_str { class Field_enum :public Field_str {
protected: protected:
......
...@@ -487,6 +487,7 @@ Item *create_func_quote(Item* a) ...@@ -487,6 +487,7 @@ Item *create_func_quote(Item* a)
return new Item_func_quote(a); return new Item_func_quote(a);
} }
#ifdef HAVE_SPATIAL
Item *create_func_as_wkt(Item *a) Item *create_func_as_wkt(Item *a)
{ {
return new Item_func_as_wkt(a); return new Item_func_as_wkt(a);
...@@ -646,6 +647,7 @@ Item *create_func_point(Item *a, Item *b) ...@@ -646,6 +647,7 @@ Item *create_func_point(Item *a, Item *b)
{ {
return new Item_func_point(a, b); return new Item_func_point(a, b);
} }
#endif /*HAVE_SPATIAL*/
Item *create_func_crc32(Item* a) Item *create_func_crc32(Item* a)
{ {
......
...@@ -99,6 +99,8 @@ Item *create_func_is_free_lock(Item* a); ...@@ -99,6 +99,8 @@ Item *create_func_is_free_lock(Item* a);
Item *create_func_is_used_lock(Item* a); Item *create_func_is_used_lock(Item* a);
Item *create_func_quote(Item* a); Item *create_func_quote(Item* a);
#ifdef HAVE_SPATIAL
Item *create_func_geometry_from_text(Item *a); Item *create_func_geometry_from_text(Item *a);
Item *create_func_as_wkt(Item *a); Item *create_func_as_wkt(Item *a);
Item *create_func_as_wkb(Item *a); Item *create_func_as_wkb(Item *a);
...@@ -138,6 +140,8 @@ Item *create_func_numgeometries(Item *a); ...@@ -138,6 +140,8 @@ Item *create_func_numgeometries(Item *a);
Item *create_func_point(Item *a, Item *b); Item *create_func_point(Item *a, Item *b);
#endif /*HAVE_SPATIAL*/
Item *create_func_compress(Item *a); Item *create_func_compress(Item *a);
Item *create_func_uncompress(Item *a); Item *create_func_uncompress(Item *a);
Item *create_func_uncompressed_length(Item *a); Item *create_func_uncompressed_length(Item *a);
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
/* This file defines all spatial functions */ /* This file defines all spatial functions */
#ifdef HAVE_SPATIAL
#ifdef __GNUC__ #ifdef __GNUC__
#pragma implementation // gcc: Class implementation #pragma implementation // gcc: Class implementation
#endif #endif
...@@ -651,3 +653,5 @@ longlong Item_func_srid::val_int() ...@@ -651,3 +653,5 @@ longlong Item_func_srid::val_int()
uint32 res= uint4korr(swkb->ptr()); uint32 res= uint4korr(swkb->ptr());
return (longlong) res; return (longlong) res;
} }
#endif /*HAVE_SPATIAL*/
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
/* This file defines all spatial functions */ /* This file defines all spatial functions */
#ifdef HAVE_SPATIAL
#ifdef __GNUC__ #ifdef __GNUC__
#pragma interface /* gcc class implementation */ #pragma interface /* gcc class implementation */
#endif #endif
...@@ -338,3 +340,12 @@ public: ...@@ -338,3 +340,12 @@ public:
const char *func_name() const { return "srid"; } const char *func_name() const { return "srid"; }
void fix_length_and_dec() { max_length= 10; } void fix_length_and_dec() { max_length= 10; }
}; };
#define GEOM_NEW(obj_constructor) new obj_constructor
#else /*HAVE_SPATIAL*/
#define GEOM_NEW(obj_constructor) NULL
#endif
...@@ -20,13 +20,24 @@ ...@@ -20,13 +20,24 @@
#include "lex_symbol.h" #include "lex_symbol.h"
/* We don't want to include sql_yacc.h into gen_lex_hash */ /* We don't want to include sql_yacc.h into gen_lex_hash */
static SYM_GROUP sym_group_common= {"", ""};
static SYM_GROUP sym_group_geom= {"Spatial extentions", "HAVE_SPATIAL"};
#ifdef NO_YACC_SYMBOLS #ifdef NO_YACC_SYMBOLS
#define SYM(A) 0 #define SYM_OR_NULL(A) 0
#define CREATE_FUNC(A) 0
#else #else
#define SYM(A) A #define SYM_OR_NULL(A) A
#define CREATE_FUNC(A) (void*) (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
#ifdef HAVE_GEOM
#define CREATE_FUNC_GEOM(A) (void *)(SYM_OR_NULL(A)), &sym_group_geom
#else
#define CREATE_FUNC_GEOM(A) 0, &sym_group_geom
#endif #endif
/* /*
...@@ -36,639 +47,641 @@ ...@@ -36,639 +47,641 @@
*/ */
static SYMBOL symbols[] = { static SYMBOL symbols[] = {
{ "&&", SYM(AND),0,0}, { "&&", SYM(AND)},
{ "<", SYM(LT),0,0}, { "<", SYM(LT)},
{ "<=", SYM(LE),0,0}, { "<=", SYM(LE)},
{ "<>", SYM(NE),0,0}, { "<>", SYM(NE)},
{ "!=", SYM(NE),0,0}, { "!=", SYM(NE)},
{ "=", SYM(EQ),0,0}, { "=", SYM(EQ)},
{ ">", SYM(GT_SYM),0,0}, { ">", SYM(GT_SYM)},
{ ">=", SYM(GE),0,0}, { ">=", SYM(GE)},
{ "<<", SYM(SHIFT_LEFT),0,0}, { "<<", SYM(SHIFT_LEFT)},
{ ">>", SYM(SHIFT_RIGHT),0,0}, { ">>", SYM(SHIFT_RIGHT)},
{ "<=>", SYM(EQUAL_SYM),0,0}, { "<=>", SYM(EQUAL_SYM)},
{ "ACTION", SYM(ACTION),0,0}, { "ACTION", SYM(ACTION)},
{ "ADD", SYM(ADD),0,0}, { "ADD", SYM(ADD)},
{ "AFTER", SYM(AFTER_SYM),0,0}, { "AFTER", SYM(AFTER_SYM)},
{ "AGAINST", SYM(AGAINST),0,0}, { "AGAINST", SYM(AGAINST)},
{ "AGGREGATE", SYM(AGGREGATE_SYM),0,0}, { "AGGREGATE", SYM(AGGREGATE_SYM)},
{ "ALL", SYM(ALL),0,0}, { "ALL", SYM(ALL)},
{ "ALTER", SYM(ALTER),0,0}, { "ALTER", SYM(ALTER)},
{ "ANALYZE", SYM(ANALYZE_SYM),0,0}, { "ANALYZE", SYM(ANALYZE_SYM)},
{ "AND", SYM(AND),0,0}, { "AND", SYM(AND)},
{ "ANY", SYM(ANY_SYM),0,0}, { "ANY", SYM(ANY_SYM)},
{ "AS", SYM(AS),0,0}, { "AS", SYM(AS)},
{ "ASC", SYM(ASC),0,0}, { "ASC", SYM(ASC)},
{ "ASCII", SYM(ASCII_SYM),0,0}, { "ASCII", SYM(ASCII_SYM)},
{ "AUTO_INCREMENT", SYM(AUTO_INC),0,0}, { "AUTO_INCREMENT", SYM(AUTO_INC)},
{ "AVG", SYM(AVG_SYM),0,0}, { "AVG", SYM(AVG_SYM)},
{ "AVG_ROW_LENGTH", SYM(AVG_ROW_LENGTH),0,0}, { "AVG_ROW_LENGTH", SYM(AVG_ROW_LENGTH)},
{ "BACKUP", SYM(BACKUP_SYM),0,0}, { "BACKUP", SYM(BACKUP_SYM)},
{ "BDB", SYM(BERKELEY_DB_SYM),0,0}, { "BDB", SYM(BERKELEY_DB_SYM)},
{ "BEFORE", SYM(BEFORE_SYM),0,0}, { "BEFORE", SYM(BEFORE_SYM)},
{ "BEGIN", SYM(BEGIN_SYM),0,0}, { "BEGIN", SYM(BEGIN_SYM)},
{ "BERKELEYDB", SYM(BERKELEY_DB_SYM),0,0}, { "BERKELEYDB", SYM(BERKELEY_DB_SYM)},
{ "BETWEEN", SYM(BETWEEN_SYM),0,0}, { "BETWEEN", SYM(BETWEEN_SYM)},
{ "BIGINT", SYM(BIGINT),0,0}, { "BIGINT", SYM(BIGINT)},
{ "BINARY", SYM(BINARY),0,0}, { "BINARY", SYM(BINARY)},
{ "BINLOG", SYM(BINLOG_SYM),0,0}, { "BINLOG", SYM(BINLOG_SYM)},
{ "BIT", SYM(BIT_SYM),0,0}, { "BIT", SYM(BIT_SYM)},
{ "BLOB", SYM(BLOB_SYM),0,0}, { "BLOB", SYM(BLOB_SYM)},
{ "BOOL", SYM(BOOL_SYM),0,0}, { "BOOL", SYM(BOOL_SYM)},
{ "BOOLEAN", SYM(BOOLEAN_SYM),0,0}, { "BOOLEAN", SYM(BOOLEAN_SYM)},
{ "BOTH", SYM(BOTH),0,0}, { "BOTH", SYM(BOTH)},
{ "BTREE", SYM(BTREE_SYM),0,0}, { "BTREE", SYM(BTREE_SYM)},
{ "BY", SYM(BY),0,0}, { "BY", SYM(BY)},
{ "BYTE", SYM(BYTE_SYM), 0, 0}, { "BYTE", SYM(BYTE_SYM)},
{ "CACHE", SYM(CACHE_SYM),0,0}, { "CACHE", SYM(CACHE_SYM)},
{ "CASCADE", SYM(CASCADE),0,0}, { "CASCADE", SYM(CASCADE)},
{ "CASE", SYM(CASE_SYM),0,0}, { "CASE", SYM(CASE_SYM)},
{ "CHANGE", SYM(CHANGE),0,0}, { "CHANGE", SYM(CHANGE)},
{ "CHANGED", SYM(CHANGED),0,0}, { "CHANGED", SYM(CHANGED)},
{ "CHAR", SYM(CHAR_SYM),0,0}, { "CHAR", SYM(CHAR_SYM)},
{ "CHARACTER", SYM(CHAR_SYM),0,0}, { "CHARACTER", SYM(CHAR_SYM)},
{ "CHARSET", SYM(CHARSET),0,0}, { "CHARSET", SYM(CHARSET)},
{ "CHECK", SYM(CHECK_SYM),0,0}, { "CHECK", SYM(CHECK_SYM)},
{ "CHECKSUM", SYM(CHECKSUM_SYM),0,0}, { "CHECKSUM", SYM(CHECKSUM_SYM)},
{ "CIPHER", SYM(CIPHER_SYM),0,0}, { "CIPHER", SYM(CIPHER_SYM)},
{ "CLIENT", SYM(CLIENT_SYM),0,0}, { "CLIENT", SYM(CLIENT_SYM)},
{ "CLOSE", SYM(CLOSE_SYM),0,0}, { "CLOSE", SYM(CLOSE_SYM)},
{ "COLLATE", SYM(COLLATE_SYM),0,0}, { "COLLATE", SYM(COLLATE_SYM)},
{ "COLLATION", SYM(COLLATION_SYM),0,0}, { "COLLATION", SYM(COLLATION_SYM)},
{ "COLUMN", SYM(COLUMN_SYM),0,0}, { "COLUMN", SYM(COLUMN_SYM)},
{ "COLUMNS", SYM(COLUMNS),0,0}, { "COLUMNS", SYM(COLUMNS)},
{ "COMMENT", SYM(COMMENT_SYM),0,0}, { "COMMENT", SYM(COMMENT_SYM)},
{ "COMMIT", SYM(COMMIT_SYM),0,0}, { "COMMIT", SYM(COMMIT_SYM)},
{ "COMMITTED", SYM(COMMITTED_SYM),0,0}, { "COMMITTED", SYM(COMMITTED_SYM)},
{ "COMPRESSED", SYM(COMPRESSED_SYM),0,0}, { "COMPRESSED", SYM(COMPRESSED_SYM)},
{ "CONCURRENT", SYM(CONCURRENT),0,0}, { "CONCURRENT", SYM(CONCURRENT)},
{ "CONSTRAINT", SYM(CONSTRAINT),0,0}, { "CONSTRAINT", SYM(CONSTRAINT)},
{ "CREATE", SYM(CREATE),0,0}, { "CREATE", SYM(CREATE)},
{ "CROSS", SYM(CROSS),0,0}, { "CROSS", SYM(CROSS)},
{ "CUBE", SYM(CUBE_SYM),0,0}, { "CUBE", SYM(CUBE_SYM)},
{ "CURRENT_DATE", SYM(CURDATE),0,0}, { "CURRENT_DATE", SYM(CURDATE)},
{ "CURRENT_TIME", SYM(CURTIME),0,0}, { "CURRENT_TIME", SYM(CURTIME)},
{ "CURRENT_TIMESTAMP", SYM(NOW_SYM),0,0}, { "CURRENT_TIMESTAMP", SYM(NOW_SYM)},
{ "DATA", SYM(DATA_SYM),0,0}, { "DATA", SYM(DATA_SYM)},
{ "DATABASE", SYM(DATABASE),0,0}, { "DATABASE", SYM(DATABASE)},
{ "DATABASES", SYM(DATABASES),0,0}, { "DATABASES", SYM(DATABASES)},
{ "DATE", SYM(DATE_SYM),0,0}, { "DATE", SYM(DATE_SYM)},
{ "DATETIME", SYM(DATETIME),0,0}, { "DATETIME", SYM(DATETIME)},
{ "DAY", SYM(DAY_SYM),0,0}, { "DAY", SYM(DAY_SYM)},
{ "DAY_HOUR", SYM(DAY_HOUR_SYM),0,0}, { "DAY_HOUR", SYM(DAY_HOUR_SYM)},
{ "DAY_MICROSECOND", SYM(DAY_MICROSECOND_SYM),0,0}, { "DAY_MICROSECOND", SYM(DAY_MICROSECOND_SYM)},
{ "DAY_MINUTE", SYM(DAY_MINUTE_SYM),0,0}, { "DAY_MINUTE", SYM(DAY_MINUTE_SYM)},
{ "DAY_SECOND", SYM(DAY_SECOND_SYM),0,0}, { "DAY_SECOND", SYM(DAY_SECOND_SYM)},
{ "DEC", SYM(DECIMAL_SYM),0,0}, { "DEC", SYM(DECIMAL_SYM)},
{ "DECIMAL", SYM(DECIMAL_SYM),0,0}, { "DECIMAL", SYM(DECIMAL_SYM)},
{ "DEFAULT", SYM(DEFAULT),0,0}, { "DEFAULT", SYM(DEFAULT)},
{ "DELAYED", SYM(DELAYED_SYM),0,0}, { "DELAYED", SYM(DELAYED_SYM)},
{ "DELAY_KEY_WRITE", SYM(DELAY_KEY_WRITE_SYM),0,0}, { "DELAY_KEY_WRITE", SYM(DELAY_KEY_WRITE_SYM)},
{ "DELETE", SYM(DELETE_SYM),0,0}, { "DELETE", SYM(DELETE_SYM)},
{ "DESC", SYM(DESC),0,0}, { "DESC", SYM(DESC)},
{ "DESCRIBE", SYM(DESCRIBE),0,0}, { "DESCRIBE", SYM(DESCRIBE)},
{ "DES_KEY_FILE", SYM(DES_KEY_FILE),0,0}, { "DES_KEY_FILE", SYM(DES_KEY_FILE)},
{ "DIRECTORY", SYM(DIRECTORY_SYM),0,0}, { "DIRECTORY", SYM(DIRECTORY_SYM)},
{ "DISABLE", SYM(DISABLE_SYM),0,0}, { "DISABLE", SYM(DISABLE_SYM)},
{ "DISCARD", SYM(DISCARD),0,0}, { "DISCARD", SYM(DISCARD)},
{ "DISTINCT", SYM(DISTINCT),0,0}, { "DISTINCT", SYM(DISTINCT)},
{ "DISTINCTROW", SYM(DISTINCT),0,0}, /* Access likes this */ { "DISTINCTROW", SYM(DISTINCT)}, /* Access likes this */
{ "DIV", SYM(DIV_SYM),0,0}, { "DIV", SYM(DIV_SYM)},
{ "DO", SYM(DO_SYM),0,0}, { "DO", SYM(DO_SYM)},
{ "DOUBLE", SYM(DOUBLE_SYM),0,0}, { "DOUBLE", SYM(DOUBLE_SYM)},
{ "DROP", SYM(DROP),0,0}, { "DROP", SYM(DROP)},
{ "DUAL", SYM(DUAL_SYM),0,0}, { "DUAL", SYM(DUAL_SYM)},
{ "DUMPFILE", SYM(DUMPFILE),0,0}, { "DUMPFILE", SYM(DUMPFILE)},
{ "DUPLICATE", SYM(DUPLICATE_SYM),0,0}, { "DUPLICATE", SYM(DUPLICATE_SYM)},
{ "DYNAMIC", SYM(DYNAMIC_SYM),0,0}, { "DYNAMIC", SYM(DYNAMIC_SYM)},
{ "ELSE", SYM(ELSE),0,0}, { "ELSE", SYM(ELSE)},
{ "ENABLE", SYM(ENABLE_SYM),0,0}, { "ENABLE", SYM(ENABLE_SYM)},
{ "ENCLOSED", SYM(ENCLOSED),0,0}, { "ENCLOSED", SYM(ENCLOSED)},
{ "END", SYM(END),0,0}, { "END", SYM(END)},
{ "ENGINE", SYM(ENGINE_SYM),0,0}, { "ENGINE", SYM(ENGINE_SYM)},
{ "ENGINES", SYM(ENGINES_SYM),0,0}, { "ENGINES", SYM(ENGINES_SYM)},
{ "ENUM", SYM(ENUM),0,0}, { "ENUM", SYM(ENUM)},
{ "ERRORS", SYM(ERRORS),0,0}, { "ERRORS", SYM(ERRORS)},
{ "ESCAPE", SYM(ESCAPE_SYM),0,0}, { "ESCAPE", SYM(ESCAPE_SYM)},
{ "ESCAPED", SYM(ESCAPED),0,0}, { "ESCAPED", SYM(ESCAPED)},
{ "EVENTS", SYM(EVENTS_SYM),0,0}, { "EVENTS", SYM(EVENTS_SYM)},
{ "EXECUTE", SYM(EXECUTE_SYM),0,0}, { "EXECUTE", SYM(EXECUTE_SYM)},
{ "EXISTS", SYM(EXISTS),0,0}, { "EXISTS", SYM(EXISTS)},
{ "EXPANSION", SYM(EXPANSION_SYM),0,0}, { "EXPANSION", SYM(EXPANSION_SYM)},
{ "EXPLAIN", SYM(DESCRIBE),0,0}, { "EXPLAIN", SYM(DESCRIBE)},
{ "EXTENDED", SYM(EXTENDED_SYM),0,0}, { "EXTENDED", SYM(EXTENDED_SYM)},
{ "FALSE", SYM(FALSE_SYM),0,0}, { "FALSE", SYM(FALSE_SYM)},
{ "FAST", SYM(FAST_SYM),0,0}, { "FAST", SYM(FAST_SYM)},
{ "FIELDS", SYM(COLUMNS),0,0}, { "FIELDS", SYM(COLUMNS)},
{ "FILE", SYM(FILE_SYM),0,0}, { "FILE", SYM(FILE_SYM)},
{ "FIRST", SYM(FIRST_SYM),0,0}, { "FIRST", SYM(FIRST_SYM)},
{ "FIXED", SYM(FIXED_SYM),0,0}, { "FIXED", SYM(FIXED_SYM)},
{ "FLOAT", SYM(FLOAT_SYM),0,0}, { "FLOAT", SYM(FLOAT_SYM)},
{ "FLOAT4", SYM(FLOAT_SYM),0,0}, { "FLOAT4", SYM(FLOAT_SYM)},
{ "FLOAT8", SYM(DOUBLE_SYM),0,0}, { "FLOAT8", SYM(DOUBLE_SYM)},
{ "FLUSH", SYM(FLUSH_SYM),0,0}, { "FLUSH", SYM(FLUSH_SYM)},
{ "FOR", SYM(FOR_SYM),0,0}, { "FOR", SYM(FOR_SYM)},
{ "FORCE", SYM(FORCE_SYM),0,0}, { "FORCE", SYM(FORCE_SYM)},
{ "FOREIGN", SYM(FOREIGN),0,0}, { "FOREIGN", SYM(FOREIGN)},
{ "FROM", SYM(FROM),0,0}, { "FROM", SYM(FROM)},
{ "FULL", SYM(FULL),0,0}, { "FULL", SYM(FULL)},
{ "FULLTEXT", SYM(FULLTEXT_SYM),0,0}, { "FULLTEXT", SYM(FULLTEXT_SYM)},
{ "FUNCTION", SYM(UDF_SYM),0,0}, { "FUNCTION", SYM(UDF_SYM)},
{ "GEOMETRY", SYM(GEOMETRY_SYM),0,0}, { "GEOMETRY", SYM(GEOMETRY_SYM)},
{ "GEOMETRYCOLLECTION",SYM(GEOMETRYCOLLECTION),0,0}, { "GEOMETRYCOLLECTION",SYM(GEOMETRYCOLLECTION)},
{ "GET_FORMAT", SYM(GET_FORMAT),0,0}, { "GET_FORMAT", SYM(GET_FORMAT)},
{ "GLOBAL", SYM(GLOBAL_SYM),0,0}, { "GLOBAL", SYM(GLOBAL_SYM)},
{ "GRANT", SYM(GRANT),0,0}, { "GRANT", SYM(GRANT)},
{ "GRANTS", SYM(GRANTS),0,0}, { "GRANTS", SYM(GRANTS)},
{ "GROUP", SYM(GROUP),0,0}, { "GROUP", SYM(GROUP)},
{ "HANDLER", SYM(HANDLER_SYM),0,0}, { "HANDLER", SYM(HANDLER_SYM)},
{ "HASH", SYM(HASH_SYM),0,0}, { "HASH", SYM(HASH_SYM)},
{ "HAVING", SYM(HAVING),0,0}, { "HAVING", SYM(HAVING)},
{ "HELP", SYM(HELP_SYM),0,0}, { "HELP", SYM(HELP_SYM)},
{ "HIGH_PRIORITY", SYM(HIGH_PRIORITY),0,0}, { "HIGH_PRIORITY", SYM(HIGH_PRIORITY)},
{ "HOSTS", SYM(HOSTS_SYM),0,0}, { "HOSTS", SYM(HOSTS_SYM)},
{ "HOUR", SYM(HOUR_SYM),0,0}, { "HOUR", SYM(HOUR_SYM)},
{ "HOUR_MICROSECOND", SYM(HOUR_MICROSECOND_SYM),0,0}, { "HOUR_MICROSECOND", SYM(HOUR_MICROSECOND_SYM)},
{ "HOUR_MINUTE", SYM(HOUR_MINUTE_SYM),0,0}, { "HOUR_MINUTE", SYM(HOUR_MINUTE_SYM)},
{ "HOUR_SECOND", SYM(HOUR_SECOND_SYM),0,0}, { "HOUR_SECOND", SYM(HOUR_SECOND_SYM)},
{ "IDENTIFIED", SYM(IDENTIFIED_SYM),0,0}, { "IDENTIFIED", SYM(IDENTIFIED_SYM)},
{ "IF", SYM(IF),0,0}, { "IF", SYM(IF)},
{ "IGNORE", SYM(IGNORE_SYM),0,0}, { "IGNORE", SYM(IGNORE_SYM)},
{ "IMPORT", SYM(IMPORT),0,0}, { "IMPORT", SYM(IMPORT)},
{ "IN", SYM(IN_SYM),0,0}, { "IN", SYM(IN_SYM)},
{ "INDEX", SYM(INDEX),0,0}, { "INDEX", SYM(INDEX)},
{ "INDEXES", SYM(INDEXES),0,0}, { "INDEXES", SYM(INDEXES)},
{ "INFILE", SYM(INFILE),0,0}, { "INFILE", SYM(INFILE)},
{ "INNER", SYM(INNER_SYM),0,0}, { "INNER", SYM(INNER_SYM)},
{ "INNOBASE", SYM(INNOBASE_SYM),0,0}, { "INNOBASE", SYM(INNOBASE_SYM)},
{ "INNODB", SYM(INNOBASE_SYM),0,0}, { "INNODB", SYM(INNOBASE_SYM)},
{ "INSERT", SYM(INSERT),0,0}, { "INSERT", SYM(INSERT)},
{ "INSERT_METHOD", SYM(INSERT_METHOD),0,0}, { "INSERT_METHOD", SYM(INSERT_METHOD)},
{ "INT", SYM(INT_SYM),0,0}, { "INT", SYM(INT_SYM)},
{ "INT1", SYM(TINYINT),0,0}, { "INT1", SYM(TINYINT)},
{ "INT2", SYM(SMALLINT),0,0}, { "INT2", SYM(SMALLINT)},
{ "INT3", SYM(MEDIUMINT),0,0}, { "INT3", SYM(MEDIUMINT)},
{ "INT4", SYM(INT_SYM),0,0}, { "INT4", SYM(INT_SYM)},
{ "INT8", SYM(BIGINT),0,0}, { "INT8", SYM(BIGINT)},
{ "INTEGER", SYM(INT_SYM),0,0}, { "INTEGER", SYM(INT_SYM)},
{ "INTERVAL", SYM(INTERVAL_SYM),0,0}, { "INTERVAL", SYM(INTERVAL_SYM)},
{ "INTO", SYM(INTO),0,0}, { "INTO", SYM(INTO)},
{ "IO_THREAD", SYM(RELAY_THREAD),0,0}, { "IO_THREAD", SYM(RELAY_THREAD)},
{ "IS", SYM(IS),0,0}, { "IS", SYM(IS)},
{ "ISOLATION", SYM(ISOLATION),0,0}, { "ISOLATION", SYM(ISOLATION)},
{ "ISSUER", SYM(ISSUER_SYM),0,0}, { "ISSUER", SYM(ISSUER_SYM)},
{ "JOIN", SYM(JOIN_SYM),0,0}, { "JOIN", SYM(JOIN_SYM)},
{ "KEY", SYM(KEY_SYM),0,0}, { "KEY", SYM(KEY_SYM)},
{ "KEYS", SYM(KEYS),0,0}, { "KEYS", SYM(KEYS)},
{ "KILL", SYM(KILL_SYM),0,0}, { "KILL", SYM(KILL_SYM)},
{ "LAST", SYM(LAST_SYM),0,0}, { "LAST", SYM(LAST_SYM)},
{ "LEADING", SYM(LEADING),0,0}, { "LEADING", SYM(LEADING)},
{ "LEAVES", SYM(LEAVES),0,0}, { "LEAVES", SYM(LEAVES)},
{ "LEFT", SYM(LEFT),0,0}, { "LEFT", SYM(LEFT)},
{ "LEVEL", SYM(LEVEL_SYM),0,0}, { "LEVEL", SYM(LEVEL_SYM)},
{ "LIKE", SYM(LIKE),0,0}, { "LIKE", SYM(LIKE)},
{ "LIMIT", SYM(LIMIT),0,0}, { "LIMIT", SYM(LIMIT)},
{ "LINES", SYM(LINES),0,0}, { "LINES", SYM(LINES)},
{ "LINESTRING", SYM(LINESTRING),0,0}, { "LINESTRING", SYM(LINESTRING)},
{ "LOAD", SYM(LOAD),0,0}, { "LOAD", SYM(LOAD)},
{ "LOCAL", SYM(LOCAL_SYM),0,0}, { "LOCAL", SYM(LOCAL_SYM)},
{ "LOCALTIME", SYM(NOW_SYM),0,0}, { "LOCALTIME", SYM(NOW_SYM)},
{ "LOCALTIMESTAMP", SYM(NOW_SYM),0,0}, { "LOCALTIMESTAMP", SYM(NOW_SYM)},
{ "LOCK", SYM(LOCK_SYM),0,0}, { "LOCK", SYM(LOCK_SYM)},
{ "LOCKS", SYM(LOCKS_SYM),0,0}, { "LOCKS", SYM(LOCKS_SYM)},
{ "LOGS", SYM(LOGS_SYM),0,0}, { "LOGS", SYM(LOGS_SYM)},
{ "LONG", SYM(LONG_SYM),0,0}, { "LONG", SYM(LONG_SYM)},
{ "LONGBLOB", SYM(LONGBLOB),0,0}, { "LONGBLOB", SYM(LONGBLOB)},
{ "LONGTEXT", SYM(LONGTEXT),0,0}, { "LONGTEXT", SYM(LONGTEXT)},
{ "LOW_PRIORITY", SYM(LOW_PRIORITY),0,0}, { "LOW_PRIORITY", SYM(LOW_PRIORITY)},
{ "MASTER", SYM(MASTER_SYM),0,0}, { "MASTER", SYM(MASTER_SYM)},
{ "MASTER_CONNECT_RETRY", SYM(MASTER_CONNECT_RETRY_SYM),0,0}, { "MASTER_CONNECT_RETRY", SYM(MASTER_CONNECT_RETRY_SYM)},
{ "MASTER_HOST", SYM(MASTER_HOST_SYM),0,0}, { "MASTER_HOST", SYM(MASTER_HOST_SYM)},
{ "MASTER_LOG_FILE", SYM(MASTER_LOG_FILE_SYM),0,0}, { "MASTER_LOG_FILE", SYM(MASTER_LOG_FILE_SYM)},
{ "MASTER_LOG_POS", SYM(MASTER_LOG_POS_SYM),0,0}, { "MASTER_LOG_POS", SYM(MASTER_LOG_POS_SYM)},
{ "MASTER_PASSWORD", SYM(MASTER_PASSWORD_SYM),0,0}, { "MASTER_PASSWORD", SYM(MASTER_PASSWORD_SYM)},
{ "MASTER_PORT", SYM(MASTER_PORT_SYM),0,0}, { "MASTER_PORT", SYM(MASTER_PORT_SYM)},
{ "MASTER_SERVER_ID", SYM(MASTER_SERVER_ID_SYM),0,0}, { "MASTER_SERVER_ID", SYM(MASTER_SERVER_ID_SYM)},
{ "MASTER_SSL", SYM(MASTER_SSL_SYM),0,0}, { "MASTER_SSL", SYM(MASTER_SSL_SYM)},
{ "MASTER_SSL_CA", SYM(MASTER_SSL_CA_SYM),0,0}, { "MASTER_SSL_CA", SYM(MASTER_SSL_CA_SYM)},
{ "MASTER_SSL_CAPATH",SYM(MASTER_SSL_CAPATH_SYM),0,0}, { "MASTER_SSL_CAPATH",SYM(MASTER_SSL_CAPATH_SYM)},
{ "MASTER_SSL_CERT", SYM(MASTER_SSL_CERT_SYM),0,0}, { "MASTER_SSL_CERT", SYM(MASTER_SSL_CERT_SYM)},
{ "MASTER_SSL_CIPHER",SYM(MASTER_SSL_CIPHER_SYM),0,0}, { "MASTER_SSL_CIPHER",SYM(MASTER_SSL_CIPHER_SYM)},
{ "MASTER_SSL_KEY", SYM(MASTER_SSL_KEY_SYM),0,0}, { "MASTER_SSL_KEY", SYM(MASTER_SSL_KEY_SYM)},
{ "MASTER_USER", SYM(MASTER_USER_SYM),0,0}, { "MASTER_USER", SYM(MASTER_USER_SYM)},
{ "MATCH", SYM(MATCH),0,0}, { "MATCH", SYM(MATCH)},
{ "MAX_CONNECTIONS_PER_HOUR", SYM(MAX_CONNECTIONS_PER_HOUR), 0,0}, { "MAX_CONNECTIONS_PER_HOUR", SYM(MAX_CONNECTIONS_PER_HOUR)},
{ "MAX_QUERIES_PER_HOUR", SYM(MAX_QUERIES_PER_HOUR), 0,0}, { "MAX_QUERIES_PER_HOUR", SYM(MAX_QUERIES_PER_HOUR)},
{ "MAX_ROWS", SYM(MAX_ROWS),0,0}, { "MAX_ROWS", SYM(MAX_ROWS)},
{ "MAX_UPDATES_PER_HOUR", SYM(MAX_UPDATES_PER_HOUR), 0,0}, { "MAX_UPDATES_PER_HOUR", SYM(MAX_UPDATES_PER_HOUR)},
{ "MEDIUM", SYM(MEDIUM_SYM),0,0}, { "MEDIUM", SYM(MEDIUM_SYM)},
{ "MEDIUMBLOB", SYM(MEDIUMBLOB),0,0}, { "MEDIUMBLOB", SYM(MEDIUMBLOB)},
{ "MEDIUMINT", SYM(MEDIUMINT),0,0}, { "MEDIUMINT", SYM(MEDIUMINT)},
{ "MEDIUMTEXT", SYM(MEDIUMTEXT),0,0}, { "MEDIUMTEXT", SYM(MEDIUMTEXT)},
{ "MICROSECOND", SYM(MICROSECOND_SYM),0,0}, { "MICROSECOND", SYM(MICROSECOND_SYM)},
{ "MIDDLEINT", SYM(MEDIUMINT),0,0}, /* For powerbuilder */ { "MIDDLEINT", SYM(MEDIUMINT)}, /* For powerbuilder */
{ "MINUTE", SYM(MINUTE_SYM),0,0}, { "MINUTE", SYM(MINUTE_SYM)},
{ "MINUTE_MICROSECOND", SYM(MINUTE_MICROSECOND_SYM),0,0}, { "MINUTE_MICROSECOND", SYM(MINUTE_MICROSECOND_SYM)},
{ "MINUTE_SECOND", SYM(MINUTE_SECOND_SYM),0,0}, { "MINUTE_SECOND", SYM(MINUTE_SECOND_SYM)},
{ "MIN_ROWS", SYM(MIN_ROWS),0,0}, { "MIN_ROWS", SYM(MIN_ROWS)},
{ "MOD", SYM(MOD_SYM),0,0}, { "MOD", SYM(MOD_SYM)},
{ "MODE", SYM(MODE_SYM),0,0}, { "MODE", SYM(MODE_SYM)},
{ "MODIFY", SYM(MODIFY_SYM),0,0}, { "MODIFY", SYM(MODIFY_SYM)},
{ "MONTH", SYM(MONTH_SYM),0,0}, { "MONTH", SYM(MONTH_SYM)},
{ "MULTILINESTRING", SYM(MULTILINESTRING),0,0}, { "MULTILINESTRING", SYM(MULTILINESTRING)},
{ "MULTIPOINT", SYM(MULTIPOINT),0,0}, { "MULTIPOINT", SYM(MULTIPOINT)},
{ "MULTIPOLYGON", SYM(MULTIPOLYGON),0,0}, { "MULTIPOLYGON", SYM(MULTIPOLYGON)},
{ "NAMES", SYM(NAMES_SYM),0,0}, { "NAMES", SYM(NAMES_SYM)},
{ "NATIONAL", SYM(NATIONAL_SYM),0,0}, { "NATIONAL", SYM(NATIONAL_SYM)},
{ "NATURAL", SYM(NATURAL),0,0}, { "NATURAL", SYM(NATURAL)},
{ "NCHAR", SYM(NCHAR_SYM),0,0}, { "NCHAR", SYM(NCHAR_SYM)},
{ "NEW", SYM(NEW_SYM),0,0}, { "NEW", SYM(NEW_SYM)},
{ "NEXT", SYM(NEXT_SYM),0,0}, { "NEXT", SYM(NEXT_SYM)},
{ "NO", SYM(NO_SYM),0,0}, { "NO", SYM(NO_SYM)},
{ "NONE", SYM(NONE_SYM),0,0}, { "NONE", SYM(NONE_SYM)},
{ "NOT", SYM(NOT),0,0}, { "NOT", SYM(NOT)},
{ "NO_WRITE_TO_BINLOG", SYM(NO_WRITE_TO_BINLOG),0,0}, { "NO_WRITE_TO_BINLOG", SYM(NO_WRITE_TO_BINLOG)},
{ "NULL", SYM(NULL_SYM),0,0}, { "NULL", SYM(NULL_SYM)},
{ "NUMERIC", SYM(NUMERIC_SYM),0,0}, { "NUMERIC", SYM(NUMERIC_SYM)},
{ "NVARCHAR", SYM(NVARCHAR_SYM),0,0}, { "NVARCHAR", SYM(NVARCHAR_SYM)},
{ "OFFSET", SYM(OFFSET_SYM),0,0}, { "OFFSET", SYM(OFFSET_SYM)},
{ "OLD_PASSWORD", SYM(OLD_PASSWORD),0,0}, { "OLD_PASSWORD", SYM(OLD_PASSWORD)},
{ "ON", SYM(ON),0,0}, { "ON", SYM(ON)},
{ "OPEN", SYM(OPEN_SYM),0,0}, { "OPEN", SYM(OPEN_SYM)},
{ "OPTIMIZE", SYM(OPTIMIZE),0,0}, { "OPTIMIZE", SYM(OPTIMIZE)},
{ "OPTION", SYM(OPTION),0,0}, { "OPTION", SYM(OPTION)},
{ "OPTIONALLY", SYM(OPTIONALLY),0,0}, { "OPTIONALLY", SYM(OPTIONALLY)},
{ "OR", SYM(OR),0,0}, { "OR", SYM(OR)},
{ "ORDER", SYM(ORDER_SYM),0,0}, { "ORDER", SYM(ORDER_SYM)},
{ "OUTER", SYM(OUTER),0,0}, { "OUTER", SYM(OUTER)},
{ "OUTFILE", SYM(OUTFILE),0,0}, { "OUTFILE", SYM(OUTFILE)},
{ "PACK_KEYS", SYM(PACK_KEYS_SYM),0,0}, { "PACK_KEYS", SYM(PACK_KEYS_SYM)},
{ "PARTIAL", SYM(PARTIAL),0,0}, { "PARTIAL", SYM(PARTIAL)},
{ "PASSWORD", SYM(PASSWORD),0,0}, { "PASSWORD", SYM(PASSWORD)},
{ "POINT", SYM(POINT_SYM),0,0}, { "POINT", SYM(POINT_SYM)},
{ "POLYGON", SYM(POLYGON),0,0}, { "POLYGON", SYM(POLYGON)},
{ "PRECISION", SYM(PRECISION),0,0}, { "PRECISION", SYM(PRECISION)},
{ "PREV", SYM(PREV_SYM),0,0}, { "PREV", SYM(PREV_SYM)},
{ "PRIMARY", SYM(PRIMARY_SYM),0,0}, { "PRIMARY", SYM(PRIMARY_SYM)},
{ "PRIVILEGES", SYM(PRIVILEGES),0,0}, { "PRIVILEGES", SYM(PRIVILEGES)},
{ "PROCEDURE", SYM(PROCEDURE),0,0}, { "PROCEDURE", SYM(PROCEDURE)},
{ "PROCESS" , SYM(PROCESS),0,0}, { "PROCESS" , SYM(PROCESS)},
{ "PROCESSLIST", SYM(PROCESSLIST_SYM),0,0}, { "PROCESSLIST", SYM(PROCESSLIST_SYM)},
{ "PURGE", SYM(PURGE),0,0}, { "PURGE", SYM(PURGE)},
{ "QUERY", SYM(QUERY_SYM),0,0}, { "QUERY", SYM(QUERY_SYM)},
{ "QUICK", SYM(QUICK),0,0}, { "QUICK", SYM(QUICK)},
{ "RAID0", SYM(RAID_0_SYM),0,0}, { "RAID0", SYM(RAID_0_SYM)},
{ "RAID_CHUNKS", SYM(RAID_CHUNKS),0,0}, { "RAID_CHUNKS", SYM(RAID_CHUNKS)},
{ "RAID_CHUNKSIZE", SYM(RAID_CHUNKSIZE),0,0}, { "RAID_CHUNKSIZE", SYM(RAID_CHUNKSIZE)},
{ "RAID_TYPE", SYM(RAID_TYPE),0,0}, { "RAID_TYPE", SYM(RAID_TYPE)},
{ "READ", SYM(READ_SYM),0,0}, { "READ", SYM(READ_SYM)},
{ "REAL", SYM(REAL),0,0}, { "REAL", SYM(REAL)},
{ "REFERENCES", SYM(REFERENCES),0,0}, { "REFERENCES", SYM(REFERENCES)},
{ "REGEXP", SYM(REGEXP),0,0}, { "REGEXP", SYM(REGEXP)},
{ "RELAY_LOG_FILE", SYM(RELAY_LOG_FILE_SYM),0,0}, { "RELAY_LOG_FILE", SYM(RELAY_LOG_FILE_SYM)},
{ "RELAY_LOG_POS", SYM(RELAY_LOG_POS_SYM),0,0}, { "RELAY_LOG_POS", SYM(RELAY_LOG_POS_SYM)},
{ "RELAY_THREAD", SYM(RELAY_THREAD),0,0}, { "RELAY_THREAD", SYM(RELAY_THREAD)},
{ "RELOAD", SYM(RELOAD),0,0}, { "RELOAD", SYM(RELOAD)},
{ "RENAME", SYM(RENAME),0,0}, { "RENAME", SYM(RENAME)},
{ "REPAIR", SYM(REPAIR),0,0}, { "REPAIR", SYM(REPAIR)},
{ "REPEATABLE", SYM(REPEATABLE_SYM),0,0}, { "REPEATABLE", SYM(REPEATABLE_SYM)},
{ "REPLACE", SYM(REPLACE),0,0}, { "REPLACE", SYM(REPLACE)},
{ "REPLICATION", SYM(REPLICATION),0,0}, { "REPLICATION", SYM(REPLICATION)},
{ "REQUIRE", SYM(REQUIRE_SYM),0,0}, { "REQUIRE", SYM(REQUIRE_SYM)},
{ "RESET", SYM(RESET_SYM),0,0}, { "RESET", SYM(RESET_SYM)},
{ "RESTORE", SYM(RESTORE_SYM),0,0}, { "RESTORE", SYM(RESTORE_SYM)},
{ "RESTRICT", SYM(RESTRICT),0,0}, { "RESTRICT", SYM(RESTRICT)},
{ "RETURNS", SYM(UDF_RETURNS_SYM),0,0}, { "RETURNS", SYM(UDF_RETURNS_SYM)},
{ "REVOKE", SYM(REVOKE),0,0}, { "REVOKE", SYM(REVOKE)},
{ "RIGHT", SYM(RIGHT),0,0}, { "RIGHT", SYM(RIGHT)},
{ "RLIKE", SYM(REGEXP),0,0}, /* Like in mSQL2 */ { "RLIKE", SYM(REGEXP)}, /* Like in mSQL2 */
{ "ROLLBACK", SYM(ROLLBACK_SYM),0,0}, { "ROLLBACK", SYM(ROLLBACK_SYM)},
{ "ROLLUP", SYM(ROLLUP_SYM),0,0}, { "ROLLUP", SYM(ROLLUP_SYM)},
{ "ROW", SYM(ROW_SYM),0,0}, { "ROW", SYM(ROW_SYM)},
{ "ROWS", SYM(ROWS_SYM),0,0}, { "ROWS", SYM(ROWS_SYM)},
{ "ROW_FORMAT", SYM(ROW_FORMAT_SYM),0,0}, { "ROW_FORMAT", SYM(ROW_FORMAT_SYM)},
{ "RTREE", SYM(RTREE_SYM),0,0}, { "RTREE", SYM(RTREE_SYM)},
{ "SAVEPOINT", SYM(SAVEPOINT_SYM),0,0}, { "SAVEPOINT", SYM(SAVEPOINT_SYM)},
{ "SECOND", SYM(SECOND_SYM),0,0}, { "SECOND", SYM(SECOND_SYM)},
{ "SECOND_MICROSECOND", SYM(SECOND_MICROSECOND_SYM),0,0}, { "SECOND_MICROSECOND", SYM(SECOND_MICROSECOND_SYM)},
{ "SELECT", SYM(SELECT_SYM),0,0}, { "SELECT", SYM(SELECT_SYM)},
{ "SEPARATOR", SYM(SEPARATOR_SYM),0,0}, { "SEPARATOR", SYM(SEPARATOR_SYM)},
{ "SERIAL", SYM(SERIAL_SYM),0,0}, { "SERIAL", SYM(SERIAL_SYM)},
{ "SERIALIZABLE", SYM(SERIALIZABLE_SYM),0,0}, { "SERIALIZABLE", SYM(SERIALIZABLE_SYM)},
{ "SESSION", SYM(SESSION_SYM),0,0}, { "SESSION", SYM(SESSION_SYM)},
{ "SET", SYM(SET),0,0}, { "SET", SYM(SET)},
{ "SHARE", SYM(SHARE_SYM),0,0}, { "SHARE", SYM(SHARE_SYM)},
{ "SHOW", SYM(SHOW),0,0}, { "SHOW", SYM(SHOW)},
{ "SHUTDOWN", SYM(SHUTDOWN),0,0}, { "SHUTDOWN", SYM(SHUTDOWN)},
{ "SIGNED", SYM(SIGNED_SYM),0,0}, { "SIGNED", SYM(SIGNED_SYM)},
{ "SIMPLE", SYM(SIMPLE_SYM),0,0}, { "SIMPLE", SYM(SIMPLE_SYM)},
{ "SLAVE", SYM(SLAVE),0,0}, { "SLAVE", SYM(SLAVE)},
{ "SMALLINT", SYM(SMALLINT),0,0}, { "SMALLINT", SYM(SMALLINT)},
{ "SOME", SYM(ANY_SYM),0,0}, { "SOME", SYM(ANY_SYM)},
{ "SONAME", SYM(UDF_SONAME_SYM),0,0}, { "SONAME", SYM(UDF_SONAME_SYM)},
{ "SOUNDS", SYM(SOUNDS_SYM),0,0}, { "SOUNDS", SYM(SOUNDS_SYM)},
{ "SPATIAL", SYM(SPATIAL_SYM),0,0}, { "SPATIAL", SYM(SPATIAL_SYM)},
{ "SQL_BIG_RESULT", SYM(SQL_BIG_RESULT),0,0}, { "SQL_BIG_RESULT", SYM(SQL_BIG_RESULT)},
{ "SQL_BUFFER_RESULT", SYM(SQL_BUFFER_RESULT),0,0}, { "SQL_BUFFER_RESULT", SYM(SQL_BUFFER_RESULT)},
{ "SQL_CACHE", SYM(SQL_CACHE_SYM), 0, 0}, { "SQL_CACHE", SYM(SQL_CACHE_SYM)},
{ "SQL_CALC_FOUND_ROWS", SYM(SQL_CALC_FOUND_ROWS),0,0}, { "SQL_CALC_FOUND_ROWS", SYM(SQL_CALC_FOUND_ROWS)},
{ "SQL_NO_CACHE", SYM(SQL_NO_CACHE_SYM), 0, 0}, { "SQL_NO_CACHE", SYM(SQL_NO_CACHE_SYM)},
{ "SQL_SMALL_RESULT", SYM(SQL_SMALL_RESULT),0,0}, { "SQL_SMALL_RESULT", SYM(SQL_SMALL_RESULT)},
{ "SQL_THREAD", SYM(SQL_THREAD),0,0}, { "SQL_THREAD", SYM(SQL_THREAD)},
{ "SSL", SYM(SSL_SYM),0,0}, { "SSL", SYM(SSL_SYM)},
{ "START", SYM(START_SYM),0,0}, { "START", SYM(START_SYM)},
{ "STARTING", SYM(STARTING),0,0}, { "STARTING", SYM(STARTING)},
{ "STATUS", SYM(STATUS_SYM),0,0}, { "STATUS", SYM(STATUS_SYM)},
{ "STOP", SYM(STOP_SYM),0,0}, { "STOP", SYM(STOP_SYM)},
{ "STORAGE", SYM(STORAGE_SYM),0,0}, { "STORAGE", SYM(STORAGE_SYM)},
{ "STRAIGHT_JOIN", SYM(STRAIGHT_JOIN),0,0}, { "STRAIGHT_JOIN", SYM(STRAIGHT_JOIN)},
{ "STRING", SYM(STRING_SYM),0,0}, { "STRING", SYM(STRING_SYM)},
{ "STRIPED", SYM(RAID_STRIPED_SYM),0,0}, { "STRIPED", SYM(RAID_STRIPED_SYM)},
{ "SUBJECT", SYM(SUBJECT_SYM),0,0}, { "SUBJECT", SYM(SUBJECT_SYM)},
{ "SUPER", SYM(SUPER_SYM),0,0}, { "SUPER", SYM(SUPER_SYM)},
{ "TABLE", SYM(TABLE_SYM),0,0}, { "TABLE", SYM(TABLE_SYM)},
{ "TABLES", SYM(TABLES),0,0}, { "TABLES", SYM(TABLES)},
{ "TABLESPACE", SYM(TABLESPACE),0,0}, { "TABLESPACE", SYM(TABLESPACE)},
{ "TEMPORARY", SYM(TEMPORARY),0,0}, { "TEMPORARY", SYM(TEMPORARY)},
{ "TERMINATED", SYM(TERMINATED),0,0}, { "TERMINATED", SYM(TERMINATED)},
{ "TEXT", SYM(TEXT_SYM),0,0}, { "TEXT", SYM(TEXT_SYM)},
{ "THEN", SYM(THEN_SYM),0,0}, { "THEN", SYM(THEN_SYM)},
{ "TIME", SYM(TIME_SYM),0,0}, { "TIME", SYM(TIME_SYM)},
{ "TIMESTAMP", SYM(TIMESTAMP),0,0}, { "TIMESTAMP", SYM(TIMESTAMP)},
{ "TINYBLOB", SYM(TINYBLOB),0,0}, { "TINYBLOB", SYM(TINYBLOB)},
{ "TINYINT", SYM(TINYINT),0,0}, { "TINYINT", SYM(TINYINT)},
{ "TINYTEXT", SYM(TINYTEXT),0,0}, { "TINYTEXT", SYM(TINYTEXT)},
{ "TO", SYM(TO_SYM),0,0}, { "TO", SYM(TO_SYM)},
{ "TRAILING", SYM(TRAILING),0,0}, { "TRAILING", SYM(TRAILING)},
{ "TRANSACTION", SYM(TRANSACTION_SYM),0,0}, { "TRANSACTION", SYM(TRANSACTION_SYM)},
{ "TRUE", SYM(TRUE_SYM),0,0}, { "TRUE", SYM(TRUE_SYM)},
{ "TRUNCATE", SYM(TRUNCATE_SYM),0,0}, { "TRUNCATE", SYM(TRUNCATE_SYM)},
{ "TYPE", SYM(TYPE_SYM),0,0}, { "TYPE", SYM(TYPE_SYM)},
{ "TYPES", SYM(TYPES_SYM),0,0}, { "TYPES", SYM(TYPES_SYM)},
{ "UNCOMMITTED", SYM(UNCOMMITTED_SYM),0,0}, { "UNCOMMITTED", SYM(UNCOMMITTED_SYM)},
{ "UNICODE", SYM(UNICODE_SYM),0,0}, { "UNICODE", SYM(UNICODE_SYM)},
{ "UNION", SYM(UNION_SYM),0,0}, { "UNION", SYM(UNION_SYM)},
{ "UNIQUE", SYM(UNIQUE_SYM),0,0}, { "UNIQUE", SYM(UNIQUE_SYM)},
{ "UNLOCK", SYM(UNLOCK_SYM),0,0}, { "UNLOCK", SYM(UNLOCK_SYM)},
{ "UNSIGNED", SYM(UNSIGNED),0,0}, { "UNSIGNED", SYM(UNSIGNED)},
{ "UNTIL", SYM(UNTIL_SYM),0,0}, { "UNTIL", SYM(UNTIL_SYM)},
{ "UPDATE", SYM(UPDATE_SYM),0,0}, { "UPDATE", SYM(UPDATE_SYM)},
{ "USAGE", SYM(USAGE),0,0}, { "USAGE", SYM(USAGE)},
{ "USE", SYM(USE_SYM),0,0}, { "USE", SYM(USE_SYM)},
{ "USER", SYM(USER),0,0}, { "USER", SYM(USER)},
{ "USER_RESOURCES", SYM(RESOURCES),0,0}, { "USER_RESOURCES", SYM(RESOURCES)},
{ "USE_FRM", SYM(USE_FRM),0,0}, { "USE_FRM", SYM(USE_FRM)},
{ "USING", SYM(USING),0,0}, { "USING", SYM(USING)},
{ "UTC_DATE", SYM(UTC_DATE_SYM),0,0}, { "UTC_DATE", SYM(UTC_DATE_SYM)},
{ "UTC_TIME", SYM(UTC_TIME_SYM),0,0}, { "UTC_TIME", SYM(UTC_TIME_SYM)},
{ "UTC_TIMESTAMP", SYM(UTC_TIMESTAMP_SYM),0,0}, { "UTC_TIMESTAMP", SYM(UTC_TIMESTAMP_SYM)},
{ "VALUE", SYM(VALUE_SYM),0,0}, { "VALUE", SYM(VALUE_SYM)},
{ "VALUES", SYM(VALUES),0,0}, { "VALUES", SYM(VALUES)},
{ "VARBINARY", SYM(VARBINARY),0,0}, { "VARBINARY", SYM(VARBINARY)},
{ "VARCHAR", SYM(VARCHAR),0,0}, { "VARCHAR", SYM(VARCHAR)},
{ "VARCHARACTER", SYM(VARCHAR),0,0}, { "VARCHARACTER", SYM(VARCHAR)},
{ "VARIABLES", SYM(VARIABLES),0,0}, { "VARIABLES", SYM(VARIABLES)},
{ "VARYING", SYM(VARYING),0,0}, { "VARYING", SYM(VARYING)},
{ "WARNINGS", SYM(WARNINGS),0,0}, { "WARNINGS", SYM(WARNINGS)},
{ "WHEN", SYM(WHEN_SYM),0,0}, { "WHEN", SYM(WHEN_SYM)},
{ "WHERE", SYM(WHERE),0,0}, { "WHERE", SYM(WHERE)},
{ "WITH", SYM(WITH),0,0}, { "WITH", SYM(WITH)},
{ "WORK", SYM(WORK_SYM),0,0}, { "WORK", SYM(WORK_SYM)},
{ "WRITE", SYM(WRITE_SYM),0,0}, { "WRITE", SYM(WRITE_SYM)},
{ "X509", SYM(X509_SYM),0,0}, { "X509", SYM(X509_SYM)},
{ "XOR", SYM(XOR),0,0}, { "XOR", SYM(XOR)},
{ "YEAR", SYM(YEAR_SYM),0,0}, { "YEAR", SYM(YEAR_SYM)},
{ "YEAR_MONTH", SYM(YEAR_MONTH_SYM),0,0}, { "YEAR_MONTH", SYM(YEAR_MONTH_SYM)},
{ "ZEROFILL", SYM(ZEROFILL),0,0}, { "ZEROFILL", SYM(ZEROFILL)},
{ "||", SYM(OR_OR_CONCAT),0,0} { "||", SYM(OR_OR_CONCAT)}
}; };
static SYMBOL sql_functions[] = { static SYMBOL sql_functions[] = {
{ "ABS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_abs)}, { "ABS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_abs)},
{ "ACOS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_acos)}, #ifdef DUMMY
{ "ADDDATE", SYM(ADDDATE_SYM),0,0}, { "ACOS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_acos)},
{ "ADDTIME", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_addtime)}, { "ADDDATE", SYM(ADDDATE_SYM)},
{ "AES_ENCRYPT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_encrypt)}, { "ADDTIME", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_addtime)},
{ "AES_DECRYPT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_decrypt)}, { "AES_ENCRYPT", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_encrypt)},
{ "AREA", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_area)}, { "AES_DECRYPT", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_decrypt)},
{ "ASIN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_asin)}, { "AREA", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_area)},
{ "ASBINARY", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_as_wkb)}, { "ASIN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_asin)},
{ "ASTEXT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_as_wkt)}, { "ASBINARY", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkb)},
{ "ASWKB", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_as_wkb)}, { "ASTEXT", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkt)},
{ "ASWKT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_as_wkt)}, { "ASWKB", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkb)},
{ "ATAN", SYM(ATAN),0,0}, { "ASWKT", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkt)},
{ "ATAN2", SYM(ATAN),0,0}, { "ATAN", SYM(ATAN)},
{ "BENCHMARK", SYM(BENCHMARK_SYM),0,0}, { "ATAN2", SYM(ATAN)},
{ "BIN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bin)}, { "BENCHMARK", SYM(BENCHMARK_SYM)},
{ "BIT_COUNT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_count)}, { "BIN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bin)},
{ "BIT_OR", SYM(BIT_OR),0,0}, { "BIT_COUNT", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_count)},
{ "BIT_AND", SYM(BIT_AND),0,0}, { "BIT_OR", SYM(BIT_OR)},
{ "BIT_XOR", SYM(BIT_XOR),0,0}, { "BIT_AND", SYM(BIT_AND)},
{ "CAST", SYM(CAST_SYM),0,0}, { "BIT_XOR", SYM(BIT_XOR)},
{ "CEIL", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)}, { "CAST", SYM(CAST_SYM)},
{ "CEILING", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)}, { "CEIL", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
{ "CURRENT_USER", SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_current_user)}, { "CEILING", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
{ "BIT_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_length)}, { "CURRENT_USER", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_current_user)},
{ "CENTROID", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_centroid)}, { "BIT_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_length)},
{ "CHAR_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)}, { "CENTROID", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_centroid)},
{ "CHARACTER_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)}, { "CHAR_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
{ "COALESCE", SYM(COALESCE),0,0}, { "CHARACTER_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
{ "COERCIBILITY", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_coercibility)}, { "COALESCE", SYM(COALESCE)},
{ "COMPRESS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_compress)}, { "COERCIBILITY", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_coercibility)},
{ "CONCAT", SYM(CONCAT),0,0}, { "COMPRESS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_compress)},
{ "CONCAT_WS", SYM(CONCAT_WS),0,0}, { "CONCAT", SYM(CONCAT)},
{ "CONNECTION_ID", SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_connection_id)}, { "CONCAT_WS", SYM(CONCAT_WS)},
{ "CONTAINS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_contains)}, { "CONNECTION_ID", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_connection_id)},
{ "CONV", SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_conv)}, { "CONTAINS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_contains)},
{ "CONVERT", SYM(CONVERT_SYM),0,0}, { "CONV", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_conv)},
{ "COUNT", SYM(COUNT_SYM),0,0}, { "CONVERT", SYM(CONVERT_SYM)},
{ "COS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cos)}, { "COUNT", SYM(COUNT_SYM)},
{ "COT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cot)}, { "COS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cos)},
{ "CRC32", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_crc32)}, { "COT", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cot)},
{ "CROSSES", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_crosses)}, { "CRC32", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_crc32)},
{ "CURDATE", SYM(CURDATE),0,0}, { "CROSSES", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_crosses)},
{ "CURTIME", SYM(CURTIME),0,0}, { "CURDATE", SYM(CURDATE)},
{ "DATE_ADD", SYM(DATE_ADD_INTERVAL),0,0}, { "CURTIME", SYM(CURTIME)},
{ "DATEDIFF", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_datediff)}, { "DATE_ADD", SYM(DATE_ADD_INTERVAL)},
{ "DATE_FORMAT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_date_format)}, { "DATEDIFF", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_datediff)},
{ "DATE_SUB", SYM(DATE_SUB_INTERVAL),0,0}, { "DATE_FORMAT", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_date_format)},
{ "DAYNAME", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayname)}, { "DATE_SUB", SYM(DATE_SUB_INTERVAL)},
{ "DAYOFMONTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofmonth)}, { "DAYNAME", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayname)},
{ "DAYOFWEEK", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofweek)}, { "DAYOFMONTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofmonth)},
{ "DAYOFYEAR", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofyear)}, { "DAYOFWEEK", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofweek)},
{ "DECODE", SYM(DECODE_SYM),0,0}, { "DAYOFYEAR", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofyear)},
{ "DEGREES", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_degrees)}, { "DECODE", SYM(DECODE_SYM)},
{ "DES_ENCRYPT", SYM(DES_ENCRYPT_SYM),0,0}, { "DEGREES", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_degrees)},
{ "DES_DECRYPT", SYM(DES_DECRYPT_SYM),0,0}, { "DES_ENCRYPT", SYM(DES_ENCRYPT_SYM)},
{ "DIMENSION", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dimension)}, { "DES_DECRYPT", SYM(DES_DECRYPT_SYM)},
{ "DISJOINT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_disjoint)}, { "DIMENSION", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_dimension)},
{ "ELT", SYM(ELT_FUNC),0,0}, { "DISJOINT", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_disjoint)},
{ "ENCODE", SYM(ENCODE_SYM),0,0}, { "ELT", SYM(ELT_FUNC)},
{ "ENCRYPT", SYM(ENCRYPT),0,0}, { "ENCODE", SYM(ENCODE_SYM)},
{ "ENDPOINT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_endpoint)}, { "ENCRYPT", SYM(ENCRYPT)},
{ "ENVELOPE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_envelope)}, { "ENDPOINT", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_endpoint)},
{ "EQUALS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_equals)}, { "ENVELOPE", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_envelope)},
{ "EXTERIORRING", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_exteriorring)}, { "EQUALS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_equals)},
{ "EXTRACT", SYM(EXTRACT_SYM),0,0}, { "EXTERIORRING", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_exteriorring)},
{ "EXP", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_exp)}, { "EXTRACT", SYM(EXTRACT_SYM)},
{ "EXPORT_SET", SYM(EXPORT_SET),0,0}, { "EXP", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_exp)},
{ "FIELD", SYM(FIELD_FUNC),0,0}, /* For compability */ { "EXPORT_SET", SYM(EXPORT_SET)},
{ "FIND_IN_SET", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_find_in_set)}, { "FIELD", SYM(FIELD_FUNC)}, /* For compability */
{ "FLOOR", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_floor)}, { "FIND_IN_SET", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_find_in_set)},
{ "FORMAT", SYM(FORMAT_SYM),0,0}, { "FLOOR", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_floor)},
{ "FOUND_ROWS", SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_found_rows)}, { "FORMAT", SYM(FORMAT_SYM)},
{ "FROM_DAYS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_from_days)}, { "FOUND_ROWS", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_found_rows)},
{ "FROM_UNIXTIME", SYM(FROM_UNIXTIME),0,0}, { "FROM_DAYS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_from_days)},
{ "GET_LOCK", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_get_lock)}, { "FROM_UNIXTIME", SYM(FROM_UNIXTIME)},
{ "GEOMETRYN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_geometryn)}, { "GET_LOCK", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_get_lock)},
{ "GEOMETRYTYPE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_geometry_type)}, { "GEOMETRYN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_geometryn)},
{ "GEOMCOLLFROMTEXT", SYM(GEOMCOLLFROMTEXT),0,0}, { "GEOMETRYTYPE", SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_geometry_type)},
{ "GEOMCOLLFROMWKB", SYM(GEOMFROMWKB),0,0}, { "GEOMCOLLFROMTEXT", SYM(GEOMCOLLFROMTEXT)},
{ "GEOMETRYCOLLECTIONFROMTEXT",SYM(GEOMCOLLFROMTEXT),0,0}, { "GEOMCOLLFROMWKB", SYM(GEOMFROMWKB)},
{ "GEOMETRYCOLLECTIONFROMWKB",SYM(GEOMFROMWKB),0,0}, { "GEOMETRYCOLLECTIONFROMTEXT",SYM(GEOMCOLLFROMTEXT)},
{ "GEOMETRYFROMTEXT", SYM(GEOMFROMTEXT),0,0}, { "GEOMETRYCOLLECTIONFROMWKB",SYM(GEOMFROMWKB)},
{ "GEOMETRYFROMWKB", SYM(GEOMFROMWKB),0,0}, { "GEOMETRYFROMTEXT", SYM(GEOMFROMTEXT)},
{ "GEOMFROMTEXT", SYM(GEOMFROMTEXT),0,0}, { "GEOMETRYFROMWKB", SYM(GEOMFROMWKB)},
{ "GEOMFROMWKB", SYM(GEOMFROMWKB),0,0}, { "GEOMFROMTEXT", SYM(GEOMFROMTEXT)},
{ "GLENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_glength)}, { "GEOMFROMWKB", SYM(GEOMFROMWKB)},
{ "GREATEST", SYM(GREATEST_SYM),0,0}, { "GLENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_glength)},
{ "GROUP_CONCAT", SYM(GROUP_CONCAT_SYM),0,0}, { "GREATEST", SYM(GREATEST_SYM)},
{ "GROUP_UNIQUE_USERS", SYM(GROUP_UNIQUE_USERS),0,0}, { "GROUP_CONCAT", SYM(GROUP_CONCAT_SYM)},
{ "HEX", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_hex)}, { "GROUP_UNIQUE_USERS", SYM(GROUP_UNIQUE_USERS)},
{ "IFNULL", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_ifnull)}, { "HEX", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_hex)},
{ "INET_ATON", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_aton)}, { "IFNULL", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_ifnull)},
{ "INET_NTOA", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_ntoa)}, { "INET_ATON", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_aton)},
{ "INSTR", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_instr)}, { "INET_NTOA", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_ntoa)},
{ "INTERIORRINGN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_interiorringn)}, { "INSTR", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_instr)},
{ "INTERSECTS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_intersects)}, { "INTERIORRINGN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_interiorringn)},
{ "ISCLOSED", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isclosed)}, { "INTERSECTS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_intersects)},
{ "ISEMPTY", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isempty)}, { "ISCLOSED", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_isclosed)},
{ "ISNULL", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isnull)}, { "ISEMPTY", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_isempty)},
{ "IS_FREE_LOCK", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_free_lock)}, { "ISNULL", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isnull)},
{ "IS_USED_LOCK", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_used_lock)}, { "IS_FREE_LOCK", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_free_lock)},
{ "LAST_INSERT_ID", SYM(LAST_INSERT_ID),0,0}, { "IS_USED_LOCK", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_used_lock)},
{ "ISSIMPLE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_issimple)}, { "LAST_INSERT_ID", SYM(LAST_INSERT_ID)},
{ "LAST_DAY", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_last_day)}, { "ISSIMPLE", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_issimple)},
{ "LCASE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)}, { "LAST_DAY", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_last_day)},
{ "LEAST", SYM(LEAST_SYM),0,0}, { "LCASE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
{ "LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)}, { "LEAST", SYM(LEAST_SYM)},
{ "LN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ln)}, { "LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
{ "LINEFROMTEXT", SYM(LINEFROMTEXT),0,0}, { "LN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ln)},
{ "LINEFROMWKB", SYM(GEOMFROMWKB),0,0}, { "LINEFROMTEXT", SYM(LINEFROMTEXT)},
{ "LINESTRINGFROMTEXT",SYM(LINEFROMTEXT),0,0}, { "LINEFROMWKB", SYM(GEOMFROMWKB)},
{ "LINESTRINGFROMWKB",SYM(GEOMFROMWKB),0,0}, { "LINESTRINGFROMTEXT",SYM(LINEFROMTEXT)},
{ "LOAD_FILE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_load_file)}, { "LINESTRINGFROMWKB",SYM(GEOMFROMWKB)},
{ "LOCATE", SYM(LOCATE),0,0}, { "LOAD_FILE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_load_file)},
{ "LOG", SYM(LOG_SYM),0,0}, { "LOCATE", SYM(LOCATE)},
{ "LOG2", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log2)}, { "LOG", SYM(LOG_SYM)},
{ "LOG10", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log10)}, { "LOG2", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log2)},
{ "LOWER", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)}, { "LOG10", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log10)},
{ "LPAD", SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_lpad)}, { "LOWER", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
{ "LTRIM", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ltrim)}, { "LPAD", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_lpad)},
{ "MAKE_SET", SYM(MAKE_SET_SYM),0,0}, { "LTRIM", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ltrim)},
{ "MAKEDATE", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_makedate)}, { "MAKE_SET", SYM(MAKE_SET_SYM)},
{ "MAKETIME", SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_maketime)}, { "MAKEDATE", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_makedate)},
{ "MASTER_POS_WAIT", SYM(MASTER_POS_WAIT),0,0}, { "MAKETIME", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_maketime)},
{ "MAX", SYM(MAX_SYM),0,0}, { "MASTER_POS_WAIT", SYM(MASTER_POS_WAIT)},
{ "MBRCONTAINS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_contains)}, { "MAX", SYM(MAX_SYM)},
{ "MBRDISJOINT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_disjoint)}, { "MBRCONTAINS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_contains)},
{ "MBREQUAL", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_equals)}, { "MBRDISJOINT", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_disjoint)},
{ "MBRINTERSECTS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_intersects)}, { "MBREQUAL", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_equals)},
{ "MBROVERLAPS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_overlaps)}, { "MBRINTERSECTS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_intersects)},
{ "MBRTOUCHES", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_touches)}, { "MBROVERLAPS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_overlaps)},
{ "MBRWITHIN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_within)}, { "MBRTOUCHES", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_touches)},
{ "MD5", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_md5)}, { "MBRWITHIN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_within)},
{ "MID", SYM(SUBSTRING),0,0}, /* unireg function */ { "MD5", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_md5)},
{ "MIN", SYM(MIN_SYM),0,0}, { "MID", SYM(SUBSTRING)}, /* unireg function */
{ "MLINEFROMTEXT", SYM(MLINEFROMTEXT),0,0}, { "MIN", SYM(MIN_SYM)},
{ "MLINEFROMWKB", SYM(GEOMFROMWKB),0,0}, { "MLINEFROMTEXT", SYM(MLINEFROMTEXT)},
{ "MPOINTFROMTEXT", SYM(MPOINTFROMTEXT),0,0}, { "MLINEFROMWKB", SYM(GEOMFROMWKB)},
{ "MPOINTFROMWKB", SYM(GEOMFROMWKB),0,0}, { "MPOINTFROMTEXT", SYM(MPOINTFROMTEXT)},
{ "MPOLYFROMTEXT", SYM(MPOLYFROMTEXT),0,0}, { "MPOINTFROMWKB", SYM(GEOMFROMWKB)},
{ "MPOLYFROMWKB", SYM(GEOMFROMWKB),0,0}, { "MPOLYFROMTEXT", SYM(MPOLYFROMTEXT)},
{ "MONTHNAME", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_monthname)}, { "MPOLYFROMWKB", SYM(GEOMFROMWKB)},
{ "MULTILINESTRINGFROMTEXT",SYM(MLINEFROMTEXT),0,0}, { "MONTHNAME", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_monthname)},
{ "MULTILINESTRINGFROMWKB",SYM(GEOMFROMWKB),0,0}, { "MULTILINESTRINGFROMTEXT",SYM(MLINEFROMTEXT)},
{ "MULTIPOINTFROMTEXT",SYM(MPOINTFROMTEXT),0,0}, { "MULTILINESTRINGFROMWKB",SYM(GEOMFROMWKB)},
{ "MULTIPOINTFROMWKB",SYM(GEOMFROMWKB),0,0}, { "MULTIPOINTFROMTEXT",SYM(MPOINTFROMTEXT)},
{ "MULTIPOLYGONFROMTEXT",SYM(MPOLYFROMTEXT),0,0}, { "MULTIPOINTFROMWKB",SYM(GEOMFROMWKB)},
{ "MULTIPOLYGONFROMWKB",SYM(GEOMFROMWKB),0,0}, { "MULTIPOLYGONFROMTEXT",SYM(MPOLYFROMTEXT)},
{ "NOW", SYM(NOW_SYM),0,0}, { "MULTIPOLYGONFROMWKB",SYM(GEOMFROMWKB)},
{ "NULLIF", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_nullif)}, { "NOW", SYM(NOW_SYM)},
{ "NUMGEOMETRIES", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_numgeometries)}, { "NULLIF", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_nullif)},
{ "NUMINTERIORRINGS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_numinteriorring)}, { "NUMGEOMETRIES", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_numgeometries)},
{ "NUMPOINTS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_numpoints)}, { "NUMINTERIORRINGS", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_numinteriorring)},
{ "OCTET_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)}, { "NUMPOINTS", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_numpoints)},
{ "OCT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_oct)}, { "OCTET_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
{ "ORD", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ord)}, { "OCT", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_oct)},
{ "OVERLAPS", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_overlaps)}, { "ORD", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ord)},
{ "PERIOD_ADD", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_add)}, { "OVERLAPS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_overlaps)},
{ "PERIOD_DIFF", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_diff)}, { "PERIOD_ADD", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_add)},
{ "PI", SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_pi)}, { "PERIOD_DIFF", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_diff)},
{ "POINTFROMTEXT", SYM(POINTFROMTEXT),0,0}, { "PI", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_pi)},
{ "POINTFROMWKB", SYM(GEOMFROMWKB),0,0}, { "POINTFROMTEXT", SYM(POINTFROMTEXT)},
{ "POINTN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pointn)}, { "POINTFROMWKB", SYM(GEOMFROMWKB)},
{ "POLYFROMTEXT", SYM(POLYFROMTEXT),0,0}, { "POINTN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_pointn)},
{ "POLYFROMWKB", SYM(GEOMFROMWKB),0,0}, { "POLYFROMTEXT", SYM(POLYFROMTEXT)},
{ "POLYGONFROMTEXT", SYM(POLYFROMTEXT),0,0}, { "POLYFROMWKB", SYM(GEOMFROMWKB)},
{ "POLYGONFROMWKB", SYM(GEOMFROMWKB),0,0}, { "POLYGONFROMTEXT", SYM(POLYFROMTEXT)},
{ "POSITION", SYM(POSITION_SYM),0,0}, { "POLYGONFROMWKB", SYM(GEOMFROMWKB)},
{ "POW", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)}, { "POSITION", SYM(POSITION_SYM)},
{ "POWER", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)}, { "POW", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
{ "QUARTER", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quarter)}, { "POWER", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
{ "QUOTE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quote)}, { "QUARTER", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quarter)},
{ "RADIANS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_radians)}, { "QUOTE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quote)},
{ "RAND", SYM(RAND),0,0}, { "RADIANS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_radians)},
{ "RELEASE_LOCK", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_release_lock)}, { "RAND", SYM(RAND)},
{ "REPEAT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_repeat)}, { "RELEASE_LOCK", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_release_lock)},
{ "REVERSE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_reverse)}, { "REPEAT", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_repeat)},
{ "ROUND", SYM(ROUND),0,0}, { "REVERSE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_reverse)},
{ "RPAD", SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_rpad)}, { "ROUND", SYM(ROUND)},
{ "RTRIM", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_rtrim)}, { "RPAD", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_rpad)},
{ "SEC_TO_TIME", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sec_to_time)}, { "RTRIM", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_rtrim)},
{ "SESSION_USER", SYM(USER),0,0}, { "SEC_TO_TIME", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sec_to_time)},
{ "SUBDATE", SYM(SUBDATE_SYM),0,0}, { "SESSION_USER", SYM(USER)},
{ "SIGN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sign)}, { "SUBDATE", SYM(SUBDATE_SYM)},
{ "SIN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sin)}, { "SIGN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sign)},
{ "SHA", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)}, { "SIN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sin)},
{ "SHA1", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)}, { "SHA", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
{ "SOUNDEX", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_soundex)}, { "SHA1", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
{ "SPACE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_space)}, { "SOUNDEX", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_soundex)},
{ "SQRT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sqrt)}, { "SPACE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_space)},
{ "SRID", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_srid)}, { "SQRT", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sqrt)},
{ "STARTPOINT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_startpoint)}, { "SRID", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_srid)},
{ "STD", SYM(STD_SYM),0,0}, { "STARTPOINT", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_startpoint)},
{ "STDDEV", SYM(STD_SYM),0,0}, { "STD", SYM(STD_SYM)},
{ "STR_TO_DATE", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_str_to_date)}, { "STDDEV", SYM(STD_SYM)},
{ "STRCMP", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_strcmp)}, { "STR_TO_DATE", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_str_to_date)},
{ "SUBSTR", SYM(SUBSTRING),0,0}, { "STRCMP", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_strcmp)},
{ "SUBSTRING", SYM(SUBSTRING),0,0}, { "SUBSTR", SYM(SUBSTRING)},
{ "SUBSTRING_INDEX", SYM(SUBSTRING_INDEX),0,0}, { "SUBSTRING", SYM(SUBSTRING)},
{ "SUBTIME", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_subtime)}, { "SUBSTRING_INDEX", SYM(SUBSTRING_INDEX)},
{ "SUM", SYM(SUM_SYM),0,0}, #endif /*dummy*/
{ "SYSDATE", SYM(NOW_SYM),0,0}, { "SUBTIME", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_subtime)},
{ "SYSTEM_USER", SYM(USER),0,0}, { "SUM", SYM(SUM_SYM)},
{ "TAN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_tan)}, { "SYSDATE", SYM(NOW_SYM)},
{ "TIME_FORMAT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_time_format)}, { "SYSTEM_USER", SYM(USER)},
{ "TIME_TO_SEC", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_time_to_sec)}, { "TAN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_tan)},
{ "TIMEDIFF", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_timediff)}, { "TIME_FORMAT", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_time_format)},
{ "TO_DAYS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_to_days)}, { "TIME_TO_SEC", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_time_to_sec)},
{ "TOUCHES", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_touches)}, { "TIMEDIFF", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_timediff)},
{ "TRIM", SYM(TRIM),0,0}, { "TO_DAYS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_to_days)},
{ "UCASE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)}, { "TOUCHES", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_touches)},
{ "UNCOMPRESS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompress)}, { "TRIM", SYM(TRIM)},
{ "UNCOMPRESSED_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompressed_length)}, { "UCASE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
{ "UNIQUE_USERS", SYM(UNIQUE_USERS),0,0}, { "UNCOMPRESS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompress)},
{ "UNIX_TIMESTAMP", SYM(UNIX_TIMESTAMP),0,0}, { "UNCOMPRESSED_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompressed_length)},
{ "UPPER", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)}, { "UNIQUE_USERS", SYM(UNIQUE_USERS)},
{ "VARIANCE", SYM(VARIANCE_SYM),0,0}, { "UNIX_TIMESTAMP", SYM(UNIX_TIMESTAMP)},
{ "VERSION", SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_version)}, { "UPPER", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
{ "WEEK", SYM(WEEK_SYM),0,0}, { "VARIANCE", SYM(VARIANCE_SYM)},
{ "WEEKDAY", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekday)}, { "VERSION", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_version)},
{ "WEEKOFYEAR", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekofyear)}, { "WEEK", SYM(WEEK_SYM)},
{ "WITHIN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_within)}, { "WEEKDAY", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekday)},
{ "X", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_x)}, { "WEEKOFYEAR", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekofyear)},
{ "Y", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_y)}, { "WITHIN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_within)},
{ "YEARWEEK", SYM(YEARWEEK),0,0} { "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)}
}; };
...@@ -20,11 +20,17 @@ ...@@ -20,11 +20,17 @@
#ifndef _lex_symbol_h #ifndef _lex_symbol_h
#define _lex_symbol_h #define _lex_symbol_h
typedef struct st_sym_group {
const char *name;
const char *needed_define;
} SYM_GROUP;
typedef struct st_symbol { typedef struct st_symbol {
const char *name; const char *name;
uint tok; uint tok;
uint length; uint length;
void *create_func; void *create_func;
SYM_GROUP *group;
} SYMBOL; } SYMBOL;
typedef struct st_lex_symbol typedef struct st_lex_symbol
......
...@@ -510,6 +510,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -510,6 +510,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
blob_columns++; blob_columns++;
break; break;
case FIELD_TYPE_GEOMETRY: case FIELD_TYPE_GEOMETRY:
#ifdef HAVE_SPATIAL
if (!(file->table_flags() & HA_HAS_GEOMETRY)) if (!(file->table_flags() & HA_HAS_GEOMETRY))
{ {
my_printf_error(ER_CHECK_NOT_IMPLEMENTED, ER(ER_CHECK_NOT_IMPLEMENTED), my_printf_error(ER_CHECK_NOT_IMPLEMENTED, ER(ER_CHECK_NOT_IMPLEMENTED),
...@@ -525,6 +526,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -525,6 +526,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
sql_field->unireg_check=Field::BLOB_FIELD; sql_field->unireg_check=Field::BLOB_FIELD;
blob_columns++; blob_columns++;
break; break;
#else
my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED), MYF(0),
"Spatial extentions", "HAVE_SPATIAL");
DBUG_RETURN(-1);
#endif /*HAVE_SPATIAL*/
case FIELD_TYPE_VAR_STRING: case FIELD_TYPE_VAR_STRING:
case FIELD_TYPE_STRING: case FIELD_TYPE_STRING:
sql_field->pack_flag=0; sql_field->pack_flag=0;
...@@ -658,8 +664,14 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -658,8 +664,14 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
key_info->flags = HA_FULLTEXT; key_info->flags = HA_FULLTEXT;
break; break;
case Key::SPATIAL: case Key::SPATIAL:
#ifdef HAVE_SPATIAL
key_info->flags = HA_SPATIAL; key_info->flags = HA_SPATIAL;
break; break;
#else
my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED),MYF(0),
"Spatial extentions", "HAVE_SPATIAL");
DBUG_RETURN(-1);
#endif
case Key::FOREIGN_KEY: case Key::FOREIGN_KEY:
key_number--; // Skip this key key_number--; // Skip this key
continue; continue;
...@@ -688,6 +700,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -688,6 +700,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
checking for proper key parts number: checking for proper key parts number:
*/ */
#ifdef HAVE_SPATIAL
/* TODO: Add proper checks if handler supports key_type and algorithm */ /* TODO: Add proper checks if handler supports key_type and algorithm */
if (key_info->flags == HA_SPATIAL) if (key_info->flags == HA_SPATIAL)
{ {
...@@ -698,8 +711,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -698,8 +711,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
} }
else if (key_info->algorithm == HA_KEY_ALG_RTREE) else
#endif
if (key_info->algorithm == HA_KEY_ALG_RTREE)
{ {
#ifdef HAVE_RTREE_KEYS
if ((key_info->key_parts & 1) == 1) if ((key_info->key_parts & 1) == 1)
{ {
my_printf_error(ER_WRONG_ARGUMENTS, my_printf_error(ER_WRONG_ARGUMENTS,
...@@ -710,6 +726,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -710,6 +726,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
my_printf_error(ER_NOT_SUPPORTED_YET, ER(ER_NOT_SUPPORTED_YET), my_printf_error(ER_NOT_SUPPORTED_YET, ER(ER_NOT_SUPPORTED_YET),
MYF(0), "RTREE INDEX"); MYF(0), "RTREE INDEX");
DBUG_RETURN(-1); DBUG_RETURN(-1);
#else
my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED),MYF(0),
"Spatial extentions", "HAVE_SPATIAL");
DBUG_RETURN(-1);
#endif
} }
List_iterator<key_part_spec> cols(key->columns); List_iterator<key_part_spec> cols(key->columns);
...@@ -779,6 +800,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -779,6 +800,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
} }
#ifdef HAVE_SPATIAL
if (key->type == Key::SPATIAL) if (key->type == Key::SPATIAL)
{ {
if (!column->length ) if (!column->length )
...@@ -790,6 +812,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -790,6 +812,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
column->length=4*sizeof(double); column->length=4*sizeof(double);
} }
} }
#endif
if (!(sql_field->flags & NOT_NULL_FLAG)) if (!(sql_field->flags & NOT_NULL_FLAG))
{ {
if (key->type == Key::PRIMARY) if (key->type == Key::PRIMARY)
...@@ -806,11 +829,13 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -806,11 +829,13 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
MYF(0),column->field_name); MYF(0),column->field_name);
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
#ifdef HAVE_SPATIAL
if (key->type == Key::SPATIAL) if (key->type == Key::SPATIAL)
{ {
my_error(ER_SPATIAL_CANT_HAVE_NULL, MYF(0)); my_error(ER_SPATIAL_CANT_HAVE_NULL, MYF(0));
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
#endif
} }
if (MTYP_TYPENR(sql_field->unireg_check) == Field::NEXT_NUMBER) if (MTYP_TYPENR(sql_field->unireg_check) == Field::NEXT_NUMBER)
{ {
...@@ -834,9 +859,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -834,9 +859,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
} }
#ifdef HAVE_SPATIAL //TODO HF What's this for???
else if (f_is_geom(sql_field->pack_flag)) else if (f_is_geom(sql_field->pack_flag))
{ {
} }
#endif
else if (column->length > length || else if (column->length > length ||
((f_is_packed(sql_field->pack_flag) || ((f_is_packed(sql_field->pack_flag) ||
((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) && ((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
......
...@@ -611,7 +611,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); ...@@ -611,7 +611,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
udf_type if_exists opt_local opt_table_options table_options udf_type if_exists opt_local opt_table_options table_options
table_option opt_if_not_exists opt_no_write_to_binlog opt_var_type table_option opt_if_not_exists opt_no_write_to_binlog opt_var_type
opt_var_ident_type delete_option opt_temporary all_or_any opt_distinct opt_var_ident_type delete_option opt_temporary all_or_any opt_distinct
opt_ignore_leaves fulltext_options opt_ignore_leaves fulltext_options spatial_type
%type <ulong_num> %type <ulong_num>
ULONG_NUM raid_types merge_insert_types ULONG_NUM raid_types merge_insert_types
...@@ -628,7 +628,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); ...@@ -628,7 +628,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
table_wild no_in_expr expr_expr simple_expr no_and_expr table_wild no_in_expr expr_expr simple_expr no_and_expr
using_list expr_or_default set_expr_or_default interval_expr using_list expr_or_default set_expr_or_default interval_expr
param_marker singlerow_subselect singlerow_subselect_init param_marker singlerow_subselect singlerow_subselect_init
exists_subselect exists_subselect_init exists_subselect exists_subselect_init geometry_function
signed_literal NUM_literal signed_literal NUM_literal
%type <item_list> %type <item_list>
...@@ -1244,8 +1244,8 @@ field_spec: ...@@ -1244,8 +1244,8 @@ field_spec:
(enum enum_field_types) $3, (enum enum_field_types) $3,
lex->length,lex->dec,lex->type, lex->length,lex->dec,lex->type,
lex->default_value, lex->comment, lex->default_value, lex->comment,
lex->change,lex->interval,lex->charset, lex->change,lex->interval,lex->charset
lex->uint_geom_type)) ,lex->uint_geom_type))
YYABORT; YYABORT;
}; };
...@@ -1297,30 +1297,19 @@ type: ...@@ -1297,30 +1297,19 @@ type:
$$=FIELD_TYPE_TINY_BLOB; } $$=FIELD_TYPE_TINY_BLOB; }
| BLOB_SYM opt_len { Lex->charset=&my_charset_bin; | BLOB_SYM opt_len { Lex->charset=&my_charset_bin;
$$=FIELD_TYPE_BLOB; } $$=FIELD_TYPE_BLOB; }
| GEOMETRY_SYM { Lex->charset=&my_charset_bin; | spatial_type {
Lex->uint_geom_type= (uint) Field::GEOM_GEOMETRY; #ifdef HAVE_SPATIAL
$$=FIELD_TYPE_GEOMETRY; } Lex->charset=&my_charset_bin;
| GEOMETRYCOLLECTION { Lex->charset=&my_charset_bin; Lex->uint_geom_type= (uint)$1;
Lex->uint_geom_type= (uint) Field::GEOM_GEOMETRYCOLLECTION; $$=FIELD_TYPE_GEOMETRY;
$$=FIELD_TYPE_GEOMETRY; } #else
| POINT_SYM { Lex->charset=&my_charset_bin; net_printf(Lex->thd, ER_FEATURE_DISABLED,
Lex->uint_geom_type= (uint) Field::GEOM_POINT; ER(ER_FEATURE_DISABLED),
$$=FIELD_TYPE_GEOMETRY; } MYF(0), "Spatial extentions",
| MULTIPOINT { Lex->charset=&my_charset_bin; "HAVE_SPATIAL");
Lex->uint_geom_type= (uint) Field::GEOM_MULTIPOINT; YYABORT;
$$=FIELD_TYPE_GEOMETRY; } #endif
| LINESTRING { Lex->charset=&my_charset_bin; }
Lex->uint_geom_type= (uint) Field::GEOM_LINESTRING;
$$=FIELD_TYPE_GEOMETRY; }
| MULTILINESTRING { Lex->charset=&my_charset_bin;
Lex->uint_geom_type= (uint) Field::GEOM_MULTILINESTRING;
$$=FIELD_TYPE_GEOMETRY; }
| POLYGON { Lex->charset=&my_charset_bin;
Lex->uint_geom_type= (uint) Field::GEOM_POLYGON;
$$=FIELD_TYPE_GEOMETRY; }
| MULTIPOLYGON { Lex->charset=&my_charset_bin;
Lex->uint_geom_type= (uint) Field::GEOM_MULTIPOLYGON;
$$=FIELD_TYPE_GEOMETRY; }
| MEDIUMBLOB { Lex->charset=&my_charset_bin; | MEDIUMBLOB { Lex->charset=&my_charset_bin;
$$=FIELD_TYPE_MEDIUM_BLOB; } $$=FIELD_TYPE_MEDIUM_BLOB; }
| LONGBLOB { Lex->charset=&my_charset_bin; | LONGBLOB { Lex->charset=&my_charset_bin;
...@@ -1359,6 +1348,17 @@ type: ...@@ -1359,6 +1348,17 @@ type:
} }
; ;
spatial_type:
GEOMETRY_SYM { $$= Field::GEOM_GEOMETRY; }
| GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; }
| POINT_SYM { $$= Field::GEOM_POINT; }
| MULTIPOINT { $$= Field::GEOM_MULTIPOINT; }
| LINESTRING { $$= Field::GEOM_LINESTRING; }
| MULTILINESTRING { $$= Field::GEOM_MULTILINESTRING; }
| POLYGON { $$= Field::GEOM_POLYGON; }
| MULTIPOLYGON { $$= Field::GEOM_MULTIPOLYGON; }
;
char: char:
CHAR_SYM {} CHAR_SYM {}
; ;
...@@ -1591,8 +1591,30 @@ key_type: ...@@ -1591,8 +1591,30 @@ key_type:
key_or_index { $$= Key::MULTIPLE; } key_or_index { $$= Key::MULTIPLE; }
| FULLTEXT_SYM { $$= Key::FULLTEXT; } | FULLTEXT_SYM { $$= Key::FULLTEXT; }
| FULLTEXT_SYM key_or_index { $$= Key::FULLTEXT; } | FULLTEXT_SYM key_or_index { $$= Key::FULLTEXT; }
| SPATIAL_SYM { $$= Key::SPATIAL; } | SPATIAL_SYM
| SPATIAL_SYM key_or_index { $$= Key::SPATIAL; }; {
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "Spatial extentions",
"HAVE_SPATIAL");
YYABORT;
#endif
}
| SPATIAL_SYM key_or_index
{
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "Spatial extentions",
"HAVE_SPATIAL");
YYABORT;
#endif
};
constraint_key_type: constraint_key_type:
PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; } PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
...@@ -1617,7 +1639,18 @@ opt_unique_or_fulltext: ...@@ -1617,7 +1639,18 @@ opt_unique_or_fulltext:
/* empty */ { $$= Key::MULTIPLE; } /* empty */ { $$= Key::MULTIPLE; }
| UNIQUE_SYM { $$= Key::UNIQUE; } | UNIQUE_SYM { $$= Key::UNIQUE; }
| FULLTEXT_SYM { $$= Key::FULLTEXT;} | FULLTEXT_SYM { $$= Key::FULLTEXT;}
| SPATIAL_SYM { $$= Key::SPATIAL; } | SPATIAL_SYM
{
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "Spatial extentions",
"HAVE_SPATIAL");
YYABORT;
#endif
}
; ;
key_alg: key_alg:
...@@ -1627,7 +1660,18 @@ key_alg: ...@@ -1627,7 +1660,18 @@ key_alg:
opt_btree_or_rtree: opt_btree_or_rtree:
BTREE_SYM { $$= HA_KEY_ALG_BTREE; } BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
| RTREE_SYM { $$= HA_KEY_ALG_RTREE; } | RTREE_SYM
{
#ifdef HAVE_RTREE_KEYS
$$= HA_KEY_ALG_RTREE;
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "RTree keys",
"HAVE_RTREE_KEYS");
YYABORT;
#endif
}
| HASH_SYM { $$= HA_KEY_ALG_HASH; }; | HASH_SYM { $$= HA_KEY_ALG_HASH; };
key_list: key_list:
...@@ -1725,8 +1769,8 @@ alter_list_item: ...@@ -1725,8 +1769,8 @@ alter_list_item:
(enum enum_field_types) $5, (enum enum_field_types) $5,
lex->length,lex->dec,lex->type, lex->length,lex->dec,lex->type,
lex->default_value, lex->comment, lex->default_value, lex->comment,
$3.str, lex->interval, lex->charset, $3.str, lex->interval, lex->charset
lex->uint_geom_type)) ,lex->uint_geom_type))
YYABORT; YYABORT;
} }
opt_place opt_place
...@@ -2556,13 +2600,53 @@ simple_expr: ...@@ -2556,13 +2600,53 @@ simple_expr:
| VALUES '(' simple_ident ')' | VALUES '(' simple_ident ')'
{ $$= new Item_insert_value($3); } { $$= new Item_insert_value($3); }
| FUNC_ARG0 '(' ')' | FUNC_ARG0 '(' ')'
{ $$= ((Item*(*)(void))($1.symbol->create_func))();} {
if (!$1.symbol->create_func)
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), $1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(void))($1.symbol->create_func))();
}
| FUNC_ARG1 '(' expr ')' | FUNC_ARG1 '(' expr ')'
{ $$= ((Item*(*)(Item*))($1.symbol->create_func))($3);} {
if (!$1.symbol->create_func)
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), $1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*))($1.symbol->create_func))($3);
}
| FUNC_ARG2 '(' expr ',' expr ')' | FUNC_ARG2 '(' expr ',' expr ')'
{ $$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);} {
if (!$1.symbol->create_func)
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), $1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);
}
| FUNC_ARG3 '(' expr ',' expr ',' expr ')' | FUNC_ARG3 '(' expr ',' expr ',' expr ')'
{ $$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7);} {
if (!$1.symbol->create_func)
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), $1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7);
}
| ADDDATE_SYM '(' expr ',' expr ')' | ADDDATE_SYM '(' expr ',' expr ')'
{ $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 0);} { $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 0);}
| ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')' | ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
...@@ -2645,18 +2729,18 @@ simple_expr: ...@@ -2645,18 +2729,18 @@ simple_expr:
} }
| FIELD_FUNC '(' expr ',' expr_list ')' | FIELD_FUNC '(' expr ',' expr_list ')'
{ $5->push_front($3); $$= new Item_func_field(*$5); } { $5->push_front($3); $$= new Item_func_field(*$5); }
| GEOMFROMTEXT '(' expr ')' | geometry_function
{ $$= new Item_func_geometry_from_text($3); } {
| GEOMFROMTEXT '(' expr ',' expr ')' #ifdef HAVE_SPATIAL
{ $$= new Item_func_geometry_from_text($3, $5); } $$= $1;
| GEOMFROMWKB '(' expr ')' #else
{ $$= new Item_func_geometry_from_wkb($3); } net_printf(Lex->thd, ER_FEATURE_DISABLED,
| GEOMFROMWKB '(' expr ',' expr ')' ER(ER_FEATURE_DISABLED),
{ $$= new Item_func_geometry_from_wkb($3, $5); } MYF(0), "Spatial extentions",
| GEOMETRYCOLLECTION '(' expr_list ')' "HAVE_SPATIAL");
{ $$= new Item_func_spatial_collection(* $3, YYABORT;
Geometry::wkbGeometryCollection, #endif
Geometry::wkbPoint); } }
| GET_FORMAT '(' date_time_type ',' expr ')' | GET_FORMAT '(' date_time_type ',' expr ')'
{ $$= new Item_func_get_format($3, $5); } { $$= new Item_func_get_format($3, $5); }
| HOUR_SYM '(' expr ')' | HOUR_SYM '(' expr ')'
...@@ -2690,17 +2774,10 @@ simple_expr: ...@@ -2690,17 +2774,10 @@ simple_expr:
} }
| LEFT '(' expr ',' expr ')' | LEFT '(' expr ',' expr ')'
{ $$= new Item_func_left($3,$5); } { $$= new Item_func_left($3,$5); }
| LINESTRING '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbLineString, Geometry::wkbPoint); }
| LOCATE '(' expr ',' expr ')' | LOCATE '(' expr ',' expr ')'
{ $$= new Item_func_locate($5,$3); } { $$= new Item_func_locate($5,$3); }
| LOCATE '(' expr ',' expr ',' expr ')' | LOCATE '(' expr ',' expr ',' expr ')'
{ $$= new Item_func_locate($5,$3,$7); } { $$= new Item_func_locate($5,$3,$7); }
| GEOMCOLLFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| GEOMCOLLFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| GREATEST_SYM '(' expr ',' expr_list ')' | GREATEST_SYM '(' expr ',' expr_list ')'
{ $5->push_front($3); $$= new Item_func_max(*$5); } { $5->push_front($3); $$= new Item_func_max(*$5); }
| LEAST_SYM '(' expr ',' expr_list ')' | LEAST_SYM '(' expr ',' expr_list ')'
...@@ -2709,10 +2786,6 @@ simple_expr: ...@@ -2709,10 +2786,6 @@ simple_expr:
{ $$= new Item_func_log($3); } { $$= new Item_func_log($3); }
| LOG_SYM '(' expr ',' expr ')' | LOG_SYM '(' expr ',' expr ')'
{ $$= new Item_func_log($3, $5); } { $$= new Item_func_log($3, $5); }
| LINEFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| LINEFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| MASTER_POS_WAIT '(' expr ',' expr ')' | MASTER_POS_WAIT '(' expr ',' expr ')'
{ {
$$= new Item_master_pos_wait($3, $5); $$= new Item_master_pos_wait($3, $5);
...@@ -2731,27 +2804,6 @@ simple_expr: ...@@ -2731,27 +2804,6 @@ simple_expr:
{ $$ = new Item_func_mod( $3, $5); } { $$ = new Item_func_mod( $3, $5); }
| MONTH_SYM '(' expr ')' | MONTH_SYM '(' expr ')'
{ $$= new Item_func_month($3); } { $$= new Item_func_month($3); }
| MULTILINESTRING '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbMultiLineString, Geometry::wkbLineString); }
| MLINEFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| MLINEFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| MPOINTFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| MPOINTFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| MPOLYFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| MPOLYFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| MULTIPOINT '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbMultiPoint, Geometry::wkbPoint); }
| MULTIPOLYGON '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbMultiPolygon, Geometry::wkbPolygon ); }
| NOW_SYM optional_braces | NOW_SYM optional_braces
{ $$= new Item_func_now_local(); Lex->safe_to_cache_query=0;} { $$= new Item_func_now_local(); Lex->safe_to_cache_query=0;}
| NOW_SYM '(' expr ')' | NOW_SYM '(' expr ')'
...@@ -2764,19 +2816,6 @@ simple_expr: ...@@ -2764,19 +2816,6 @@ simple_expr:
} }
| OLD_PASSWORD '(' expr ')' | OLD_PASSWORD '(' expr ')'
{ $$= new Item_func_old_password($3); } { $$= new Item_func_old_password($3); }
| POINT_SYM '(' expr ',' expr ')'
{ $$= new Item_func_point($3,$5); }
| POINTFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| POINTFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| POLYFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| POLYFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| POLYGON '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbPolygon, Geometry::wkbLineString); }
| POSITION_SYM '(' no_in_expr IN_SYM expr ')' | POSITION_SYM '(' no_in_expr IN_SYM expr ')'
{ $$ = new Item_func_locate($5,$3); } { $$ = new Item_func_locate($5,$3); }
| RAND '(' expr ')' | RAND '(' expr ')'
...@@ -2914,6 +2953,66 @@ simple_expr: ...@@ -2914,6 +2953,66 @@ simple_expr:
| EXTRACT_SYM '(' interval FROM expr ')' | EXTRACT_SYM '(' interval FROM expr ')'
{ $$=new Item_extract( $3, $5); }; { $$=new Item_extract( $3, $5); };
geometry_function:
GEOMFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| GEOMFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| GEOMFROMWKB '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_wkb($3)); }
| GEOMFROMWKB '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_wkb($3, $5)); }
| GEOMETRYCOLLECTION '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbGeometryCollection,
Geometry::wkbPoint)); }
| LINESTRING '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbLineString, Geometry::wkbPoint)); }
| MULTILINESTRING '(' expr_list ')'
{ $$= GEOM_NEW( Item_func_spatial_collection(* $3,
Geometry::wkbMultiLineString, Geometry::wkbLineString)); }
| MLINEFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| MLINEFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| MPOINTFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| MPOINTFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| MPOLYFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| MPOLYFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| MULTIPOINT '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbMultiPoint, Geometry::wkbPoint)); }
| MULTIPOLYGON '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbMultiPolygon, Geometry::wkbPolygon)); }
| POINT_SYM '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_point($3,$5)); }
| POINTFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| POINTFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| POLYFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| POLYFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| POLYGON '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbPolygon, Geometry::wkbLineString)); }
| GEOMCOLLFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| GEOMCOLLFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| LINEFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| LINEFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
;
fulltext_options: fulltext_options:
/* nothing */ { $$= FT_NL; } /* nothing */ { $$= FT_NL; }
| WITH QUERY_SYM EXPANSION_SYM { $$= FT_NL | FT_EXPAND; } | WITH QUERY_SYM EXPANSION_SYM { $$= FT_NL | FT_EXPAND; }
......
...@@ -405,8 +405,13 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, ...@@ -405,8 +405,13 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
// charset and geometry_type share the same byte in frm // charset and geometry_type share the same byte in frm
if (field_type == FIELD_TYPE_GEOMETRY) if (field_type == FIELD_TYPE_GEOMETRY)
{ {
#ifdef HAVE_SPATIAL
geom_type= (Field::geometry_type) strpos[14]; geom_type= (Field::geometry_type) strpos[14];
charset= &my_charset_bin; charset= &my_charset_bin;
#else
error= 4; // unsupported field type
goto err_not_open;
#endif
} }
else else
{ {
......
...@@ -471,7 +471,12 @@ static bool pack_fields(File file,List<create_field> &create_fields) ...@@ -471,7 +471,12 @@ static bool pack_fields(File file,List<create_field> &create_fields)
buff[12]= (uchar) field->interval_id; buff[12]= (uchar) field->interval_id;
buff[13]= (uchar) field->sql_type; buff[13]= (uchar) field->sql_type;
if (field->sql_type == FIELD_TYPE_GEOMETRY) if (field->sql_type == FIELD_TYPE_GEOMETRY)
{
buff[14]= (uchar) field->geom_type; buff[14]= (uchar) field->geom_type;
#ifndef HAVE_SPATIAL
DBUG_ASSERT(0); // Should newer happen
#endif
}
else if (field->charset) else if (field->charset)
buff[14]= (uchar) field->charset->number; buff[14]= (uchar) field->charset->number;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment