summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-11-16 00:01:48 +0200
committerunknown <bell@sanja.is.com.ua>2002-11-16 00:01:48 +0200
commit49aefe3fb75a9dbe19b2615bb922132433586c25 (patch)
tree78d18b865c3747b3418696243cef96e0f95f348b
parente7bbe3aa0b2f9dda5f6883a3e1998377a9071db5 (diff)
downloadmariadb-git-49aefe3fb75a9dbe19b2615bb922132433586c25.tar.gz
Fixed bugs pointed by "Crash with 'big' derivated table in MySQL-4.1" bugreport
- fixed switching from heap to MyISAM table - fixed error handler sql/sql_derived.cc: A fix for the bug when MyISAM tmp table has to be created in order to resolve derived table. fixed error handler sql/sql_parse.cc: fixed error handler sql/sql_union.cc: fixed switching from heap to MyISAM table
-rw-r--r--sql/sql_derived.cc3
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_union.cc8
3 files changed, 9 insertions, 4 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 7cbc1ea6db3..56636f299a7 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -88,6 +88,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
if ((derived_result=new select_union(table)))
{
+ derived_result->tmp_table_param=&tmp_table_param;
unit->offset_limit_cnt= sl->offset_limit;
unit->select_limit_cnt= sl->select_limit+sl->offset_limit;
if (unit->select_limit_cnt < sl->select_limit)
@@ -128,8 +129,6 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
free_tmp_table(thd,table);
exit:
close_thread_tables(thd);
- if (res > 0)
- send_error(thd, ER_UNKNOWN_COM_ERROR); // temporary only ...
}
DBUG_RETURN(res);
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 8df74f332eb..4d6fad17144 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1344,7 +1344,7 @@ mysql_execute_command(THD *thd)
cursor->derived,
cursor)))
{
- if (res < 0)
+ if (res < 0 || thd->net.report_error)
send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN : 0);
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 53f89747ce7..0e6de306c0d 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -78,7 +78,13 @@ bool select_union::send_data(List<Item> &values)
fill_record(table->field,values);
if ((write_record(table,&info)))
{
- if (create_myisam_from_heap(table, tmp_table_param, info.last_errno, 0))
+ if (thd->net.last_errno == ER_RECORD_FILE_FULL)
+ {
+ thd->clear_error(); // do not report user about table overflow
+ if (create_myisam_from_heap(table, tmp_table_param, info.last_errno, 0))
+ return 1;
+ }
+ else
return 1;
}
return 0;