Documentation
¶
Index ¶
- Constants
- func EscapeValue(colValue string) string
- func FixedLengthInt(buf []byte) uint64
- func GetFilesFromOS(FilePath string) ([]string, error)
- func GetFixedLength(DataType uint64, FieldLen uint64) uint64
- func GetFixedLengthByMySQLType(MySQLType uint64, FieldLen uint64) uint64
- func GetIntValue(FixLength int, value []byte) interface{}
- func GetMaxLength(MySQLType uint64)
- func GetTimeFormat(data []byte) int
- func GetUintValue(FixLength int, value []byte) uint64
- func MachUllGetMuchCompressedSize(num uint64) uint64
- func MatchGetCompressedSize(n uint64) (uint64, error)
- func MatchParseCompressed(data []byte, pos uint64) (uint64, uint64, error)
- func MatchReadFrom1(b []byte) uint64
- func MatchReadFrom2(b []byte) uint64
- func MatchReadFrom3(b []byte) uint64
- func MatchReadFrom4(b []byte) uint64
- func MatchReadFrom7(b []byte) uint64
- func MatchReadFrom8(b []byte) uint64
- func MatchUllReadComPressed(b []byte, pos *uint64) uint64
- func MatchUllReadMuchCompressed(b []byte) (uint64, error)
- func PageHeaderGetField(b []byte, field uint64) uint64
- func PageIsComp(b []byte) uint64
- func ParseBinaryFloat32(data []byte) float32
- func ParseBinaryFloat64(data []byte) float64
- func ParseBinaryInt16(data []byte) int16
- func ParseBinaryInt24(data []byte) int32
- func ParseBinaryInt32(data []byte) int32
- func ParseBinaryInt64(data []byte) int64
- func ParseBinaryInt8(data []byte) int8
- func ParseBinaryUint16(data []byte) uint16
- func ParseBinaryUint24(data []byte) uint32
- func ParseBinaryUint32(data []byte) uint32
- func ParseBinaryUint64(data []byte) uint64
- func ParseBinaryUint8(data []byte) uint8
- func ParseBlob(data []byte) string
- func ParseData(DataType uint64, MySQLType uint64, data []byte, FieldLen uint64, FixLength int, ...) (interface{}, error)
- func ParseDate(data []byte) string
- func ParseDateTime(data []byte) string
- func ParseDouble(data []byte) float64
- func ParseFloat(data []byte) float32
- func ParseIndex(comp bool, data []byte, pos uint64) (error, uint64)
- func ParseInsertRecord(IsShort bool, data []byte, pos uint64) (error, uint64)
- func ParseTime(data []byte) string
- func ParseTimeStamp(data []byte) string
- func ReadIntoStruct(file *os.File, dest interface{}, size int) error
- func ReadNextBytes(file *os.File, number int) ([]byte, error)
- func Rec1GetFieldEndInfo(d []byte, offset uint64, n uint64) uint64
- func Rec2GetFieldEndInfo(d []byte, offset uint64, n uint64) uint64
- func RecGet1byteOffsFlag(rec []byte, offset uint64) uint64
- func RecGetBitField1(rec []byte, offset uint64, offs uint64, mask uint64, shift uint64) uint64
- func RecGetNthField(rec []byte, offsets []uint64, n int, length *uint64) []byte
- func RecGetNthFieldOffs(offsets []uint64, n int, len *uint64) uint64
- func RecGetStatus(rec []byte, offset uint64) uint64
- func RecOffNFields(offsets *[]uint64) uint64
- func RecOffsDataSize(offsets *[]uint64) uint64
- func RecOffsExtraSize(offsets *[]uint64) uint64
- func RecOffsNthSize(offsets *[]uint64, n int) uint64
- func RecOffsSize(offsets *[]uint64) uint64
- func UtAlignOffset(rec []byte, AlignNo uint64) uint64
- func UtUllCreate(high uint64, low uint64) uint64
Constants ¶
View Source
const ( // The 'MAIN TYPE' of a column // missing column DATA_MISSING uint64 = iota // character varying of the latin1_swedish_ci charset-collation; // note that the MySQL format for this, DATA_BINARY, DATA_VARMYSQL, // is also affected by whether the 'precise type' contains DATA_MYSQL_TRUE_VARCHAR DATA_VARCHAR // fixed length character of the latin1_swedish_ci charset-collation DATA_CHAR // binary string of fixed length DATA_FIXBINARY // binary string DATA_BINARY // binary large object, or a TEXT type; if prtype & DATA_BINARY_TYPE == 0, // then this is actually a TEXT column (or a BLOB created with < 4.0.14; // since column prefix indexes came only in 4.0.14, // the missing flag in BLOBs created before that does not cause any harm) DATA_BLOB // integer: can be any size 1 - 8 bytes DATA_INT // address of the child page in node pointer DATA_SYS_CHILD // system column Data types >= DATA_FLOAT // must be compared using the whole field, not as binary strings DATA_SYS DATA_FLOAT DATA_DOUBLE // decimal number stored as an ASCII string DATA_DECIMAL // any charset varying length char DATA_VARMYSQL // any charset fixed length char NOTE that 4.1.1 used DATA_MYSQL and // DATA_VARMYSQL for all character sets, and the charset-collation for // tables created with it can also be latin1_swedish_ci DATA_MYSQL // dtype_store_for_order_and_null_size() DATA_MTYPE_MAX )
The MySQL InnoDB data type
View Source
const ( MYSQL_TYPE_DECIMAL uint64 = iota MYSQL_TYPE_TINY MYSQL_TYPE_SHORT MYSQL_TYPE_LONG MYSQL_TYPE_FLOAT MYSQL_TYPE_DOUBLE MYSQL_TYPE_NULL MYSQL_TYPE_TIMESTAMP MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24 MYSQL_TYPE_DATE MYSQL_TYPE_TIME MYSQL_TYPE_DATETIME MYSQL_TYPE_YEAR MYSQL_TYPE_NEWDATE MYSQL_TYPE_VARCHAR MYSQL_TYPE_BIT MYSQL_TYPE_TIMESTAMP2 MYSQL_TYPE_DATETIME2 MYSQL_TYPE_TIME2 MYSQL_TYPE_NEWDECIMAL = 246 MYSQL_TYPE_ENUM = 247 MYSQL_TYPE_SET = 248 MYSQL_TYPE_TINY_BLOB = 249 MYSQL_TYPE_MEDIUM_BLOB = 250 MYSQL_TYPE_LONG_BLOB = 251 MYSQL_TYPE_BLOB = 252 MYSQL_TYPE_VAR_STRING = 253 MYSQL_TYPE_STRING = 254 MYSQL_TYPE_GEOMETRY = 255 )
The MySQL Server type
View Source
const ( TinyIntRange = 128 * 2 SmallIntRange = 32768 * 2 IntRange = 2147483648 * 2 )
The MySQL integer data type range.
View Source
const (
MySQLVersion = 5.6
)
Variables ¶
This section is empty.
Functions ¶
func EscapeValue ¶
func GetFilesFromOS ¶
func GetFixedLength ¶
func GetIntValue ¶
func GetMaxLength ¶
func GetMaxLength(MySQLType uint64)
func GetTimeFormat ¶
func GetUintValue ¶
func MatchGetCompressedSize ¶
func MatchParseCompressed ¶
func MatchReadFrom1 ¶
func MatchReadFrom2 ¶
func MatchReadFrom3 ¶
func MatchReadFrom4 ¶
func MatchReadFrom7 ¶
func MatchReadFrom8 ¶
func MatchUllReadComPressed ¶
func PageHeaderGetField ¶
func PageIsComp ¶
func ParseBinaryFloat32 ¶
func ParseBinaryFloat64 ¶
func ParseBinaryInt16 ¶
func ParseBinaryInt24 ¶
func ParseBinaryInt32 ¶
func ParseBinaryInt64 ¶
func ParseBinaryInt8 ¶
func ParseBinaryUint16 ¶
func ParseBinaryUint24 ¶
func ParseBinaryUint32 ¶
func ParseBinaryUint64 ¶
func ParseBinaryUint8 ¶
func ParseData ¶
func ParseData(DataType uint64, MySQLType uint64, data []byte, FieldLen uint64, FixLength int, IsUnsigned bool, IsBinary *bool) (interface{}, error)
TODO: deal with chinese, many character, should provide solutions.
func ParseDateTime ¶
func ParseDouble ¶
func ParseFloat ¶
func ParseInsertRecord ¶
func ParseTimeStamp ¶
func Rec1GetFieldEndInfo ¶
Reference MySQL rec_1_get_field_end_info method.
func Rec2GetFieldEndInfo ¶
Reference MySQL rec_2_get_field_end_info method.
func RecGet1byteOffsFlag ¶
Reference MySQL rec_get_1byte_offs_flag
func RecGetBitField1 ¶
func RecGetNthField ¶
#define rec_get_nth_field(rec, offsets, n, len) \ ((rec) + rec_get_nth_field_offs(offsets, n, len))
func RecGetStatus ¶
Reference MySQL rec_get_status method
func RecOffNFields ¶
Reference MySQL rec_offs_n_fields method.
func RecOffsDataSize ¶
Reference MySQL rec_offs_data_size method.
func RecOffsExtraSize ¶
Reference MySQL rec_offs_extra_size method.
func RecOffsNthSize ¶
Reference MySQL rec_offs_nth_size method.
func UtAlignOffset ¶
Reference MySQL ut_align_offset method
func UtUllCreate ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.