This flag will be set for all modern clients. Some old clients expect to receive only 1 byte of flags in the field definition record, while the newer ones expect 2 bytes. If this flag is cleared, the client is old and wants only 1 byte for field flags. This flag will also be set by the modern server to indicate that it is capable of sending the field definition in the new format with 2 bytes for field flags. Old servers (pre-3.23) will not report having this capability.
CLIENT_CONNECT_WITH_DB
0x0008
This flag is also set for all modern clients and servers. It indicates that the initial default database can be specified during authentication.
CLIENT_NO_SCHEMA
0x0010
If set, the client is asking the server to consider the syntax db_name.table_name.col_namean error. This syntax is normally accepted.
CLIENT_COMPRESS
0x0020
When set, indicates that the client or the server is capable of using the compressed protocol.
CLIENT_ODBC
0x0040
Apparently was created to indicate that the client is an ODBC client. At this point, it does not appear to be used.
CLIENT_LOCAL_FILES
0x0080
When set, indicates that the client is capable of uploading local files with LOAD DATA LOCALINFILE.
CLIENT_IGNORE_SPACE
0x0100
When set, communicates to the server that the parser should ignore the space characters between identifiers and subsequent ‘.’ or ‘(’ characters. This flag enables syntax such as: db_name .table_name or length (str) which would normally be illegal.
CLIENT_PROTOCOL_41
0x0200
When set, indicates that the client or the server is capable of using the new protocol that was introduced in version 4.1.
CLIENT_INTERACTIVE
0x0400
When set, the client is communicating to the server that it is accepting commands directly from a human. For the server, this means that a different inactivity timeout value should be applied. The server has two settings: wait_timout and interactive_timeout. The former is for regular clients, while the latter is for the interactive ones. This distinction was created to deal with applications using buggy persistent connection pools that would lose track of established connections without closing them first, keep creating new ones, and eventually overflow the server max_connectionslimit. The workaround was to set wait_timeoutto a low value that would disconnect the lost connections sooner. This, unfortunately, had a side effect of disconnecting interactive clients too soon, which was solved by giving them a separate timeout.
Table 4-5. Protocol capability bits (continued)
Bit macro symbol
Hex value
Description
CLIENT_SSL
0x0800
When set, indicates the capability of the client or the server to use SSL.
CLIENT_IGNORE_SIGPIPE
0x1000
Used internally in the client code in versions 3.23 and 4.0. SIGPIPEis a Unix signal sent to a process when the socket or the pipe it is writing to has already been closed by the peer. However, a thread in a threaded application on some platforms may get a SIGPIPEsignal spuriously under some circumstances. Versions 3.23 and 4.0 permit the client pro-grammer to choose whether SIGPIPEshould be ignored. Version 4.1 just blocks it during the client initialization and does not worry about the issue from that point on.
CLIENT_TRANSACTIONS
0x2000
When set in the packet coming from the server, indicates that the server supports transactions and is capable of report-ing transaction status. When present in the client packet, indicates that the client is aware of servers that support transactions.
CLIENT_RESERVED
0x4000
Not used.
CLIENT_SECURE_CONNECTION
0x8000
When set, indicates that the client or the server can authenti-cate using the new SHA1 method introduced in 4.1.
CLIENT_MULTI_STATEMENTS
0x10000
When set, indicates that the client can send more than one statement in one query, for example:
res = mysql_query(con,"SELECT a FROM t1 WHERE id =1; SELECT b FROM t1 WHERE id=3");
CLIENT_MULTI_RESULTS
0x20000
When set, indicates that the client can receive results from multiple queries in the same statement.
CLIENT_REMEMBER_OPTIONS
0x80000000
Internal flag used inside the client routines. Never sent to the server.