From ef5edca39360f1a84591b6004d7b2eecb39b5a35 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Nov 2002 22:38:06 +0200 Subject: [PATCH 1/2] cleanup & fixing possible bug in select's error handling --- sql/sql_select.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 20d9c1ca208..b9162daadaa 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -444,7 +444,7 @@ JOIN::optimize() best_read > (double) thd->variables.max_join_size && !(select_options & SELECT_DESCRIBE)) { /* purecov: inspected */ - result->send_error(ER_TOO_BIG_SELECT,ER(ER_TOO_BIG_SELECT)); /* purecov: inspected */ + my_message(ER_TOO_BIG_SELECT, ER(ER_TOO_BIG_SELECT), MYF(0)); error= 1; /* purecov: inspected */ DBUG_RETURN(-1); } @@ -670,10 +670,7 @@ JOIN::exec() if (!having || having->val_int()) { if (do_send_rows && result->send_data(fields_list)) - { - result->send_error(0,NullS); /* purecov: inspected */ error= 1; - } else error= (int) result->send_eof(); } @@ -1092,12 +1089,13 @@ err: thd->limit_found_rows = join->send_records; thd->examined_row_count = join->examined_rows; thd->proc_info="end"; - int error= (fake_select_lex?0:join->cleanup(thd)) || thd->net.report_error; + int error= (fake_select_lex?join->error:join->cleanup(thd)) || + thd->net.report_error; delete join; DBUG_RETURN(error); } else - DBUG_RETURN(0); + DBUG_RETURN(join->error); } /***************************************************************************** From e3f2b294762deeec5bba40d761178cd526ff861c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Nov 2002 20:11:55 +0200 Subject: [PATCH 2/2] Small fix to avoid problems in building with --without-debug --- sql/sql_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_test.cc b/sql/sql_test.cc index b3bf47e7fd2..3fbeaa753db 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -41,6 +41,7 @@ static const char *lock_descriptions[] = "High priority write lock", "Highest priority write lock" }; +extern HASH open_cache; #ifndef DBUG_OFF @@ -64,7 +65,6 @@ print_where(COND *cond,const char *info) } /* This is for debugging purposes */ -extern HASH open_cache; extern TABLE *unused_tables; void print_cached_tables(void)