go整理tidb/mysql所有关键字,保留字

// tidb 暂时不支持'SELECT * FROM mysql.help_keyword;', 支持后可以替换一下
var keyWords = map[string]struct{}{
    "ACTION":{},"ADD":{},"ADDDATE":{},"ADMIN":{},"AFTER":{},"ALL":{},"ALTER":{},"ALWAYS":{},"ANALYZE":{},
    "AND":{},"ANY":{},"AS":{},"ASC":{},"ASCII":{},"AUTO_INCREMENT":{},"AVG":{},"AVG_ROW_LENGTH":{},

    "BEGIN":{},"BETWEEN":{},"BIGINT":{},"BINARY":{},"BINLOG":{},"BIT":{},"BIT_XOR":{},"BLOB":{},"BOOL":{},
    "BOOLEAN":{},"BOTH":{},"BTREE":{},"BY":{},"BYTE":{},

    "CASCADE":{},"CASE":{},"CAST":{},"CHANGE":{},"CHAR":{},"CHARACTER":{},"CHARSET":{},"CHECK":{},"CHECKSUM":{},
    "COALESCE":{},"COLLATE":{},"COLLATION":{},"COLUMN":{},"COLUMNS":{},"COMMENT":{},"COMMIT":{},"COMMITTED":{},"COMPACT":{},
    "COMPRESSED":{},"COMPRESSION":{},"CONNECTION":{},"CONSISTENT":{},"CONSTRAINT":{},"CONVERT":{},"COUNT":{},"CREATE":{},"CROSS":{},
    "CUME_DIST":{},"CURRENT_DATE":{},"CURRENT_TIME":{},"CURRENT_TIMESTAMP":{},"CURRENT_USER":{},"CURTIME":{},

    "DATA":{},"DATABASE":{},"DATABASES":{},"DATE":{},"DATE_ADD":{},"DATE_SUB":{},"DATETIME":{},"DAY":{},"DAY_HOUR":{},
    "DAY_MICROSECOND":{},"DAY_MINUTE":{},"DAY_SECOND":{},"DDL":{},"DEALLOCATE":{},"DEC":{},"DECIMAL":{},"DEFAULT":{},"DELAY_KEY_WRITE":{},
    "DELAYED":{},"DELETE":{},"DENSE_RANK":{},"DESC":{},"DESCRIBE":{},"DISABLE":{},"DISTINCT":{},"DISTINCTROW":{},"DIV":{},
    "DO":{},"DOUBLE":{},"DROP":{},"DUAL":{},"DUPLICATE":{},"DYNAMIC":{},

    "ELSE":{},"ENABLE":{},"ENCLOSED":{},"END":{},"ENGINE":{},"ENGINES":{},"ENUM":{},"ESCAPE":{},"ESCAPED":{},
    "EVENTS":{},"EXCLUSIVE":{},"EXECUTE":{},"EXISTS":{},"EXPLAIN":{},"EXTRACT":{},

    "FALSE":{},"FIELDS":{},"FIRST":{},"FIRST_VALUE":{},"FIXED":{},"FLOAT":{},"FLUSH":{},"FOR":{},"FORCE":{},
    "FOREIGN":{},"FORMAT":{},"FROM":{},"FULL":{},"FULLTEXT":{},"FUNCTION":{},

    "GENERATED":{},"GET_FORMAT":{},"GLOBAL":{},"GRANT":{},"GRANTS":{},"GROUP":{},"GROUP_CONCAT":{},"GROUPS":{},


    "HASH":{},"HAVING":{},"HIGH_PRIORITY":{},"HOUR":{},"HOUR_MICROSECOND":{},"HOUR_MINUTE":{},"HOUR_SECOND":{},

    "IDENTIFIED":{},"IF":{},"IGNORE":{},"IN":{},"INDEX":{},"INDEXES":{},"INFILE":{},"INNER":{},"INSERT":{},
    "INT":{},"INTEGER":{},"INTERVAL":{},"INTO":{},"IS":{},"ISOLATION":{},

    "JOBS":{},"JOIN":{},"JSON":{},

    "KEY":{},"KEY_BLOCK_SIZE":{},"KEYS":{},"KILL":{},

    "LAG":{},"LAST_VALUE":{},"LEAD":{},"LEADING":{},"LEFT":{},"LESS":{},"LEVEL":{},"LIKE":{},"LIMIT":{},
    "LINES":{},"LOAD":{},"LOCAL":{},"LOCALTIME":{},"LOCALTIMESTAMP":{},"LOCK":{},"LONGBLOB":{},"LONGTEXT":{},"LOW_PRIORITY":{},

    "MAX":{},"MAX_ROWS":{},"MAXVALUE":{},"MEDIUMBLOB":{},"MEDIUMINT":{},"MEDIUMTEXT":{},"MICROSECOND":{},"MIN":{},"MIN_ROWS":{},
    "MINUTE":{},"MINUTE_MICROSECOND":{},"MINUTE_SECOND":{},"MOD":{},"MODE":{},"MODIRY":{},"MONTH":{},

    "NAMES":{},"NATIONAL":{},"NATURAL":{},"NO":{},"NO_WRITE_TO_BINLOG":{},"NONE":{},"NOT":{},"NOW":{},"NTH_VALUE":{},
    "NTILE":{},"NULL":{},"NUMERIC":{},"NVARCHAR":{},


    "OFFSET":{},"ON":{},"ONLY":{},"OPTION":{},"OR":{},"ORDER":{},"OUTER":{},"OVER":{},

    "PARTITION":{},"PARTITIONS":{},"PASSWORD":{},"PERCENT_RANK":{},"PLUGINS":{},"POSITION":{},"PRECISION":{},"PREPARE":{},"PRIMARY":{},
    "PRIVILEGES":{},"PROCEDURE":{},"PROCESS":{},"PROCESSLIST":{},

    "QUARTER":{},"QUERY":{},"QUICK":{},

    "RANGE":{},"RANK":{},"READ":{},"REAL":{},"REDUNDANT":{},"REFERENCES":{},"REGEXP":{},"RENAME":{},"REPEAT":{},
    "REPEATABLE":{},"REPLACE":{},"RESTRICT":{},"REVERSE":{},"REVOKE":{},"RIGHT":{},"RLIKE":{},"ROLLBACK":{},"ROW":{},
    "ROW_COUNT":{},"ROW_FORMAT":{},"ROW_NUMBER":{},"ROWS":{},

    "SCHEMA":{},"SCHEMAS":{},"SECOND":{},"SECOND_MICROSECOND":{},"SELECT":{},"SERIALIZABLE":{},"SESSION":{},"SET":{},"SHARE":{},
    "SHARED":{},"SHOW":{},"SIGNED":{},"SMALLINT":{},"SNAPSHOT":{},"SOME":{},"SQL_CACHE":{},"SQL_CALC_FOUND_ROWS":{},"SQL_NO_CACHE":{},
    "START":{},"STARTING":{},"STATS":{},"STATS_BUCKETS":{},"STATS_HISTOGRAMS":{},"STATS_META":{},"STATS_PERSISTENT":{},"STATUS":{},"STORED":{},
    "SUBDATE":{},"SUBSTR":{},"SUBSTRING":{},"SUM":{},"SUPER":{},

    "TABLE":{},"TABLES":{},"TERMINATED":{},"TEXT":{},"THAN":{},"THEN":{},"TIDB":{},"TIDB_INLJ":{},"TIDB_SMJ":{},
    "TIME":{},"TIMESTAMP":{},"TIMESTAMPADD":{},"TIMESTAMPDIFF":{},"TINYBLOB":{},"TINYINT":{},"TINYTEXT":{},"TO":{},"TRAILING":{},
    "TRANSACTION":{},"TRIGGER":{},"TRIGGERS":{},"TRIM":{},"TRUE":{},"TRUNCATE":{},

    "UNCOMMITTED":{},"UNION":{},"UNIQUE":{},"UNKNOWN":{},"UNLOCK":{},"UNSIGNED":{},"UPDATE":{},"USE":{},"USER":{},
    "USING":{},"UTC_DATE":{},"UTC_TIME":{},"UTC_TIMESTAMP":{},

    "VALUE":{},"VALUES":{},"VARBINARY":{},"VARCHAR":{},"VARIABLES":{},"VIEW":{},"VIRTUAL":{},

    "WARNINGS":{},"WEEK":{},"WHEN":{},"WHERE":{},"WINDOW":{},"WITH":{},"WRITE":{},

    "XOR":{},"YEAR":{},"YEAR_MONTH":{},"ZEROFILL":{},
}

func isKeyWord(name string) bool {
    name = strings.ToUpper(name)
    if _, ok := keyWords[name];ok{
        return true
    }
    return false
}