This repository was archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathCapabilities.java
104 lines (77 loc) · 3.83 KB
/
Capabilities.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* Copyright 2018-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.miku.r2dbc.mysql.constant;
/**
* Values for the capabilities flag bitmask used by the MySQL Client/Server Protocol.
*/
public final class Capabilities {
/**
* Can use long password.
*/
private static final int LONG_PASSWORD = 1;
// public static final int FOUND_ROWS = 2; // Return found rows instead of affected rows, should not enable this.
/**
* Get all column.
*/
private static final int LONG_FLAG = 4;
public static final int CONNECT_WITH_DB = 8;
// public static final int NO_SCHEMA = 16; // Don't allows statement like {@code database.table.column}.
// public static final int COMPRESS = 32; // The deflate compression, old compression flag.
// public static final int ODBC = 64; // Is this client ODBC?
// public static final int LOCAL_FILES = 128; // Can use local data
// public static final int IGNORE_SPACE = 256; // Ignore spaces before '('.
public static final int PROTOCOL_41 = 512;
// public static final int INTERACTIVE_CLIENT = 1024; // Does this client is interactive? (answer is no)
public static final int SSL = 2048;
private static final int IGNORE_SIGPIPE = 4096;
public static final int TRANSACTIONS = 8192;
/**
* Old flag for PROTOCOL_41.
*/
private static final int RESERVED = 16384;
/**
* Can do 4.1 authentication, is also RESERVED2, allowing second part of authentication hashing salt.
*/
public static final int SECURE_CONNECTION = 32768;
public static final int MULTI_STATEMENTS = 65536;
private static final int MULTI_RESULTS = 1 << 17;
private static final int PREPARED_MULTI_RESULTS = 1 << 18;
public static final int PLUGIN_AUTH = 1 << 19;
public static final int CONNECT_ATTRS = 1 << 20;
/**
* Can use var int sized bytes to encode client data.
*/
public static final int PLUGIN_AUTH_VAR_INT_SIZED_DATA = 1 << 21;
// public static final int HANDLE_EXPIRED_PASSWORD = 1 << 22; // Client can handle expired passwords.
// public static final int SESSION_TRACK = 1 << 23;
/**
* WARNING: should ALWAYS enable this option. MySQL recommends deprecating EOF messages.
*/
public static final int DEPRECATE_EOF = 1 << 24;
// public static final int OPTIONAL_RESULT_SET_METADATA = 1 << 25; // means server MAYBE have NOT metadata in response, should NEVER enable this option.
// public static final int Z_STD_COMPRESSION = 1 << 26;
// public static final int CAPABILITY_EXTENSION = 1 << 29;
public static final int SSL_VERIFY_SERVER_CERT = 1 << 30;
// public static final int REMEMBER_OPTIONS = 1 << 31;
public static final int ALL_SUPPORTED = Capabilities.LONG_PASSWORD | Capabilities.LONG_FLAG |
Capabilities.CONNECT_WITH_DB | Capabilities.PROTOCOL_41 | Capabilities.SSL | Capabilities.IGNORE_SIGPIPE |
Capabilities.TRANSACTIONS | Capabilities.RESERVED | Capabilities.SECURE_CONNECTION |
Capabilities.MULTI_STATEMENTS | Capabilities.MULTI_RESULTS | Capabilities.PREPARED_MULTI_RESULTS |
Capabilities.PLUGIN_AUTH | Capabilities.CONNECT_ATTRS | Capabilities.PLUGIN_AUTH_VAR_INT_SIZED_DATA |
Capabilities.DEPRECATE_EOF | Capabilities.SSL_VERIFY_SERVER_CERT;
private Capabilities() {
}
}