# Functions
AddGSetWithPurged is used to handle this case: https://github.com/pingcap/dm/issues/1418 we might get a gtid set from Previous_gtids event in binlog, but that gtid set can't be used to start a gtid sync because it doesn't cover all gtid_purged.
AddSuffixForUUID adds a suffix for UUID.
AdjustBinaryProtocolForDatum converts the data in binlog to TiDB datum.
AdjustSQLModeCompatible adjust downstream sql mode to compatible.
CollectDirFiles gets files in path.
CompareShardingDDLs compares s and t ddls only concern in content, ignore order of ddl.
DecodeBinlogPosition parses a mysql.Position from string format.
Decrypt tries to decrypt base64 encoded ciphertext to plaintext.
DecryptOrPlaintext tries to decrypt base64 encoded ciphertext to plaintext or return plaintext.
Encrypt tries to encrypt plaintext to base64 encoded ciphertext.
ExtractDBAndTableFromLockID extract schema and table from lockID.
ExtractTaskFromLockID extract task from lockID.
ExtractTiDBVersion extract tidb's version version format: "5.7.25-TiDB-v3.0.0-beta-211-g09beefbe0-dirty" ^~~~~~~~~^.
FetchAllDoTables returns all need to do tables after filtered (fetches from upstream MySQL).
FetchLowerCaseTableNamesSetting return the `lower_case_table_names` setting of target db.
FetchTargetDoTables returns all need to do tables after filtered and routed (fetches from upstream MySQL).
GenDDLLockID returns lock ID used in shard-DDL.
GenFakeRotateEvent generates a fake ROTATE_EVENT without checksum ref: https://github.com/mysql/mysql-server/blob/4f1d7cf5fcb11a3f84cff27e37100d7295e7d5ca/sql/rpl_binlog_sender.cc#L855.
GenHashKey generates key with crc32 algorithm.
GenTableID generates table ID.
GetAllServerID gets all slave server id and master server id.
GetDBFromDumpFilename extracts db name from dump filename.
GetFileSize return the size of the file.
GetFlavor gets flavor from DB.
GetGlobalVariable gets server's global variable.
GetGTIDMode return GTID_MODE.
GetMariaDBGTID gets MariaDB's `gtid_binlog_pos` it can not get by `SHOW MASTER STATUS`.
GetMariaDBGtidDomainID gets MariaDB server's `gtid_domain_id`.
GetMariaDBUUID gets equivalent `server_uuid` for MariaDB `gtid_domain_id` joined `server_id` with domainServerIDSeparator.
GetMasterStatus gets status from master.
GetParser gets a parser for sql.DB which is suitable for session variable sql_mode.
GetParserForConn gets a parser for sql.Conn which is suitable for session variable sql_mode.
GetParserFromSQLModeStr gets a parser and applies given sqlMode.
GetRandomServerID gets a random server ID which is not used.
GetRawInfo do what its name tells.
GetServerID gets server's `server_id`.
GetServerUnixTS gets server's `UNIX_TIMESTAMP()`.
GetServerUUID gets server's `server_uuid`.
GetSessionVariable gets connection's session variable.
GetSlaveServerID gets all slave server id.
GetSQLModeStrBySQLMode get string represent of sql_mode by sql_mode.
GetStorageSize gets storage's capacity and available size.
GetSuffixUUID gets UUID (with suffix) by UUID (without suffix) when multi UUIDs (without suffix) are the same, the newest will be return.
GetTableFromDumpFilename extracts db and table name from dump filename.
GetUUIDBySuffix gets UUID from uuids by suffix.
HidePassword replace password with ******.
IgnoreErrorCheckpoint is used in checkpoint update.
IsBuildInSkipDDL return true when checked sql that will be skipped for syncer.
IsContextCanceledError checks whether err is context.Canceled.
IsDirExists checks if dir exists.
IsErrBinlogPurged checks whether err is BinlogPurged error.
IsFakeRotateEvent return true if is this event is a fake rotate event If log pos equals zero then the received event is a fake rotate event and contains only a name of the next binlog file See https://github.com/mysql/mysql-server/blob/8e797a5d6eb3a87f16498edcb7261a75897babae/sql/rpl_binlog_sender.h#L235 and https://github.com/mysql/mysql-server/blob/8cc757da3d87bf4a1f07dcfb2d3c96fed3806870/sql/rpl_binlog_sender.cc#L899.
IsFileExists checks if file exists.
IsMySQLError checks whether err is MySQLError error.
IsNoSuchThreadError checks whether err is NoSuchThreadError.
KillConn kills the DB connection (thread in mysqld).
NonRepeatStringsEqual is used to compare two un-ordered, non-repeat-element string slice is equal.
ParseSuffixForUUID parses UUID (with suffix) to (UUID without suffix, suffix) pair.
ParseUUIDIndex parses server-uuid.index.
PrintInfo prints some information of the app, like git hash, binary build time, etc.
PrintInfo2 print app's info to stdout.
SuffixIntToStr convert int-represented suffix to string-represented.
TrimCtrlChars returns a slice of the string s with all leading and trailing control characters removed.
TrimQuoteMark tries to trim leading and tailing quote(") mark if exists only trim if leading and tailing quote matched as a pair.
TruncateInterface converts the interface to a string and returns a string with only the leading (at most) n runes of the input string.
TruncateString returns a string with only the leading (at most) n runes of the input string.
UnpackTableID unpacks table ID to <schema, table> pair.
UnwrapScheme removes http or https scheme from input.
WaitSomething waits for something done with `true`.
WrapSchemes adds http or https scheme to input if missing.
WrapSchemesForInitialCluster acts like WrapSchemes, except input is "name=URL,...".
WriteFileAtomic writes file to temp and atomically move when everything else succeeds.
# Constants
DefaultDBTimeout represents a DB operation timeout for common usages.
LCTableNamesInsensitive represent lower_case_table_names = 1, case insensitive.
LCTableNamesMixed represent lower_case_table_names = 2, table names are case-sensitive, but case-insensitive in usage.
LCTableNamesSensitive represent lower_case_table_names = 0, case sensitive.
# Variables
Version information.
Version information.
Version information.
Version information.
not support to config yet.
OsExit is function placeholder for os.Exit.
Version information.
UTCSession can be used as a sessionctx.Context, with UTC timezone.
not support to config yet.
# Structs
StorageSize represents the storage's capacity and available size Learn from tidb-binlog source code.
# Type aliases
LowerCaseTableNamesFlavor represents the type of db `lower_case_table_names` settings.