Skip to content

Commit 64370a1

Browse files
author
zhengshuxin
committed
Add mysql-8.4.7's headers and use it as the default.
1 parent f303928 commit 64370a1

18 files changed

+9764
-8
lines changed

include/mysql/8.4.7/errmsg.h

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
#ifndef ERRMSG_INCLUDED
2+
#define ERRMSG_INCLUDED
3+
4+
/* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
5+
6+
This program is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License, version 2.0,
8+
as published by the Free Software Foundation.
9+
10+
This program is designed to work with certain software (including
11+
but not limited to OpenSSL) that is licensed under separate terms,
12+
as designated in a particular file or component or in included license
13+
documentation. The authors of MySQL hereby grant you an additional
14+
permission to link the program and your derivative works with the
15+
separately licensed software that they have either included with
16+
the program or referenced in the documentation.
17+
18+
Without limiting anything contained in the foregoing, this file,
19+
which is part of C Driver for MySQL (Connector/C), is also subject to the
20+
Universal FOSS Exception, version 1.0, a copy of which can be found at
21+
http://oss.oracle.com/licenses/universal-foss-exception.
22+
23+
This program is distributed in the hope that it will be useful,
24+
but WITHOUT ANY WARRANTY; without even the implied warranty of
25+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26+
GNU General Public License, version 2.0, for more details.
27+
28+
You should have received a copy of the GNU General Public License
29+
along with this program; if not, write to the Free Software
30+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
31+
32+
/**
33+
@file include/errmsg.h
34+
35+
Error messages for MySQL clients.
36+
These are constant and use the CR_ prefix.
37+
<mysqlclient_ername.h> will contain auto-generated mappings
38+
containing the symbolic name and the number from this file,
39+
and the english error messages in libmysql/errmsg.c.
40+
41+
Dynamic error messages for the daemon are in share/language/errmsg.sys.
42+
The server equivalent to <errmsg.h> is <mysqld_error.h>.
43+
The server equivalent to <mysqlclient_ername.h> is <mysqld_ername.h>.
44+
45+
Note that the auth subsystem also uses codes with a CR_ prefix.
46+
*/
47+
48+
void init_client_errs(void);
49+
void finish_client_errs(void);
50+
extern const char *client_errors[]; /* Error messages */
51+
52+
#define CR_MIN_ERROR 2000 /* For easier client code */
53+
#define CR_MAX_ERROR 2999
54+
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
55+
56+
/* Do not add error numbers before CR_ERROR_FIRST. */
57+
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
58+
#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/
59+
#define CR_UNKNOWN_ERROR 2000
60+
#define CR_SOCKET_CREATE_ERROR 2001
61+
#define CR_CONNECTION_ERROR 2002
62+
#define CR_CONN_HOST_ERROR 2003
63+
#define CR_IPSOCK_ERROR 2004
64+
#define CR_UNKNOWN_HOST 2005
65+
#define CR_SERVER_GONE_ERROR 2006
66+
#define CR_VERSION_ERROR 2007
67+
#define CR_OUT_OF_MEMORY 2008
68+
#define CR_WRONG_HOST_INFO 2009
69+
#define CR_LOCALHOST_CONNECTION 2010
70+
#define CR_TCP_CONNECTION 2011
71+
#define CR_SERVER_HANDSHAKE_ERR 2012
72+
#define CR_SERVER_LOST 2013
73+
#define CR_COMMANDS_OUT_OF_SYNC 2014
74+
#define CR_NAMEDPIPE_CONNECTION 2015
75+
#define CR_NAMEDPIPEWAIT_ERROR 2016
76+
#define CR_NAMEDPIPEOPEN_ERROR 2017
77+
#define CR_NAMEDPIPESETSTATE_ERROR 2018
78+
#define CR_CANT_READ_CHARSET 2019
79+
#define CR_NET_PACKET_TOO_LARGE 2020
80+
#define CR_EMBEDDED_CONNECTION 2021
81+
#define CR_PROBE_REPLICA_STATUS 2022
82+
#define CR_PROBE_REPLICA_HOSTS 2023
83+
#define CR_PROBE_REPLICA_CONNECT 2024
84+
#define CR_PROBE_SOURCE_CONNECT 2025
85+
#define CR_SSL_CONNECTION_ERROR 2026
86+
#define CR_MALFORMED_PACKET 2027
87+
#define CR_WRONG_LICENSE 2028
88+
89+
/* new 4.1 error codes */
90+
#define CR_NULL_POINTER 2029
91+
#define CR_NO_PREPARE_STMT 2030
92+
#define CR_PARAMS_NOT_BOUND 2031
93+
#define CR_DATA_TRUNCATED 2032
94+
#define CR_NO_PARAMETERS_EXISTS 2033
95+
#define CR_INVALID_PARAMETER_NO 2034
96+
#define CR_INVALID_BUFFER_USE 2035
97+
#define CR_UNSUPPORTED_PARAM_TYPE 2036
98+
99+
#define CR_SHARED_MEMORY_CONNECTION 2037
100+
#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
101+
#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
102+
#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
103+
#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
104+
#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
105+
#define CR_SHARED_MEMORY_MAP_ERROR 2043
106+
#define CR_SHARED_MEMORY_EVENT_ERROR 2044
107+
#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
108+
#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
109+
#define CR_CONN_UNKNOW_PROTOCOL 2047
110+
#define CR_INVALID_CONN_HANDLE 2048
111+
#define CR_UNUSED_1 2049
112+
#define CR_FETCH_CANCELED 2050
113+
#define CR_NO_DATA 2051
114+
#define CR_NO_STMT_METADATA 2052
115+
#define CR_NO_RESULT_SET 2053
116+
#define CR_NOT_IMPLEMENTED 2054
117+
#define CR_SERVER_LOST_EXTENDED 2055
118+
#define CR_STMT_CLOSED 2056
119+
#define CR_NEW_STMT_METADATA 2057
120+
#define CR_ALREADY_CONNECTED 2058
121+
#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
122+
#define CR_DUPLICATE_CONNECTION_ATTR 2060
123+
#define CR_AUTH_PLUGIN_ERR 2061
124+
#define CR_INSECURE_API_ERR 2062
125+
#define CR_FILE_NAME_TOO_LONG 2063
126+
#define CR_SSL_FIPS_MODE_ERR 2064
127+
#define CR_DEPRECATED_COMPRESSION_NOT_SUPPORTED 2065
128+
#define CR_COMPRESSION_WRONGLY_CONFIGURED 2066
129+
#define CR_KERBEROS_USER_NOT_FOUND 2067
130+
#define CR_LOAD_DATA_LOCAL_INFILE_REJECTED 2068
131+
#define CR_LOAD_DATA_LOCAL_INFILE_REALPATH_FAIL 2069
132+
#define CR_DNS_SRV_LOOKUP_FAILED 2070
133+
#define CR_MANDATORY_TRACKER_NOT_FOUND 2071
134+
#define CR_INVALID_FACTOR_NO 2072
135+
#define CR_CANT_GET_SESSION_DATA 2073
136+
#define CR_INVALID_CLIENT_CHARSET 2074
137+
#define CR_TLS_SERVER_NOT_FOUND 2075
138+
#define CR_ERROR_LAST /*Copy last error nr:*/ 2075
139+
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
140+
141+
/* Visual Studio requires '__inline' for C code */
142+
static inline const char *ER_CLIENT(int client_errno) {
143+
if (client_errno >= CR_ERROR_FIRST && client_errno <= CR_ERROR_LAST)
144+
return client_errors[client_errno - CR_ERROR_FIRST];
145+
return client_errors[CR_UNKNOWN_ERROR - CR_ERROR_FIRST];
146+
}
147+
148+
#endif /* ERRMSG_INCLUDED */

