diff options
author | unknown <davi@mysql.com/endora.local> | 2008-02-28 14:55:46 -0300 |
---|---|---|
committer | unknown <davi@mysql.com/endora.local> | 2008-02-28 14:55:46 -0300 |
commit | 33a4e7609095388099bb3048778a5b5d164d26fa (patch) | |
tree | 403f098823cf42179ec9f51f5bd0ccab5fc77112 /sql-common | |
parent | 944f2599fedfaa7c9a4348a2fd505419eb59a5b6 (diff) | |
download | mariadb-git-33a4e7609095388099bb3048778a5b5d164d26fa.tar.gz |
Bug#34655 Compile error
Rename client_last_error to last_error and client_last_errno to last_errno
to not break connectors which use the internal net structure for error handling.
include/mysql_com.h:
Rename client_last_error to last_error, client_last_errno to last_errno.
include/mysql_h.ic:
Rename client_last_error to last_error, client_last_errno to last_errno.
libmysql/libmysql.c:
Rename client_last_error to last_error, client_last_errno to last_errno.
libmysql/manager.c:
Rename client_last_error to last_error, client_last_errno to last_errno.
libmysqld/lib_sql.cc:
Rename client_last_error to last_error, client_last_errno to last_errno.
libmysqld/libmysqld.c:
Rename client_last_error to last_error, client_last_errno to last_errno.
server-tools/instance-manager/mysql_connection.cc:
Rename client_last_error to last_error, client_last_errno to last_errno.
sql/log_event.cc:
Rename client_last_error to last_error, client_last_errno to last_errno.
sql-common/client.c:
Rename client_last_error to last_error, client_last_errno to last_errno.
sql/log_event_old.cc:
Rename client_last_error to last_error, client_last_errno to last_errno.
sql/net_serv.cc:
Rename client_last_error to last_error, client_last_errno to last_errno.
sql/repl_failsafe.cc:
Rename client_last_error to last_error, client_last_errno to last_errno.
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index f4d587d4df3..b1728f0f74f 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -289,8 +289,8 @@ void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate) DBUG_ASSERT(mysql != 0); net= &mysql->net; - net->client_last_errno= errcode; - strmov(net->client_last_error, ER(errcode)); + net->last_errno= errcode; + strmov(net->last_error, ER(errcode)); strmov(net->sqlstate, sqlstate); DBUG_VOID_RETURN; @@ -304,8 +304,8 @@ void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate) void net_clear_error(NET *net) { - net->client_last_errno= 0; - net->client_last_error[0]= '\0'; + net->last_errno= 0; + net->last_error[0]= '\0'; strmov(net->sqlstate, not_error_sqlstate); } @@ -331,9 +331,9 @@ static void set_mysql_extended_error(MYSQL *mysql, int errcode, DBUG_ASSERT(mysql != 0); net= &mysql->net; - net->client_last_errno= errcode; + net->last_errno= errcode; va_start(args, format); - my_vsnprintf(net->client_last_error, sizeof(net->client_last_error)-1, + my_vsnprintf(net->last_error, sizeof(net->last_error)-1, format, args); va_end(args); strmov(net->sqlstate, sqlstate); @@ -667,7 +667,7 @@ cli_safe_read(MYSQL *mysql) return (packet_error); #endif /*MYSQL_SERVER*/ end_server(mysql); - set_mysql_error(mysql, net->client_last_errno == ER_NET_PACKET_TOO_LARGE ? + set_mysql_error(mysql, net->last_errno == ER_NET_PACKET_TOO_LARGE ? CR_NET_PACKET_TOO_LARGE: CR_SERVER_LOST, unknown_sqlstate); return (packet_error); } @@ -676,7 +676,7 @@ cli_safe_read(MYSQL *mysql) if (len > 3) { char *pos=(char*) net->read_pos+1; - net->client_last_errno=uint2korr(pos); + net->last_errno=uint2korr(pos); pos+=2; len-=2; if (protocol_41(mysql) && pos[0] == '#') @@ -684,8 +684,8 @@ cli_safe_read(MYSQL *mysql) strmake(net->sqlstate, pos+1, SQLSTATE_LENGTH); pos+= SQLSTATE_LENGTH+1; } - (void) strmake(net->client_last_error,(char*) pos, - min((uint) len,(uint) sizeof(net->client_last_error)-1)); + (void) strmake(net->last_error,(char*) pos, + min((uint) len,(uint) sizeof(net->last_error)-1)); } else set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate); @@ -701,9 +701,9 @@ cli_safe_read(MYSQL *mysql) mysql->server_status&= ~SERVER_MORE_RESULTS_EXISTS; DBUG_PRINT("error",("Got error: %d/%s (%s)", - net->client_last_errno, + net->last_errno, net->sqlstate, - net->client_last_error)); + net->last_error)); return(packet_error); } return len; @@ -760,7 +760,7 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command, { DBUG_PRINT("error",("Can't send command to server. Error: %d", socket_errno)); - if (net->client_last_errno == ER_NET_PACKET_TOO_LARGE) + if (net->last_errno == ER_NET_PACKET_TOO_LARGE) { set_mysql_error(mysql, CR_NET_PACKET_TOO_LARGE, unknown_sqlstate); goto end; @@ -845,7 +845,7 @@ static my_bool is_NT(void) @retval 0 success @retval !0 network error or the server is not commercial. - Error code is saved in mysql->net.client_last_errno. + Error code is saved in mysql->net.last_errno. */ static int check_license(MYSQL *mysql) @@ -858,7 +858,7 @@ static int check_license(MYSQL *mysql) if (mysql_real_query(mysql, query, sizeof(query)-1)) { - if (net->client_last_errno == ER_UNKNOWN_SYSTEM_VARIABLE) + if (net->last_errno == ER_UNKNOWN_SYSTEM_VARIABLE) { set_mysql_extended_error(mysql, CR_WRONG_LICENSE, unknown_sqlstate, ER(CR_WRONG_LICENSE), required_license); @@ -873,7 +873,7 @@ static int check_license(MYSQL *mysql) two is ever true for server variables now), or column value mismatch, set wrong license error. */ - if (!net->client_last_errno && + if (!net->last_errno && (!row || !row[0] || strncmp(row[0], required_license, sizeof(required_license)))) { @@ -881,7 +881,7 @@ static int check_license(MYSQL *mysql) ER(CR_WRONG_LICENSE), required_license); } mysql_free_result(res); - return net->client_last_errno; + return net->last_errno; } #endif /* CHECK_LICENSE */ @@ -2090,7 +2090,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, if ((pkt_length=cli_safe_read(mysql)) == packet_error) { - if (mysql->net.client_last_errno == CR_SERVER_LOST) + if (mysql->net.last_errno == CR_SERVER_LOST) set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, ER(CR_SERVER_LOST_EXTENDED), "reading initial communication packet", @@ -2324,7 +2324,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, if ((pkt_length=cli_safe_read(mysql)) == packet_error) { - if (mysql->net.client_last_errno == CR_SERVER_LOST) + if (mysql->net.last_errno == CR_SERVER_LOST) set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, ER(CR_SERVER_LOST_EXTENDED), "reading authorization packet", @@ -2352,7 +2352,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, /* Read what server thinks about out new auth message report */ if (cli_safe_read(mysql) == packet_error) { - if (mysql->net.client_last_errno == CR_SERVER_LOST) + if (mysql->net.last_errno == CR_SERVER_LOST) set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, ER(CR_SERVER_LOST_EXTENDED), "reading final connect information", @@ -2371,7 +2371,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, if (db && mysql_select_db(mysql, db)) { - if (mysql->net.client_last_errno == CR_SERVER_LOST) + if (mysql->net.last_errno == CR_SERVER_LOST) set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, ER(CR_SERVER_LOST_EXTENDED), "Setting intital database", @@ -2415,9 +2415,9 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, error: reset_sigpipe(mysql); DBUG_PRINT("error",("message: %u/%s (%s)", - net->client_last_errno, + net->last_errno, net->sqlstate, - net->client_last_error)); + net->last_error)); { /* Free alloced memory */ end_server(mysql); @@ -2475,8 +2475,8 @@ my_bool mysql_reconnect(MYSQL *mysql) mysql->db, mysql->port, mysql->unix_socket, mysql->client_flag | CLIENT_REMEMBER_OPTIONS)) { - mysql->net.client_last_errno= tmp_mysql.net.client_last_errno; - strmov(mysql->net.client_last_error, tmp_mysql.net.client_last_error); + mysql->net.last_errno= tmp_mysql.net.last_errno; + strmov(mysql->net.last_error, tmp_mysql.net.last_error); strmov(mysql->net.sqlstate, tmp_mysql.net.sqlstate); DBUG_RETURN(1); } @@ -2485,8 +2485,8 @@ my_bool mysql_reconnect(MYSQL *mysql) DBUG_PRINT("error", ("mysql_set_character_set() failed")); bzero((char*) &tmp_mysql.options,sizeof(tmp_mysql.options)); mysql_close(&tmp_mysql); - mysql->net.client_last_errno= tmp_mysql.net.client_last_errno; - strmov(mysql->net.client_last_error, tmp_mysql.net.client_last_error); + mysql->net.last_errno= tmp_mysql.net.last_errno; + strmov(mysql->net.last_error, tmp_mysql.net.last_error); strmov(mysql->net.sqlstate, tmp_mysql.net.sqlstate); DBUG_RETURN(1); } @@ -3087,13 +3087,13 @@ unsigned int STDCALL mysql_num_fields(MYSQL_RES *res) uint STDCALL mysql_errno(MYSQL *mysql) { - return mysql->net.client_last_errno; + return mysql->net.last_errno; } const char * STDCALL mysql_error(MYSQL *mysql) { - return mysql->net.client_last_error; + return mysql->net.last_error; } @@ -3162,7 +3162,7 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name) ER(CR_CANT_READ_CHARSET), cs_name, cs_dir_name); } charsets_dir= save_csdir; - return mysql->net.client_last_errno; + return mysql->net.last_errno; } |