diff options
author | unknown <kostja@bodhi.(none)> | 2007-12-12 18:36:10 +0300 |
---|---|---|
committer | unknown <kostja@bodhi.(none)> | 2007-12-12 18:36:10 +0300 |
commit | 2be5708a21b425ee70c2fe3bcd5631ecff3b815f (patch) | |
tree | b28764824a85f53f79f9230601a6470ac02ddebf /libmysql | |
parent | 8f967bf6ef1a2d0cacb99fb5da16cdd8045e0272 (diff) | |
parent | 2a0d2fef51219846e51eae8a56b2de45193edc37 (diff) | |
download | mariadb-git-2be5708a21b425ee70c2fe3bcd5631ecff3b815f.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into bodhi.(none):/opt/local/work/mysql-5.1-12713-1
mysql-test/r/grant.result:
Auto merged
mysql-test/t/grant.test:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/table.cc:
Auto merged
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 40 | ||||
-rw-r--r-- | libmysql/manager.c | 2 |
2 files changed, 23 insertions, 19 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index bf5dd7d63eb..f5ac1c09248 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -440,11 +440,11 @@ static void expand_error(MYSQL* mysql, int error) char tmp[MYSQL_ERRMSG_SIZE]; char *p; uint err_length; - strmake(tmp, mysql->net.last_error, MYSQL_ERRMSG_SIZE-1); - p = strmake(mysql->net.last_error, ER(error), MYSQL_ERRMSG_SIZE-1); - err_length= (uint) (p - mysql->net.last_error); + strmake(tmp, mysql->net.client_last_error, MYSQL_ERRMSG_SIZE-1); + p = strmake(mysql->net.client_last_error, ER(error), MYSQL_ERRMSG_SIZE-1); + err_length= (uint) (p - mysql->net.client_last_error); strmake(p, tmp, MYSQL_ERRMSG_SIZE-1 - err_length); - mysql->net.last_errno = error; + mysql->net.client_last_errno = error; } /* @@ -870,9 +870,10 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) VOID(my_net_write(net,(const uchar*) "",0)); /* Server needs one packet */ net_flush(net); strmov(net->sqlstate, unknown_sqlstate); - net->last_errno= (*options->local_infile_error)(li_ptr, - net->last_error, - sizeof(net->last_error)-1); + net->client_last_errno= + (*options->local_infile_error)(li_ptr, + net->client_last_error, + sizeof(net->client_last_error)-1); goto err; } @@ -899,9 +900,10 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) if (readcount < 0) { - net->last_errno= (*options->local_infile_error)(li_ptr, - net->last_error, - sizeof(net->last_error)-1); + net->client_last_errno= + (*options->local_infile_error)(li_ptr, + net->client_last_error, + sizeof(net->client_last_error)-1); goto err; } @@ -1395,7 +1397,7 @@ const char *cli_read_statistics(MYSQL *mysql) if (!mysql->net.read_pos[0]) { set_mysql_error(mysql, CR_WRONG_HOST_INFO, unknown_sqlstate); - return mysql->net.last_error; + return mysql->net.client_last_error; } return (char*) mysql->net.read_pos; } @@ -1406,7 +1408,7 @@ mysql_stat(MYSQL *mysql) { DBUG_ENTER("mysql_stat"); if (simple_command(mysql,COM_STATISTICS,0,0,0)) - DBUG_RETURN(mysql->net.last_error); + DBUG_RETURN(mysql->net.client_last_error); DBUG_RETURN((*mysql->methods->read_statistics)(mysql)); } @@ -1771,7 +1773,7 @@ static my_bool my_realloc_str(NET *net, ulong length) if (res) { strmov(net->sqlstate, unknown_sqlstate); - strmov(net->last_error, ER(net->last_errno)); + strmov(net->client_last_error, ER(net->client_last_errno)); } net->write_pos= net->buff+ buf_length; } @@ -1822,13 +1824,15 @@ void set_stmt_error(MYSQL_STMT * stmt, int errcode, void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net) { DBUG_ENTER("set_stmt_errmsg"); - DBUG_PRINT("enter", ("error: %d/%s '%s'", net->last_errno, net->sqlstate, - net->last_error)); + DBUG_PRINT("enter", ("error: %d/%s '%s'", + net->client_last_errno, + net->sqlstate, + net->client_last_error)); DBUG_ASSERT(stmt != 0); - stmt->last_errno= net->last_errno; - if (net->last_error && net->last_error[0]) - strmov(stmt->last_error, net->last_error); + stmt->last_errno= net->client_last_errno; + if (net->client_last_error && net->client_last_error[0]) + strmov(stmt->last_error, net->client_last_error); strmov(stmt->sqlstate, net->sqlstate); DBUG_VOID_RETURN; diff --git a/libmysql/manager.c b/libmysql/manager.c index 53ffffa55c0..27d35758f3e 100644 --- a/libmysql/manager.c +++ b/libmysql/manager.c @@ -160,7 +160,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con, msg_len=strlen(msg_buf); if (my_net_write(&con->net,(uchar*) msg_buf,msg_len) || net_flush(&con->net)) { - con->last_errno=con->net.last_errno; + con->last_errno=con->net.client_last_errno; strmov(con->last_error,"Write error on socket"); goto err; } |