summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc29
1 files changed, 23 insertions, 6 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 9a72b647261..7075b24c83c 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -675,6 +675,7 @@ THD::THD()
first_successful_insert_id_in_cur_stmt(0),
stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE),
examined_row_count(0),
+ accessed_rows_and_keys(0),
global_read_lock(0),
global_disable_checkpoint(0),
is_fatal_error(0),
@@ -1373,26 +1374,31 @@ void THD::awake(killed_state state_to_set)
int killed_errno(killed_state killed)
{
+ DBUG_ENTER("killed_errno");
+ DBUG_PRINT("enter", ("killed: %d", killed));
+
switch (killed) {
case NOT_KILLED:
case KILL_HARD_BIT:
- return 0; // Probably wrong usage
+ DBUG_RETURN(0); // Probably wrong usage
case KILL_BAD_DATA:
case KILL_BAD_DATA_HARD:
- return 0; // Not a real error
+ case ABORT_QUERY_HARD:
+ case ABORT_QUERY:
+ DBUG_RETURN(0); // Not a real error
case KILL_CONNECTION:
case KILL_CONNECTION_HARD:
case KILL_SYSTEM_THREAD:
case KILL_SYSTEM_THREAD_HARD:
- return ER_CONNECTION_KILLED;
+ DBUG_RETURN(ER_CONNECTION_KILLED);
case KILL_QUERY:
case KILL_QUERY_HARD:
- return ER_QUERY_INTERRUPTED;
+ DBUG_RETURN(ER_QUERY_INTERRUPTED);
case KILL_SERVER:
case KILL_SERVER_HARD:
- return ER_SERVER_SHUTDOWN;
+ DBUG_RETURN(ER_SERVER_SHUTDOWN);
}
- return 0; // Keep compiler happy
+ DBUG_RETURN(0); // Keep compiler happy
}
@@ -1975,6 +1981,8 @@ int select_send::send_data(List<Item> &items)
unit->offset_limit_cnt--;
return 0;
}
+ if (thd->killed == ABORT_QUERY)
+ return 0;
/*
We may be passing the control from mysqld to the client: release the
@@ -2293,6 +2301,8 @@ int select_export::send_data(List<Item> &items)
unit->offset_limit_cnt--;
DBUG_RETURN(0);
}
+ if (thd->killed == ABORT_QUERY)
+ DBUG_RETURN(0);
row_count++;
Item *item;
uint used_length=0,items_left=items.elements;
@@ -2548,6 +2558,9 @@ int select_dump::send_data(List<Item> &items)
unit->offset_limit_cnt--;
DBUG_RETURN(0);
}
+ if (thd->killed == ABORT_QUERY)
+ DBUG_RETURN(0);
+
if (row_count++ > 1)
{
my_message(ER_TOO_MANY_ROWS, ER(ER_TOO_MANY_ROWS), MYF(0));
@@ -2594,6 +2607,8 @@ int select_singlerow_subselect::send_data(List<Item> &items)
unit->offset_limit_cnt--;
DBUG_RETURN(0);
}
+ if (thd->killed == ABORT_QUERY)
+ DBUG_RETURN(0);
List_iterator_fast<Item> li(items);
Item *val_item;
for (uint i= 0; (val_item= li++); i++)
@@ -2737,6 +2752,8 @@ int select_exists_subselect::send_data(List<Item> &items)
unit->offset_limit_cnt--;
DBUG_RETURN(0);
}
+ if (thd->killed == ABORT_QUERY)
+ DBUG_RETURN(0);
it->value= 1;
it->assigned(1);
DBUG_RETURN(0);