rbdc_mysql/protocol/
capabilities.rs

1// https://dev.mysql.com/doc/dev/mysql-server/8.0.12/group__group__cs__capabilities__flags.html
2// https://mariadb.com/kb/en/library/connection/#capabilities
3bitflags::bitflags! {
4    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
5    pub struct Capabilities: u64 {
6        // [MariaDB] MySQL compatibility
7        const MYSQL = 1;
8
9        // [*] Send found rows instead of affected rows in EOF_Packet.
10        const FOUND_ROWS = 2;
11
12        // Get all column flags.
13        const LONG_FLAG = 4;
14
15        // [*] Database (schema) name can be specified on connect in Handshake Response Packet.
16        const CONNECT_WITH_DB = 8;
17
18        // Don't allow database.table.column
19        const NO_SCHEMA = 16;
20
21        // [*] Compression protocol supported
22        const COMPRESS = 32;
23
24        // Special handling of ODBC behavior.
25        const ODBC = 64;
26
27        // Can use LOAD DATA LOCAL
28        const LOCAL_FILES = 128;
29
30        // [*] Ignore spaces before '('
31        const IGNORE_SPACE = 256;
32
33        // [*] New 4.1+ protocol
34        const PROTOCOL_41 = 512;
35
36        // This is an interactive client
37        const INTERACTIVE = 1024;
38
39        // Use SSL encryption for this session
40        const SSL = 2048;
41
42        // Client knows about transactions
43        const TRANSACTIONS = 8192;
44
45        // 4.1+ authentication
46        const SECURE_CONNECTION = (1 << 15);
47
48        // Enable/disable multi-statement support for COM_QUERY *and* COM_STMT_PREPARE
49        const MULTI_STATEMENTS = (1 << 16);
50
51        // Enable/disable multi-results for COM_QUERY
52        const MULTI_RESULTS = (1 << 17);
53
54        // Enable/disable multi-results for COM_STMT_PREPARE
55        const PS_MULTI_RESULTS = (1 << 18);
56
57        // Client supports plugin authentication
58        const PLUGIN_AUTH = (1 << 19);
59
60        // Client supports connection attributes
61        const CONNECT_ATTRS = (1 << 20);
62
63        // Enable authentication response packet to be larger than 255 bytes.
64        const PLUGIN_AUTH_LENENC_DATA = (1 << 21);
65
66        // Don't close the connection for a user account with expired password.
67        const CAN_HANDLE_EXPIRED_PASSWORDS = (1 << 22);
68
69        // Capable of handling server state change information.
70        const SESSION_TRACK = (1 << 23);
71
72        // Client no longer needs EOF_Packet and will use OK_Packet instead.
73        const DEPRECATE_EOF = (1 << 24);
74
75        // Support ZSTD protocol compression
76        const ZSTD_COMPRESSION_ALGORITHM = (1 << 26);
77
78        // Verify server certificate
79        const SSL_VERIFY_SERVER_CERT = (1 << 30);
80
81        // The client can handle optional metadata information in the resultset
82        const OPTIONAL_RESULTSET_METADATA = (1 << 25);
83
84        // Don't reset the options after an unsuccessful connect
85        const REMEMBER_OPTIONS = (1 << 31);
86    }
87}