lex.h
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:19k
源码类别:

MySQL数据库

开发平台:

Visual C++

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