home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 January / Chip_2001-01_cd1.bin / tema / mysql / mysql-3.23.28g-win-source.exe / sql / lex.h < prev    next >
C/C++ Source or Header  |  2000-11-16  |  19KB  |  457 lines

  1. /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
  2.  
  3.    This program is free software; you can redistribute it and/or modify
  4.    it under the terms of the GNU General Public License as published by
  5.    the Free Software Foundation; either version 2 of the License, or
  6.    (at your option) any later version.
  7.  
  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.
  12.  
  13.    You should have received a copy of the GNU General Public License
  14.    along with this program; if not, write to the Free Software
  15.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
  16.  
  17.  
  18. /* This file includes all reserved words and functions */
  19.  
  20. #include "lex_symbol.h"
  21.  
  22. /* We don't want to include sql_yacc.h into gen_lex_hash */
  23.  
  24. #ifdef NO_YACC_SYMBOLS
  25. #define SYM(A) 0
  26. #define CREATE_FUNC(A) 0
  27. #else
  28. #define SYM(A) A
  29. #define CREATE_FUNC(A) (void*) (A)
  30. #endif
  31.  
  32. /*
  33. ** Symbols are breaked in to separated arrays to allow fieldnames with
  34. ** same name as functions
  35. ** Theese are kept sorted for human lookup (the symbols are hashed)
  36. */
  37.  
  38. static SYMBOL symbols[] = {
  39.   { "&&",        SYM(AND),0,0},
  40.   { "<",        SYM(LT),0,0},
  41.   { "<=",        SYM(LE),0,0},
  42.   { "<>",        SYM(NE),0,0},
  43.   { "!=",        SYM(NE),0,0},
  44.   { "=",        SYM(EQ),0,0},
  45.   { ">",        SYM(GT_SYM),0,0},
  46.   { ">=",        SYM(GE),0,0},
  47.   { "<<",        SYM(SHIFT_LEFT),0,0},
  48.   { ">>",        SYM(SHIFT_RIGHT),0,0},
  49.   { "<=>",        SYM(EQUAL_SYM),0,0},
  50.   { "ACTION",        SYM(ACTION),0,0},
  51.   { "ADD",        SYM(ADD),0,0},
  52.   { "AGGREGATE",    SYM(AGGREGATE_SYM),0,0},
  53.   { "ALL",        SYM(ALL),0,0},
  54.   { "ALTER",        SYM(ALTER),0,0},
  55.   { "AFTER",        SYM(AFTER_SYM),0,0},
  56.   { "AGAINST",          SYM(AGAINST),0,0},
  57.   { "ANALYZE",        SYM(ANALYZE_SYM),0,0},
  58.   { "AND",        SYM(AND),0,0},
  59.   { "AS",        SYM(AS),0,0},
  60.   { "ASC",        SYM(ASC),0,0},
  61.   { "AVG",        SYM(AVG_SYM),0,0},
  62.   { "AVG_ROW_LENGTH",    SYM(AVG_ROW_LENGTH),0,0},
  63.   { "AUTO_INCREMENT",    SYM(AUTO_INC),0,0},
  64.   { "AUTOCOMMIT",    SYM(AUTOCOMMIT),0,0},
  65.   { "BACKUP",           SYM(BACKUP_SYM),0,0},
  66.   { "BEGIN",           SYM(BEGIN_SYM),0,0},
  67.   { "BERKELEYDB",       SYM(BERKELEY_DB_SYM),0,0},
  68.   { "BDB",              SYM(BERKELEY_DB_SYM),0,0},
  69.   { "BETWEEN",        SYM(BETWEEN_SYM),0,0},
  70.   { "BIGINT",        SYM(BIGINT),0,0},
  71.   { "BIT",        SYM(BIT_SYM),0,0},
  72.   { "BINARY",        SYM(BINARY),0,0},
  73.   { "BLOB",        SYM(BLOB_SYM),0,0},
  74.   { "BOOL",        SYM(BOOL_SYM),0,0},
  75.   { "BOTH",        SYM(BOTH),0,0},
  76.   { "BY",        SYM(BY),0,0},
  77.   { "CASCADE",        SYM(CASCADE),0,0},
  78.   { "CASE",        SYM(CASE_SYM),0,0},
  79.   { "CHAR",        SYM(CHAR_SYM),0,0},
  80.   { "CHARACTER",    SYM(CHAR_SYM),0,0},
  81.   { "CHANGE",        SYM(CHANGE),0,0},
  82.   { "CHANGED",        SYM(CHANGED),0,0},
  83.   { "CHECK",        SYM(CHECK_SYM),0,0},
  84.   { "CHECKSUM",        SYM(CHECKSUM_SYM),0,0},
  85.   { "COLUMN",        SYM(COLUMN_SYM),0,0},
  86.   { "COLUMNS",        SYM(COLUMNS),0,0},
  87.   { "COMMENT",        SYM(COMMENT_SYM),0,0},
  88.   { "COMMIT",        SYM(COMMIT_SYM),0,0},
  89.   { "COMPRESSED",    SYM(COMPRESSED_SYM),0,0},
  90.   { "CONSTRAINT",    SYM(CONSTRAINT),0,0},
  91.   { "CREATE",        SYM(CREATE),0,0},
  92.   { "CROSS",        SYM(CROSS),0,0},
  93.   { "CURRENT_DATE",    SYM(CURDATE),0,0},
  94.   { "CURRENT_TIME",    SYM(CURTIME),0,0},
  95.   { "CURRENT_TIMESTAMP", SYM(NOW_SYM),0,0},
  96.   { "DATA",        SYM(DATA_SYM),0,0},
  97.   { "DATABASE",        SYM(DATABASE),0,0},
  98.   { "DATABASES",    SYM(DATABASES),0,0},
  99.   { "DATE",        SYM(DATE_SYM),0,0},
  100.   { "DATETIME",        SYM(DATETIME),0,0},
  101.   { "DAY",        SYM(DAY_SYM),0,0},
  102.   { "DAY_HOUR",        SYM(DAY_HOUR_SYM),0,0},
  103.   { "DAY_MINUTE",    SYM(DAY_MINUTE_SYM),0,0},
  104.   { "DAY_SECOND",    SYM(DAY_SECOND_SYM),0,0},
  105.   { "DEC",        SYM(DECIMAL_SYM),0,0},
  106.   { "DECIMAL",        SYM(DECIMAL_SYM),0,0},
  107.   { "DEFAULT",        SYM(DEFAULT),0,0},
  108.   { "DELAYED",        SYM(DELAYED_SYM),0,0},
  109.   { "DELAY_KEY_WRITE",    SYM(DELAY_KEY_WRITE_SYM),0,0},
  110.   { "DELETE",        SYM(DELETE_SYM),0,0},
  111.   { "DESC",        SYM(DESC),0,0},
  112.   { "DESCRIBE",        SYM(DESCRIBE),0,0},
  113.   { "DISTINCT",        SYM(DISTINCT),0,0},
  114.   { "DISTINCTROW",    SYM(DISTINCT),0,0},    /* Access likes this */
  115.   { "DOUBLE",        SYM(DOUBLE_SYM),0,0},
  116.   { "DROP",        SYM(DROP),0,0},
  117.   { "DUMPFILE",        SYM(DUMPFILE),0,0},
  118.   { "DYNAMIC",        SYM(DYNAMIC_SYM),0,0},
  119.   { "END",        SYM(END),0,0},
  120.   { "ELSE",             SYM(ELSE),0,0},
  121.   { "ESCAPE",        SYM(ESCAPE_SYM),0,0},
  122.   { "ESCAPED",        SYM(ESCAPED),0,0},
  123.   { "ENCLOSED",        SYM(ENCLOSED),0,0},
  124.   { "ENUM",        SYM(ENUM),0,0},
  125.   { "EXPLAIN",        SYM(DESCRIBE),0,0},
  126.   { "EXISTS",        SYM(EXISTS),0,0},
  127.   { "EXTENDED",        SYM(EXTENDED_SYM),0,0},
  128.   { "FAST",        SYM(FAST_SYM),0,0},
  129.   { "FIELDS",        SYM(COLUMNS),0,0},
  130.   { "FILE",        SYM(FILE_SYM),0,0},
  131.   { "FIRST",        SYM(FIRST_SYM),0,0},
  132.   { "FIXED",        SYM(FIXED_SYM),0,0},
  133.   { "FLOAT",        SYM(FLOAT_SYM),0,0},
  134.   { "FLOAT4",        SYM(FLOAT_SYM),0,0},
  135.   { "FLOAT8",        SYM(DOUBLE_SYM),0,0},
  136.   { "FLUSH",        SYM(FLUSH_SYM),0,0},
  137.   { "FOREIGN",        SYM(FOREIGN),0,0},
  138.   { "RAID_TYPE",    SYM(RAID_TYPE),0,0},
  139.   { "RAID_CHUNKS",    SYM(RAID_CHUNKS),0,0},
  140.   { "RAID_CHUNKSIZE",    SYM(RAID_CHUNKSIZE),0,0},
  141.   { "ROW_FORMAT",    SYM(ROW_FORMAT_SYM),0,0},
  142.   { "FROM",        SYM(FROM),0,0},
  143.   { "FOR",        SYM(FOR_SYM),0,0},
  144.   { "FULL",        SYM(FULL),0,0},
  145.   { "FULLTEXT",        SYM(FULLTEXT_SYM),0,0},
  146.   { "FUNCTION",        SYM(UDF_SYM),0,0},
  147.   { "GRANT",        SYM(GRANT),0,0},
  148.   { "GRANTS",            SYM(GRANTS),0,0},
  149.   { "GROUP",        SYM(GROUP),0,0},
  150.   { "HAVING",        SYM(HAVING),0,0},
  151.   { "HEAP",        SYM(HEAP_SYM),0,0},
  152.   { "HIGH_PRIORITY",    SYM(HIGH_PRIORITY),0,0},
  153.   { "HOUR",        SYM(HOUR_SYM),0,0},
  154.   { "HOUR_MINUTE",    SYM(HOUR_MINUTE_SYM),0,0},
  155.   { "HOUR_SECOND",    SYM(HOUR_SECOND_SYM),0,0},
  156.   { "HOSTS",        SYM(HOSTS_SYM),0,0},
  157.   { "IDENTIFIED",    SYM(IDENTIFIED_SYM),0,0},
  158.   { "IGNORE",        SYM(IGNORE_SYM),0,0},
  159.   { "IN",        SYM(IN_SYM),0,0},
  160.   { "INDEX",        SYM(INDEX),0,0},
  161.   { "INFILE",        SYM(INFILE),0,0},
  162.   { "INNER",        SYM(INNER_SYM),0,0},
  163.   { "INNOBASE",        SYM(INNOBASE_SYM),0,0},
  164.   { "INSERT",        SYM(INSERT),0,0},
  165.   { "INSERT_ID",    SYM(INSERT_ID),0,0},
  166.   { "INT",        SYM(INT_SYM),0,0},
  167.   { "INTEGER",        SYM(INT_SYM),0,0},
  168.   { "INTERVAL",        SYM(INTERVAL_SYM),0,0},
  169.   { "INT1",        SYM(TINYINT),0,0},
  170.   { "INT2",        SYM(SMALLINT),0,0},
  171.   { "INT3",        SYM(MEDIUMINT),0,0},
  172.   { "INT4",        SYM(INT_SYM),0,0},
  173.   { "INT8",        SYM(BIGINT),0,0},
  174.   { "INTO",        SYM(INTO),0,0},
  175.   { "IF",        SYM(IF),0,0},
  176.   { "IS",        SYM(IS),0,0},
  177.   { "ISAM",        SYM(ISAM_SYM),0,0},
  178.   { "JOIN",        SYM(JOIN_SYM),0,0},
  179.   { "KEY",        SYM(KEY_SYM),0,0},
  180.   { "KEYS",        SYM(KEYS),0,0},
  181.   { "KILL",        SYM(KILL_SYM),0,0},
  182.   { "LAST_INSERT_ID",    SYM(LAST_INSERT_ID),0,0},
  183.   { "LEADING",        SYM(LEADING),0,0},
  184.   { "LEFT",        SYM(LEFT),0,0},
  185.   { "LIKE",        SYM(LIKE),0,0},
  186.   { "LINES",        SYM(LINES),0,0},
  187.   { "LIMIT",        SYM(LIMIT),0,0},
  188.   { "LOAD",        SYM(LOAD),0,0},
  189.   { "LOCAL",        SYM(LOCAL_SYM),0,0},
  190.   { "LOCK",        SYM(LOCK_SYM),0,0},
  191.   { "LOGS",        SYM(LOGS_SYM),0,0},
  192.   { "LONG",        SYM(LONG_SYM),0,0},
  193.   { "LONGBLOB",        SYM(LONGBLOB),0,0},
  194.   { "LONGTEXT",        SYM(LONGTEXT),0,0},
  195.   { "LOW_PRIORITY",    SYM(LOW_PRIORITY),0,0},
  196.   { "MASTER",           SYM(MASTER_SYM),0,0},
  197.   { "MASTER_CONNECT_RETRY",           SYM(MASTER_CONNECT_RETRY_SYM),0,0},
  198.   { "MASTER_HOST",           SYM(MASTER_HOST_SYM),0,0},
  199.   { "MASTER_LOG_FILE",           SYM(MASTER_LOG_FILE_SYM),0,0},
  200.   { "MASTER_LOG_POS",           SYM(MASTER_LOG_POS_SYM),0,0},
  201.   { "MASTER_PASSWORD",           SYM(MASTER_PASSWORD_SYM),0,0},
  202.   { "MASTER_PORT",           SYM(MASTER_PORT_SYM),0,0},
  203.   { "MASTER_USER",           SYM(MASTER_USER_SYM),0,0},
  204.   { "MAX_ROWS",        SYM(MAX_ROWS),0,0},
  205.   { "MATCH",        SYM(MATCH),0,0},
  206.   { "MEDIUMBLOB",    SYM(MEDIUMBLOB),0,0},
  207.   { "MEDIUMTEXT",    SYM(MEDIUMTEXT),0,0},
  208.   { "MEDIUMINT",    SYM(MEDIUMINT),0,0},
  209.   { "MERGE",        SYM(MERGE_SYM),0,0},
  210.   { "MIDDLEINT",    SYM(MEDIUMINT),0,0},    /* For powerbuilder */
  211.   { "MIN_ROWS",        SYM(MIN_ROWS),0,0},
  212.   { "MINUTE",        SYM(MINUTE_SYM),0,0},
  213.   { "MINUTE_SECOND",    SYM(MINUTE_SECOND_SYM),0,0},
  214.   { "MODIFY",        SYM(MODIFY_SYM),0,0},
  215.   { "MONTH",        SYM(MONTH_SYM),0,0},
  216.   { "MRG_MYISAM",    SYM(MERGE_SYM),0,0},
  217.   { "MYISAM",        SYM(MYISAM_SYM),0,0},
  218.   { "NATURAL",        SYM(NATURAL),0,0},
  219.   { "NATIONAL",        SYM(NATIONAL_SYM),0,0},
  220.   { "NCHAR",        SYM(NCHAR_SYM),0,0},
  221.   { "NUMERIC",        SYM(NUMERIC_SYM),0,0},
  222.   { "NO",        SYM(NO_SYM),0,0},
  223.   { "NOT",        SYM(NOT),0,0},
  224.   { "NULL",        SYM(NULL_SYM),0,0},
  225.   { "ON",        SYM(ON),0,0},
  226.   { "OPTIMIZE",        SYM(OPTIMIZE),0,0},
  227.   { "OPTION",        SYM(OPTION),0,0},
  228.   { "OPTIONALLY",    SYM(OPTIONALLY),0,0},
  229.   { "OR",        SYM(OR),0,0},
  230.   { "ORDER",        SYM(ORDER_SYM),0,0},
  231.   { "OUTER",        SYM(OUTER),0,0},
  232.   { "OUTFILE",        SYM(OUTFILE),0,0},
  233.   { "PACK_KEYS",    SYM(PACK_KEYS_SYM),0,0},
  234.   { "PARTIAL",        SYM(PARTIAL),0,0},
  235.   { "PASSWORD",        SYM(PASSWORD),0,0},
  236.   { "PURGE",        SYM(PURGE),0,0},
  237.   { "PRECISION",    SYM(PRECISION),0,0},
  238.   { "PRIMARY",        SYM(PRIMARY_SYM),0,0},
  239.   { "PROCEDURE",    SYM(PROCEDURE),0,0},
  240.   { "PROCESS"    ,    SYM(PROCESS),0,0},
  241.   { "PROCESSLIST",    SYM(PROCESSLIST_SYM),0,0},
  242.   { "PRIVILEGES",    SYM(PRIVILEGES),0,0},
  243.   { "QUICK",            SYM(QUICK),0,0},
  244.   { "RAID0",        SYM(RAID_0_SYM),0,0},
  245.   { "READ",        SYM(READ_SYM),0,0},
  246.   { "REAL",        SYM(REAL),0,0},
  247.   { "REFERENCES",    SYM(REFERENCES),0,0},
  248.   { "RELOAD",        SYM(RELOAD),0,0},
  249.   { "REGEXP",        SYM(REGEXP),0,0},
  250.   { "RENAME",        SYM(RENAME),0,0},
  251.   { "REPAIR",        SYM(REPAIR),0,0},
  252.   { "REPLACE",        SYM(REPLACE),0,0},
  253.   { "RESET",        SYM(RESET_SYM),0,0},
  254.   { "RESTORE",        SYM(RESTORE_SYM),0,0},
  255.   { "RESTRICT",        SYM(RESTRICT),0,0},
  256.   { "RETURNS",        SYM(UDF_RETURNS_SYM),0,0},
  257.   { "REVOKE",        SYM(REVOKE),0,0},
  258.   { "RIGHT",        SYM(RIGHT),0,0},
  259.   { "RLIKE",        SYM(REGEXP),0,0},    /* Like in mSQL2 */
  260.   { "ROLLBACK",        SYM(ROLLBACK_SYM),0,0},
  261.   { "ROW",        SYM(ROW_SYM),0,0},
  262.   { "ROWS",        SYM(ROWS_SYM),0,0},
  263.   { "SECOND",        SYM(SECOND_SYM),0,0},
  264.   { "SELECT",        SYM(SELECT_SYM),0,0},
  265.   { "SET",        SYM(SET),0,0},
  266.   { "SHOW",        SYM(SHOW),0,0},
  267.   { "SHUTDOWN",        SYM(SHUTDOWN),0,0},
  268.   { "SLAVE",            SYM(SLAVE),0,0},
  269.   { "SMALLINT",        SYM(SMALLINT),0,0},
  270.   { "SONAME",        SYM(UDF_SONAME_SYM),0,0},
  271.   { "SQL_AUTO_IS_NULL", SYM(SQL_AUTO_IS_NULL),0,0},
  272.   { "SQL_BIG_RESULT",    SYM(SQL_BIG_RESULT),0,0},
  273.   { "SQL_BIG_SELECTS",    SYM(SQL_BIG_SELECTS),0,0},
  274.   { "SQL_BIG_TABLES",    SYM(SQL_BIG_TABLES),0,0},
  275.   { "SQL_BUFFER_RESULT", SYM(SQL_BUFFER_RESULT),0,0},
  276.   { "SQL_LOG_BIN",    SYM(SQL_LOG_BIN),0,0},
  277.   { "SQL_LOG_OFF",    SYM(SQL_LOG_OFF),0,0},
  278.   { "SQL_LOG_UPDATE",    SYM(SQL_LOG_UPDATE),0,0},
  279.   { "SQL_LOW_PRIORITY_UPDATES", SYM(SQL_LOW_PRIORITY_UPDATES),0,0},
  280.   { "SQL_MAX_JOIN_SIZE",SYM(SQL_MAX_JOIN_SIZE), 0, 0},
  281.   { "SQL_QUOTE_SHOW_CREATE",SYM(SQL_QUOTE_SHOW_CREATE), 0, 0},
  282.   { "SQL_SAFE_UPDATES", SYM(SQL_SAFE_UPDATES),0,0},
  283.   { "SQL_SELECT_LIMIT", SYM(SQL_SELECT_LIMIT),0,0},
  284.   { "SQL_SMALL_RESULT", SYM(SQL_SMALL_RESULT),0,0},
  285.   { "SQL_WARNINGS",    SYM(SQL_WARNINGS),0,0},
  286.   { "STRAIGHT_JOIN",    SYM(STRAIGHT_JOIN),0,0},
  287.   { "START",        SYM(START_SYM),0,0},
  288.   { "STARTING",        SYM(STARTING),0,0},
  289.   { "STATUS",        SYM(STATUS_SYM),0,0},
  290.   { "STRING",        SYM(STRING_SYM),0,0},
  291.   { "STOP",        SYM(STOP_SYM),0,0},
  292.   { "STRIPED",        SYM(RAID_STRIPED_SYM),0,0},
  293.   { "TABLE",        SYM(TABLE_SYM),0,0},
  294.   { "TABLES",        SYM(TABLES),0,0},
  295.   { "TEMPORARY",    SYM(TEMPORARY),0,0},
  296.   { "TERMINATED",    SYM(TERMINATED),0,0},
  297.   { "TEXT",        SYM(TEXT_SYM),0,0},
  298.   { "THEN",        SYM(THEN_SYM),0,0},
  299.   { "TIME",        SYM(TIME_SYM),0,0},
  300.   { "TIMESTAMP",    SYM(TIMESTAMP),0,0},
  301.   { "TINYBLOB",        SYM(TINYBLOB),0,0},
  302.   { "TINYTEXT",        SYM(TINYTEXT),0,0},
  303.   { "TINYINT",        SYM(TINYINT),0,0},
  304.   { "TRAILING",        SYM(TRAILING),0,0},
  305.   { "TRUNCATE",        SYM(TRUNCATE_SYM),0,0},
  306.   { "TO",        SYM(TO_SYM),0,0},
  307.   { "TYPE",        SYM(TYPE_SYM),0,0},
  308.   { "UNION",            SYM(UNION_SYM),0,0},
  309.   { "UNIQUE",        SYM(UNIQUE_SYM),0,0},
  310.   { "UNLOCK",        SYM(UNLOCK_SYM),0,0},
  311.   { "UNSIGNED",        SYM(UNSIGNED),0,0},
  312.   { "USE",        SYM(USE_SYM),0,0},
  313.   { "USING",        SYM(USING),0,0},
  314.   { "UPDATE",        SYM(UPDATE_SYM),0,0},
  315.   { "USAGE",        SYM(USAGE),0,0},
  316.   { "VALUES",        SYM(VALUES),0,0},
  317.   { "VARCHAR",        SYM(VARCHAR),0,0},
  318.   { "VARIABLES",    SYM(VARIABLES),0,0},
  319.   { "VARYING",        SYM(VARYING),0,0},
  320.   { "VARBINARY",    SYM(VARBINARY),0,0},
  321.   { "WITH",        SYM(WITH),0,0},
  322.   { "WORK",        SYM(WORK_SYM),0,0},
  323.   { "WRITE",        SYM(WRITE_SYM),0,0},
  324.   { "WHEN",        SYM(WHEN_SYM),0,0},
  325.   { "WHERE",        SYM(WHERE),0,0},
  326.   { "YEAR",        SYM(YEAR_SYM),0,0},
  327.   { "YEAR_MONTH",    SYM(YEAR_MONTH_SYM),0,0},
  328.   { "ZEROFILL",        SYM(ZEROFILL),0,0},
  329.   { "||",        SYM(OR_OR_CONCAT),0,0}
  330. };
  331.  
  332.  
  333. static SYMBOL sql_functions[] = {
  334.   { "ABS",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_abs)},
  335.   { "ACOS",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_acos)},
  336.   { "ADDDATE",        SYM(DATE_ADD_INTERVAL),0,0},
  337.   { "ASCII",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ascii)},
  338.   { "ASIN",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_asin)},
  339.   { "ATAN",        SYM(ATAN),0,0},
  340.   { "ATAN2",        SYM(ATAN),0,0},
  341.   { "BENCHMARK",    SYM(BENCHMARK_SYM),0,0},
  342.   { "BIN",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bin)},
  343.   { "BIT_COUNT",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_count)},
  344.   { "BIT_OR",        SYM(BIT_OR),0,0},
  345.   { "BIT_AND",        SYM(BIT_AND),0,0},
  346.   { "CEILING",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
  347.   { "CHAR_LENGTH",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
  348.   { "CHARACTER_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
  349.   { "COALESCE",        SYM(COALESCE),0,0},
  350.   { "CONCAT",        SYM(CONCAT),0,0},
  351.   { "CONCAT_WS",    SYM(CONCAT_WS),0,0},
  352.   { "CONNECTION_ID",    SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_connection_id)},
  353.   { "CONV",        SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_conv)},
  354.   { "COUNT",        SYM(COUNT_SYM),0,0},
  355.   { "COS",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cos)},
  356.   { "COT",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cot)},
  357.   { "CURDATE",        SYM(CURDATE),0,0},
  358.   { "CURTIME",        SYM(CURTIME),0,0},
  359.   { "DATE_ADD",        SYM(DATE_ADD_INTERVAL),0,0},
  360.   { "DATE_FORMAT",    SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_date_format)},
  361.   { "DATE_SUB",        SYM(DATE_SUB_INTERVAL),0,0},
  362.   { "DAYNAME",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayname)},
  363.   { "DAYOFMONTH",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofmonth)},
  364.   { "DAYOFWEEK",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofweek)},
  365.   { "DAYOFYEAR",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofyear)},
  366.   { "DECODE",        SYM(DECODE_SYM),0,0},
  367.   { "DEGREES",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_degrees)},
  368.   { "ELT",        SYM(ELT_FUNC),0,0},
  369.   { "ENCODE",        SYM(ENCODE_SYM),0,0},
  370.   { "ENCRYPT",        SYM(ENCRYPT),0,0},
  371.   { "EXTRACT",        SYM(EXTRACT_SYM),0,0},
  372.   { "EXP",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_exp)},
  373.   { "EXPORT_SET",    SYM(EXPORT_SET),0,0},
  374.   { "FIELD",        SYM(FIELD_FUNC),0,0},    /* For compability */
  375.   { "FIND_IN_SET",    SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_find_in_set)},
  376.   { "FLOOR",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_floor)},
  377.   { "FORMAT",        SYM(FORMAT_SYM),0,0},
  378.   { "FROM_DAYS",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_from_days)},
  379.   { "FROM_UNIXTIME",    SYM(FROM_UNIXTIME),0,0},
  380.   { "GET_LOCK",        SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_get_lock)},
  381.   { "GREATEST",        SYM(GREATEST_SYM),0,0},
  382.   { "GROUP_UNIQUE_USERS",    SYM(GROUP_UNIQUE_USERS),0,0},
  383.   { "HEX",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_hex)},
  384.   { "IFNULL",        SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_ifnull)},
  385.   { "INET_ATON",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_aton)},
  386.   { "INET_NTOA",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_ntoa)},
  387.   { "INSTR",        SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_instr)},
  388.   { "ISNULL",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isnull)},
  389.   { "LCASE",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
  390.   { "LEAST",        SYM(LEAST_SYM),0,0},
  391.   { "LENGTH",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
  392.   { "LOAD_FILE",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_load_file)},
  393.   { "LOCATE",        SYM(LOCATE),0,0},
  394.   { "LOG",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log)},
  395.   { "LOG10",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log10)},
  396.   { "LOWER",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
  397.   { "LPAD",        SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_lpad)},
  398.   { "LTRIM",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ltrim)},
  399.   { "MAKE_SET",        SYM(MAKE_SET_SYM),0,0},
  400.   { "MAX",        SYM(MAX_SYM),0,0},
  401.   { "MD5",              SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_md5)},
  402.   { "MID",        SYM(SUBSTRING),0,0},    /* unireg function */
  403.   { "MIN",        SYM(MIN_SYM),0,0},
  404.   { "MOD",        SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_mod)},
  405.   { "MONTHNAME",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_monthname)},
  406.   { "NOW",        SYM(NOW_SYM),0,0},
  407.   { "NULLIF",        SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_nullif)},
  408.   { "OCTET_LENGTH",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
  409.   { "OCT",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_oct)},
  410.   { "ORD",              SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ord)},
  411.   { "PERIOD_ADD",    SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_add)},
  412.   { "PERIOD_DIFF",    SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_diff)},
  413.   { "PI",        SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_pi)},
  414.   { "POSITION",        SYM(POSITION_SYM),0,0},
  415.   { "POW",        SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
  416.   { "POWER",        SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
  417.   { "QUARTER",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quarter)},
  418.   { "RADIANS",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_radians)},
  419.   { "RAND",        SYM(RAND),0,0},
  420.   { "RELEASE_LOCK",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_release_lock)},
  421.   { "REPEAT",        SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_repeat)},
  422.   { "REVERSE",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_reverse)},
  423.   { "ROUND",        SYM(ROUND),0,0},
  424.   { "RPAD",        SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_rpad)},
  425.   { "RTRIM",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_rtrim)},
  426.   { "SEC_TO_TIME",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sec_to_time)},
  427.   { "SESSION_USER",    SYM(USER),0,0},
  428.   { "SUBDATE",        SYM(DATE_SUB_INTERVAL),0,0},
  429.   { "SIGN",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sign)},
  430.   { "SIN",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sin)},
  431.   { "SOUNDEX",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_soundex)},
  432.   { "SPACE",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_space)},
  433.   { "SQRT",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sqrt)},
  434.   { "STD",        SYM(STD_SYM),0,0},
  435.   { "STDDEV",        SYM(STD_SYM),0,0},
  436.   { "STRCMP",        SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_strcmp)},
  437.   { "SUBSTRING",    SYM(SUBSTRING),0,0},
  438.   { "SUBSTRING_INDEX",    SYM(SUBSTRING_INDEX),0,0},
  439.   { "SUM",        SYM(SUM_SYM),0,0},
  440.   { "SYSDATE",        SYM(NOW_SYM),0,0},
  441.   { "SYSTEM_USER",    SYM(USER),0,0},
  442.   { "TAN",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_tan)},
  443.   { "TIME_FORMAT",    SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_time_format)},
  444.   { "TIME_TO_SEC",    SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_time_to_sec)},
  445.   { "TO_DAYS",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_to_days)},
  446.   { "TRIM",        SYM(TRIM),0,0},
  447.   { "UCASE",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
  448.   { "UPPER",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
  449.   { "UNIQUE_USERS",    SYM(UNIQUE_USERS),0,0},
  450.   { "UNIX_TIMESTAMP",    SYM(UNIX_TIMESTAMP),0,0},
  451.   { "USER",        SYM(USER),0,0},
  452.   { "VERSION",        SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_version)},
  453.   { "WEEK",        SYM(WEEK_SYM),0,0},
  454.   { "WEEKDAY",        SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekday)},
  455.   { "YEARWEEK",        SYM(YEARWEEK),0,0}
  456. };
  457.