CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rbmysql/constants.rb
Views: 11766
1
# coding: ascii-8bit
2
# Copyright (C) 2003-2008 TOMITA Masahiro
3
# mailto:[email protected]
4
5
class RbMysql
6
# Command
7
COM_SLEEP = 0
8
COM_QUIT = 1
9
COM_INIT_DB = 2
10
COM_QUERY = 3
11
COM_FIELD_LIST = 4
12
COM_CREATE_DB = 5
13
COM_DROP_DB = 6
14
COM_REFRESH = 7
15
COM_SHUTDOWN = 8
16
COM_STATISTICS = 9
17
COM_PROCESS_INFO = 10
18
COM_CONNECT = 11
19
COM_PROCESS_KILL = 12
20
COM_DEBUG = 13
21
COM_PING = 14
22
COM_TIME = 15
23
COM_DELAYED_INSERT = 16
24
COM_CHANGE_USER = 17
25
COM_BINLOG_DUMP = 18
26
COM_TABLE_DUMP = 19
27
COM_CONNECT_OUT = 20
28
COM_REGISTER_SLAVE = 21
29
COM_STMT_PREPARE = 22
30
COM_STMT_EXECUTE = 23
31
COM_STMT_SEND_LONG_DATA = 24
32
COM_STMT_CLOSE = 25
33
COM_STMT_RESET = 26
34
COM_SET_OPTION = 27
35
COM_STMT_FETCH = 28
36
COM_DAEMON = 29
37
COM_BINLOG_DUMP_GTID = 30
38
COM_RESET_CONNECTION = 31
39
40
# Client flag
41
CLIENT_LONG_PASSWORD = 1 # new more secure passwords
42
CLIENT_FOUND_ROWS = 1 << 1 # Found instead of affected rows
43
CLIENT_LONG_FLAG = 1 << 2 # Get all column flags
44
CLIENT_CONNECT_WITH_DB = 1 << 3 # One can specify db on connect
45
CLIENT_NO_SCHEMA = 1 << 4 # Don't allow database.table.column
46
CLIENT_COMPRESS = 1 << 5 # Can use compression protocol
47
CLIENT_ODBC = 1 << 6 # Odbc client
48
CLIENT_LOCAL_FILES = 1 << 7 # Can use LOAD DATA LOCAL
49
CLIENT_IGNORE_SPACE = 1 << 8 # Ignore spaces before '('
50
CLIENT_PROTOCOL_41 = 1 << 9 # New 4.1 protocol
51
CLIENT_INTERACTIVE = 1 << 10 # This is an interactive client
52
CLIENT_SSL = 1 << 11 # Switch to SSL after handshake
53
CLIENT_IGNORE_SIGPIPE = 1 << 12 # IGNORE sigpipes
54
CLIENT_TRANSACTIONS = 1 << 13 # Client knows about transactions
55
CLIENT_RESERVED = 1 << 14 # Old flag for 4.1 protocol
56
CLIENT_SECURE_CONNECTION = 1 << 15 # New 4.1 authentication
57
CLIENT_MULTI_STATEMENTS = 1 << 16 # Enable/disable multi-stmt support
58
CLIENT_MULTI_RESULTS = 1 << 17 # Enable/disable multi-results
59
CLIENT_PS_MULTI_RESULTS = 1 << 18 # Multi-results in PS-protocol
60
CLIENT_PLUGIN_AUTH = 1 << 19 # Client supports plugin authentication
61
CLIENT_CONNECT_ATTRS = 1 << 20 # Client supports connection attribute
62
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA = 1 << 21 # Enable authentication response packet to be larger than 255 bytes.
63
CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS = 1 << 22 # Don't close the connection for a connection with expired password.
64
CLIENT_SESSION_TRACK = 1 << 23 # Capable of handling server state change information. Its a hint to the server to include the state change information in Ok packet.
65
CLIENT_DEPRECATE_EOF = 1 << 24 # Client no longer needs EOF packet
66
CLIENT_SSL_VERIFY_SERVER_CERT = 1 << 30
67
CLIENT_REMEMBER_OPTIONS = 1 << 31
68
69
# Connection Option
70
OPT_CONNECT_TIMEOUT = 0
71
OPT_COMPRESS = 1
72
OPT_NAMED_PIPE = 2
73
INIT_COMMAND = 3
74
READ_DEFAULT_FILE = 4
75
READ_DEFAULT_GROUP = 5
76
SET_CHARSET_DIR = 6
77
SET_CHARSET_NAME = 7
78
OPT_LOCAL_INFILE = 8
79
OPT_PROTOCOL = 9
80
SHARED_MEMORY_BASE_NAME = 10
81
OPT_READ_TIMEOUT = 11
82
OPT_WRITE_TIMEOUT = 12
83
OPT_USE_RESULT = 13
84
OPT_USE_REMOTE_CONNECTION = 14
85
OPT_USE_EMBEDDED_CONNECTION = 15
86
OPT_GUESS_CONNECTION = 16
87
SET_CLIENT_IP = 17
88
SECURE_AUTH = 18
89
REPORT_DATA_TRUNCATION = 19
90
OPT_RECONNECT = 20
91
OPT_SSL_VERIFY_SERVER_CERT = 21
92
93
# Server Option
94
OPTION_MULTI_STATEMENTS_ON = 0
95
OPTION_MULTI_STATEMENTS_OFF = 1
96
97
# Server Status
98
SERVER_STATUS_IN_TRANS = 1
99
SERVER_STATUS_AUTOCOMMIT = 1 << 1
100
SERVER_MORE_RESULTS_EXISTS = 1 << 3
101
SERVER_QUERY_NO_GOOD_INDEX_USED = 1 << 4
102
SERVER_QUERY_NO_INDEX_USED = 1 << 5
103
SERVER_STATUS_CURSOR_EXISTS = 1 << 6
104
SERVER_STATUS_LAST_ROW_SENT = 1 << 7
105
SERVER_STATUS_DB_DROPPED = 1 << 8
106
SERVER_STATUS_NO_BACKSLASH_ESCAPES = 1 << 9
107
SERVER_STATUS_METADATA_CHANGED = 1 << 10
108
SERVER_QUERY_WAS_SLOW = 1 << 11
109
SERVER_PS_OUT_PARAMS = 1 << 12
110
SERVER_STATUS_IN_TRANS_READONLY = 1 << 13
111
SERVER_SESSION_STATE_CHANGED = 1 << 14
112
113
# Refresh parameter
114
REFRESH_GRANT = 1
115
REFRESH_LOG = 1 << 1
116
REFRESH_TABLES = 1 << 2
117
REFRESH_HOSTS = 1 << 3
118
REFRESH_STATUS = 1 << 4
119
REFRESH_THREADS = 1 << 5
120
REFRESH_SLAVE = 1 << 6
121
REFRESH_MASTER = 1 << 7
122
REFRESH_ERROR_LOG = 1 << 8
123
REFRESH_ENGINE_LOG = 1 << 9
124
REFRESH_BINARY_LOG = 1 << 10
125
REFRESH_RELAY_LOG = 1 << 11
126
REFRESH_GENERAL_LOG = 1 << 12
127
REFRESH_SLOW_LOG = 1 << 13
128
REFRESH_READ_LOCK = 1 << 14
129
REFRESH_FAST = 1 << 15
130
REFRESH_QUERY_CACHE = 1 << 16
131
REFRESH_QUERY_CACHE_FREE = 1 << 17
132
REFRESH_DES_KEY_FILE = 1 << 18
133
REFRESH_USER_RESOURCES = 1 << 19
134
REFRESH_FOR_EXPORT = 1 << 20
135
REFRESH_OPTIMIZER_COSTS = 1 << 21
136
137
class Field
138
# Field type
139
TYPE_DECIMAL = 0
140
TYPE_TINY = 1
141
TYPE_SHORT = 2
142
TYPE_LONG = 3
143
TYPE_FLOAT = 4
144
TYPE_DOUBLE = 5
145
TYPE_NULL = 6
146
TYPE_TIMESTAMP = 7
147
TYPE_LONGLONG = 8
148
TYPE_INT24 = 9
149
TYPE_DATE = 10
150
TYPE_TIME = 11
151
TYPE_DATETIME = 12
152
TYPE_YEAR = 13
153
TYPE_NEWDATE = 14
154
TYPE_VARCHAR = 15
155
TYPE_BIT = 16
156
TYPE_TIMESTAMP2 = 17
157
TYPE_DATETIME2 = 18
158
TYPE_TIME2 = 19
159
TYPE_JSON = 245
160
TYPE_NEWDECIMAL = 246
161
TYPE_ENUM = 247
162
TYPE_SET = 248
163
TYPE_TINY_BLOB = 249
164
TYPE_MEDIUM_BLOB = 250
165
TYPE_LONG_BLOB = 251
166
TYPE_BLOB = 252
167
TYPE_VAR_STRING = 253
168
TYPE_STRING = 254
169
TYPE_GEOMETRY = 255
170
TYPE_CHAR = TYPE_TINY
171
TYPE_INTERVAL = TYPE_ENUM
172
173
# Flag
174
NOT_NULL_FLAG = 1
175
PRI_KEY_FLAG = 2
176
UNIQUE_KEY_FLAG = 4
177
MULTIPLE_KEY_FLAG = 8
178
BLOB_FLAG = 16
179
UNSIGNED_FLAG = 32
180
ZEROFILL_FLAG = 64
181
BINARY_FLAG = 128
182
ENUM_FLAG = 256
183
AUTO_INCREMENT_FLAG = 512
184
TIMESTAMP_FLAG = 1024
185
SET_FLAG = 2048
186
NO_DEFAULT_VALUE_FLAG = 4096
187
ON_UPDATE_NOW_FLAG = 8192
188
NUM_FLAG = 32768
189
PART_KEY_FLAG = 16384
190
GROUP_FLAG = 32768
191
UNIQUE_FLAG = 65536
192
BINCMP_FLAG = 131072
193
end
194
195
class Stmt
196
# Cursor type
197
CURSOR_TYPE_NO_CURSOR = 0
198
CURSOR_TYPE_READ_ONLY = 1
199
CURSOR_TYPE_FOR_UPDATE = 2
200
CURSOR_TYPE_SCROLLABLE = 4
201
end
202
end
203