Versions in this module Expand all Collapse all v1 v1.0.0 May 30, 2020 Changes in this version + const COLUMN_COMMENT_MAXLEN + const DBTypeMariaDB + const DBTypeMysql + const DBTypeTiDB + const ErrExprInOrderBy + const ErrExprInSelect + const INDEX_COMMENT_MAXLEN + const StageBackup + const StageCheck + const StageExec + const StageOK + const StatusAuditOk + const StatusBackupFail + const StatusBackupOK + const StatusExecFail + const StatusExecOK + const TABLE_COMMENT_MAXLEN + const TABLE_PARTITION_COMMENT_MAXLEN + var ErrCutValueGroupConcat = terror.ClassExpression.New(mysql.ErrCutValueGroupConcat, mysql.MySQLErrName[mysql.ErrCutValueGroupConcat]) + var ErrDivisionByZero = terror.ClassExpression.New(mysql.ErrDivisionByZero, mysql.MySQLErrName[mysql.ErrDivisionByZero]) + var ErrIncorrectParameterCount = terror.ClassExpression.New(mysql.ErrWrongParamcountToNativeFct, ...) + var ErrOperandColumns = terror.ClassExpression.New(mysql.ErrOperandColumns, mysql.MySQLErrName[mysql.ErrOperandColumns]) + var ErrRegexp = terror.ClassExpression.New(mysql.ErrRegexp, mysql.MySQLErrName[mysql.ErrRegexp]) + var ErrTruncatedWrongValue = terror.ClassVariable.New(mysql.ErrTruncatedWrongValue, mysql.MySQLErrName[mysql.ErrTruncatedWrongValue]) + var ErrWrongTypeForVar = terror.ClassVariable.New(mysql.ErrWrongTypeForVar, mysql.MySQLErrName[mysql.ErrWrongTypeForVar]) + var ErrWrongValueForVar = terror.ClassVariable.New(mysql.ErrWrongValueForVar, mysql.MySQLErrName[mysql.ErrWrongValueForVar]) + var ErrorsChinese = map[ErrorCode]string + var ErrorsDefault = map[ErrorCode]string + var Keywords = map[string]bool + var StageList = [4]string + var StatusList = [5]string + var URL string + func CheckAuditSetting(cnf *config.Config) + func Exist(filename string) bool + func GetDataTypeBase(dataType string) string + func GetDataTypeLength(dataType string) []int + func GetErrorLevel(code ErrorCode) uint8 + func GetErrorMessage(code ErrorCode, lang string) string + func GetRows4Test(ctx context.Context, sctx sessionctx.Context, rs ast.RecordSet) ([]chunk.Row, error) + func GetTimeValue(ctx sessionctx.Context, v interface{}, tp byte, fsp int) (d types.Datum, err error) + func HTMLEscape(w io.Writer, b []byte) + func HTMLEscapeString(s string) string + func IsCurrentTimestampExpr(e ast.ExprNode) bool + func Max(x, y int) int + func Min(x, y int) int + func StringStorageReq(dataType string, charset string) int + type ChanOscData struct — darwin/amd64, js/wasm, linux/amd64 + type DBInfo struct + IsDeleted bool + IsNew bool + Name string + type ErrExprLoc struct + Loc string + Offset int + type ErrorCode int + const ER_ALTER_TABLE_ONCE + const ER_AUTOINC_UNSIGNED + const ER_AUTO_INCR_ID_WARNING + const ER_BAD_FIELD_ERROR + const ER_BAD_NULL_ERROR + const ER_BINLOG_CORRUPTED + const ER_BINLOG_FORMAT_STATEMENT + const ER_BLOB_CANT_HAVE_DEFAULT + const ER_BLOB_USED_AS_KEY + const ER_CANT_DROP_DATABASE + const ER_CANT_DROP_FIELD_OR_KEY + const ER_CANT_DROP_TABLE + const ER_CANT_SET_CHARSET + const ER_CANT_SET_COLLATION + const ER_CANT_SET_ENGINE + const ER_CHANGE_COLUMN_TYPE + const ER_CHANGE_TOO_MUCH_ROWS + const ER_CHARSET_ON_COLUMN + const ER_CHAR_TO_VARCHAR_LEN + const ER_COLLATION_CHARSET_MISMATCH + const ER_COLUMN_EXISTED + const ER_COLUMN_HAVE_NO_COMMENT + const ER_COLUMN_NOT_EXISTED + const ER_CONFLICTING_DECLARATIONS + const ER_CON_COUNT_ERROR + const ER_DATETIME_DEFAULT + const ER_DB_NOT_EXISTED_ERROR + const ER_DDL_DML_COEXIST + const ER_DUP_FIELDNAME + const ER_DUP_INDEX + const ER_DUP_KEYNAME + const ER_END_WITH_COMMIT + const ER_END_WITH_SEMICOLON + const ER_ERROR_EXIST_BEFORE + const ER_ERROR_FIRST + const ER_ERROR_LAST + const ER_FIELD_SPECIFIED_TWICE + const ER_FORCING_CLOSE + const ER_FOREIGN_KEY + const ER_HAVE_BEGIN + const ER_HOSTNAME + const ER_IDENT_USE_KEYWORD + const ER_ID_IS_UPER + const ER_INCEPTION_EMPTY_QUERY + const ER_INCORRECT_GLOBAL_LOCAL_VAR + const ER_INC_INIT_ERR + const ER_INDEX_NAME_IDX_PREFIX + const ER_INDEX_NAME_UNIQ_PREFIX + const ER_INDEX_USE_ALTER_TABLE + const ER_INSERT_TOO_MUCH_ROWS + const ER_INVALID_BACKUP_HOST_INFO + const ER_INVALID_COMMAND + const ER_INVALID_DATA_TYPE + const ER_INVALID_DEFAULT + const ER_INVALID_GROUP_FUNC_USE + const ER_INVALID_IDENT + const ER_INVALID_ON_UPDATE + const ER_KEY_COLUMN_DOES_NOT_EXITS + const ER_MULTIPLE_PRI_KEY + const ER_MUST_AT_LEAST_ONE_COLUMN + const ER_MUST_HAVE_COLUMNS + const ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE + const ER_NET_PACKETS_OUT_OF_ORDER + const ER_NET_READ_ERROR + const ER_NET_READ_INTERRUPTED + const ER_NON_UNIQ_ERROR + const ER_NORMAL_SHUTDOWN + const ER_NOT_ALLOWED_NULLABLE + const ER_NOT_SUPPORTED_ALTER_OPTION + const ER_NOT_SUPPORTED_ITEM_TYPE + const ER_NOT_SUPPORTED_KEY_TYPE + const ER_NOT_SUPPORTED_YET + const ER_NOT_VALID_PASSWORD + const ER_NO_DB_ERROR + const ER_NO_WHERE_CONDITION + const ER_ORDERY_BY_RAND + const ER_OSC_KILL_FAILED + const ER_OUTOFMEMORY + const ER_PARSE_ERROR + const ER_PARTITION_NOT_ALLOWED + const ER_PK_COLS_NOT_INT + const ER_PK_TOO_MANY_PARTS + const ER_PRIMARY_CANT_HAVE_NULL + const ER_REMOTE_EXE_ERROR + const ER_REMOVED_SPACES + const ER_SELECT_ONLY_STAR + const ER_SET_DATA_TYPE_INT_BIGINT + const ER_SHUTDOWN_COMPLETE + const ER_SLAVE_CORRUPT_EVENT + const ER_SLAVE_RELAY_LOG_WRITE_FAILURE + const ER_SQL_INVALID_OP_TYPE + const ER_SQL_INVALID_SOURCE + const ER_SQL_NO_OP_TYPE + const ER_SQL_NO_SOURCE + const ER_START_AS_BEGIN + const ER_SYNTAX_ERROR + const ER_TABLE_CANT_HANDLE_AUTO_INCREMENT + const ER_TABLE_CHARSET_MUST_NULL + const ER_TABLE_CHARSET_MUST_UTF8 + const ER_TABLE_EXISTS_ERROR + const ER_TABLE_MUST_HAVE_COMMENT + const ER_TABLE_MUST_HAVE_PK + const ER_TABLE_NOT_EXISTED_ERROR + const ER_TABLE_PREFIX + const ER_TEMP_TABLE_TMP_PREFIX + const ER_TEXT_NOT_NULLABLE_ERROR + const ER_TIMESTAMP_DEFAULT + const ER_TOO_LONG_BAKDB_NAME + const ER_TOO_LONG_IDENT + const ER_TOO_LONG_INDEX_COMMENT + const ER_TOO_LONG_KEY + const ER_TOO_MANY_KEYS + const ER_TOO_MANY_KEY_PARTS + const ER_TOO_MUCH_AUTO_DATETIME_COLS + const ER_TOO_MUCH_AUTO_TIMESTAMP_COLS + const ER_TRUNCATED_WRONG_VALUE + const ER_UDPATE_TOO_MUCH_ROWS + const ER_UNKNOWN_CHARACTER_SET + const ER_UNKNOWN_COLLATION + const ER_UNKNOWN_SYSTEM_VARIABLE + const ER_UNKNOWN_TABLE + const ER_USERNAME + const ER_USE_ENUM + const ER_USE_TEXT_OR_BLOB + const ER_VARCHAR_TO_TEXT_LEN + const ER_VIEW_SELECT_CLAUSE + const ER_WITH_DEFAULT_ADD_COLUMN + const ER_WITH_INSERT_FIELD + const ER_WITH_INSERT_VALUES + const ER_WITH_LIMIT_CONDITION + const ER_WITH_ORDERBY_CONDITION + const ER_WRONG_ARGUMENTS + const ER_WRONG_AUTO_KEY + const ER_WRONG_COLUMN_NAME + const ER_WRONG_DB_NAME + const ER_WRONG_KEY_COLUMN + const ER_WRONG_NAME_FOR_INDEX + const ER_WRONG_STRING_LENGTH + const ER_WRONG_SUB_KEY + const ER_WRONG_TABLE_NAME + const ER_WRONG_VALUE_COUNT_ON_ROW + const ER_WRONG_VALUE_FOR_VAR + const ErCantChangeColumn + const ErCantChangeColumnPosition + const ErrCannotAddForeign + const ErrCantRemoveAllFields + const ErrCharsetNotSupport + const ErrCollationNotSupport + const ErrColumnsMustHaveIndex + const ErrColumnsMustHaveIndexTypeErr + const ErrDataTooLong + const ErrEngineNotSupport + const ErrFieldNotInGroupBy + const ErrFkDupName + const ErrFloatDoubleToDecimal + const ErrIdentifierUpper + const ErrImplicitTypeConversion + const ErrJoinNoOnCondition + const ErrJsonTypeSupport + const ErrMixOfGroupFuncAndFields + const ErrNonUniqTable + const ErrNotFoundMasterStatus + const ErrNotFoundTableInfo + const ErrNotFoundThreadId + const ErrTableCollationNotSupport + const ErrUseValueExpr + const ErrWrongAndExpr + const ErrWrongFkDefWithMatch + const ErrWrongUsage + func (e ErrorCode) String() string + type ExplainInfo struct + Count float32 + Extra string + Filtered float32 + Key string + KeyLen string + Partitions string + PossibleKeys string + Ref string + Rows int + SelectType string + Table string + Type string + type FieldInfo struct + Collation string + Comment string + Default *string + Extra string + Field string + IsDeleted bool + IsNew bool + Key string + Null string + Privileges string + Tp *types.FieldType + Type string + type IndexInfo struct + ColumnName string + IndexName string + IndexType string + IsDeleted bool + NonUnique int + Seq int + Table string + type LevelSets struct + func NewLevelSets(count int) *LevelSets + func (s *LevelSets) Append(name string, value int64, desc string) + func (s *LevelSets) Rows() []sqlexec.RecordSet + type MasterStatus struct + BinlogDoDB string + BinlogIgnoreDB string + ExecutedGtidSet string + File string + Position int + type MyRecordSets struct + MaxLevel uint8 + SeqNo int + func NewRecordSets() *MyRecordSets + func (s *MyRecordSets) All() []*Record + func (s *MyRecordSets) Append(r *Record) + func (s *MyRecordSets) Next() *Record + func (s *MyRecordSets) Rows() []sqlexec.RecordSet + type PrintRecord struct + ErrLevel uint8 + ErrorMessage string + ID int + QueryTree string + SQL string + func (r *PrintRecord) List() []interface{} + type PrintSets struct + func NewPrintSets() *PrintSets + func (s *PrintSets) Append(errLevel int64, sql, tree, errmsg string) + func (s *PrintSets) Rows() []sqlexec.RecordSet + type ProcessListSets struct + func NewOscProcessListSets(count int, hideCommand bool) *ProcessListSets + func NewProcessListSets(count int) *ProcessListSets + func (s *ProcessListSets) Rows() []sqlexec.RecordSet + type Record struct + AffectedRows int + BackupCostTime string + BackupDBName string + Buf *bytes.Buffer + DBName string + DDLRollback string + EndFile string + EndPosition int + ErrLevel uint8 + ErrorMessage string + ExecComplete bool + ExecTime string + ExecTimestamp int64 + MultiTables map[string]*TableInfo + OPID string + SeqNo int + Sql string + Sqlsha1 string + Stage byte + StageStatus byte + StartFile string + StartPosition int + TableInfo *TableInfo + TableName string + ThreadId uint32 + Type ast.StmtNode + UseOsc bool + func (r *Record) List() []interface{} + type Rewrite struct + SQL string + Stmt sqlparser.Statement + func NewRewrite(sql string) (*Rewrite, error) + func (rw *Rewrite) Rewrite() error + func (rw *Rewrite) RewriteDML2Select() error + func (rw *Rewrite) TestSelect2Count() string + type SQLError struct + Code ErrorCode + Message string + func NewErr(errCode ErrorCode, args ...interface{}) *SQLError + func NewErrf(format string, args ...interface{}) *SQLError + func (e *SQLError) Error() string + type Session interface + AffectedRows func() uint64 + Audit func(ctx context.Context, sql string) ([]Record, error) + Auth func(user *auth.UserIdentity, auth []byte, salt []byte) bool + CheckStmt func(ctx context.Context, stmtNode ast.StmtNode, currentSQL string) ([]sqlexec.RecordSet, error) + Execute func(context.Context, string) ([]Record, error) + ExecuteInc func(context.Context, string) ([]sqlexec.RecordSet, error) + GetAlterTablePostPart func(sql string, isPtOSC bool) string + LoadOptions func(opt SourceOptions) error + Print func(ctx context.Context, sql string) ([]PrintRecord, error) + QueryTree func(ctx context.Context, sql string) ([]PrintRecord, error) + RunExecute func(ctx context.Context, sql string) ([]Record, error) + SetCollation func(coID int) error + SetConnectionID func(uint64) + SetProcessInfo func(string, time.Time, byte) + SetSessionManager func(util.SessionManager) + ShowProcess func() util.ProcessInfo + Split func(ctx context.Context, sql string) ([]SplitRecord, error) + func CreateSession(store kv.Storage) (Session, error) + func CreateSession4Test(store kv.Storage) (Session, error) + func NewInception() Session + type SourceOptions struct + Backup bool + Check bool + DB string + Execute bool + Fingerprint bool + Host string + IgnoreWarnings bool + MiddlewareDB string + MiddlewareExtend string + ParseHost string + ParsePort int + Password string + Port int + Print bool + RealRowCount bool + Sleep int + SleepRows int + Split bool + Ssl string + SslCA string + SslCert string + SslKey string + TranBatch int + User string + type SplitRecord struct + ErrLevel uint8 + ErrorMessage string + ID int + IsDDL bool + SQL string + func (r *SplitRecord) List() []interface{} + type SplitSets struct + func NewSplitSets() *SplitSets + func (s *SplitSets) Append(sql string, errmsg string) + func (s *SplitSets) CurrentId() int64 + func (s *SplitSets) Increment() + func (s *SplitSets) Rows() []sqlexec.RecordSet + type TableInfo struct + AlterCount int + AsName string + Collation string + Fields []FieldInfo + Indexes []*IndexInfo + IsClear bool + IsCreated bool + IsDeleted bool + IsNew bool + IsNewColumns bool + Name string + Schema string + TableSize uint + type TxnState struct + func (st *TxnState) Commit(ctx context.Context) error + func (st *TxnState) Delete(k kv.Key) error + func (st *TxnState) Get(k kv.Key) ([]byte, error) + func (st *TxnState) Rollback() error + func (st *TxnState) Seek(k kv.Key) (kv.Iterator, error) + func (st *TxnState) SeekReverse(k kv.Key) (kv.Iterator, error) + func (st *TxnState) Set(k kv.Key, v []byte) error + func (st *TxnState) String() string + func (st *TxnState) Valid() bool + type VariableSets struct + func NewVariableSets(count int) *VariableSets + func (s *VariableSets) Append(name string, value string) + func (s *VariableSets) Rows() []sqlexec.RecordSet