include/mysql/8.4.7/field_types.h

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/* Copyright (c) 2014, 2025, Oracle and/or its affiliates.
2+
3+
This program is free software; you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License, version 2.0,
5+
as published by the Free Software Foundation.
6+
7+
This program is designed to work with certain software (including
8+
but not limited to OpenSSL) that is licensed under separate terms,
9+
as designated in a particular file or component or in included license
10+
documentation. The authors of MySQL hereby grant you an additional
11+
permission to link the program and your derivative works with the
12+
separately licensed software that they have either included with
13+
the program or referenced in the documentation.
14+
15+
Without limiting anything contained in the foregoing, this file,
16+
which is part of C Driver for MySQL (Connector/C), is also subject to the
17+
Universal FOSS Exception, version 1.0, a copy of which can be found at
18+
http://oss.oracle.com/licenses/universal-foss-exception.
19+
20+
This program is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
GNU General Public License, version 2.0, for more details.
24+
25+
You should have received a copy of the GNU General Public License
26+
along with this program; if not, write to the Free Software
27+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
28+
29+
/**
30+
@file field_types.h
31+
32+
@brief This file contains the field type.
33+
34+
35+
@note This file can be imported both from C and C++ code, so the
36+
definitions have to be constructed to support this.
37+
*/
38+
39+
#ifndef FIELD_TYPES_INCLUDED
40+
#define FIELD_TYPES_INCLUDED
41+
42+
#ifdef __cplusplus
43+
extern "C" {
44+
#endif /* __cplusplus */
45+
46+
/*
47+
* Constants exported from this package.
48+
*/
49+
50+
/**
51+
Column types for MySQL
52+
Note: Keep include/mysql/components/services/bits/stored_program_bits.h in
53+
sync with this
54+
*/
55+
enum enum_field_types {
56+
MYSQL_TYPE_DECIMAL,
57+
MYSQL_TYPE_TINY,
58+
MYSQL_TYPE_SHORT,
59+
MYSQL_TYPE_LONG,
60+
MYSQL_TYPE_FLOAT,
61+
MYSQL_TYPE_DOUBLE,
62+
MYSQL_TYPE_NULL,
63+
MYSQL_TYPE_TIMESTAMP,
64+
MYSQL_TYPE_LONGLONG,
65+
MYSQL_TYPE_INT24,
66+
MYSQL_TYPE_DATE,
67+
MYSQL_TYPE_TIME,
68+
MYSQL_TYPE_DATETIME,
69+
MYSQL_TYPE_YEAR,
70+
MYSQL_TYPE_NEWDATE, /**< Internal to MySQL. Not used in protocol */
71+
MYSQL_TYPE_VARCHAR,
72+
MYSQL_TYPE_BIT,
73+
MYSQL_TYPE_TIMESTAMP2,
74+
MYSQL_TYPE_DATETIME2, /**< Internal to MySQL. Not used in protocol */
75+
MYSQL_TYPE_TIME2, /**< Internal to MySQL. Not used in protocol */
76+
MYSQL_TYPE_TYPED_ARRAY, /**< Used for replication only */
77+
MYSQL_TYPE_INVALID = 243,
78+
MYSQL_TYPE_BOOL = 244, /**< Currently just a placeholder */
79+
MYSQL_TYPE_JSON = 245,
80+
MYSQL_TYPE_NEWDECIMAL = 246,
81+
MYSQL_TYPE_ENUM = 247,
82+
MYSQL_TYPE_SET = 248,
83+
MYSQL_TYPE_TINY_BLOB = 249,
84+
MYSQL_TYPE_MEDIUM_BLOB = 250,
85+
MYSQL_TYPE_LONG_BLOB = 251,
86+
MYSQL_TYPE_BLOB = 252,
87+
MYSQL_TYPE_VAR_STRING = 253,
88+
MYSQL_TYPE_STRING = 254,
89+
MYSQL_TYPE_GEOMETRY = 255
90+
};
91+
92+
#ifdef __cplusplus
93+
} // extern "C"
94+
#else
95+
typedef enum enum_field_types enum_field_types;
96+
#endif /* __cplusplus */
97+
98+
#endif /* FIELD_TYPES_INCLUDED */

