1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/hanchuanchuan-goInception

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
const.go 28 КБ
Копировать Редактировать Исходные данные Просмотреть построчно История
hanchuanchuan Отправлено 5 лет назад 95c2e8f
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
// Copyright 2013 The ql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSES/QL-LICENSE file.
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package session
import (
"github.com/hanchuanchuan/goInception/mysql"
)
// 数据库类型
const (
DBTypeMysql = iota
DBTypeMariaDB
DBTypeTiDB
)
// 审核阶段
const (
StageOK byte = iota
StageCheck
StageExec
StageBackup
)
// 审核状态
const (
StatusAuditOk byte = iota
StatusExecFail
StatusExecOK
StatusBackupFail
StatusBackupOK
)
var (
StageList = [4]string{"RERUN", "CHECKED", "EXECUTED", "BACKUP"}
StatusList = [5]string{"Audit Completed", "Execute failed", "Execute Successfully",
"Execute Successfully\nBackup failed", "Execute Successfully\nBackup Successfully"}
)
// int类型map(用以数值列类型变更审核)
var IntegerOrderedMaps = map[string]int{
"bit": 1,
"tinyint": 2,
"smallint": 3,
"mediumint": 4,
"int": 5,
"bigint": 6,
}
// int类型map(用以数值列类型变更审核)
var IntegerOrderedMaps2 = map[byte]int{
mysql.TypeBit: 1,
mysql.TypeTiny: 2,
mysql.TypeShort: 3,
mysql.TypeInt24: 4,
mysql.TypeLong: 5,
mysql.TypeLonglong: 6,
}
// Keywords 数据库关键字
var Keywords = map[string]bool{
"ACCESSIBLE": true,
"ACCOUNT": true,
"ACTION": true,
"ADD": true,
"ADDDATE": true,
"ADMIN": true,
"AFTER": true,
"AGAINST": true,
"AGGREGATE": true,
"ALGORITHM": true,
"ALL": true,
"ALTER": true,
"ALWAYS": true,
"ANALYSE": true,
"ANALYZE": true,
"AND": true,
"ANY": true,
"AS": true,
"ASC": true,
"ASCII": true,
"ASENSITIVE": true,
"AT": true,
"AUTO_INCREMENT": true,
"AUTOEXTEND_SIZE": true,
"AVG": true,
"AVG_ROW_LENGTH": true,
"BACKUP": true,
"BEFORE": true,
"BEGIN": true,
"BETWEEN": true,
"BIGINT": true,
"BINARY": true,
"BINLOG": true,
"BIT": true,
"BIT_AND": true,
"BIT_OR": true,
"BIT_XOR": true,
"BLOB": true,
"BLOCK": true,
"BOOL": true,
"BOOLEAN": true,
"BOTH": true,
"BTREE": true,
"BUCKETS": true,
"BY": true,
"BYTE": true,
"CACHE": true,
"CALL": true,
"CANCEL": true,
"CASCADE": true,
"CASCADED": true,
"CASE": true,
"CAST": true,
"CATALOG_NAME": true,
"CHAIN": true,
"CHANGE": true,
"CHANGED": true,
"CHANNEL": true,
"CHAR": true,
"CHARACTER": true,
"CHARSET": true,
"CHECK": true,
"CHECKSUM": true,
"CIPHER": true,
"CLASS_ORIGIN": true,
"CLEANUP": true,
"CLIENT": true,
"CLOSE": true,
"COALESCE": true,
"CODE": true,
"COLLATE": true,
"COLLATION": true,
"COLUMN": true,
"COLUMN_FORMAT": true,
"COLUMN_NAME": true,
"COLUMNS": true,
"COMMENT": true,
"COMMIT": true,
"COMMITTED": true,
"COMPACT": true,
"COMPLETION": true,
"COMPRESSED": true,
"COMPRESSION": true,
"CONCURRENT": true,
"CONDITION": true,
"CONNECTION": true,
"CONSISTENT": true,
"CONSTRAINT": true,
"CONSTRAINT_CATALOG": true,
"CONSTRAINT_NAME": true,
"CONSTRAINT_SCHEMA": true,
"CONTAINS": true,
"CONTEXT": true,
"CONTINUE": true,
"CONVERT": true,
"COPY": true,
"COUNT": true,
"CPU": true,
"CREATE": true,
"CROSS": true,
"CUBE": true,
"CURRENT": true,
"CURRENT_DATE": true,
"CURRENT_TIME": true,
"CURRENT_TIMESTAMP": true,
"CURRENT_USER": true,
"CURSOR": true,
"CURSOR_NAME": true,
"CURTIME": true,
"DATA": true,
"DATABASE": true,
"DATABASES": true,
"DATAFILE": true,
"DATE": true,
"DATE_ADD": true,
"DATE_SUB": true,
"DATETIME": true,
"DAY": true,
"DAY_HOUR": true,
"DAY_MICROSECOND": true,
"DAY_MINUTE": true,
"DAY_SECOND": true,
"DDL": true,
"DEALLOCATE": true,
"DEC": true,
"DECIMAL": true,
"DECLARE": true,
"DEFAULT": true,
"DEFAULT_AUTH": true,
"DEFINER": true,
"DELAY_KEY_WRITE": true,
"DELAYED": true,
"DELETE": true,
"DES_KEY_FILE": true,
"DESC": true,
"DESCRIBE": true,
"DETERMINISTIC": true,
"DIAGNOSTICS": true,
"DIRECTORY": true,
"DISABLE": true,
"DISCARD": true,
"DISK": true,
"DISTINCT": true,
"DISTINCTROW": true,
"DIV": true,
"DO": true,
"DOUBLE": true,
"DROP": true,
"DUAL": true,
"DUMPFILE": true,
"DUPLICATE": true,
"DYNAMIC": true,
"EACH": true,
"ELSE": true,
"ELSEIF": true,
"ENABLE": true,
"ENCLOSED": true,
"ENCRYPTION": true,
"END": true,
"ENDS": true,
"ENGINE": true,
"ENGINES": true,
"ENUM": true,
"ERROR": true,
"ERRORS": true,
"ESCAPE": true,
"ESCAPED": true,
"EVENT": true,
"EVENTS": true,
"EVERY": true,
"EXCHANGE": true,
"EXCLUSIVE": true,
"EXECUTE": true,
"EXISTS": true,
"EXIT": true,
"EXPANSION": true,
"EXPIRE": true,
"EXPLAIN": true,
"EXPORT": true,
"EXTENDED": true,
"EXTENT_SIZE": true,
"EXTRACT": true,
"FALSE": true,
"FAST": true,
"FAULTS": true,
"FETCH": true,
"FIELDS": true,
"FILE": true,
"FILE_BLOCK_SIZE": true,
"FILTER": true,
"FIRST": true,
"FIXED": true,
"FLOAT": true,
"FLOAT4": true,
"FLOAT8": true,
"FLUSH": true,
"FOLLOWS": true,
"FOR": true,
"FORCE": true,
"FOREIGN": true,
"FORMAT": true,
"FOUND": true,
"FROM": true,
"FULL": true,
"FULLTEXT": true,
"FUNCTION": true,
"GENERAL": true,
"GENERATED": true,
"GEOMETRY": true,
"GEOMETRYCOLLECTION": true,
"GET": true,
"GET_FORMAT": true,
"GLOBAL": true,
"GRANT": true,
"GRANTS": true,
"GROUP": true,
"GROUP_CONCAT": true,
"GROUP_REPLICATION": true,
"HANDLER": true,
"HASH": true,
"HAVING": true,
"HELP": true,
"HIGH_PRIORITY": true,
"HOST": true,
"HOSTS": true,
"HOUR": true,
"HOUR_MICROSECOND": true,
"HOUR_MINUTE": true,
"HOUR_SECOND": true,
"IDENTIFIED": true,
"IF": true,
"IGNORE": true,
"IGNORE_SERVER_IDS": true,
"IMPORT": true,
"IN": true,
"INCEPTION": true,
"INCEPTION_MAGIC_COMMIT": true,
"INCEPTION_MAGIC_START": true,
"INDEX": true,
"INDEXES": true,
"INFILE": true,
"INITIAL_SIZE": true,
"INNER": true,
"INOUT": true,
"INPLACE": true,
"INSENSITIVE": true,
"INSERT": true,
"INSERT_METHOD": true,
"INSTALL": true,
"INSTANCE": true,
"INT": true,
"INT1": true,
"INT2": true,
"INT3": true,
"INT4": true,
"INT8": true,
"INTEGER": true,
"INTERNAL": true,
"INTERVAL": true,
"INTO": true,
"INVOKER": true,
"IO": true,
"IO_AFTER_GTIDS": true,
"IO_BEFORE_GTIDS": true,
"IO_THREAD": true,
"IPC": true,
"IS": true,
"ISOLATION": true,
"ISSUER": true,
"ITERATE": true,
"JOB": true,
"JOBS": true,
"JOIN": true,
"JSON": true,
"KEY": true,
"KEY_BLOCK_SIZE": true,
"KEYS": true,
"KILL": true,
"LANGUAGE": true,
"LAST": true,
"LEADING": true,
"LEAVE": true,
"LEAVES": true,
"LEFT": true,
"LESS": true,
"LEVEL": true,
"LIKE": true,
"LIMIT": true,
"LINEAR": true,
"LINES": true,
"LINESTRING": true,
"LIST": true,
"LOAD": true,
"LOCAL": true,
"LOCALTIME": true,
"LOCALTIMESTAMP": true,
"LOCK": true,
"LOCKS": true,
"LOGFILE": true,
"LOGS": true,
"LONG": true,
"LONGBLOB": true,
"LONGTEXT": true,
"LOOP": true,
"LOW_PRIORITY": true,
"MASTER": true,
"MASTER_AUTO_POSITION": true,
"MASTER_BIND": true,
"MASTER_CONNECT_RETRY": true,
"MASTER_DELAY": true,
"MASTER_HEARTBEAT_PERIOD": true,
"MASTER_HOST": true,
"MASTER_LOG_FILE": true,
"MASTER_LOG_POS": true,
"MASTER_PASSWORD": true,
"MASTER_PORT": true,
"MASTER_RETRY_COUNT": true,
"MASTER_SERVER_ID": true,
"MASTER_SSL": true,
"MASTER_SSL_CA": true,
"MASTER_SSL_CAPATH": true,
"MASTER_SSL_CERT": true,
"MASTER_SSL_CIPHER": true,
"MASTER_SSL_CRL": true,
"MASTER_SSL_CRLPATH": true,
"MASTER_SSL_KEY": true,
"MASTER_SSL_VERIFY_SERVER_CERT": true,
"MASTER_TLS_VERSION": true,
"MASTER_USER": true,
"MATCH": true,
"MAX": true,
"MAX_CONNECTIONS_PER_HOUR": true,
"MAX_EXECUTION_TIME": true,
"MAX_QUERIES_PER_HOUR": true,
"MAX_ROWS": true,
"MAX_SIZE": true,
"MAX_STATEMENT_TIME": true,
"MAX_UPDATES_PER_HOUR": true,
"MAX_USER_CONNECTIONS": true,
"MAXVALUE": true,
"MEDIUM": true,
"MEDIUMBLOB": true,
"MEDIUMINT": true,
"MEDIUMTEXT": true,
"MEMORY": true,
"MERGE": true,
"MESSAGE_TEXT": true,
"MICROSECOND": true,
"MIDDLEINT": true,
"MIGRATE": true,
"MIN": true,
"MIN_ROWS": true,
"MINUTE": true,
"MINUTE_MICROSECOND": true,
"MINUTE_SECOND": true,
"MOD": true,
"MODE": true,
"MODIFIES": true,
"MODIFY": true,
"MONTH": true,
"MULTILINESTRING": true,
"MULTIPOINT": true,
"MULTIPOLYGON": true,
"MUTEX": true,
"MYSQL_ERRNO": true,
"NAME": true,
"NAMES": true,
"NATIONAL": true,
"NATURAL": true,
"NCHAR": true,
"NDB": true,
"NDBCLUSTER": true,
"NEVER": true,
"NEW": true,
"NEXT": true,
"NO": true,
"NO_WAIT": true,
"NO_WRITE_TO_BINLOG": true,
"NODEGROUP": true,
"NONBLOCKING": true,
"NONE": true,
"NOT": true,
"NOW": true,
"NULL": true,
"NUMBER": true,
"NUMERIC": true,
"NVARCHAR": true,
"OFFSET": true,
"OLD_PASSWORD": true,
"ON": true,
"ONE": true,
"ONLY": true,
"OPEN": true,
"OPTIMIZE": true,
"OPTIMIZER_COSTS": true,
"OPTION": true,
"OPTIONALLY": true,
"OPTIONS": true,
"OR": true,
"ORDER": true,
"OUT": true,
"OUTER": true,
"OUTFILE": true,
"OWNER": true,
"PACK_KEYS": true,
"PAGE": true,
"PARSE_GCOL_EXPR": true,
"PARSER": true,
"PARTIAL": true,
"PARTITION": true,
"PARTITIONING": true,
"PARTITIONS": true,
"PASSWORD": true,
"PHASE": true,
"PLUGIN": true,
"PLUGIN_DIR": true,
"PLUGINS": true,
"POINT": true,
"POLYGON": true,
"PORT": true,
"POSITION": true,
"PRECEDES": true,
"PRECISION": true,
"PREPARE": true,
"PRESERVE": true,
"PREV": true,
"PRIMARY": true,
"PRIVILEGES": true,
"PROCEDURE": true,
"PROCESS": true,
"PROCESSLIST": true,
"PROFILE": true,
"PROFILES": true,
"PROXY": true,
"PURGE": true,
"QUARTER": true,
"QUERIES": true,
"QUERY": true,
"QUICK": true,
"RANGE": true,
"READ": true,
"READ_ONLY": true,
"READ_WRITE": true,
"READS": true,
"REAL": true,
"REBUILD": true,
"RECENT": true,
"RECOVER": true,
"REDO_BUFFER_SIZE": true,
"REDOFILE": true,
"REDUNDANT": true,
"REFERENCES": true,
"REGEXP": true,
"RELAY": true,
"RELAY_LOG_FILE": true,
"RELAY_LOG_POS": true,
"RELAY_THREAD": true,
"RELAYLOG": true,
"RELEASE": true,
"RELOAD": true,
"REMOVE": true,
"RENAME": true,
"REORGANIZE": true,
"REPAIR": true,
"REPEAT": true,
"REPEATABLE": true,
"REPLACE": true,
"REPLICATE_DO_DB": true,
"REPLICATE_DO_TABLE": true,
"REPLICATE_IGNORE_DB": true,
"REPLICATE_IGNORE_TABLE": true,
"REPLICATE_REWRITE_DB": true,
"REPLICATE_WILD_DO_TABLE": true,
"REPLICATE_WILD_IGNORE_TABLE": true,
"REPLICATION": true,
"REQUIRE": true,
"RESET": true,
"RESIGNAL": true,
"RESTORE": true,
"RESTRICT": true,
"RESUME": true,
"RETURN": true,
"RETURNED_SQLSTATE": true,
"RETURNS": true,
"REVERSE": true,
"REVOKE": true,
"RIGHT": true,
"RLIKE": true,
"ROLLBACK": true,
"ROLLUP": true,
"ROTATE": true,
"ROUTINE": true,
"ROW": true,
"ROW_COUNT": true,
"ROW_FORMAT": true,
"ROWS": true,
"RTREE": true,
"SAVEPOINT": true,
"SCHEDULE": true,
"SCHEMA": true,
"SCHEMA_NAME": true,
"SCHEMAS": true,
"SECOND": true,
"SECOND_MICROSECOND": true,
"SECURITY": true,
"SELECT": true,
"SENSITIVE": true,
"SEPARATOR": true,
"SERIAL": true,
"SERIALIZABLE": true,
"SERVER": true,
"SESSION": true,
"SET": true,
"SHARD_ROW_ID_BITS": true,
"SHARE": true,
"SHARED": true,
"SHOW": true,
"SHUTDOWN": true,
"SIGNAL": true,
"SIGNED": true,
"SIMPLE": true,
"SLAVE": true,
"SLOW": true,
"SMALLINT": true,
"SNAPSHOT": true,
"SOCKET": true,
"SOME": true,
"SONAME": true,
"SOUNDS": true,
"SOURCE": true,
"SPATIAL": true,
"SPECIFIC": true,
"SQL": true,
"SQL_AFTER_GTIDS": true,
"SQL_AFTER_MTS_GAPS": true,
"SQL_BEFORE_GTIDS": true,
"SQL_BIG_RESULT": true,
"SQL_BUFFER_RESULT": true,
"SQL_CACHE": true,
"SQL_CALC_FOUND_ROWS": true,
"SQL_NO_CACHE": true,
"SQL_SMALL_RESULT": true,
"SQL_THREAD": true,
"SQL_TSI_DAY": true,
"SQL_TSI_HOUR": true,
"SQL_TSI_MINUTE": true,
"SQL_TSI_MONTH": true,
"SQL_TSI_QUARTER": true,
"SQL_TSI_SECOND": true,
"SQL_TSI_WEEK": true,
"SQL_TSI_YEAR": true,
"SQLEXCEPTION": true,
"SQLSTATE": true,
"SQLWARNING": true,
"SSL": true,
"STACKED": true,
"START": true,
"STARTING": true,
"STARTS": true,
"STATS": true,
"STATS_AUTO_RECALC": true,
"STATS_BUCKETS": true,
"STATS_HEALTHY": true,
"STATS_HISTOGRAMS": true,
"STATS_META": true,
"STATS_PERSISTENT": true,
"STATS_SAMPLE_PAGES": true,
"STATUS": true,
"STOP": true,
"STORAGE": true,
"STORED": true,
"STRAIGHT_JOIN": true,
"STRING": true,
"SUBCLASS_ORIGIN": true,
"SUBDATE": true,
"SUBJECT": true,
"SUBPARTITION": true,
"SUBPARTITIONS": true,
"SUBSTR": true,
"SUBSTRING": true,
"SUM": true,
"SUPER": true,
"SUSPEND": true,
"SWAPS": true,
"SWITCHES": true,
"TABLE": true,
"TABLE_CHECKSUM": true,
"TABLE_NAME": true,
"TABLES": true,
"TABLESPACE": true,
"TEMPORARY": true,
"TEMPTABLE": true,
"TERMINATED": true,
"TEXT": true,
"THAN": true,
"THEN": true,
"TIDB": true,
"TIDB_HJ": true,
"TIDB_INLJ": true,
"TIDB_SMJ": true,
"TIME": true,
"TIMESTAMP": true,
"TIMESTAMPADD": true,
"TIMESTAMPDIFF": true,
"TINYBLOB": true,
"TINYINT": true,
"TINYTEXT": true,
"TO": true,
"TOP": true,
"TRACE": true,
"TRAILING": true,
"TRANSACTION": true,
"TRIGGER": true,
"TRIGGERS": true,
"TRIM": true,
"TRUE": true,
"TRUNCATE": true,
"TYPE": true,
"TYPES": true,
"UNCOMMITTED": true,
"UNDEFINED": true,
"UNDO": true,
"UNDO_BUFFER_SIZE": true,
"UNDOFILE": true,
"UNICODE": true,
"UNINSTALL": true,
"UNION": true,
"UNIQUE": true,
"UNKNOWN": true,
"UNLOCK": true,
"UNSIGNED": true,
"UNTIL": true,
"UPDATE": true,
"UPGRADE": true,
"USAGE": true,
"USE": true,
"USE_FRM": true,
"USER": true,
"USER_RESOURCES": true,
"USING": true,
"UTC_DATE": true,
"UTC_TIME": true,
"UTC_TIMESTAMP": true,
"VALIDATION": true,
"VALUE": true,
"VALUES": true,
"VARBINARY": true,
"VARCHAR": true,
"VARCHARACTER": true,
"VARIABLES": true,
"VARYING": true,
"VIEW": true,
"VIRTUAL": true,
"WAIT": true,
"WARNINGS": true,
"WEEK": true,
"WEIGHT_STRING": true,
"WHEN": true,
"WHERE": true,
"WHILE": true,
"WITH": true,
"WITHOUT": true,
"WORK": true,
"WRAPPER": true,
"WRITE": true,
"X509": true,
"XA": true,
"XID": true,
"XML": true,
"XOR": true,
"YEAR": true,
"YEAR_MONTH": true,
"ZEROFILL": true,
}

Комментарий ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/hanchuanchuan-goInception.git
git@gitlife.ru:oschina-mirror/hanchuanchuan-goInception.git
oschina-mirror
hanchuanchuan-goInception
hanchuanchuan-goInception
v1.2.3