Mapping from types used in SQL queries | |||
---|---|---|---|
MySQL type | Core type | Example code | Variable operators |
BIGINT | int64 | int64 val = fields[n].GetInt64(); |
%I64d (Capital i) |
BIGINT UNSIGNED | uint64 | uint64 val = fields[n].GetUInt64();
|
%I64u (Capital i) |
INT | int32 | int32 val = fields[n].GetInt32();
|
%u |
INT UNSIGNED | uint32 | uint32 val = fields[n].GetUInt32();
|
%u |
MEDIUMINT | int32 | int32 val = fields[n].GetInt32();
|
%u |
MEDIUMINT UNSIGNED | uint32 | uint32 val = fields[n].GetUInt32();
|
%u |
SMALLINT | int16 | int16 val = fields[n].GetInt16();
|
|
SMALLINT UNSIGNED | uint16 | uint16 val = fields[n].GetUInt16();
|
|
TINYINT | int8 | int16 val = fields[n].GetInt16();
|
|
TINYINT UNSIGNED | uint8 | uint8 val = fields[n].GetUInt8();
|
|
FLOAT | float | float val = fields[n].GetFLOAT(); |
|
FLOAT UNSIGNED | |||
DOUBLE | double | double val = fields[n].GetDouble(); |
|
DOUBLE UNSIGNED | |||
text |
string (std::string) or cstring (char const*) |
|
%s |
longtext | %s | ||
tinytext | %s | ||
char(k) | %s | ||
VARCHAR(k) | %s | ||
blob | %s | ||
COUNT(x) | uint64 | uint64 count = fields[n].GetUInt64();
|
%UI64FMT* |
MAX(x) | uint32 or int32 |
|
%u |
MIN(x) | %u | ||
SUM(x) |
string (std::string) or cstring (char const*) |
|
%s
%s |
UNIX_TIMESTAMP(x) | uint64 | uint64 unix_time = fields[n].GetUInt64(); |
|
1* %UI64FMT does not work with acore_string
Example