include/mysql/8.4.7/my_command.h

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/* Copyright (c) 2015, 2025, Oracle and/or its affiliates.
2+
3+
This program is free software; you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License, version 2.0,
5+
as published by the Free Software Foundation.
6+
7+
This program is designed to work with certain software (including
8+
but not limited to OpenSSL) that is licensed under separate terms,
9+
as designated in a particular file or component or in included license
10+
documentation. The authors of MySQL hereby grant you an additional
11+
permission to link the program and your derivative works with the
12+
separately licensed software that they have either included with
13+
the program or referenced in the documentation.
14+
15+
Without limiting anything contained in the foregoing, this file,
16+
which is part of C Driver for MySQL (Connector/C), is also subject to the
17+
Universal FOSS Exception, version 1.0, a copy of which can be found at
18+
http://oss.oracle.com/licenses/universal-foss-exception.
19+
20+
This program is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
GNU General Public License, version 2.0, for more details.
24+
25+
You should have received a copy of the GNU General Public License
26+
along with this program; if not, write to the Free Software
27+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
28+
29+
#ifndef _mysql_command_h
30+
#define _mysql_command_h
31+
32+
/**
33+
@file include/my_command.h
34+
*/
35+
36+
/**
37+
@enum enum_server_command
38+
39+
@brief A list of all MySQL protocol commands.
40+
41+
These are the top level commands the server can receive
42+
while it listens for a new command in ::dispatch_command
43+
44+
@par Warning
45+
Add new commands to the end of this list, otherwise old
46+
servers won't be able to handle them as 'unsupported'.
47+
*/
48+
enum enum_server_command {
49+
/**
50+
Currently refused by the server. See ::dispatch_command.
51+
Also used internally to mark the start of a session.
52+
*/
53+
COM_SLEEP,
54+
COM_QUIT, /**< See @ref page_protocol_com_quit */
55+
COM_INIT_DB, /**< See @ref page_protocol_com_init_db */
56+
COM_QUERY, /**< See @ref page_protocol_com_query */
57+
COM_FIELD_LIST, /**< Deprecated. See @ref page_protocol_com_field_list */
58+
COM_CREATE_DB, /**< Currently refused by the server. See ::dispatch_command */
59+
COM_DROP_DB, /**< Currently refused by the server. See ::dispatch_command */
60+
COM_UNUSED_2, /**< Removed, used to be COM_REFRESH. */
61+
COM_UNUSED_1, /**< Removed, used to be COM_SHUTDOWN */
62+
COM_STATISTICS, /**< See @ref page_protocol_com_statistics */
63+
COM_UNUSED_4, /**< Removed, used to be COM_PROCESS_INFO */
64+
COM_CONNECT, /**< Currently refused by the server. */
65+
COM_UNUSED_5, /**< Removed, used to be COM_PROCESS_KILL */
66+
COM_DEBUG, /**< See @ref page_protocol_com_debug */
67+
COM_PING, /**< See @ref page_protocol_com_ping */
68+
COM_TIME, /**< Currently refused by the server. */
69+
COM_DELAYED_INSERT, /**< Functionality removed. */
70+
COM_CHANGE_USER, /**< See @ref page_protocol_com_change_user */
71+
COM_BINLOG_DUMP, /**< See @ref page_protocol_com_binlog_dump */
72+
COM_TABLE_DUMP,
73+
COM_CONNECT_OUT,
74+
COM_REGISTER_SLAVE,
75+
COM_STMT_PREPARE, /**< See @ref page_protocol_com_stmt_prepare */
76+
COM_STMT_EXECUTE, /**< See @ref page_protocol_com_stmt_execute */
77+
/** See @ref page_protocol_com_stmt_send_long_data */
78+
COM_STMT_SEND_LONG_DATA,
79+
COM_STMT_CLOSE, /**< See @ref page_protocol_com_stmt_close */
80+
COM_STMT_RESET, /**< See @ref page_protocol_com_stmt_reset */
81+
COM_SET_OPTION, /**< See @ref page_protocol_com_set_option */
82+
COM_STMT_FETCH, /**< See @ref page_protocol_com_stmt_fetch */
83+
/**
84+
Currently refused by the server. See ::dispatch_command.
85+
Also used internally to mark the session as a "daemon",
86+
i.e. non-client THD. Currently the scheduler and the GTID
87+
code does use this state.
88+
These threads won't be killed by `KILL`
89+
90+
@sa Event_scheduler::start, ::init_thd, ::kill_one_thread,
91+
::Find_thd_with_id
92+
*/
93+
COM_DAEMON,
94+
COM_BINLOG_DUMP_GTID,
95+
COM_RESET_CONNECTION, /**< See @ref page_protocol_com_reset_connection */
96+
COM_CLONE,
97+
COM_SUBSCRIBE_GROUP_REPLICATION_STREAM,
98+
/* don't forget to update std::string Command_names::m_names[] in sql_parse.cc
99+
*/
100+
101+
/* Must be last */
102+
COM_END /**< Not a real command. Refused. */
103+
};
104+
105+
#endif /* _mysql_command_h */

0 commit comments

Comments
 (0)