Below is the list of changes that have just been committed into a local
4.1 repository of bell. When bell does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2474 06/01/18 13:48:57 bell@stripped +5 -0
Excluded posibility of tmp_table_param.copy_field double deletion (BUG#14851).
sql/sql_select.h
1.79 06/01/18 13:48:54 bell@stripped +9 -2
JOINs constructor added, initialization of them fixed (it is not related to the bug
directly but might cause other problems).
sql/sql_select.cc
1.444 06/01/18 13:48:54 bell@stripped +14 -0
Allocation of tmp_join fixed to involve constructor (it is not related to the bug
directly but might cause other problems).
Excluded posibility of tmp_table_param.copy_field double deletion (BUG#14851).
sql/sql_class.cc
1.203 06/01/18 13:48:54 bell@stripped +3 -0
Debug prints are added.
mysql-test/t/kill.test
1.11 06/01/18 13:48:54 bell@stripped +48 -1
BUG#14851 test
mysql-test/r/kill.result
1.6 06/01/18 13:48:54 bell@stripped +13 -1
BUG#14851 test
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: bell
# Host: sanja.is.com.ua
# Root: /home/bell/mysql/bk/work-bug8-4.1
--- 1.202/sql/sql_class.cc 2005-10-14 16:34:49 +03:00
+++ 1.203/sql/sql_class.cc 2006-01-18 13:48:54 +02:00
@@ -1681,7 +1681,10 @@
void TMP_TABLE_PARAM::init()
{
+ DBUG_ENTER("TMP_TABLE_PARAM::init");
+ DBUG_PRINT("enter", ("this: 0x%lx", (ulong)this));
field_count= sum_func_count= func_count= hidden_field_count= 0;
group_parts= group_length= group_null_parts= 0;
quick_group= 1;
+ DBUG_VOID_RETURN;
}
--- 1.443/sql/sql_select.cc 2005-11-01 16:34:18 +02:00
+++ 1.444/sql/sql_select.cc 2006-01-18 13:48:54 +02:00
@@ -4107,6 +4107,20 @@
problems in free_elements() as some of the elements are then deleted.
*/
tmp_table_param.copy_funcs.empty();
+ /*
+ If we have tmp_join and 'this' JOIN is not tmp_join and
+ tmp_table_param.copy_field's of them are equal then we have to remove
+ pointer to tmp_table_param.copy_field from tmp_join, because it qill
+ be removed in tmp_table_param.cleanup().
+ */
+ if (tmp_join &&
+ tmp_join != this &&
+ tmp_join->tmp_table_param.copy_field ==
+ tmp_table_param.copy_field)
+ {
+ tmp_join->tmp_table_param.copy_field=
+ tmp_join->tmp_table_param.save_copy_field= 0;
+ }
tmp_table_param.cleanup();
}
DBUG_VOID_RETURN;
--- 1.78/sql/sql_select.h 2005-11-01 16:34:18 +02:00
+++ 1.79/sql/sql_select.h 2006-01-18 13:48:54 +02:00
@@ -227,7 +227,14 @@
{
init(thd_arg, fields_arg, select_options_arg, result_arg);
}
-
+
+ JOIN(JOIN &join)
+ :fields_list(join.fields_list)
+ {
+ init(join.thd, join.fields_list, join.select_options,
+ join.result);
+ }
+
void init(THD *thd_arg, List<Item> &fields_arg, ulong select_options_arg,
select_result *result_arg)
{
@@ -272,7 +279,7 @@
fields_list= fields_arg;
bzero((char*) &keyuse,sizeof(keyuse));
- tmp_table_param.copy_field=0;
+ tmp_table_param.init();
tmp_table_param.end_write_records= HA_POS_ERROR;
rollup.state= ROLLUP::STATE_NONE;
}
--- 1.5/mysql-test/r/kill.result 2005-04-11 23:36:01 +03:00
+++ 1.6/mysql-test/r/kill.result 2006-01-18 13:48:54 +02:00
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1, t2, t3;
create table t1 (kill_id int);
insert into t1 values(connection_id());
select ((@id := kill_id) - kill_id) from t1;
@@ -17,3 +17,15 @@
4
4
drop table t1;
+create table t1 (id int primary key);
+create table t2 (id int unsigned not null);
+insert into t2 select id from t1;
+create table t3 (kill_id int);
+insert into t3 values(connection_id());
+ select id from t1 where id in (select distinct id from t2);
+select ((@id := kill_id) - kill_id) from t3;
+((@id := kill_id) - kill_id)
+0
+kill @id;
+ERROR 08S01: Server shutdown in progress
+drop table t1, t2, t3;
--- 1.10/mysql-test/t/kill.test 2005-09-20 19:36:33 +03:00
+++ 1.11/mysql-test/t/kill.test 2006-01-18 13:48:54 +02:00
@@ -12,7 +12,7 @@
#remember id of con1
connection con1;
--disable_warnings
-drop table if exists t1;
+drop table if exists t1, t2, t3;
--enable_warnings
create table t1 (kill_id int);
@@ -39,5 +39,52 @@
connection con2;
select 4;
drop table t1;
+
+disconnect con2;
+connection default;
+#
+# BUG#14851: killing long running subquery processed via a temporary table.
+#
+create table t1 (id int primary key);
+create table t2 (id int unsigned not null);
+
+connect (conn1, localhost, root,,);
+connection conn1;
+
+-- disable_result_log
+-- disable_query_log
+let $1 = 4096;
+while ($1)
+{
+ eval insert into t1 values ($1);
+ dec $1;
+}
+-- enable_query_log
+-- enable_result_log
+
+insert into t2 select id from t1;
+
+create table t3 (kill_id int);
+insert into t3 values(connection_id());
+
+-- disable_result_log
+send select id from t1 where id in (select distinct id from t2);
+-- enable_result_log
+
+connect (conn2, localhost, root,,);
+connection conn2;
+select ((@id := kill_id) - kill_id) from t3;
+-- sleep 1
+kill @id;
+
+connection conn1;
+-- error 1053
+reap;
+
+disconnect conn1;
+disconnect conn2;
+connection default;
+
+drop table t1, t2, t3;
# End of 4.1 tests
| Thread |
|---|
| • bk commit into 4.1 tree (bell:1.2474) BUG#14851 | sanja | 18 Jan |