Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dd9929c

Browse filesBrowse files
scopmethane
authored andcommitted
Update error constants (PyMySQL#113)
* Add CR and ER main methods for updating from connector-c headers * Sync CR and ER with MySQL/MariaDB connector C 6.1.6/2.3.1
1 parent db1bb2c commit dd9929c
Copy full SHA for dd9929c

File tree

Expand file treeCollapse file tree

2 files changed

+670
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+670
-3
lines changed

‎MySQLdb/constants/CR.py

Copy file name to clipboardExpand all lines: MySQLdb/constants/CR.py
+75-1Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,35 @@
55
66
"""
77

8+
if __name__ == "__main__":
9+
"""
10+
Usage: python CR.py [/path/to/mysql/errmsg.h ...] >> CR.py
11+
"""
12+
import fileinput, re
13+
data = {}
14+
error_last = None
15+
for line in fileinput.input():
16+
line = re.sub(r'/\*.*?\*/', '', line)
17+
m = re.match(r'^\s*#define\s+CR_([A-Z0-9_]+)\s+(\d+)(\s.*|$)', line)
18+
if m:
19+
name = m.group(1)
20+
value = int(m.group(2))
21+
if name == 'ERROR_LAST':
22+
if error_last is None or error_last < value:
23+
error_last = value
24+
continue
25+
if value not in data:
26+
data[value] = set()
27+
data[value].add(name)
28+
for value, names in sorted(data.items()):
29+
for name in sorted(names):
30+
print('%s = %s' % (name, value))
31+
if error_last is not None:
32+
print('ERROR_LAST = %s' % error_last)
33+
34+
35+
ERROR_FIRST = 2000
836
MIN_ERROR = 2000
9-
MAX_ERROR = 2999
1037
UNKNOWN_ERROR = 2000
1138
SOCKET_CREATE_ERROR = 2001
1239
CONNECTION_ERROR = 2002
@@ -28,3 +55,50 @@
2855
NAMEDPIPESETSTATE_ERROR = 2018
2956
CANT_READ_CHARSET = 2019
3057
NET_PACKET_TOO_LARGE = 2020
58+
EMBEDDED_CONNECTION = 2021
59+
PROBE_SLAVE_STATUS = 2022
60+
PROBE_SLAVE_HOSTS = 2023
61+
PROBE_SLAVE_CONNECT = 2024
62+
PROBE_MASTER_CONNECT = 2025
63+
SSL_CONNECTION_ERROR = 2026
64+
MALFORMED_PACKET = 2027
65+
WRONG_LICENSE = 2028
66+
NULL_POINTER = 2029
67+
NO_PREPARE_STMT = 2030
68+
PARAMS_NOT_BOUND = 2031
69+
DATA_TRUNCATED = 2032
70+
NO_PARAMETERS_EXISTS = 2033
71+
INVALID_PARAMETER_NO = 2034
72+
INVALID_BUFFER_USE = 2035
73+
UNSUPPORTED_PARAM_TYPE = 2036
74+
SHARED_MEMORY_CONNECTION = 2037
75+
SHARED_MEMORY_CONNECT_REQUEST_ERROR = 2038
76+
SHARED_MEMORY_CONNECT_ANSWER_ERROR = 2039
77+
SHARED_MEMORY_CONNECT_FILE_MAP_ERROR = 2040
78+
SHARED_MEMORY_CONNECT_MAP_ERROR = 2041
79+
SHARED_MEMORY_FILE_MAP_ERROR = 2042
80+
SHARED_MEMORY_MAP_ERROR = 2043
81+
SHARED_MEMORY_EVENT_ERROR = 2044
82+
SHARED_MEMORY_CONNECT_ABANDONED_ERROR = 2045
83+
SHARED_MEMORY_CONNECT_SET_ERROR = 2046
84+
CONN_UNKNOW_PROTOCOL = 2047
85+
INVALID_CONN_HANDLE = 2048
86+
SECURE_AUTH = 2049
87+
UNUSED_1 = 2049
88+
FETCH_CANCELED = 2050
89+
NO_DATA = 2051
90+
NO_STMT_METADATA = 2052
91+
NO_RESULT_SET = 2053
92+
NOT_IMPLEMENTED = 2054
93+
SERVER_LOST_EXTENDED = 2055
94+
STMT_CLOSED = 2056
95+
NEW_STMT_METADATA = 2057
96+
ALREADY_CONNECTED = 2058
97+
AUTH_PLUGIN_CANNOT_LOAD = 2058
98+
ALREADY_CONNECTED = 2059
99+
AUTH_PLUGIN_CANNOT_LOAD = 2059
100+
DUPLICATE_CONNECTION_ATTR = 2060
101+
PLUGIN_FUNCTION_NOT_SUPPORTED = 2060
102+
AUTH_PLUGIN_ERR = 2061
103+
MAX_ERROR = 2999
104+
ERROR_LAST = 2061

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.