MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:November 8 2010 2:46pm
Subject:bzr commit into mysql-5.1-innodb branch (vasil.dimov:3657)
View as plain text  
#At file:///usr/local/devel/bzrroot/server/t/mysql-5.1-innodb/ based on revid:marko.makela@stripped

 3657 Vasil Dimov	2010-11-08 [merge]
      Merge mysql-5.1-bugteam -> mysql-5.1-innodb

    added:
      mysql-test/collections/mysql-5.1-bugteam.daily
      mysql-test/collections/mysql-5.1-bugteam.push
      mysql-test/suite/innodb/r/innodb_bug57255.result
      mysql-test/suite/innodb/t/innodb_bug57255.test
      mysql-test/suite/innodb_plugin/r/innodb_bug57255.result
      mysql-test/suite/innodb_plugin/t/innodb_bug57255.test
    modified:
      .bzrignore
      config/ac-macros/maintainer.m4
      configure.in
      mysql-test/r/func_time.result
      mysql-test/r/log_tables.result
      mysql-test/r/ps.result
      mysql-test/r/type_blob.result
      mysql-test/t/func_time.test
      mysql-test/t/log_tables.test
      mysql-test/t/ps.test
      mysql-test/t/type_blob.test
      mysys/stacktrace.c
      sql/item_subselect.cc
      sql/item_timefunc.h
      sql/sql_prepare.cc
      sql/sql_rename.cc
      sql/sql_select.cc
      sql/sql_show.cc
      storage/innobase/row/row0mysql.c
      storage/innodb_plugin/ChangeLog
      storage/innodb_plugin/row/row0mysql.c
=== modified file '.bzrignore'
--- a/.bzrignore	revid:marko.makela@stripped
+++ b/.bzrignore	revid:vasil.dimov@stripped
@@ -9,15 +9,19 @@
 *.core
 *.d
 *.da
+*.dll
 *.exe
+*.exp
 *.gcda
 *.gcno
 *.gcov
 *.idb
+*.ilk
 *.la
 *.lai
 *.lib
 *.lo
+*.manifest
 *.map
 *.o
 *.obj
@@ -87,6 +91,7 @@ BitKeeper/tmp/*
 BitKeeper/tmp/bkr3sAHD
 BitKeeper/tmp/gone
 CMakeFiles/*
+CMakeFiles
 COPYING
 COPYING.LIB
 Docs/#manual.texi#
@@ -146,6 +151,7 @@ Makefile
 Makefile.in
 Makefile.in'
 PENDING/*
+scripts/scripts
 TAGS
 VC++Files/client/mysql_amd64.dsp
 ac_available_languages_fragment
@@ -1968,6 +1974,7 @@ sql-bench/test-transactions
 sql-bench/test-wisconsin
 sql/*.cpp
 sql/*.ds?
+sql/*.def
 sql/*.vcproj
 sql/.deps/client.Po
 sql/.deps/derror.Po
@@ -2100,6 +2107,7 @@ sql/.libs/udf_example.lai
 sql/.libs/udf_example.so.0
 sql/.libs/udf_example.so.0.0.0
 sql/client.c
+sql/cmake_dummy.cc
 sql/Doxyfile
 sql/f.c
 sql/gen_lex_hash
@@ -3030,6 +3038,7 @@ vio/viotest.cpp
 win/configure.data
 win/vs71cache.txt
 win/vs8cache.txt
+win/nmake_cache.txt
 ylwrap
 zlib/*.ds?
 zlib/*.vcproj

=== modified file 'config/ac-macros/maintainer.m4'
--- a/config/ac-macros/maintainer.m4	revid:marko.makela@stripped
+++ b/config/ac-macros/maintainer.m4	revid:vasil.dimov@stripped
@@ -19,6 +19,7 @@ AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], 
   AS_IF([test "$GCC" = "yes"], [
     C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
     CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
+    C_WARNINGS="${C_WARNINGS} -Wdeclaration-after-statement"
   ])
 
   # Test whether the warning options work.

=== modified file 'configure.in'
--- a/configure.in	revid:marko.makela@stripped
+++ b/configure.in	revid:vasil.dimov@stripped
@@ -12,7 +12,7 @@ dnl
 dnl When changing the major version number please also check the switch
 dnl statement in mysqlbinlog::check_master_version().  You may also need
 dnl to update version.c in ndb.
-AC_INIT([MySQL Server], [5.1.52], [], [mysql])
+AC_INIT([MySQL Server], [5.1.54], [], [mysql])
 
 AC_CONFIG_SRCDIR([sql/mysqld.cc])
 AC_CANONICAL_SYSTEM

=== added file 'mysql-test/collections/mysql-5.1-bugteam.daily'
--- a/mysql-test/collections/mysql-5.1-bugteam.daily	1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-5.1-bugteam.daily	revid:vasil.dimov@stripped
@@ -0,0 +1,5 @@
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed  --embedded --experimental=collections/default.experimental
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row  --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental

=== added file 'mysql-test/collections/mysql-5.1-bugteam.push'
--- a/mysql-test/collections/mysql-5.1-bugteam.push	1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-5.1-bugteam.push	revid:vasil.dimov@stripped
@@ -0,0 +1,4 @@
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --suite=main --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed  --suite=main --embedded --experimental=collections/default.experimental --skip-ndb
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --skip-ndb

=== modified file 'mysql-test/r/func_time.result'
--- a/mysql-test/r/func_time.result	revid:marko.makela@stripped
+++ b/mysql-test/r/func_time.result	revid:vasil.dimov@stripped
@@ -1343,4 +1343,18 @@ SELECT 1 FROM t1 ORDER BY @x:=makedate(a
 1
 1
 DROP TABLE t1;
+#
+# Bug #52160: crash and inconsistent results when grouping
+#             by a function and column
+#
+CREATE TABLE t1(a CHAR(10) NOT NULL);
+INSERT INTO t1 VALUES (''),('');
+SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a);
+COUNT(*)
+2
+Warnings:
+Warning	1292	Truncated incorrect time value: ''
+Warning	1292	Truncated incorrect time value: ''
+Warning	1292	Truncated incorrect time value: ''
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/log_tables.result'
--- a/mysql-test/r/log_tables.result	revid:marko.makela@stripped
+++ b/mysql-test/r/log_tables.result	revid:vasil.dimov@stripped
@@ -899,6 +899,16 @@ TIMESTAMP	1	1	SELECT SQL_NO_CACHE 'Bug#3
 TIMESTAMP	1	1	SELECT SQL_NO_CACHE 'Bug#31700 - PK',  f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2
 DROP TABLE t1;
 TRUNCATE TABLE mysql.slow_log;
+use mysql;
+drop table if exists renamed_general_log;
+drop table if exists renamed_slow_log;
+RENAME TABLE general_log TO renamed_general_log;
+ERROR HY000: Cannot rename 'general_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'general_log'
+RENAME TABLE slow_log TO renamed_slow_log;
+ERROR HY000: Cannot rename 'slow_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'slow_log'
+use test;
+flush tables with read lock;
+unlock tables;
 SET @@session.long_query_time= @old_long_query_time;
 SET @@global.log_output=       @old_log_output;
 SET @@global.slow_query_log=   @old_slow_query_log;

=== modified file 'mysql-test/r/ps.result'
--- a/mysql-test/r/ps.result	revid:marko.makela@stripped
+++ b/mysql-test/r/ps.result	revid:vasil.dimov@stripped
@@ -3001,4 +3001,42 @@ EXECUTE stmt;
 1
 DEALLOCATE PREPARE stmt;
 DROP TABLE t1;
+#
+# Bug#54494 crash with explain extended and prepared statements
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1),(2);
+PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
+EXECUTE stmt;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	100.00	
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	
+Warnings:
+Note	1003	select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
+EXECUTE stmt;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	100.00	
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	
+Warnings:
+Note	1003	select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+#
+# Bug#54488 crash when using explain and prepared statements with subqueries
+#
+CREATE TABLE t1(f1 INT);
+INSERT INTO t1 VALUES (1),(1);
+PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))';
+EXECUTE stmt;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
+2	SUBQUERY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
+3	SUBQUERY	t1	ALL	NULL	NULL	NULL	NULL	2	Using temporary; Using filesort
+EXECUTE stmt;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
+2	SUBQUERY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
+3	SUBQUERY	t1	ALL	NULL	NULL	NULL	NULL	2	Using temporary; Using filesort
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
 End of 5.1 tests.

=== modified file 'mysql-test/r/type_blob.result'
--- a/mysql-test/r/type_blob.result	revid:marko.makela@stripped
+++ b/mysql-test/r/type_blob.result	revid:vasil.dimov@stripped
@@ -974,3 +974,14 @@ ERROR 42000: Display width out of range 
 explain select convert(1, binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
 ERROR 42000: Display width out of range for column 'cast as char' (max = 4294967295)
 End of 5.0 tests
+# Bug #52160: crash and inconsistent results when grouping
+#             by a function and column
+CREATE FUNCTION f1() RETURNS TINYBLOB RETURN 1;
+CREATE TABLE t1(a CHAR(1));
+INSERT INTO t1 VALUES ('0'), ('0');
+SELECT COUNT(*) FROM t1 GROUP BY f1(), a;
+COUNT(*)
+2
+DROP FUNCTION f1;
+DROP TABLE t1;
+End of 5.1 tests

=== added file 'mysql-test/suite/innodb/r/innodb_bug57255.result'
--- a/mysql-test/suite/innodb/r/innodb_bug57255.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug57255.result	revid:vasil.dimov@stripped
@@ -0,0 +1,10 @@
+create table A(id int not null primary key) engine=innodb;
+create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
+create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
+insert into A values(1), (2);
+DELETE FROM A where id = 1;
+DELETE FROM C where f1 = 2;
+DELETE FROM A where id = 1;
+DROP TABLE C;
+DROP TABLE B;
+DROP TABLE A;

=== added file 'mysql-test/suite/innodb/t/innodb_bug57255.test'
--- a/mysql-test/suite/innodb/t/innodb_bug57255.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug57255.test	revid:vasil.dimov@stripped
@@ -0,0 +1,36 @@
+# Test Bug #57255. Cascade deletes that affect different rows should not
+# result in DB_FOREIGN_EXCEED_MAX_CASCADE error
+
+--source include/have_innodb.inc
+
+create table A(id int not null primary key) engine=innodb;
+
+create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
+
+create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
+
+insert into A values(1), (2);
+
+--disable_query_log
+let $i=257;
+while ($i)
+{
+insert into B(f1) values(1);
+dec $i;
+}
+let $i=486;
+while ($i)
+{
+insert into C(f1) values(2);
+dec $i;
+}
+--enable_query_log
+
+# Following Deletes should not report error
+DELETE FROM A where id = 1;
+DELETE FROM C where f1 = 2;
+DELETE FROM A where id = 1;
+
+DROP TABLE C;
+DROP TABLE B;
+DROP TABLE A;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug57255.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug57255.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug57255.result	revid:vasil.dimov@stripped
@@ -0,0 +1,10 @@
+create table A(id int not null primary key) engine=innodb;
+create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
+create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
+insert into A values(1), (2);
+DELETE FROM A where id = 1;
+DELETE FROM C where f1 = 2;
+DELETE FROM A where id = 1;
+DROP TABLE C;
+DROP TABLE B;
+DROP TABLE A;

=== added file 'mysql-test/suite/innodb_plugin/t/innodb_bug57255.test'
--- a/mysql-test/suite/innodb_plugin/t/innodb_bug57255.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug57255.test	revid:vasil.dimov@stripped
@@ -0,0 +1,36 @@
+# Test Bug #57255. Cascade deletes that affect different rows should not
+# result in DB_FOREIGN_EXCEED_MAX_CASCADE error
+
+--source include/have_innodb_plugin.inc
+
+create table A(id int not null primary key) engine=innodb;
+
+create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
+
+create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
+
+insert into A values(1), (2);
+
+--disable_query_log
+let $i=257;
+while ($i)
+{
+insert into B(f1) values(1);
+dec $i;
+}
+let $i=486;
+while ($i)
+{
+insert into C(f1) values(2);
+dec $i;
+}
+--enable_query_log
+
+# Following Deletes should not report error
+DELETE FROM A where id = 1;
+DELETE FROM C where f1 = 2;
+DELETE FROM A where id = 1;
+
+DROP TABLE C;
+DROP TABLE B;
+DROP TABLE A;

=== modified file 'mysql-test/t/func_time.test'
--- a/mysql-test/t/func_time.test	revid:marko.makela@stripped
+++ b/mysql-test/t/func_time.test	revid:vasil.dimov@stripped
@@ -849,4 +849,14 @@ INSERT INTO t1 VALUES (0),(9.216e-096);
 SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a);
 DROP TABLE t1;
 
+--echo #
+--echo # Bug #52160: crash and inconsistent results when grouping
+--echo #             by a function and column
+--echo #
+
+CREATE TABLE t1(a CHAR(10) NOT NULL);
+INSERT INTO t1 VALUES (''),('');
+SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a);
+DROP TABLE t1;
+
 --echo End of 5.1 tests

=== modified file 'mysql-test/t/log_tables.test'
--- a/mysql-test/t/log_tables.test	revid:marko.makela@stripped
+++ b/mysql-test/t/log_tables.test	revid:vasil.dimov@stripped
@@ -1027,6 +1027,25 @@ DROP TABLE t1;
 
 TRUNCATE TABLE mysql.slow_log;
 
+#
+# Bug #47924 main.log_tables times out sporadically
+#
+
+use mysql;
+# Should result in error
+--disable_warnings
+drop table if exists renamed_general_log;
+drop table if exists renamed_slow_log;
+--enable_warnings
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE general_log TO renamed_general_log;
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE slow_log TO renamed_slow_log;
+
+use test;
+flush tables with read lock;
+unlock tables;
+
 SET @@session.long_query_time= @old_long_query_time;
 
 SET @@global.log_output=       @old_log_output;

=== modified file 'mysql-test/t/ps.test'
--- a/mysql-test/t/ps.test	revid:marko.makela@stripped
+++ b/mysql-test/t/ps.test	revid:vasil.dimov@stripped
@@ -3079,4 +3079,26 @@ EXECUTE stmt;
 DEALLOCATE PREPARE stmt;
 DROP TABLE t1;
 
+--echo #
+--echo # Bug#54494 crash with explain extended and prepared statements
+--echo #
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1),(2);
+PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
+EXECUTE stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#54488 crash when using explain and prepared statements with subqueries
+--echo #
+CREATE TABLE t1(f1 INT);
+INSERT INTO t1 VALUES (1),(1);
+PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))';
+EXECUTE stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+
 --echo End of 5.1 tests.

=== modified file 'mysql-test/t/type_blob.test'
--- a/mysql-test/t/type_blob.test	revid:marko.makela@stripped
+++ b/mysql-test/t/type_blob.test	revid:vasil.dimov@stripped
@@ -612,3 +612,19 @@ explain select convert(1, binary(4294967
 explain select convert(1, binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
 
 --echo End of 5.0 tests
+
+--echo # Bug #52160: crash and inconsistent results when grouping
+--echo #             by a function and column
+
+CREATE FUNCTION f1() RETURNS TINYBLOB RETURN 1;
+
+CREATE TABLE t1(a CHAR(1));
+INSERT INTO t1 VALUES ('0'), ('0');
+
+SELECT COUNT(*) FROM t1 GROUP BY f1(), a;
+
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
+

=== modified file 'mysys/stacktrace.c'
--- a/mysys/stacktrace.c	revid:marko.makela@stripped
+++ b/mysys/stacktrace.c	revid:vasil.dimov@stripped
@@ -318,6 +318,9 @@ end:
 /* Produce a core for the thread */
 void my_write_core(int sig)
 {
+#ifdef HAVE_gcov
+  extern void __gcov_flush(void);
+#endif
   signal(sig, SIG_DFL);
 #ifdef HAVE_gcov
   /*
@@ -325,7 +328,6 @@ void my_write_core(int sig)
     information from this process, causing gcov output to be incomplete.
     So we force the writing of coverage information here before terminating.
   */
-  extern void __gcov_flush(void);
   __gcov_flush();
 #endif
   pthread_kill(pthread_self(), sig);

=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc	revid:marko.makela@stripped
+++ b/sql/item_subselect.cc	revid:vasil.dimov@stripped
@@ -1907,18 +1907,22 @@ int subselect_single_select_engine::exec
     }
     if (!select_lex->uncacheable && thd->lex->describe && 
         !(join->select_options & SELECT_DESCRIBE) && 
-        join->need_tmp && item->const_item())
+        join->need_tmp)
     {
-      /*
-        Force join->join_tmp creation, because this subquery will be replaced
-        by a simple select from the materialization temp table by optimize()
-        called by EXPLAIN and we need to preserve the initial query structure
-        so we can display it.
-       */
-      select_lex->uncacheable|= UNCACHEABLE_EXPLAIN;
-      select_lex->master_unit()->uncacheable|= UNCACHEABLE_EXPLAIN;
-      if (join->init_save_join_tab())
-        DBUG_RETURN(1);                        /* purecov: inspected */
+      item->update_used_tables();
+      if (item->const_item())
+      {
+        /*
+          Force join->join_tmp creation, because this subquery will be replaced
+          by a simple select from the materialization temp table by optimize()
+          called by EXPLAIN and we need to preserve the initial query structure
+          so we can display it.
+        */
+        select_lex->uncacheable|= UNCACHEABLE_EXPLAIN;
+        select_lex->master_unit()->uncacheable|= UNCACHEABLE_EXPLAIN;
+        if (join->init_save_join_tab())
+          DBUG_RETURN(1);                        /* purecov: inspected */
+      }
     }
     if (item->engine_changed)
     {

=== modified file 'sql/item_timefunc.h'
--- a/sql/item_timefunc.h	revid:marko.makela@stripped
+++ b/sql/item_timefunc.h	revid:vasil.dimov@stripped
@@ -331,6 +331,7 @@ public:
   const char *func_name() const { return "time_to_sec"; }
   void fix_length_and_dec()
   {
+    maybe_null= TRUE;
     decimals=0;
     max_length=10*MY_CHARSET_BIN_MB_MAXLEN;
   }

=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc	revid:marko.makela@stripped
+++ b/sql/sql_prepare.cc	revid:vasil.dimov@stripped
@@ -2362,11 +2362,15 @@ void reinit_stmt_before_use(THD *thd, LE
         sl->where= sl->prep_where->copy_andor_structure(thd);
         sl->where->cleanup();
       }
+      else
+        sl->where= NULL;
       if (sl->prep_having)
       {
         sl->having= sl->prep_having->copy_andor_structure(thd);
         sl->having->cleanup();
       }
+      else
+        sl->having= NULL;
       DBUG_ASSERT(sl->join == 0);
       ORDER *order;
       /* Fix GROUP list */

=== modified file 'sql/sql_rename.cc'
--- a/sql/sql_rename.cc	revid:marko.makela@stripped
+++ b/sql/sql_rename.cc	revid:vasil.dimov@stripped
@@ -99,7 +99,7 @@ bool mysql_rename_tables(THD *thd, TABLE
             */
             my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), ren_table->table_name,
                      ren_table->table_name);
-            DBUG_RETURN(1);
+            goto err;
           }
         }
         else
@@ -112,7 +112,7 @@ bool mysql_rename_tables(THD *thd, TABLE
             */
             my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), ren_table->table_name,
                      ren_table->table_name);
-            DBUG_RETURN(1);
+            goto err;
           }
           else
           {
@@ -130,7 +130,7 @@ bool mysql_rename_tables(THD *thd, TABLE
       else
         my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), rename_log_table[1],
                  rename_log_table[1]);
-      DBUG_RETURN(1);
+      goto err;
     }
   }
 

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	revid:marko.makela@stripped
+++ b/sql/sql_select.cc	revid:vasil.dimov@stripped
@@ -15198,6 +15198,8 @@ calc_group_buffer(JOIN *join,ORDER *grou
         {
           key_length+= 8;
         }
+        else if (type == MYSQL_TYPE_BLOB)
+          key_length+= MAX_BLOB_WIDTH;		// Can't be used as a key
         else
         {
           /*

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	revid:marko.makela@stripped
+++ b/sql/sql_show.cc	revid:vasil.dimov@stripped
@@ -534,12 +534,6 @@ find_files(THD *thd, List<LEX_STRING> *f
 	else if (wild_compare(uname, wild, 0))
 	  continue;
       }
-      if (!(file_name= 
-            thd->make_lex_string(file_name, uname, file_name_len, TRUE)))
-      {
-        my_dirend(dirp);
-        DBUG_RETURN(FIND_FILES_OOM);
-      }
     }
     else
     {

=== modified file 'storage/innobase/row/row0mysql.c'
--- a/storage/innobase/row/row0mysql.c	revid:marko.makela@stripped
+++ b/storage/innobase/row/row0mysql.c	revid:vasil.dimov@stripped
@@ -1613,6 +1613,9 @@ row_update_cascade_for_mysql(
 
 	trx = thr_get_trx(thr);
 
+	/* Increment fk_cascade_depth to record the recursive call depth on
+	a single update/delete that affects multiple tables chained
+	together with foreign key relations. */
 	thr->fk_cascade_depth++;
 
 	if (thr->fk_cascade_depth > FK_MAX_CASCADE_DEL) {
@@ -1624,6 +1627,12 @@ run_again:
 
 	row_upd_step(thr);
 
+	/* The recursive call for cascading update/delete happens
+	in above row_upd_step(), reset the counter once we come
+	out of the recursive call, so it does not accumulate for
+	different row deletes */
+	thr->fk_cascade_depth = 0;
+
 	err = trx->error_state;
 
 	/* Note that the cascade node is a subnode of another InnoDB

=== modified file 'storage/innodb_plugin/ChangeLog'
--- a/storage/innodb_plugin/ChangeLog	revid:marko.makela@stripped
+++ b/storage/innodb_plugin/ChangeLog	revid:vasil.dimov@stripped
@@ -58,10 +58,14 @@
 
 2010-10-11	The InnoDB Team
 
-	* row/row0sel.c:
-	Fix Bug#57345 btr_pcur_store_position abort for load with concurrent
-	lock/unlock tables
-
+	* row/row0sel.c
+	Fix Bug #57345 btr_pcur_store_position abort for load with
+	concurrent lock/unlock tables
+
+2010-10-06	The InnoDB Team
+	* row/row0mysql.c, innodb_bug57255.result, innodb_bug57255.test
+	Fix Bug #Cascade Delete results in "Got error -1 from storage engine"
+ 
 2010-09-27	The InnoDB Team
 
 	* row/row0sel.c, innodb_bug56716.result, innodb_bug56716.test:

=== modified file 'storage/innodb_plugin/row/row0mysql.c'
--- a/storage/innodb_plugin/row/row0mysql.c	revid:marko.makela@stripped
+++ b/storage/innodb_plugin/row/row0mysql.c	revid:vasil.dimov@stripped
@@ -1593,6 +1593,9 @@ row_update_cascade_for_mysql(
 
 	trx = thr_get_trx(thr);
 
+	/* Increment fk_cascade_depth to record the recursive call depth on
+	a single update/delete that affects multiple tables chained
+	together with foreign key relations. */
 	thr->fk_cascade_depth++;
 
 	if (thr->fk_cascade_depth > FK_MAX_CASCADE_DEL) {
@@ -1604,6 +1607,12 @@ run_again:
 
 	row_upd_step(thr);
 
+	/* The recursive call for cascading update/delete happens
+	in above row_upd_step(), reset the counter once we come
+	out of the recursive call, so it does not accumulate for
+	different row deletes */
+	thr->fk_cascade_depth = 0;
+
 	err = trx->error_state;
 
 	/* Note that the cascade node is a subnode of another InnoDB

No bundle (reason: revision is a merge).
Thread
bzr commit into mysql-5.1-innodb branch (vasil.dimov:3657) vasil.dimov8 Nov