@@ -108,7 +108,6 @@ def os_strerror_patched(code):
108
108
os .strerror = os_strerror_patched
109
109
del os_strerror_patched
110
110
111
-
112
111
class SchemaError (DatabaseError ):
113
112
def __init__ (self , value ):
114
113
super (SchemaError , self ).__init__ (0 , value )
@@ -117,6 +116,16 @@ def __init__(self, value):
117
116
def __str__ (self ):
118
117
return str (self .value )
119
118
119
+ class SchemaReloadException (DatabaseError ):
120
+ def __init__ (self , message , schema_version ):
121
+ super (SchemaReloadException , self ).__init__ (109 , message )
122
+ self .code = 109
123
+ self .message = message
124
+ self .schema_version = schema_version
125
+
126
+ def __str__ (self ):
127
+ return str (self .message )
128
+
120
129
121
130
class NetworkError (DatabaseError ):
122
131
@@ -144,18 +153,8 @@ class NetworkWarning(UserWarning):
144
153
pass
145
154
146
155
147
- class RetryWarning (UserWarning ):
148
-
149
- '''
150
- Warning is emited in case of server return completion_status == 1
151
- (try again)
152
- '''
153
- pass
154
-
155
-
156
156
# always print this warnings
157
157
warnings .filterwarnings ("always" , category = NetworkWarning )
158
- warnings .filterwarnings ("always" , category = RetryWarning )
159
158
160
159
161
160
def warn (message , warning_class ):
@@ -169,68 +168,120 @@ def warn(message, warning_class):
169
168
warnings .warn_explicit (message , warning_class , module_name , line_no )
170
169
171
170
_strerror = {
172
- 0 : ("ER_OK" , "OK" ),
173
- 1 : ("ER_ILLEGAL_PARAMS" , "Illegal parameters, %s" ),
174
- 2 : ("ER_MEMORY_ISSUE" , "Failed to allocate %u bytes in %s for %s" ),
175
- 3 : ("ER_TUPLE_FOUND" , "Duplicate key exists in unique index %u" ),
176
- 4 : ("ER_TUPLE_NOT_FOUND" , "Tuple doesn't exist in index %u" ),
177
- 5 : ("ER_UNSUPPORTED" , "%s does not support %s" ),
178
- 6 : ("ER_NONMASTER" ,
179
- "Can't modify data on a replication slave. My master is: %s" ),
180
- 7 : ("ER_SECONDARY" ,
181
- "Can't modify data upon a request on the secondary port." ),
182
- 8 : ("ER_INJECTION" , "Error injection '%s'" ),
183
- 9 : ("ER_CREATE_SPACE" , "Failed to create space %u: %s" ),
184
- 10 : ("ER_SPACE_EXISTS" , "Space %u already exists" ),
185
- 11 : ("ER_DROP_SPACE" , "Can't drop space %u: %s" ),
186
- 12 : ("ER_ALTER_SPACE" , "Can't modify space %u: %s" ),
187
- 13 : ("ER_INDEX_TYPE" ,
188
- "Unsupported index type supplied for index %u in space %u" ),
189
- 14 : ("ER_MODIFY_INDEX" ,
190
- "Can't create or modify index %u in space %u: %s" ),
191
- 15 : ("ER_LAST_DROP" ,
192
- "Can't drop the primary key in a system space, space id %u" ),
193
- 16 : ("ER_TUPLE_FORMAT_LIMIT" , "Tuple format limit reached: %u" ),
194
- 17 : ("ER_DROP_PRIMARY_KEY" ,
195
- "Can't drop primary key in space %u while secondary keys exist" ),
196
- 18 : ("ER_KEY_FIELD_TYPE" ,
197
- ("Supplied key type of part %u does not match index part type:"
198
- " expected %s" )),
199
- 19 : ("ER_EXACT_MATCH" ,
200
- "Invalid key part count in an exact match (expected %u, got %u)" ),
201
- 20 : ("ER_INVALID_MSGPACK" , "Invalid MsgPack - %s" ),
202
- 21 : ("ER_PROC_RET" , "msgpack.encode: can not encode Lua type '%s'" ),
203
- 22 : ("ER_TUPLE_NOT_ARRAY" , "Tuple/Key must be MsgPack array" ),
204
- 23 : ("ER_FIELD_TYPE" ,
205
- ("Tuple field %u type does not match one required by operation:"
206
- " expected %s" )),
207
- 24 : ("ER_FIELD_TYPE_MISMATCH" ,
208
- ("Ambiguous field type in index %u, key part %u. Requested type"
209
- " is %s but the field has previously been defined as %s" )),
210
- 25 : ("ER_SPLICE" , "Field SPLICE error: %s" ),
211
- 26 : ("ER_ARG_TYPE" ,
212
- ("Argument type in operation on field %u does not match field type:"
213
- " expected a %s" )),
214
- 27 : ("ER_TUPLE_IS_TOO_LONG" , "Tuple is too long %u" ),
215
- 28 : ("ER_UNKNOWN_UPDATE_OP" , "Unknown UPDATE operation" ),
216
- 29 : ("ER_UPDATE_FIELD" , "Field %u UPDATE error: %s" ),
217
- 30 : ("ER_FIBER_STACK" ,
218
- "Can not create a new fiber: recursion limit reached" ),
219
- 31 : ("ER_KEY_PART_COUNT" ,
220
- "Invalid key part count (expected [0..%u], got %u)" ),
221
- 32 : ("ER_PROC_LUA" , "%s" ),
222
- 33 : ("ER_NO_SUCH_PROC" , "Procedure '%.*s' is not defined" ),
223
- 34 : ("ER_NO_SUCH_TRIGGER" , "Trigger is not found" ),
224
- 35 : ("ER_NO_SUCH_INDEX" , "No index #%u is defined in space %u" ),
225
- 36 : ("ER_NO_SUCH_SPACE" , "Space %u does not exist" ),
226
- 37 : ("ER_NO_SUCH_FIELD" , "Field %u was not found in the tuple" ),
227
- 38 : ("ER_SPACE_ARITY" ,
228
- "Tuple field count %u does not match space %u arity %u" ),
229
- 39 : ("ER_INDEX_ARITY" ,
230
- ("Tuple field count %u is less than required by a defined index"
231
- " (expected %u)" )),
232
- 40 : ("ER_WAL_IO" , "Failed to write to disk" ),
233
- 41 : ("ER_MORE_THAN_ONE_TUPLE" , "More than one tuple found" ),
171
+ 0 : ("ER_UNKNOWN" , "Unknown error" ),
172
+ 1 : ("ER_ILLEGAL_PARAMS" , "Illegal parameters, %s" ),
173
+ 2 : ("ER_MEMORY_ISSUE" , "Failed to allocate %u bytes in %s for %s" ),
174
+ 3 : ("ER_TUPLE_FOUND" , "Duplicate key exists in unique index '%s' in space '%s'" ),
175
+ 4 : ("ER_TUPLE_NOT_FOUND" , "Tuple doesn't exist in index '%s' in space '%s'" ),
176
+ 5 : ("ER_UNSUPPORTED" , "%s does not support %s" ),
177
+ 6 : ("ER_NONMASTER" , "Can't modify data on a replication slave. My master is: %s" ),
178
+ 7 : ("ER_READONLY" , "Can't modify data because this server is in read-only mode." ),
179
+ 8 : ("ER_INJECTION" , "Error injection '%s'" ),
180
+ 9 : ("ER_CREATE_SPACE" , "Failed to create space '%s': %s" ),
181
+ 10 : ("ER_SPACE_EXISTS" , "Space '%s' already exists" ),
182
+ 11 : ("ER_DROP_SPACE" , "Can't drop space '%s': %s" ),
183
+ 12 : ("ER_ALTER_SPACE" , "Can't modify space '%s': %s" ),
184
+ 13 : ("ER_INDEX_TYPE" , "Unsupported index type supplied for index '%s' in space '%s'" ),
185
+ 14 : ("ER_MODIFY_INDEX" , "Can't create or modify index '%s' in space '%s': %s" ),
186
+ 15 : ("ER_LAST_DROP" , "Can't drop the primary key in a system space, space '%s'" ),
187
+ 16 : ("ER_TUPLE_FORMAT_LIMIT" , "Tuple format limit reached: %u" ),
188
+ 17 : ("ER_DROP_PRIMARY_KEY" , "Can't drop primary key in space '%s' while secondary keys exist" ),
189
+ 18 : ("ER_KEY_PART_TYPE" , "Supplied key type of part %u does not match index part type: expected %s" ),
190
+ 19 : ("ER_EXACT_MATCH" , "Invalid key part count in an exact match (expected %u, got %u)" ),
191
+ 20 : ("ER_INVALID_MSGPACK" , "Invalid MsgPack - %s" ),
192
+ 21 : ("ER_PROC_RET" , "msgpack.encode: can not encode Lua type '%s'" ),
193
+ 22 : ("ER_TUPLE_NOT_ARRAY" , "Tuple/Key must be MsgPack array" ),
194
+ 23 : ("ER_FIELD_TYPE" , "Tuple field %u type does not match one required by operation: expected %s" ),
195
+ 24 : ("ER_FIELD_TYPE_MISMATCH" , "Ambiguous field type in index '%s', key part %u. Requested type is %s but the field has previously been defined as %s" ),
196
+ 25 : ("ER_SPLICE" , "SPLICE error on field %u: %s" ),
197
+ 26 : ("ER_ARG_TYPE" , "Argument type in operation '%c' on field %u does not match field type: expected a %s" ),
198
+ 27 : ("ER_TUPLE_IS_TOO_LONG" , "Tuple is too long %u" ),
199
+ 28 : ("ER_UNKNOWN_UPDATE_OP" , "Unknown UPDATE operation" ),
200
+ 29 : ("ER_UPDATE_FIELD" , "Field %u UPDATE error: %s" ),
201
+ 30 : ("ER_FIBER_STACK" , "Can not create a new fiber: recursion limit reached" ),
202
+ 31 : ("ER_KEY_PART_COUNT" , "Invalid key part count (expected [0..%u], got %u)" ),
203
+ 32 : ("ER_PROC_LUA" , "%s" ),
204
+ 33 : ("ER_NO_SUCH_PROC" , "Procedure '%.*s' is not defined" ),
205
+ 34 : ("ER_NO_SUCH_TRIGGER" , "Trigger is not found" ),
206
+ 35 : ("ER_NO_SUCH_INDEX" , "No index #%u is defined in space '%s'" ),
207
+ 36 : ("ER_NO_SUCH_SPACE" , "Space '%s' does not exist" ),
208
+ 37 : ("ER_NO_SUCH_FIELD" , "Field %d was not found in the tuple" ),
209
+ 38 : ("ER_SPACE_FIELD_COUNT" , "Tuple field count %u does not match space '%s' field count %u" ),
210
+ 39 : ("ER_INDEX_FIELD_COUNT" , "Tuple field count %u is less than required by a defined index (expected %u)" ),
211
+ 40 : ("ER_WAL_IO" , "Failed to write to disk" ),
212
+ 41 : ("ER_MORE_THAN_ONE_TUPLE" , "More than one tuple found by get()" ),
213
+ 42 : ("ER_ACCESS_DENIED" , "%s access on %s is denied for user '%s'" ),
214
+ 43 : ("ER_CREATE_USER" , "Failed to create user '%s': %s" ),
215
+ 44 : ("ER_DROP_USER" , "Failed to drop user or role '%s': %s" ),
216
+ 45 : ("ER_NO_SUCH_USER" , "User '%s' is not found" ),
217
+ 46 : ("ER_USER_EXISTS" , "User '%s' already exists" ),
218
+ 47 : ("ER_PASSWORD_MISMATCH" , "Incorrect password supplied for user '%s'" ),
219
+ 48 : ("ER_UNKNOWN_REQUEST_TYPE" , "Unknown request type %u" ),
220
+ 49 : ("ER_UNKNOWN_SCHEMA_OBJECT" , "Unknown object type '%s'" ),
221
+ 50 : ("ER_CREATE_FUNCTION" , "Failed to create function '%s': %s" ),
222
+ 51 : ("ER_NO_SUCH_FUNCTION" , "Function '%s' does not exist" ),
223
+ 52 : ("ER_FUNCTION_EXISTS" , "Function '%s' already exists" ),
224
+ 53 : ("ER_FUNCTION_ACCESS_DENIED" , "%s access is denied for user '%s' to function '%s'" ),
225
+ 54 : ("ER_FUNCTION_MAX" , "A limit on the total number of functions has been reached: %u" ),
226
+ 55 : ("ER_SPACE_ACCESS_DENIED" , "%s access is denied for user '%s' to space '%s'" ),
227
+ 56 : ("ER_USER_MAX" , "A limit on the total number of users has been reached: %u" ),
228
+ 57 : ("ER_NO_SUCH_ENGINE" , "Space engine '%s' does not exist" ),
229
+ 58 : ("ER_RELOAD_CFG" , "Can't set option '%s' dynamically" ),
230
+ 59 : ("ER_CFG" , "Incorrect value for option '%s': %s" ),
231
+ 60 : ("ER_SOPHIA" , "%s" ),
232
+ 61 : ("ER_LOCAL_SERVER_IS_NOT_ACTIVE" , "Local server is not active" ),
233
+ 62 : ("ER_UNKNOWN_SERVER" , "Server %s is not registered with the cluster" ),
234
+ 63 : ("ER_CLUSTER_ID_MISMATCH" , "Cluster id of the replica %s doesn't match cluster id of the master %s" ),
235
+ 64 : ("ER_INVALID_UUID" , "Invalid UUID: %s" ),
236
+ 65 : ("ER_CLUSTER_ID_IS_RO" , "Can't reset cluster id: it is already assigned" ),
237
+ 66 : ("ER_RESERVED66" , "Reserved66" ),
238
+ 67 : ("ER_SERVER_ID_IS_RESERVED" , "Can't initialize server id with a reserved value %u" ),
239
+ 68 : ("ER_INVALID_ORDER" , "Invalid LSN order for server %u: previous LSN = %llu, new lsn = %llu" ),
240
+ 69 : ("ER_MISSING_REQUEST_FIELD" , "Missing mandatory field '%s' in request" ),
241
+ 70 : ("ER_IDENTIFIER" , "Invalid identifier '%s' (expected letters, digits or an underscore)" ),
242
+ 71 : ("ER_DROP_FUNCTION" , "Can't drop function %u: %s" ),
243
+ 72 : ("ER_ITERATOR_TYPE" , "Unknown iterator type '%s'" ),
244
+ 73 : ("ER_REPLICA_MAX" , "Replica count limit reached: %u" ),
245
+ 74 : ("ER_INVALID_XLOG" , "Failed to read xlog: %lld" ),
246
+ 75 : ("ER_INVALID_XLOG_NAME" , "Invalid xlog name: expected %lld got %lld" ),
247
+ 76 : ("ER_INVALID_XLOG_ORDER" , "Invalid xlog order: %lld and %lld" ),
248
+ 77 : ("ER_NO_CONNECTION" , "Connection is not established" ),
249
+ 78 : ("ER_TIMEOUT" , "Timeout exceeded" ),
250
+ 79 : ("ER_ACTIVE_TRANSACTION" , "Operation is not permitted when there is an active transaction " ),
251
+ 80 : ("ER_NO_ACTIVE_TRANSACTION" , "Operation is not permitted when there is no active transaction " ),
252
+ 81 : ("ER_CROSS_ENGINE_TRANSACTION" , "A multi-statement transaction can not use multiple storage engines" ),
253
+ 82 : ("ER_NO_SUCH_ROLE" , "Role '%s' is not found" ),
254
+ 83 : ("ER_ROLE_EXISTS" , "Role '%s' already exists" ),
255
+ 84 : ("ER_CREATE_ROLE" , "Failed to create role '%s': %s" ),
256
+ 85 : ("ER_INDEX_EXISTS" , "Index '%s' already exists" ),
257
+ 86 : ("ER_TUPLE_REF_OVERFLOW" , "Tuple reference counter overflow" ),
258
+ 87 : ("ER_ROLE_LOOP" , "Granting role '%s' to role '%s' would create a loop" ),
259
+ 88 : ("ER_GRANT" , "Incorrect grant arguments: %s" ),
260
+ 89 : ("ER_PRIV_GRANTED" , "User '%s' already has %s access on %s '%s'" ),
261
+ 90 : ("ER_ROLE_GRANTED" , "User '%s' already has role '%s'" ),
262
+ 91 : ("ER_PRIV_NOT_GRANTED" , "User '%s' does not have %s access on %s '%s'" ),
263
+ 92 : ("ER_ROLE_NOT_GRANTED" , "User '%s' does not have role '%s'" ),
264
+ 93 : ("ER_MISSING_SNAPSHOT" , "Can't find snapshot" ),
265
+ 94 : ("ER_CANT_UPDATE_PRIMARY_KEY" , "Attempt to modify a tuple field which is part of index '%s' in space '%s'" ),
266
+ 95 : ("ER_UPDATE_INTEGER_OVERFLOW" , "Integer overflow when performing '%c' operation on field %u" ),
267
+ 96 : ("ER_GUEST_USER_PASSWORD" , "Setting password for guest user has no effect" ),
268
+ 97 : ("ER_TRANSACTION_CONFLICT" , "Transaction has been aborted by conflict" ),
269
+ 98 : ("ER_UNSUPPORTED_ROLE_PRIV" , "Unsupported role privilege '%s'" ),
270
+ 99 : ("ER_LOAD_FUNCTION" , "Failed to dynamically load function '%s': %s" ),
271
+ 100 : ("ER_FUNCTION_LANGUAGE" , "Unsupported language '%s' specified for function '%s'" ),
272
+ 101 : ("ER_RTREE_RECT" , "RTree: %s must be an array with %u (point) or %u (rectangle/box) numeric coordinates" ),
273
+ 102 : ("ER_PROC_C" , "%s" ),
274
+ 103 : ("ER_UNKNOWN_RTREE_INDEX_DISTANCE_TYPE" , "Unknown RTREE index distance type %s" ),
275
+ 104 : ("ER_PROTOCOL" , "%s" ),
276
+ 105 : ("ER_UPSERT_UNIQUE_SECONDARY_KEY" , "Space %s has a unique secondary index and does not support UPSERT" ),
277
+ 106 : ("ER_WRONG_INDEX_RECORD" , "Wrong record in _index space: got {%s}, expected {%s}" ),
278
+ 107 : ("ER_WRONG_INDEX_PARTS" , "Wrong index parts (field %u): %s; expected field1 id (number), field1 type (string), ..." ),
279
+ 108 : ("ER_WRONG_INDEX_OPTIONS" , "Wrong index options (field %u): %s" ),
280
+ 109 : ("ER_WRONG_SCHEMA_VERSION" , "Wrong schema version, current: %d, in request: %u" ),
281
+ 110 : ("ER_SLAB_ALLOC_MAX" , "Failed to allocate %u bytes for tuple in the slab allocator: tuple is too large. Check 'slab_alloc_maximal' configuration option." ),
282
+ 111 : ("ER_WRONG_SPACE_OPTIONS" , "Wrong space options (field %u): %s" ),
283
+ 112 : ("ER_UNSUPPORTED_INDEX_FEATURE" , "Index '%s' (%s) of space '%s' (%s) does not support %s" ),
284
+ 113 : ("ER_VIEW_IS_RO" , "View '%s' is read-only" ),
234
285
}
235
286
236
287
0 commit comments