Commit 38334f62 authored by hf@deer.(none)'s avatar hf@deer.(none)

Proposed fix for bug #3412 (embedded server: prepared statement returns

empty recordset where some records should be found)
parent ccc41712
......@@ -60,13 +60,11 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
DBUG_PRINT(msg_type,("message: %s",msgbuf));
#ifndef EMBEDDED_LIBRARY
if (thd->net.vio == 0)
if (!thd->vio_ok())
{
sql_print_error(msgbuf);
return;
}
#endif
if (param->testflag & (T_CREATE_MISSING_KEYS | T_SAFE_REPAIR |
T_AUTO_REPAIR))
......
......@@ -661,7 +661,7 @@ static void close_connections(void)
break;
}
#ifndef __bsdi__ // Bug in BSDI kernel
if (tmp->net.vio)
if (tmp->vio_ok())
{
sql_print_error(ER(ER_FORCING_CLOSE),my_progname,
tmp->thread_id,tmp->user ? tmp->user : "");
......
......@@ -1386,7 +1386,7 @@ int fetch_master_table(THD *thd, const char *db_name, const char *table_name,
thd->net.no_send_ok = 0; // Clear up garbage after create_table_from_dump
if (!called_connected)
mysql_close(mysql);
if (errmsg && thd->net.vio)
if (errmsg && thd->vio_ok())
send_error(thd, error, errmsg);
DBUG_RETURN(test(error)); // Return 1 on error
}
......
......@@ -746,7 +746,7 @@ bool select_send::send_data(List<Item> &items)
}
}
thd->sent_row_count++;
if (!thd->net.vio)
if (!thd->vio_ok())
DBUG_RETURN(0);
if (!thd->net.report_error)
DBUG_RETURN(protocol->write());
......
......@@ -932,8 +932,10 @@ class THD :public ilink,
net.last_errno= 0;
net.report_error= 0;
}
inline bool vio_ok() const { return net.vio; }
#else
void clear_error();
inline bool vio_ok() const { return true; }
#endif
inline void fatal_error()
{
......
......@@ -1540,13 +1540,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
while ((tmp=it++))
{
struct st_my_thread_var *mysys_var;
#ifndef EMBEDDED_LIBRARY
if ((tmp->net.vio || tmp->system_thread) &&
(!user || (tmp->user && !strcmp(tmp->user,user))))
#else
if (tmp->system_thread &&
if ((tmp->vio_ok() || tmp->system_thread) &&
(!user || (tmp->user && !strcmp(tmp->user,user))))
#endif
{
thread_info *thd_info=new thread_info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment