List:Internals« Previous MessageNext Message »
From:sanja Date:November 21 2005 4:23pm
Subject:bk commit into 4.1 tree (bell:1.2474) BUG#14851
View as plain text  
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 05/11/21 17:23:41 bell@stripped +5 -0
  Excluded posibility of tmp_table_param.copy_field double deletion (BUG#14851).

  mysql-test/t/subselect_notembedded.test
    1.1 05/11/21 17:23:38 bell@stripped +52 -0
    New BitKeeper file ``mysql-test/t/subselect_notembedded.test''

  mysql-test/r/subselect_notembedded.result
    1.1 05/11/21 17:23:38 bell@stripped +13 -0
    New BitKeeper file ``mysql-test/r/subselect_notembedded.result''

  sql/sql_select.h
    1.79 05/11/21 17:23:38 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 05/11/21 17:23:38 bell@stripped +9 -1
    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 05/11/21 17:23:38 bell@stripped +3 -0
    Debug prints are added.

  mysql-test/t/subselect_notembedded.test
    1.0 05/11/21 17:23:38 bell@stripped +0 -0
    BitKeeper file
/home/bell/mysql/bk/work-bug8-4.1/mysql-test/t/subselect_notembedded.test

  mysql-test/r/subselect_notembedded.result
    1.0 05/11/21 17:23:38 bell@stripped +0 -0
    BitKeeper file
/home/bell/mysql/bk/work-bug8-4.1/mysql-test/r/subselect_notembedded.result

# 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	2005-11-21 17:23:38 +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	2005-11-21 17:23:38 +02:00
@@ -950,7 +950,7 @@
     
     if (thd->lex->subqueries)
     {
-      if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN))))
+      if (!(tmp_join= new JOIN(*this)))
 	DBUG_RETURN(-1);
       error= 0;				// Ensure that tmp_join.error= 0
       restore_tmp();
@@ -4107,6 +4107,14 @@
       problems in free_elements() as some of the elements are then deleted.
     */
     tmp_table_param.copy_funcs.empty();
+    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	2005-11-21 17:23:38 +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;
   }
--- New file ---
+++ mysql-test/r/subselect_notembedded.result	05/11/21 17:23:38
drop table if exists t1,t2,t3;
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;

--- New file ---
+++ mysql-test/t/subselect_notembedded.test	05/11/21 17:23:38
-- source include/not_embedded.inc

--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings

#
# 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 (con1, localhost, root,,);
connection con1;

-- 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 (con2, localhost, root,,);
connection con2;
select ((@id := kill_id) - kill_id) from t3;
-- sleep 1
kill @id;

connection con1;
-- error 1053
reap;

disconnect con1;
disconnect con2;
connection default;

drop table t1, t2, t3;

# End of 4.1 tests

Thread
bk commit into 4.1 tree (bell:1.2474) BUG#14851sanja21 Nov