Resultset
You are viewing an old version of this article. View
the current version here.
Resultset
A resultset consist in differents packets :
- Resultset metadata
- 1 Column count packet
- for each column (i.e column_count times)
- if not CLIENT_DEPRECATE_EOF : EOF_Packet
- n resultset row
- ERR_Packet / EOF_Packet
ResultSet metadata
Column count packet
- int<lenenc> column count
Column definition packet
- string<lenenc> catalog (always 'def')
- string<lenenc> schema
- string<lenenc> table alias
- string<lenenc> table
- string<lenenc> column alias
- string<lenenc> column
- int<lenenc> length of fixed fields (=0xC)
- int<2> character set number
- int<4> max. column size
- int<1> Field types
- int<2> Field detail flag
- int<1> decimals
- int<2> - unused -
Field types
0 | MYSQL_TYPE_DECIMAL |
1 | MYSQL_TYPE_TINY |
2 | MYSQL_TYPE_SHORT |
3 | MYSQL_TYPE_LONG, |
4 | MYSQL_TYPE_FLOAT |
5 | MYSQL_TYPE_DOUBLE, |
6 | MYSQL_TYPE_NULL |
7 | MYSQL_TYPE_TIMESTAMP |
8 | MYSQL_TYPE_LONGLONG, |
9 | MYSQL_TYPE_INT24 |
10 | MYSQL_TYPE_DATE |
11 | MYSQL_TYPE_TIME |
12 | MYSQL_TYPE_DATETIME |
13 | MYSQL_TYPE_YEAR |
14 | MYSQL_TYPE_NEWDATE |
15 | MYSQL_TYPE_VARCHAR |
16 | MYSQL_TYPE_BIT |
17 | MYSQL_TYPE_TIMESTAMP2 |
18 | MYSQL_TYPE_DATETIME2 |
19 | MYSQL_TYPE_TIME2 |
246 | MYSQL_TYPE_NEWDECIMAL |
247 | MYSQL_TYPE_ENUM |
248 | MYSQL_TYPE_SET |
249 | MYSQL_TYPE_TINY_BLOB |
250 | MYSQL_TYPE_MEDIUM_BLOB |
251 | MYSQL_TYPE_LONG_BLOB |
252 | MYSQL_TYPE_BLOB |
253 | MYSQL_TYPE_VAR_STRING |
254 | MYSQL_TYPE_STRING |
255 | MYSQL_TYPE_GEOMETRY |
Field detail flag
Field details flag will permit to have indication, like is this field signed ?
Blob flag is not enough to permit to identify if field is a binary flag : char binary and varchar binary are not binary (handle like string), but have the binary flag !
1 | NOT_NULL | field cannot be null |
2 | PRIMARY_KEY | field is a primary key |
4 | UNIQUE_KEY | field is unique |
8 | MULTIPLE_KEY | field is in a multiple key |
16 | BLOB | is this field a Blob |
32 | UNSIGNED | is this field unsigned |
64 | DECIMAL | is this field a decimal |
128 | BINARY_COLLATION | has this field a Binary collation |
256 | ENUM | Field is an enumeration |
512 | AUTO_INCREMENT | field auto-increment |
1024 | TIMESTAMP | field is a timestamp value |
2048 | SET | field is a SET |
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.