MindsDB 25.5.4.2__py3-none-any.whl → 25.6.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of MindsDB might be problematic. Click here for more details.
- mindsdb/__about__.py +1 -1
- mindsdb/api/a2a/agent.py +50 -26
- mindsdb/api/a2a/common/server/server.py +32 -26
- mindsdb/api/a2a/task_manager.py +68 -6
- mindsdb/api/executor/command_executor.py +69 -14
- mindsdb/api/executor/datahub/datanodes/integration_datanode.py +49 -65
- mindsdb/api/executor/datahub/datanodes/mindsdb_tables.py +91 -84
- mindsdb/api/executor/datahub/datanodes/project_datanode.py +29 -48
- mindsdb/api/executor/datahub/datanodes/system_tables.py +35 -61
- mindsdb/api/executor/planner/plan_join.py +67 -77
- mindsdb/api/executor/planner/query_planner.py +176 -155
- mindsdb/api/executor/planner/steps.py +37 -12
- mindsdb/api/executor/sql_query/result_set.py +45 -64
- mindsdb/api/executor/sql_query/steps/fetch_dataframe.py +14 -18
- mindsdb/api/executor/sql_query/steps/fetch_dataframe_partition.py +17 -18
- mindsdb/api/executor/sql_query/steps/insert_step.py +13 -33
- mindsdb/api/executor/sql_query/steps/subselect_step.py +43 -35
- mindsdb/api/executor/utilities/sql.py +42 -48
- mindsdb/api/http/namespaces/config.py +1 -1
- mindsdb/api/http/namespaces/file.py +14 -23
- mindsdb/api/http/namespaces/knowledge_bases.py +132 -154
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_datum.py +12 -28
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/binary_resultset_row_package.py +59 -50
- mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/resultset_row_package.py +9 -8
- mindsdb/api/mysql/mysql_proxy/libs/constants/mysql.py +449 -461
- mindsdb/api/mysql/mysql_proxy/utilities/dump.py +87 -36
- mindsdb/integrations/handlers/bigquery_handler/bigquery_handler.py +219 -28
- mindsdb/integrations/handlers/file_handler/file_handler.py +15 -9
- mindsdb/integrations/handlers/file_handler/tests/test_file_handler.py +43 -24
- mindsdb/integrations/handlers/litellm_handler/litellm_handler.py +10 -3
- mindsdb/integrations/handlers/llama_index_handler/requirements.txt +1 -1
- mindsdb/integrations/handlers/mysql_handler/mysql_handler.py +29 -33
- mindsdb/integrations/handlers/openai_handler/openai_handler.py +277 -356
- mindsdb/integrations/handlers/oracle_handler/oracle_handler.py +74 -51
- mindsdb/integrations/handlers/postgres_handler/postgres_handler.py +305 -98
- mindsdb/integrations/handlers/salesforce_handler/salesforce_handler.py +145 -40
- mindsdb/integrations/handlers/salesforce_handler/salesforce_tables.py +136 -6
- mindsdb/integrations/handlers/snowflake_handler/snowflake_handler.py +352 -83
- mindsdb/integrations/libs/api_handler.py +279 -57
- mindsdb/integrations/libs/base.py +185 -30
- mindsdb/integrations/utilities/files/file_reader.py +99 -73
- mindsdb/integrations/utilities/handler_utils.py +23 -8
- mindsdb/integrations/utilities/sql_utils.py +35 -40
- mindsdb/interfaces/agents/agents_controller.py +226 -196
- mindsdb/interfaces/agents/constants.py +8 -1
- mindsdb/interfaces/agents/langchain_agent.py +42 -11
- mindsdb/interfaces/agents/mcp_client_agent.py +29 -21
- mindsdb/interfaces/agents/mindsdb_database_agent.py +23 -18
- mindsdb/interfaces/data_catalog/__init__.py +0 -0
- mindsdb/interfaces/data_catalog/base_data_catalog.py +54 -0
- mindsdb/interfaces/data_catalog/data_catalog_loader.py +375 -0
- mindsdb/interfaces/data_catalog/data_catalog_reader.py +38 -0
- mindsdb/interfaces/database/database.py +81 -57
- mindsdb/interfaces/database/integrations.py +222 -234
- mindsdb/interfaces/database/log.py +72 -104
- mindsdb/interfaces/database/projects.py +156 -193
- mindsdb/interfaces/file/file_controller.py +21 -65
- mindsdb/interfaces/knowledge_base/controller.py +66 -25
- mindsdb/interfaces/knowledge_base/evaluate.py +516 -0
- mindsdb/interfaces/knowledge_base/llm_client.py +75 -0
- mindsdb/interfaces/skills/custom/text2sql/mindsdb_kb_tools.py +83 -43
- mindsdb/interfaces/skills/skills_controller.py +31 -36
- mindsdb/interfaces/skills/sql_agent.py +113 -86
- mindsdb/interfaces/storage/db.py +242 -82
- mindsdb/migrations/versions/2025-05-28_a44643042fe8_added_data_catalog_tables.py +118 -0
- mindsdb/migrations/versions/2025-06-09_608e376c19a7_updated_data_catalog_data_types.py +58 -0
- mindsdb/utilities/config.py +13 -2
- mindsdb/utilities/log.py +35 -26
- mindsdb/utilities/ml_task_queue/task.py +19 -22
- mindsdb/utilities/render/sqlalchemy_render.py +129 -181
- mindsdb/utilities/starters.py +40 -0
- {mindsdb-25.5.4.2.dist-info → mindsdb-25.6.3.0.dist-info}/METADATA +257 -257
- {mindsdb-25.5.4.2.dist-info → mindsdb-25.6.3.0.dist-info}/RECORD +76 -68
- {mindsdb-25.5.4.2.dist-info → mindsdb-25.6.3.0.dist-info}/WHEEL +0 -0
- {mindsdb-25.5.4.2.dist-info → mindsdb-25.6.3.0.dist-info}/licenses/LICENSE +0 -0
- {mindsdb-25.5.4.2.dist-info → mindsdb-25.6.3.0.dist-info}/top_level.txt +0 -0
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* permission of MindsDB Inc
|
|
9
9
|
*******************************************************
|
|
10
10
|
"""
|
|
11
|
+
|
|
11
12
|
import enum
|
|
12
13
|
from dataclasses import dataclass, field
|
|
13
14
|
|
|
@@ -58,20 +59,26 @@ CAPABILITIES = CAPABILITIES()
|
|
|
58
59
|
# SERVER STATUS
|
|
59
60
|
class SERVER_STATUS(object):
|
|
60
61
|
__slots__ = ()
|
|
61
|
-
SERVER_STATUS_IN_TRANS = 1
|
|
62
|
-
SERVER_STATUS_AUTOCOMMIT = 2
|
|
63
|
-
SERVER_MORE_RESULTS_EXISTS = 8
|
|
62
|
+
SERVER_STATUS_IN_TRANS = 1 # A transaction is currently active
|
|
63
|
+
SERVER_STATUS_AUTOCOMMIT = 2 # Autocommit mode is set
|
|
64
|
+
SERVER_MORE_RESULTS_EXISTS = 8 # more results exists (more packet follow)
|
|
64
65
|
SERVER_QUERY_NO_GOOD_INDEX_USED = 16
|
|
65
66
|
SERVER_QUERY_NO_INDEX_USED = 32
|
|
66
|
-
SERVER_STATUS_CURSOR_EXISTS =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
SERVER_STATUS_CURSOR_EXISTS = (
|
|
68
|
+
64 # when using COM_STMT_FETCH, indicate that current cursor still has result (deprecated)
|
|
69
|
+
)
|
|
70
|
+
SERVER_STATUS_LAST_ROW_SENT = (
|
|
71
|
+
128 # when using COM_STMT_FETCH, indicate that current cursor has finished to send results (deprecated)
|
|
72
|
+
)
|
|
73
|
+
SERVER_STATUS_DB_DROPPED = 1 << 8 # database has been dropped
|
|
74
|
+
SERVER_STATUS_NO_BACKSLASH_ESCAPES = 1 << 9 # current escape mode is "no backslash escape"
|
|
75
|
+
SERVER_STATUS_METADATA_CHANGED = (
|
|
76
|
+
1 << 10
|
|
77
|
+
) # A DDL change did have an impact on an existing PREPARE (an automatic reprepare has been executed)
|
|
71
78
|
SERVER_QUERY_WAS_SLOW = 1 << 11
|
|
72
|
-
SERVER_PS_OUT_PARAMs = 1 << 12
|
|
73
|
-
SERVER_STATUS_IN_TRANS_READONLY = 1 << 13
|
|
74
|
-
SERVER_SESSION_STATE_CHANGED = 1 << 14
|
|
79
|
+
SERVER_PS_OUT_PARAMs = 1 << 12 # this resultset contain stored procedure output parameter
|
|
80
|
+
SERVER_STATUS_IN_TRANS_READONLY = 1 << 13 # current transaction is a read-only transaction
|
|
81
|
+
SERVER_SESSION_STATE_CHANGED = 1 << 14 # session state change. see Session change type for more information
|
|
75
82
|
|
|
76
83
|
|
|
77
84
|
SERVER_STATUS = SERVER_STATUS()
|
|
@@ -80,24 +87,24 @@ SERVER_STATUS = SERVER_STATUS()
|
|
|
80
87
|
# COMMANDS
|
|
81
88
|
class COMMANDS(object):
|
|
82
89
|
__slots__ = ()
|
|
83
|
-
COM_CHANGE_USER = int(
|
|
84
|
-
COM_DEBUG = int(
|
|
85
|
-
COM_INIT_DB = int(
|
|
86
|
-
COM_PING = int(
|
|
87
|
-
COM_PROCESS_KILL = int(
|
|
88
|
-
COM_QUERY = int(
|
|
89
|
-
COM_QUIT = int(
|
|
90
|
-
COM_RESET_CONNECTION = int(
|
|
91
|
-
COM_SET_OPTION = int(
|
|
92
|
-
COM_SHUTDOWN = int(
|
|
93
|
-
COM_SLEEP = int(
|
|
94
|
-
COM_STATISTICS = int(
|
|
95
|
-
COM_STMT_PREPARE = int(
|
|
96
|
-
COM_STMT_EXECUTE = int(
|
|
97
|
-
COM_STMT_FETCH = int(
|
|
98
|
-
COM_STMT_RESET = int(
|
|
99
|
-
COM_STMT_CLOSE = int(
|
|
100
|
-
COM_FIELD_LIST = int(
|
|
90
|
+
COM_CHANGE_USER = int("0x11", 0)
|
|
91
|
+
COM_DEBUG = int("0x0D", 0)
|
|
92
|
+
COM_INIT_DB = int("0x02", 0)
|
|
93
|
+
COM_PING = int("0x0e", 0)
|
|
94
|
+
COM_PROCESS_KILL = int("0xC", 0)
|
|
95
|
+
COM_QUERY = int("0x03", 0)
|
|
96
|
+
COM_QUIT = int("0x01", 0)
|
|
97
|
+
COM_RESET_CONNECTION = int("0x1f", 0)
|
|
98
|
+
COM_SET_OPTION = int("0x1b", 0)
|
|
99
|
+
COM_SHUTDOWN = int("0x0a", 0)
|
|
100
|
+
COM_SLEEP = int("0x00", 0)
|
|
101
|
+
COM_STATISTICS = int("0x09", 0)
|
|
102
|
+
COM_STMT_PREPARE = int("0x16", 0)
|
|
103
|
+
COM_STMT_EXECUTE = int("0x17", 0)
|
|
104
|
+
COM_STMT_FETCH = int("0x1c", 0)
|
|
105
|
+
COM_STMT_RESET = int("0x1a", 0)
|
|
106
|
+
COM_STMT_CLOSE = int("0x19", 0)
|
|
107
|
+
COM_FIELD_LIST = int("0x04", 0) # deprecated
|
|
101
108
|
|
|
102
109
|
|
|
103
110
|
COMMANDS = COMMANDS()
|
|
@@ -150,186 +157,146 @@ TYPES = TYPES()
|
|
|
150
157
|
|
|
151
158
|
|
|
152
159
|
class MYSQL_DATA_TYPE(enum.Enum):
|
|
153
|
-
TINYINT =
|
|
154
|
-
SMALLINT =
|
|
155
|
-
MEDIUMINT =
|
|
156
|
-
INT =
|
|
157
|
-
BIGINT =
|
|
158
|
-
FLOAT =
|
|
159
|
-
DOUBLE =
|
|
160
|
-
DECIMAL =
|
|
161
|
-
YEAR =
|
|
162
|
-
TIME =
|
|
163
|
-
DATE =
|
|
164
|
-
DATETIME =
|
|
165
|
-
TIMESTAMP =
|
|
166
|
-
CHAR =
|
|
167
|
-
BINARY =
|
|
168
|
-
VARCHAR =
|
|
169
|
-
VARBINARY =
|
|
170
|
-
TINYBLOB =
|
|
171
|
-
TINYTEXT =
|
|
172
|
-
BLOB =
|
|
173
|
-
TEXT =
|
|
174
|
-
MEDIUMBLOB =
|
|
175
|
-
MEDIUMTEXT =
|
|
176
|
-
LONGBLOB =
|
|
177
|
-
LONGTEXT =
|
|
178
|
-
BIT =
|
|
179
|
-
BOOL =
|
|
180
|
-
BOOLEAN =
|
|
160
|
+
TINYINT = "TINYINT"
|
|
161
|
+
SMALLINT = "SMALLINT"
|
|
162
|
+
MEDIUMINT = "MEDIUMINT"
|
|
163
|
+
INT = "INT"
|
|
164
|
+
BIGINT = "BIGINT"
|
|
165
|
+
FLOAT = "FLOAT"
|
|
166
|
+
DOUBLE = "DOUBLE"
|
|
167
|
+
DECIMAL = "DECIMAL"
|
|
168
|
+
YEAR = "YEAR"
|
|
169
|
+
TIME = "TIME"
|
|
170
|
+
DATE = "DATE"
|
|
171
|
+
DATETIME = "DATETIME"
|
|
172
|
+
TIMESTAMP = "TIMESTAMP"
|
|
173
|
+
CHAR = "CHAR"
|
|
174
|
+
BINARY = "BINARY"
|
|
175
|
+
VARCHAR = "VARCHAR"
|
|
176
|
+
VARBINARY = "VARBINARY"
|
|
177
|
+
TINYBLOB = "TINYBLOB"
|
|
178
|
+
TINYTEXT = "TINYTEXT"
|
|
179
|
+
BLOB = "BLOB"
|
|
180
|
+
TEXT = "TEXT"
|
|
181
|
+
MEDIUMBLOB = "MEDIUMBLOB"
|
|
182
|
+
MEDIUMTEXT = "MEDIUMTEXT"
|
|
183
|
+
LONGBLOB = "LONGBLOB"
|
|
184
|
+
LONGTEXT = "LONGTEXT"
|
|
185
|
+
BIT = "BIT"
|
|
186
|
+
BOOL = "BOOL"
|
|
187
|
+
BOOLEAN = "BOOLEAN"
|
|
188
|
+
JSON = "JSON"
|
|
189
|
+
VECTOR = "VECTOR"
|
|
181
190
|
|
|
182
191
|
|
|
183
192
|
# Default values for attributes of MySQL data types as they appear in information_schema.columns
|
|
184
193
|
# These values match the MySQL v8.0.37 defaults and are used to properly represent column metadata
|
|
185
194
|
MYSQL_DATA_TYPE_COLUMNS_DEFAULT = {
|
|
186
|
-
MYSQL_DATA_TYPE.TINYINT: {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
-
MYSQL_DATA_TYPE.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
MYSQL_DATA_TYPE.MEDIUMINT: {
|
|
195
|
-
'NUMERIC_PRECISION': 7,
|
|
196
|
-
'NUMERIC_SCALE': 0
|
|
197
|
-
},
|
|
198
|
-
MYSQL_DATA_TYPE.INT: {
|
|
199
|
-
'NUMERIC_PRECISION': 10,
|
|
200
|
-
'NUMERIC_SCALE': 0
|
|
201
|
-
},
|
|
202
|
-
MYSQL_DATA_TYPE.BIGINT: {
|
|
203
|
-
'NUMERIC_PRECISION': 19,
|
|
204
|
-
'NUMERIC_SCALE': 0
|
|
205
|
-
},
|
|
206
|
-
MYSQL_DATA_TYPE.FLOAT: {
|
|
207
|
-
'NUMERIC_PRECISION': 12
|
|
208
|
-
},
|
|
209
|
-
MYSQL_DATA_TYPE.DOUBLE: {
|
|
210
|
-
'NUMERIC_PRECISION': 22
|
|
211
|
-
},
|
|
212
|
-
MYSQL_DATA_TYPE.DECIMAL: {
|
|
213
|
-
'NUMERIC_PRECISION': 10,
|
|
214
|
-
'NUMERIC_SCALE': 0,
|
|
215
|
-
'COLUMN_TYPE': 'decimal(10,0)'
|
|
216
|
-
},
|
|
195
|
+
MYSQL_DATA_TYPE.TINYINT: {"NUMERIC_PRECISION": 3, "NUMERIC_SCALE": 0},
|
|
196
|
+
MYSQL_DATA_TYPE.SMALLINT: {"NUMERIC_PRECISION": 5, "NUMERIC_SCALE": 0},
|
|
197
|
+
MYSQL_DATA_TYPE.MEDIUMINT: {"NUMERIC_PRECISION": 7, "NUMERIC_SCALE": 0},
|
|
198
|
+
MYSQL_DATA_TYPE.INT: {"NUMERIC_PRECISION": 10, "NUMERIC_SCALE": 0},
|
|
199
|
+
MYSQL_DATA_TYPE.BIGINT: {"NUMERIC_PRECISION": 19, "NUMERIC_SCALE": 0},
|
|
200
|
+
MYSQL_DATA_TYPE.FLOAT: {"NUMERIC_PRECISION": 12},
|
|
201
|
+
MYSQL_DATA_TYPE.DOUBLE: {"NUMERIC_PRECISION": 22},
|
|
202
|
+
MYSQL_DATA_TYPE.DECIMAL: {"NUMERIC_PRECISION": 10, "NUMERIC_SCALE": 0, "COLUMN_TYPE": "decimal(10,0)"},
|
|
217
203
|
MYSQL_DATA_TYPE.YEAR: {
|
|
218
204
|
# every column is null
|
|
219
205
|
},
|
|
220
|
-
MYSQL_DATA_TYPE.TIME: {
|
|
221
|
-
'DATETIME_PRECISION': 0
|
|
222
|
-
},
|
|
206
|
+
MYSQL_DATA_TYPE.TIME: {"DATETIME_PRECISION": 0},
|
|
223
207
|
MYSQL_DATA_TYPE.DATE: {
|
|
224
208
|
# every column is null
|
|
225
209
|
},
|
|
226
|
-
MYSQL_DATA_TYPE.DATETIME: {
|
|
227
|
-
|
|
228
|
-
},
|
|
229
|
-
MYSQL_DATA_TYPE.TIMESTAMP: {
|
|
230
|
-
'DATETIME_PRECISION': 0
|
|
231
|
-
},
|
|
210
|
+
MYSQL_DATA_TYPE.DATETIME: {"DATETIME_PRECISION": 0},
|
|
211
|
+
MYSQL_DATA_TYPE.TIMESTAMP: {"DATETIME_PRECISION": 0},
|
|
232
212
|
MYSQL_DATA_TYPE.CHAR: {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
MYSQL_DATA_TYPE.BINARY: {
|
|
240
|
-
'CHARACTER_MAXIMUM_LENGTH': 1,
|
|
241
|
-
'CHARACTER_OCTET_LENGTH': 1,
|
|
242
|
-
'COLUMN_TYPE': 'binary(1)'
|
|
213
|
+
"CHARACTER_MAXIMUM_LENGTH": 1,
|
|
214
|
+
"CHARACTER_OCTET_LENGTH": 4,
|
|
215
|
+
"CHARACTER_SET_NAME": "utf8",
|
|
216
|
+
"COLLATION_NAME": "utf8_bin",
|
|
217
|
+
"COLUMN_TYPE": "char(1)",
|
|
243
218
|
},
|
|
219
|
+
MYSQL_DATA_TYPE.BINARY: {"CHARACTER_MAXIMUM_LENGTH": 1, "CHARACTER_OCTET_LENGTH": 1, "COLUMN_TYPE": "binary(1)"},
|
|
244
220
|
MYSQL_DATA_TYPE.VARCHAR: {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
221
|
+
"CHARACTER_MAXIMUM_LENGTH": 1024, # NOTE mandatory for field creation
|
|
222
|
+
"CHARACTER_OCTET_LENGTH": 4096, # NOTE mandatory for field creation
|
|
223
|
+
"CHARACTER_SET_NAME": "utf8",
|
|
224
|
+
"COLLATION_NAME": "utf8_bin",
|
|
225
|
+
"COLUMN_TYPE": "varchar(1024)",
|
|
250
226
|
},
|
|
251
227
|
MYSQL_DATA_TYPE.VARBINARY: {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
},
|
|
256
|
-
MYSQL_DATA_TYPE.TINYBLOB: {
|
|
257
|
-
'CHARACTER_MAXIMUM_LENGTH': 255,
|
|
258
|
-
'CHARACTER_OCTET_LENGTH': 255
|
|
228
|
+
"CHARACTER_MAXIMUM_LENGTH": 1024, # NOTE mandatory for field creation
|
|
229
|
+
"CHARACTER_OCTET_LENGTH": 1024, # NOTE mandatory for field creation
|
|
230
|
+
"COLUMN_TYPE": "varbinary(1024)",
|
|
259
231
|
},
|
|
232
|
+
MYSQL_DATA_TYPE.TINYBLOB: {"CHARACTER_MAXIMUM_LENGTH": 255, "CHARACTER_OCTET_LENGTH": 255},
|
|
260
233
|
MYSQL_DATA_TYPE.TINYTEXT: {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
},
|
|
266
|
-
MYSQL_DATA_TYPE.BLOB: {
|
|
267
|
-
'CHARACTER_MAXIMUM_LENGTH': 65535,
|
|
268
|
-
'CHARACTER_OCTET_LENGTH': 65535
|
|
234
|
+
"CHARACTER_MAXIMUM_LENGTH": 255,
|
|
235
|
+
"CHARACTER_OCTET_LENGTH": 255,
|
|
236
|
+
"CHARACTER_SET_NAME": "utf8",
|
|
237
|
+
"COLLATION_NAME": "utf8_bin",
|
|
269
238
|
},
|
|
239
|
+
MYSQL_DATA_TYPE.BLOB: {"CHARACTER_MAXIMUM_LENGTH": 65535, "CHARACTER_OCTET_LENGTH": 65535},
|
|
270
240
|
MYSQL_DATA_TYPE.TEXT: {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
MYSQL_DATA_TYPE.MEDIUMBLOB: {
|
|
277
|
-
'CHARACTER_MAXIMUM_LENGTH': 16777215,
|
|
278
|
-
'CHARACTER_OCTET_LENGTH': 16777215
|
|
241
|
+
"CHARACTER_MAXIMUM_LENGTH": 65535,
|
|
242
|
+
"CHARACTER_OCTET_LENGTH": 65535,
|
|
243
|
+
"CHARACTER_SET_NAME": "utf8",
|
|
244
|
+
"COLLATION_NAME": "utf8_bin",
|
|
279
245
|
},
|
|
246
|
+
MYSQL_DATA_TYPE.MEDIUMBLOB: {"CHARACTER_MAXIMUM_LENGTH": 16777215, "CHARACTER_OCTET_LENGTH": 16777215},
|
|
280
247
|
MYSQL_DATA_TYPE.MEDIUMTEXT: {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
248
|
+
"CHARACTER_MAXIMUM_LENGTH": 16777215,
|
|
249
|
+
"CHARACTER_OCTET_LENGTH": 16777215,
|
|
250
|
+
"CHARACTER_SET_NAME": "utf8",
|
|
251
|
+
"COLLATION_NAME": "utf8_bin",
|
|
285
252
|
},
|
|
286
253
|
MYSQL_DATA_TYPE.LONGBLOB: {
|
|
287
|
-
|
|
288
|
-
|
|
254
|
+
"CHARACTER_MAXIMUM_LENGTH": 4294967295,
|
|
255
|
+
"CHARACTER_OCTET_LENGTH": 4294967295,
|
|
289
256
|
},
|
|
290
257
|
MYSQL_DATA_TYPE.LONGTEXT: {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
258
|
+
"CHARACTER_MAXIMUM_LENGTH": 4294967295,
|
|
259
|
+
"CHARACTER_OCTET_LENGTH": 4294967295,
|
|
260
|
+
"CHARACTER_SET_NAME": "utf8",
|
|
261
|
+
"COLLATION_NAME": "utf8_bin",
|
|
295
262
|
},
|
|
296
263
|
MYSQL_DATA_TYPE.BIT: {
|
|
297
|
-
|
|
298
|
-
|
|
264
|
+
"NUMERIC_PRECISION": 1,
|
|
265
|
+
"COLUMN_TYPE": "bit(1)",
|
|
299
266
|
# 'NUMERIC_SCALE': null
|
|
300
267
|
},
|
|
301
268
|
MYSQL_DATA_TYPE.BOOL: {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
269
|
+
"DATA_TYPE": "tinyint",
|
|
270
|
+
"NUMERIC_PRECISION": 3,
|
|
271
|
+
"NUMERIC_SCALE": 0,
|
|
272
|
+
"COLUMN_TYPE": "tinyint(1)",
|
|
306
273
|
},
|
|
307
274
|
MYSQL_DATA_TYPE.BOOLEAN: {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
275
|
+
"DATA_TYPE": "tinyint",
|
|
276
|
+
"NUMERIC_PRECISION": 3,
|
|
277
|
+
"NUMERIC_SCALE": 0,
|
|
278
|
+
"COLUMN_TYPE": "tinyint(1)",
|
|
279
|
+
},
|
|
313
280
|
}
|
|
314
281
|
|
|
315
282
|
|
|
316
283
|
class FIELD_FLAG(object):
|
|
317
284
|
__slots__ = ()
|
|
318
|
-
NOT_NULL = 1
|
|
319
|
-
PRIMARY_KEY = 2
|
|
320
|
-
UNIQUE_KEY = 4
|
|
321
|
-
MULTIPLE_KEY = 8
|
|
322
|
-
BLOB = 16
|
|
323
|
-
UNSIGNED = 32
|
|
324
|
-
ZEROFILL_FLAG = 64
|
|
325
|
-
BINARY_COLLATION = 128
|
|
326
|
-
ENUM = 256
|
|
327
|
-
AUTO_INCREMENT = 512
|
|
328
|
-
TIMESTAMP = 1024
|
|
329
|
-
SET = 2048
|
|
330
|
-
NO_DEFAULT_VALUE_FLAG = 4096
|
|
331
|
-
ON_UPDATE_NOW_FLAG = 8192
|
|
332
|
-
NUM_FLAG = 32768
|
|
285
|
+
NOT_NULL = 1 # field cannot be null
|
|
286
|
+
PRIMARY_KEY = 2 # field is a primary key
|
|
287
|
+
UNIQUE_KEY = 4 # field is unique
|
|
288
|
+
MULTIPLE_KEY = 8 # field is in a multiple key
|
|
289
|
+
BLOB = 16 # is this field a Blob
|
|
290
|
+
UNSIGNED = 32 # is this field unsigned
|
|
291
|
+
ZEROFILL_FLAG = 64 # is this field a zerofill
|
|
292
|
+
BINARY_COLLATION = 128 # whether this field has a binary collation
|
|
293
|
+
ENUM = 256 # Field is an enumeration
|
|
294
|
+
AUTO_INCREMENT = 512 # field auto-increment
|
|
295
|
+
TIMESTAMP = 1024 # field is a timestamp value
|
|
296
|
+
SET = 2048 # field is a SET
|
|
297
|
+
NO_DEFAULT_VALUE_FLAG = 4096 # field doesn't have default value
|
|
298
|
+
ON_UPDATE_NOW_FLAG = 8192 # field is set to NOW on UPDATE
|
|
299
|
+
NUM_FLAG = 32768 # field is num
|
|
333
300
|
|
|
334
301
|
|
|
335
302
|
FIELD_FLAG = FIELD_FLAG()
|
|
@@ -344,6 +311,7 @@ class CTypeProperties:
|
|
|
344
311
|
size (int | None): Size of the column. If not specified, then size is variable (text/blob types).
|
|
345
312
|
flags (list[int]): Flags of the mysql type.
|
|
346
313
|
"""
|
|
314
|
+
|
|
347
315
|
code: int
|
|
348
316
|
size: int | None = None
|
|
349
317
|
flags: list[int] = field(default_factory=list)
|
|
@@ -365,22 +333,38 @@ DATA_C_TYPE_MAP = {
|
|
|
365
333
|
MYSQL_DATA_TYPE.TIME: CTypeProperties(C_TYPES.MYSQL_TYPE_TIME, 10, [FIELD_FLAG.BINARY_COLLATION]),
|
|
366
334
|
MYSQL_DATA_TYPE.DATE: CTypeProperties(C_TYPES.MYSQL_TYPE_DATE, 10, [FIELD_FLAG.BINARY_COLLATION]),
|
|
367
335
|
MYSQL_DATA_TYPE.DATETIME: CTypeProperties(C_TYPES.MYSQL_TYPE_DATETIME, 19, [FIELD_FLAG.BINARY_COLLATION]),
|
|
368
|
-
MYSQL_DATA_TYPE.TIMESTAMP: CTypeProperties(
|
|
336
|
+
MYSQL_DATA_TYPE.TIMESTAMP: CTypeProperties(
|
|
337
|
+
C_TYPES.MYSQL_TYPE_TIMESTAMP, 19, [FIELD_FLAG.BINARY_COLLATION, FIELD_FLAG.TIMESTAMP]
|
|
338
|
+
),
|
|
369
339
|
MYSQL_DATA_TYPE.CHAR: CTypeProperties(C_TYPES.MYSQL_TYPE_STRING),
|
|
370
340
|
MYSQL_DATA_TYPE.BINARY: CTypeProperties(C_TYPES.MYSQL_TYPE_STRING, flags=[FIELD_FLAG.BINARY_COLLATION]),
|
|
371
341
|
MYSQL_DATA_TYPE.VARCHAR: CTypeProperties(C_TYPES.MYSQL_TYPE_VAR_STRING),
|
|
372
342
|
MYSQL_DATA_TYPE.VARBINARY: CTypeProperties(C_TYPES.MYSQL_TYPE_VAR_STRING, flags=[FIELD_FLAG.BINARY_COLLATION]),
|
|
373
|
-
MYSQL_DATA_TYPE.TINYBLOB: CTypeProperties(
|
|
343
|
+
MYSQL_DATA_TYPE.TINYBLOB: CTypeProperties(
|
|
344
|
+
C_TYPES.MYSQL_TYPE_BLOB, flags=[FIELD_FLAG.BLOB, FIELD_FLAG.BINARY_COLLATION]
|
|
345
|
+
),
|
|
374
346
|
MYSQL_DATA_TYPE.TINYTEXT: CTypeProperties(C_TYPES.MYSQL_TYPE_BLOB, flags=[FIELD_FLAG.BLOB]),
|
|
375
|
-
MYSQL_DATA_TYPE.BLOB: CTypeProperties(
|
|
347
|
+
MYSQL_DATA_TYPE.BLOB: CTypeProperties(
|
|
348
|
+
C_TYPES.MYSQL_TYPE_BLOB, flags=[FIELD_FLAG.BLOB, FIELD_FLAG.BINARY_COLLATION]
|
|
349
|
+
),
|
|
376
350
|
MYSQL_DATA_TYPE.TEXT: CTypeProperties(C_TYPES.MYSQL_TYPE_BLOB, flags=[FIELD_FLAG.BLOB]),
|
|
377
|
-
MYSQL_DATA_TYPE.MEDIUMBLOB: CTypeProperties(
|
|
351
|
+
MYSQL_DATA_TYPE.MEDIUMBLOB: CTypeProperties(
|
|
352
|
+
C_TYPES.MYSQL_TYPE_BLOB, flags=[FIELD_FLAG.BLOB, FIELD_FLAG.BINARY_COLLATION]
|
|
353
|
+
),
|
|
378
354
|
MYSQL_DATA_TYPE.MEDIUMTEXT: CTypeProperties(C_TYPES.MYSQL_TYPE_BLOB, flags=[FIELD_FLAG.BLOB]),
|
|
379
|
-
MYSQL_DATA_TYPE.LONGBLOB: CTypeProperties(
|
|
355
|
+
MYSQL_DATA_TYPE.LONGBLOB: CTypeProperties(
|
|
356
|
+
C_TYPES.MYSQL_TYPE_BLOB, flags=[FIELD_FLAG.BLOB, FIELD_FLAG.BINARY_COLLATION]
|
|
357
|
+
),
|
|
380
358
|
MYSQL_DATA_TYPE.LONGTEXT: CTypeProperties(C_TYPES.MYSQL_TYPE_BLOB, flags=[FIELD_FLAG.BLOB]),
|
|
381
359
|
MYSQL_DATA_TYPE.BIT: CTypeProperties(C_TYPES.MYSQL_TYPE_BIT, 8, [FIELD_FLAG.UNSIGNED]),
|
|
382
360
|
MYSQL_DATA_TYPE.BOOL: CTypeProperties(C_TYPES.MYSQL_TYPE_TINY, 1),
|
|
383
|
-
MYSQL_DATA_TYPE.BOOLEAN: CTypeProperties(C_TYPES.MYSQL_TYPE_TINY, 1)
|
|
361
|
+
MYSQL_DATA_TYPE.BOOLEAN: CTypeProperties(C_TYPES.MYSQL_TYPE_TINY, 1),
|
|
362
|
+
MYSQL_DATA_TYPE.JSON: CTypeProperties(
|
|
363
|
+
C_TYPES.MYSQL_TYPE_JSON, flags=[FIELD_FLAG.BLOB, FIELD_FLAG.BINARY_COLLATION]
|
|
364
|
+
),
|
|
365
|
+
MYSQL_DATA_TYPE.VECTOR: CTypeProperties(
|
|
366
|
+
C_TYPES.MYSQL_TYPE_VECTOR, 4096, flags=[FIELD_FLAG.BLOB, FIELD_FLAG.BINARY_COLLATION]
|
|
367
|
+
),
|
|
384
368
|
}
|
|
385
369
|
|
|
386
370
|
|
|
@@ -390,33 +374,35 @@ DEFAULT_COALLITION_ID = 83
|
|
|
390
374
|
SERVER_STATUS_AUTOCOMMIT = 2
|
|
391
375
|
|
|
392
376
|
# NOTE real mysql-server returns by default all (capabilities 0xffff, extended 0xc1ff)
|
|
393
|
-
DEFAULT_CAPABILITIES = sum(
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
377
|
+
DEFAULT_CAPABILITIES = sum(
|
|
378
|
+
[
|
|
379
|
+
CAPABILITIES.CLIENT_LONG_PASSWORD,
|
|
380
|
+
CAPABILITIES.CLIENT_LONG_FLAG,
|
|
381
|
+
CAPABILITIES.CLIENT_CONNECT_WITH_DB,
|
|
382
|
+
CAPABILITIES.CLIENT_PROTOCOL_41,
|
|
383
|
+
CAPABILITIES.CLIENT_TRANSACTIONS,
|
|
384
|
+
CAPABILITIES.CLIENT_FOUND_ROWS,
|
|
385
|
+
CAPABILITIES.CLIENT_LOCAL_FILES,
|
|
386
|
+
CAPABILITIES.CLIENT_CONNECT_ATTRS,
|
|
387
|
+
CAPABILITIES.CLIENT_PLUGIN_AUTH,
|
|
388
|
+
CAPABILITIES.CLIENT_SSL,
|
|
389
|
+
CAPABILITIES.CLIENT_SECURE_CONNECTION,
|
|
390
|
+
CAPABILITIES.CLIENT_DEPRECATE_EOF,
|
|
391
|
+
]
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
DEFAULT_AUTH_METHOD = "caching_sha2_password" # [mysql_native_password|caching_sha2_password]
|
|
409
395
|
|
|
410
396
|
FILLER_FOR_WIRESHARK_DUMP = 21
|
|
411
397
|
|
|
412
398
|
|
|
413
399
|
# Datum lenenc encoding
|
|
414
400
|
|
|
415
|
-
NULL_VALUE = b
|
|
416
|
-
ONE_BYTE_ENC = b
|
|
417
|
-
TWO_BYTE_ENC = b
|
|
418
|
-
THREE_BYTE_ENC = b
|
|
419
|
-
EIGHT_BYTE_ENC = b
|
|
401
|
+
NULL_VALUE = b"\xfb"
|
|
402
|
+
ONE_BYTE_ENC = b"\xfa"
|
|
403
|
+
TWO_BYTE_ENC = b"\xfc"
|
|
404
|
+
THREE_BYTE_ENC = b"\xfd"
|
|
405
|
+
EIGHT_BYTE_ENC = b"\xfe"
|
|
420
406
|
|
|
421
407
|
|
|
422
408
|
# ERROR CODES
|
|
@@ -859,225 +845,225 @@ WARN = WARN()
|
|
|
859
845
|
|
|
860
846
|
# noqa
|
|
861
847
|
CHARSET_NUMBERS = {
|
|
862
|
-
"big5_chinese_ci":
|
|
863
|
-
"latin2_czech_cs":
|
|
864
|
-
"dec8_swedish_ci":
|
|
865
|
-
"cp850_general_ci":
|
|
866
|
-
"latin1_german1_ci":
|
|
867
|
-
"hp8_english_ci":
|
|
868
|
-
"koi8r_general_ci":
|
|
869
|
-
"latin1_swedish_ci":
|
|
870
|
-
"latin2_general_ci":
|
|
871
|
-
"swe7_swedish_ci":
|
|
872
|
-
"ascii_general_ci":
|
|
873
|
-
"ujis_japanese_ci":
|
|
874
|
-
"sjis_japanese_ci":
|
|
875
|
-
"cp1251_bulgarian_ci":
|
|
876
|
-
"latin1_danish_ci":
|
|
877
|
-
"hebrew_general_ci":
|
|
878
|
-
"tis620_thai_ci":
|
|
879
|
-
"euckr_korean_ci":
|
|
880
|
-
"latin7_estonian_cs":
|
|
881
|
-
"latin2_hungarian_ci":
|
|
882
|
-
"koi8u_general_ci":
|
|
883
|
-
"cp1251_ukrainian_ci":
|
|
884
|
-
"gb2312_chinese_ci":
|
|
885
|
-
"greek_general_ci":
|
|
886
|
-
"cp1250_general_ci":
|
|
887
|
-
"latin2_croatian_ci":
|
|
888
|
-
"gbk_chinese_ci":
|
|
889
|
-
"cp1257_lithuanian_ci":
|
|
890
|
-
"latin5_turkish_ci":
|
|
891
|
-
"latin1_german2_ci":
|
|
892
|
-
"armscii8_general_ci":
|
|
893
|
-
"utf8_general_ci":
|
|
894
|
-
"cp1250_czech_cs":
|
|
895
|
-
"ucs2_general_ci":
|
|
896
|
-
"cp866_general_ci":
|
|
897
|
-
"keybcs2_general_ci":
|
|
898
|
-
"macce_general_ci":
|
|
899
|
-
"macroman_general_ci":
|
|
900
|
-
"cp852_general_ci":
|
|
901
|
-
"latin7_general_ci":
|
|
902
|
-
"latin7_general_cs":
|
|
903
|
-
"macce_bin":
|
|
904
|
-
"cp1250_croatian_ci":
|
|
905
|
-
"utf8mb4_general_ci":
|
|
906
|
-
"utf8mb4_bin":
|
|
907
|
-
"latin1_bin":
|
|
908
|
-
"latin1_general_ci":
|
|
909
|
-
"latin1_general_cs":
|
|
910
|
-
"cp1251_bin":
|
|
911
|
-
"cp1251_general_ci":
|
|
912
|
-
"cp1251_general_cs":
|
|
913
|
-
"macroman_bin":
|
|
914
|
-
"utf16_general_ci":
|
|
915
|
-
"utf16_bin":
|
|
916
|
-
"utf16le_general_ci":
|
|
917
|
-
"cp1256_general_ci":
|
|
918
|
-
"cp1257_bin":
|
|
919
|
-
"cp1257_general_ci":
|
|
920
|
-
"utf32_general_ci":
|
|
921
|
-
"utf32_bin":
|
|
922
|
-
"utf16le_bin":
|
|
923
|
-
"binary":
|
|
924
|
-
"armscii8_bin":
|
|
925
|
-
"ascii_bin":
|
|
926
|
-
"cp1250_bin":
|
|
927
|
-
"cp1256_bin":
|
|
928
|
-
"cp866_bin":
|
|
929
|
-
"dec8_bin":
|
|
930
|
-
"greek_bin":
|
|
931
|
-
"hebrew_bin":
|
|
932
|
-
"hp8_bin":
|
|
933
|
-
"keybcs2_bin":
|
|
934
|
-
"koi8r_bin":
|
|
935
|
-
"koi8u_bin":
|
|
936
|
-
"latin2_bin":
|
|
937
|
-
"latin5_bin":
|
|
938
|
-
"latin7_bin":
|
|
939
|
-
"cp850_bin":
|
|
940
|
-
"cp852_bin":
|
|
941
|
-
"swe7_bin":
|
|
942
|
-
"utf8_bin":
|
|
943
|
-
"big5_bin":
|
|
944
|
-
"euckr_bin":
|
|
945
|
-
"gb2312_bin":
|
|
946
|
-
"gbk_bin":
|
|
947
|
-
"sjis_bin":
|
|
948
|
-
"tis620_bin":
|
|
949
|
-
"ucs2_bin":
|
|
950
|
-
"ujis_bin":
|
|
951
|
-
"geostd8_general_ci":
|
|
952
|
-
"geostd8_bin":
|
|
953
|
-
"latin1_spanish_ci":
|
|
954
|
-
"cp932_japanese_ci":
|
|
955
|
-
"cp932_bin":
|
|
956
|
-
"eucjpms_japanese_ci":
|
|
957
|
-
"eucjpms_bin":
|
|
958
|
-
"cp1250_polish_ci":
|
|
959
|
-
"utf16_unicode_ci":
|
|
960
|
-
"utf16_icelandic_ci":
|
|
961
|
-
"utf16_latvian_ci":
|
|
962
|
-
"utf16_romanian_ci":
|
|
963
|
-
"utf16_slovenian_ci":
|
|
964
|
-
"utf16_polish_ci":
|
|
965
|
-
"utf16_estonian_ci":
|
|
966
|
-
"utf16_spanish_ci":
|
|
967
|
-
"utf16_swedish_ci":
|
|
968
|
-
"utf16_turkish_ci":
|
|
969
|
-
"utf16_czech_ci":
|
|
970
|
-
"utf16_danish_ci":
|
|
971
|
-
"utf16_lithuanian_ci":
|
|
972
|
-
"utf16_slovak_ci":
|
|
973
|
-
"utf16_spanish2_ci":
|
|
974
|
-
"utf16_roman_ci":
|
|
975
|
-
"utf16_persian_ci":
|
|
976
|
-
"utf16_esperanto_ci":
|
|
977
|
-
"utf16_hungarian_ci":
|
|
978
|
-
"utf16_sinhala_ci":
|
|
979
|
-
"utf16_german2_ci":
|
|
980
|
-
"utf16_croatian_ci":
|
|
981
|
-
"utf16_unicode_520_ci":
|
|
982
|
-
"utf16_vietnamese_ci":
|
|
983
|
-
"ucs2_unicode_ci":
|
|
984
|
-
"ucs2_icelandic_ci":
|
|
985
|
-
"ucs2_latvian_ci":
|
|
986
|
-
"ucs2_romanian_ci":
|
|
987
|
-
"ucs2_slovenian_ci":
|
|
988
|
-
"ucs2_polish_ci":
|
|
989
|
-
"ucs2_estonian_ci":
|
|
990
|
-
"ucs2_spanish_ci":
|
|
991
|
-
"ucs2_swedish_ci":
|
|
992
|
-
"ucs2_turkish_ci":
|
|
993
|
-
"ucs2_czech_ci":
|
|
994
|
-
"ucs2_danish_ci":
|
|
995
|
-
"ucs2_lithuanian_ci":
|
|
996
|
-
"ucs2_slovak_ci":
|
|
997
|
-
"ucs2_spanish2_ci":
|
|
998
|
-
"ucs2_roman_ci":
|
|
999
|
-
"ucs2_persian_ci":
|
|
1000
|
-
"ucs2_esperanto_ci":
|
|
1001
|
-
"ucs2_hungarian_ci":
|
|
1002
|
-
"ucs2_sinhala_ci":
|
|
1003
|
-
"ucs2_german2_ci":
|
|
1004
|
-
"ucs2_croatian_ci":
|
|
1005
|
-
"ucs2_unicode_520_ci":
|
|
1006
|
-
"ucs2_vietnamese_ci":
|
|
848
|
+
"big5_chinese_ci": 1,
|
|
849
|
+
"latin2_czech_cs": 2,
|
|
850
|
+
"dec8_swedish_ci": 3,
|
|
851
|
+
"cp850_general_ci": 4,
|
|
852
|
+
"latin1_german1_ci": 5,
|
|
853
|
+
"hp8_english_ci": 6,
|
|
854
|
+
"koi8r_general_ci": 7,
|
|
855
|
+
"latin1_swedish_ci": 8,
|
|
856
|
+
"latin2_general_ci": 9,
|
|
857
|
+
"swe7_swedish_ci": 10,
|
|
858
|
+
"ascii_general_ci": 11,
|
|
859
|
+
"ujis_japanese_ci": 12,
|
|
860
|
+
"sjis_japanese_ci": 13,
|
|
861
|
+
"cp1251_bulgarian_ci": 14,
|
|
862
|
+
"latin1_danish_ci": 15,
|
|
863
|
+
"hebrew_general_ci": 16,
|
|
864
|
+
"tis620_thai_ci": 18,
|
|
865
|
+
"euckr_korean_ci": 19,
|
|
866
|
+
"latin7_estonian_cs": 20,
|
|
867
|
+
"latin2_hungarian_ci": 21,
|
|
868
|
+
"koi8u_general_ci": 22,
|
|
869
|
+
"cp1251_ukrainian_ci": 23,
|
|
870
|
+
"gb2312_chinese_ci": 24,
|
|
871
|
+
"greek_general_ci": 25,
|
|
872
|
+
"cp1250_general_ci": 26,
|
|
873
|
+
"latin2_croatian_ci": 27,
|
|
874
|
+
"gbk_chinese_ci": 28,
|
|
875
|
+
"cp1257_lithuanian_ci": 29,
|
|
876
|
+
"latin5_turkish_ci": 30,
|
|
877
|
+
"latin1_german2_ci": 31,
|
|
878
|
+
"armscii8_general_ci": 32,
|
|
879
|
+
"utf8_general_ci": 33,
|
|
880
|
+
"cp1250_czech_cs": 34,
|
|
881
|
+
"ucs2_general_ci": 35,
|
|
882
|
+
"cp866_general_ci": 36,
|
|
883
|
+
"keybcs2_general_ci": 37,
|
|
884
|
+
"macce_general_ci": 38,
|
|
885
|
+
"macroman_general_ci": 39,
|
|
886
|
+
"cp852_general_ci": 40,
|
|
887
|
+
"latin7_general_ci": 41,
|
|
888
|
+
"latin7_general_cs": 42,
|
|
889
|
+
"macce_bin": 43,
|
|
890
|
+
"cp1250_croatian_ci": 44,
|
|
891
|
+
"utf8mb4_general_ci": 45,
|
|
892
|
+
"utf8mb4_bin": 46,
|
|
893
|
+
"latin1_bin": 47,
|
|
894
|
+
"latin1_general_ci": 48,
|
|
895
|
+
"latin1_general_cs": 49,
|
|
896
|
+
"cp1251_bin": 50,
|
|
897
|
+
"cp1251_general_ci": 51,
|
|
898
|
+
"cp1251_general_cs": 52,
|
|
899
|
+
"macroman_bin": 53,
|
|
900
|
+
"utf16_general_ci": 54,
|
|
901
|
+
"utf16_bin": 55,
|
|
902
|
+
"utf16le_general_ci": 56,
|
|
903
|
+
"cp1256_general_ci": 57,
|
|
904
|
+
"cp1257_bin": 58,
|
|
905
|
+
"cp1257_general_ci": 59,
|
|
906
|
+
"utf32_general_ci": 60,
|
|
907
|
+
"utf32_bin": 61,
|
|
908
|
+
"utf16le_bin": 62,
|
|
909
|
+
"binary": 63,
|
|
910
|
+
"armscii8_bin": 64,
|
|
911
|
+
"ascii_bin": 65,
|
|
912
|
+
"cp1250_bin": 66,
|
|
913
|
+
"cp1256_bin": 67,
|
|
914
|
+
"cp866_bin": 68,
|
|
915
|
+
"dec8_bin": 69,
|
|
916
|
+
"greek_bin": 70,
|
|
917
|
+
"hebrew_bin": 71,
|
|
918
|
+
"hp8_bin": 72,
|
|
919
|
+
"keybcs2_bin": 73,
|
|
920
|
+
"koi8r_bin": 74,
|
|
921
|
+
"koi8u_bin": 75,
|
|
922
|
+
"latin2_bin": 77,
|
|
923
|
+
"latin5_bin": 78,
|
|
924
|
+
"latin7_bin": 79,
|
|
925
|
+
"cp850_bin": 80,
|
|
926
|
+
"cp852_bin": 81,
|
|
927
|
+
"swe7_bin": 82,
|
|
928
|
+
"utf8_bin": 83,
|
|
929
|
+
"big5_bin": 84,
|
|
930
|
+
"euckr_bin": 85,
|
|
931
|
+
"gb2312_bin": 86,
|
|
932
|
+
"gbk_bin": 87,
|
|
933
|
+
"sjis_bin": 88,
|
|
934
|
+
"tis620_bin": 89,
|
|
935
|
+
"ucs2_bin": 90,
|
|
936
|
+
"ujis_bin": 91,
|
|
937
|
+
"geostd8_general_ci": 92,
|
|
938
|
+
"geostd8_bin": 93,
|
|
939
|
+
"latin1_spanish_ci": 94,
|
|
940
|
+
"cp932_japanese_ci": 95,
|
|
941
|
+
"cp932_bin": 96,
|
|
942
|
+
"eucjpms_japanese_ci": 97,
|
|
943
|
+
"eucjpms_bin": 98,
|
|
944
|
+
"cp1250_polish_ci": 99,
|
|
945
|
+
"utf16_unicode_ci": 101,
|
|
946
|
+
"utf16_icelandic_ci": 102,
|
|
947
|
+
"utf16_latvian_ci": 103,
|
|
948
|
+
"utf16_romanian_ci": 104,
|
|
949
|
+
"utf16_slovenian_ci": 105,
|
|
950
|
+
"utf16_polish_ci": 106,
|
|
951
|
+
"utf16_estonian_ci": 107,
|
|
952
|
+
"utf16_spanish_ci": 108,
|
|
953
|
+
"utf16_swedish_ci": 109,
|
|
954
|
+
"utf16_turkish_ci": 110,
|
|
955
|
+
"utf16_czech_ci": 111,
|
|
956
|
+
"utf16_danish_ci": 112,
|
|
957
|
+
"utf16_lithuanian_ci": 113,
|
|
958
|
+
"utf16_slovak_ci": 114,
|
|
959
|
+
"utf16_spanish2_ci": 115,
|
|
960
|
+
"utf16_roman_ci": 116,
|
|
961
|
+
"utf16_persian_ci": 117,
|
|
962
|
+
"utf16_esperanto_ci": 118,
|
|
963
|
+
"utf16_hungarian_ci": 119,
|
|
964
|
+
"utf16_sinhala_ci": 120,
|
|
965
|
+
"utf16_german2_ci": 121,
|
|
966
|
+
"utf16_croatian_ci": 122,
|
|
967
|
+
"utf16_unicode_520_ci": 123,
|
|
968
|
+
"utf16_vietnamese_ci": 124,
|
|
969
|
+
"ucs2_unicode_ci": 128,
|
|
970
|
+
"ucs2_icelandic_ci": 129,
|
|
971
|
+
"ucs2_latvian_ci": 130,
|
|
972
|
+
"ucs2_romanian_ci": 131,
|
|
973
|
+
"ucs2_slovenian_ci": 132,
|
|
974
|
+
"ucs2_polish_ci": 133,
|
|
975
|
+
"ucs2_estonian_ci": 134,
|
|
976
|
+
"ucs2_spanish_ci": 135,
|
|
977
|
+
"ucs2_swedish_ci": 136,
|
|
978
|
+
"ucs2_turkish_ci": 137,
|
|
979
|
+
"ucs2_czech_ci": 138,
|
|
980
|
+
"ucs2_danish_ci": 139,
|
|
981
|
+
"ucs2_lithuanian_ci": 140,
|
|
982
|
+
"ucs2_slovak_ci": 141,
|
|
983
|
+
"ucs2_spanish2_ci": 142,
|
|
984
|
+
"ucs2_roman_ci": 143,
|
|
985
|
+
"ucs2_persian_ci": 144,
|
|
986
|
+
"ucs2_esperanto_ci": 145,
|
|
987
|
+
"ucs2_hungarian_ci": 146,
|
|
988
|
+
"ucs2_sinhala_ci": 147,
|
|
989
|
+
"ucs2_german2_ci": 148,
|
|
990
|
+
"ucs2_croatian_ci": 149,
|
|
991
|
+
"ucs2_unicode_520_ci": 150,
|
|
992
|
+
"ucs2_vietnamese_ci": 151,
|
|
1007
993
|
"ucs2_general_mysql500_ci": 159,
|
|
1008
|
-
"utf32_unicode_ci":
|
|
1009
|
-
"utf32_icelandic_ci":
|
|
1010
|
-
"utf32_latvian_ci":
|
|
1011
|
-
"utf32_romanian_ci":
|
|
1012
|
-
"utf32_slovenian_ci":
|
|
1013
|
-
"utf32_polish_ci":
|
|
1014
|
-
"utf32_estonian_ci":
|
|
1015
|
-
"utf32_spanish_ci":
|
|
1016
|
-
"utf32_swedish_ci":
|
|
1017
|
-
"utf32_turkish_ci":
|
|
1018
|
-
"utf32_czech_ci":
|
|
1019
|
-
"utf32_danish_ci":
|
|
1020
|
-
"utf32_lithuanian_ci":
|
|
1021
|
-
"utf32_slovak_ci":
|
|
1022
|
-
"utf32_spanish2_ci":
|
|
1023
|
-
"utf32_roman_ci":
|
|
1024
|
-
"utf32_persian_ci":
|
|
1025
|
-
"utf32_esperanto_ci":
|
|
1026
|
-
"utf32_hungarian_ci":
|
|
1027
|
-
"utf32_sinhala_ci":
|
|
1028
|
-
"utf32_german2_ci":
|
|
1029
|
-
"utf32_croatian_ci":
|
|
1030
|
-
"utf32_unicode_520_ci":
|
|
1031
|
-
"utf32_vietnamese_ci":
|
|
1032
|
-
"utf8_unicode_ci":
|
|
1033
|
-
"utf8_icelandic_ci":
|
|
1034
|
-
"utf8_latvian_ci":
|
|
1035
|
-
"utf8_romanian_ci":
|
|
1036
|
-
"utf8_slovenian_ci":
|
|
1037
|
-
"utf8_polish_ci":
|
|
1038
|
-
"utf8_estonian_ci":
|
|
1039
|
-
"utf8_spanish_ci":
|
|
1040
|
-
"utf8_swedish_ci":
|
|
1041
|
-
"utf8_turkish_ci":
|
|
1042
|
-
"utf8_czech_ci":
|
|
1043
|
-
"utf8_danish_ci":
|
|
1044
|
-
"utf8_lithuanian_ci":
|
|
1045
|
-
"utf8_slovak_ci":
|
|
1046
|
-
"utf8_spanish2_ci":
|
|
1047
|
-
"utf8_roman_ci":
|
|
1048
|
-
"utf8_persian_ci":
|
|
1049
|
-
"utf8_esperanto_ci":
|
|
1050
|
-
"utf8_hungarian_ci":
|
|
1051
|
-
"utf8_sinhala_ci":
|
|
1052
|
-
"utf8_german2_ci":
|
|
1053
|
-
"utf8_croatian_ci":
|
|
1054
|
-
"utf8_unicode_520_ci":
|
|
1055
|
-
"utf8_vietnamese_ci":
|
|
994
|
+
"utf32_unicode_ci": 160,
|
|
995
|
+
"utf32_icelandic_ci": 161,
|
|
996
|
+
"utf32_latvian_ci": 162,
|
|
997
|
+
"utf32_romanian_ci": 163,
|
|
998
|
+
"utf32_slovenian_ci": 164,
|
|
999
|
+
"utf32_polish_ci": 165,
|
|
1000
|
+
"utf32_estonian_ci": 166,
|
|
1001
|
+
"utf32_spanish_ci": 167,
|
|
1002
|
+
"utf32_swedish_ci": 168,
|
|
1003
|
+
"utf32_turkish_ci": 169,
|
|
1004
|
+
"utf32_czech_ci": 170,
|
|
1005
|
+
"utf32_danish_ci": 171,
|
|
1006
|
+
"utf32_lithuanian_ci": 172,
|
|
1007
|
+
"utf32_slovak_ci": 173,
|
|
1008
|
+
"utf32_spanish2_ci": 174,
|
|
1009
|
+
"utf32_roman_ci": 175,
|
|
1010
|
+
"utf32_persian_ci": 176,
|
|
1011
|
+
"utf32_esperanto_ci": 177,
|
|
1012
|
+
"utf32_hungarian_ci": 178,
|
|
1013
|
+
"utf32_sinhala_ci": 179,
|
|
1014
|
+
"utf32_german2_ci": 180,
|
|
1015
|
+
"utf32_croatian_ci": 181,
|
|
1016
|
+
"utf32_unicode_520_ci": 182,
|
|
1017
|
+
"utf32_vietnamese_ci": 183,
|
|
1018
|
+
"utf8_unicode_ci": 192,
|
|
1019
|
+
"utf8_icelandic_ci": 193,
|
|
1020
|
+
"utf8_latvian_ci": 194,
|
|
1021
|
+
"utf8_romanian_ci": 195,
|
|
1022
|
+
"utf8_slovenian_ci": 196,
|
|
1023
|
+
"utf8_polish_ci": 197,
|
|
1024
|
+
"utf8_estonian_ci": 198,
|
|
1025
|
+
"utf8_spanish_ci": 199,
|
|
1026
|
+
"utf8_swedish_ci": 200,
|
|
1027
|
+
"utf8_turkish_ci": 201,
|
|
1028
|
+
"utf8_czech_ci": 202,
|
|
1029
|
+
"utf8_danish_ci": 203,
|
|
1030
|
+
"utf8_lithuanian_ci": 204,
|
|
1031
|
+
"utf8_slovak_ci": 205,
|
|
1032
|
+
"utf8_spanish2_ci": 206,
|
|
1033
|
+
"utf8_roman_ci": 207,
|
|
1034
|
+
"utf8_persian_ci": 208,
|
|
1035
|
+
"utf8_esperanto_ci": 209,
|
|
1036
|
+
"utf8_hungarian_ci": 210,
|
|
1037
|
+
"utf8_sinhala_ci": 211,
|
|
1038
|
+
"utf8_german2_ci": 212,
|
|
1039
|
+
"utf8_croatian_ci": 213,
|
|
1040
|
+
"utf8_unicode_520_ci": 214,
|
|
1041
|
+
"utf8_vietnamese_ci": 215,
|
|
1056
1042
|
"utf8_general_mysql500_ci": 223,
|
|
1057
|
-
"utf8mb4_unicode_ci":
|
|
1058
|
-
"utf8mb4_icelandic_ci":
|
|
1059
|
-
"utf8mb4_latvian_ci":
|
|
1060
|
-
"utf8mb4_romanian_ci":
|
|
1061
|
-
"utf8mb4_slovenian_ci":
|
|
1062
|
-
"utf8mb4_polish_ci":
|
|
1063
|
-
"utf8mb4_estonian_ci":
|
|
1064
|
-
"utf8mb4_spanish_ci":
|
|
1065
|
-
"utf8mb4_swedish_ci":
|
|
1066
|
-
"utf8mb4_turkish_ci":
|
|
1067
|
-
"utf8mb4_czech_ci":
|
|
1068
|
-
"utf8mb4_danish_ci":
|
|
1069
|
-
"utf8mb4_lithuanian_ci":
|
|
1070
|
-
"utf8mb4_slovak_ci":
|
|
1071
|
-
"utf8mb4_spanish2_ci":
|
|
1072
|
-
"utf8mb4_roman_ci":
|
|
1073
|
-
"utf8mb4_persian_ci":
|
|
1074
|
-
"utf8mb4_esperanto_ci":
|
|
1075
|
-
"utf8mb4_hungarian_ci":
|
|
1076
|
-
"utf8mb4_sinhala_ci":
|
|
1077
|
-
"utf8mb4_german2_ci":
|
|
1078
|
-
"utf8mb4_croatian_ci":
|
|
1079
|
-
"utf8mb4_unicode_520_ci":
|
|
1080
|
-
"utf8mb4_vietnamese_ci":
|
|
1043
|
+
"utf8mb4_unicode_ci": 224,
|
|
1044
|
+
"utf8mb4_icelandic_ci": 225,
|
|
1045
|
+
"utf8mb4_latvian_ci": 226,
|
|
1046
|
+
"utf8mb4_romanian_ci": 227,
|
|
1047
|
+
"utf8mb4_slovenian_ci": 228,
|
|
1048
|
+
"utf8mb4_polish_ci": 229,
|
|
1049
|
+
"utf8mb4_estonian_ci": 230,
|
|
1050
|
+
"utf8mb4_spanish_ci": 231,
|
|
1051
|
+
"utf8mb4_swedish_ci": 232,
|
|
1052
|
+
"utf8mb4_turkish_ci": 233,
|
|
1053
|
+
"utf8mb4_czech_ci": 234,
|
|
1054
|
+
"utf8mb4_danish_ci": 235,
|
|
1055
|
+
"utf8mb4_lithuanian_ci": 236,
|
|
1056
|
+
"utf8mb4_slovak_ci": 237,
|
|
1057
|
+
"utf8mb4_spanish2_ci": 238,
|
|
1058
|
+
"utf8mb4_roman_ci": 239,
|
|
1059
|
+
"utf8mb4_persian_ci": 240,
|
|
1060
|
+
"utf8mb4_esperanto_ci": 241,
|
|
1061
|
+
"utf8mb4_hungarian_ci": 242,
|
|
1062
|
+
"utf8mb4_sinhala_ci": 243,
|
|
1063
|
+
"utf8mb4_german2_ci": 244,
|
|
1064
|
+
"utf8mb4_croatian_ci": 245,
|
|
1065
|
+
"utf8mb4_unicode_520_ci": 246,
|
|
1066
|
+
"utf8mb4_vietnamese_ci": 247,
|
|
1081
1067
|
}
|
|
1082
1068
|
|
|
1083
1069
|
|
|
@@ -1170,53 +1156,55 @@ SQL_RESERVED_WORDS = [
|
|
|
1170
1156
|
"USING",
|
|
1171
1157
|
"VERBOSE",
|
|
1172
1158
|
"WHEN",
|
|
1173
|
-
"WHERE"
|
|
1159
|
+
"WHERE",
|
|
1174
1160
|
]
|
|
1175
1161
|
|
|
1176
1162
|
SERVER_VARIABLES = {
|
|
1177
1163
|
# var_name: (value, type, charset)
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1164
|
+
"@@session.auto_increment_increment": (1, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1165
|
+
"@@auto_increment_increment": (1, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1166
|
+
"@@character_set_client": ("utf8", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1167
|
+
"@@character_set_connection": ("utf8", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1168
|
+
"@@character_set_results": ("utf8", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1169
|
+
"@@GLOBAL.character_set_server": ("latin1", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1170
|
+
"@@character_set_server": ("latin1", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1171
|
+
"@@GLOBAL.collation_server": ("latin1_swedish_ci", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1172
|
+
"@@collation_server": ("latin1_swedish_ci", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1173
|
+
"@@init_connect": ("", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]), # None or '' ?
|
|
1174
|
+
"@@interactive_timeout": (28800, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1175
|
+
"@@license": ("GPL", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1176
|
+
"@@lower_case_table_names": (0, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1177
|
+
"@@GLOBAL.lower_case_table_names": (0, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1178
|
+
"@@max_allowed_packet": (16777216, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1179
|
+
"@@net_buffer_length": (16384, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1180
|
+
"@@net_write_timeout": (60, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1181
|
+
"@@query_cache_size": (16777216, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1182
|
+
"@@query_cache_type": ("OFF", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1183
|
+
"@@sql_mode": (
|
|
1184
|
+
"ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",
|
|
1185
|
+
TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1186
|
+
CHARSET_NUMBERS["utf8_general_ci"],
|
|
1187
|
+
),
|
|
1201
1188
|
# '@@system_time_zone': ('MSK', TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS['utf8_general_ci']),
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1189
|
+
"@@system_time_zone": ("UTC", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1190
|
+
"@@time_zone": ("SYSTEM", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1191
|
+
"@@session.tx_isolation": ("REPEATABLE-READ", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1192
|
+
"@@tx_isolation": ("REPEATABLE-READ", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1193
|
+
"@@wait_timeout": (28800, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1194
|
+
"@@session.tx_read_only": ("0", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1195
|
+
"@@version_comment": ("(MindsDB)", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1196
|
+
"@@version": ("8.0.17", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1197
|
+
"@@collation_connection": ("utf8_general_ci", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1198
|
+
"@@performance_schema": (1, TYPES.MYSQL_TYPE_LONGLONG, CHARSET_NUMBERS["binary"]),
|
|
1199
|
+
"@@GLOBAL.transaction_isolation": (
|
|
1200
|
+
"REPEATABLE-READ",
|
|
1201
|
+
TYPES.MYSQL_TYPE_VAR_STRING,
|
|
1202
|
+
CHARSET_NUMBERS["utf8_general_ci"],
|
|
1203
|
+
),
|
|
1204
|
+
"@@transaction_isolation": ("REPEATABLE-READ", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1205
|
+
"@@event_scheduler": ("OFF", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1206
|
+
"@@default_storage_engine": ("InnoDB", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1207
|
+
"@@default_tmp_storage_engine": ("InnoDB", TYPES.MYSQL_TYPE_VAR_STRING, CHARSET_NUMBERS["utf8_general_ci"]),
|
|
1220
1208
|
}
|
|
1221
1209
|
|
|
1222
1210
|
|
|
@@ -1235,19 +1223,19 @@ SESSION_TRACK = SESSION_TRACK()
|
|
|
1235
1223
|
ALL = vars()
|
|
1236
1224
|
|
|
1237
1225
|
|
|
1238
|
-
def VAR_NAME(val, prefix=
|
|
1226
|
+
def VAR_NAME(val, prefix=""):
|
|
1239
1227
|
global ALL
|
|
1240
1228
|
|
|
1241
1229
|
for key in ALL.keys():
|
|
1242
1230
|
value = ALL[key]
|
|
1243
|
-
if value == val and key !=
|
|
1244
|
-
if prefix ==
|
|
1231
|
+
if value == val and key != "val":
|
|
1232
|
+
if prefix == "" or (prefix != "" and prefix == key[: len(prefix)]):
|
|
1245
1233
|
return key
|
|
1246
1234
|
return None
|
|
1247
1235
|
|
|
1248
1236
|
|
|
1249
1237
|
def getConstName(consts, value):
|
|
1250
|
-
attrs = [x for x in dir(consts) if x.startswith(
|
|
1238
|
+
attrs = [x for x in dir(consts) if x.startswith("__") is False]
|
|
1251
1239
|
constNames = {getattr(consts, x): x for x in attrs}
|
|
1252
1240
|
if value in constNames:
|
|
1253
1241
|
return constNames[value]
|