List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:February 2 2006 10:03am
Subject:bk commit into 5.1 tree (konstantin:1.2131)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of kostja. When kostja 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.2131 06/02/02 12:03:35 konstantin@stripped +26 -0
  Merge mysql.com:/home/kostja/mysql/mysql-5.0-for_merge
  into  mysql.com:/home/kostja/mysql/mysql-5.1-merge

  sql/sql_yacc.yy
    1.449 06/02/02 12:03:05 konstantin@stripped +3 -1
    Manual merge: resolve the conflict with moved sp_if rule

  mysql-test/mysql-test-run.pl
    1.59 06/02/02 12:00:33 konstantin@stripped +0 -0
    SCCS merged

  sql/share/errmsg.txt
    1.78 06/02/02 11:59:20 konstantin@stripped +0 -0
    Auto merged

  sql/sql_table.cc
    1.302 06/02/02 11:59:19 konstantin@stripped +0 -0
    Auto merged

  sql/sql_select.cc
    1.384 06/02/02 11:59:19 konstantin@stripped +0 -0
    Auto merged

  sql/sql_handler.cc
    1.80 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  sql/sp_head.h
    1.76 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  sql/sp_head.cc
    1.196 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  sql/ha_berkeley.cc
    1.171 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/t/sp.test
    1.171 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/t/ps.test
    1.59 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/t/mysqltest.test
    1.33 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/t/ctype_ucs.test
    1.38 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/t/create.test
    1.76 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/t/alter_table.test
    1.46 06/02/02 11:59:18 konstantin@stripped +10 -10
    Auto merged

  mysql-test/r/view_grant.result
    1.11 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/r/variables.result
    1.78 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/r/type_decimal.result
    1.40 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/r/sp.result
    1.183 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/r/sp-error.result
    1.100 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/r/ps.result
    1.61 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/r/mysqltest.result
    1.29 06/02/02 11:59:18 konstantin@stripped +0 -0
    Auto merged

  mysql-test/r/ctype_ucs.result
    1.42 06/02/02 11:59:17 konstantin@stripped +0 -0
    Auto merged

  mysql-test/r/create.result
    1.114 06/02/02 11:59:17 konstantin@stripped +0 -0
    Auto merged

  mysql-test/r/alter_table.result
    1.59 06/02/02 11:59:17 konstantin@stripped +4 -4
    Auto merged

  client/mysqltest.c
    1.177 06/02/02 11:59:17 konstantin@stripped +0 -0
    Auto merged

# 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:	konstantin
# Host:	oak.local
# Root:	/home/kostja/mysql/mysql-5.1-merge/RESYNC

--- 1.448/sql/sql_yacc.yy	2006-02-01 13:28:40 +03:00
+++ 1.449/sql/sql_yacc.yy	2006-02-02 12:03:05 +03:00
@@ -2288,7 +2288,9 @@
         ;
 
 sp_proc_stmt_if:
-        IF sp_if END IF {}
+        IF { Lex->sphead->new_cont_backpatch(NULL); }
+        sp_if END IF
+        { Lex->sphead->do_cont_backpatch(); }
         ;
         
 sp_proc_stmt_statement:
@@ -2366,13 +2368,17 @@
 	CASE_SYM WHEN_SYM
 	  {
 	    Lex->sphead->m_flags&= ~sp_head::IN_SIMPLE_CASE;
+            Lex->sphead->new_cont_backpatch(NULL);
 	  }
-	  sp_case END CASE_SYM {}
+          sp_case END CASE_SYM { Lex->sphead->do_cont_backpatch(); }
         ;
         
 sp_proc_stmt_case:
           CASE_SYM
-          { Lex->sphead->reset_lex(YYTHD); }
+          {
+            Lex->sphead->reset_lex(YYTHD);
+            Lex->sphead->new_cont_backpatch(NULL);
+          }
           expr WHEN_SYM
 	  {
 	    LEX *lex= Lex;
@@ -2396,6 +2402,7 @@
 	  sp_case END CASE_SYM
 	  {
 	    Lex->spcont->pop_case_expr_id();
+            Lex->sphead->do_cont_backpatch();
 	  }
         ;
 
@@ -2686,6 +2693,7 @@
                                                                $2, lex);
 
 	    sp->push_backpatch(i, ctx->push_label((char *)"", 0));
+            sp->add_cont_backpatch(i);
             sp->add_instr(i);
             sp->restore_lex(YYTHD);
 	  }
@@ -2744,6 +2752,7 @@
 	      i= new sp_instr_jump_if_not(ip, ctx, expr, lex);
 	    }
 	    sp->push_backpatch(i, ctx->push_label((char *)"", 0));
+            sp->add_cont_backpatch(i);
             sp->add_instr(i);
             sp->restore_lex(YYTHD);
 	  }
@@ -2873,6 +2882,7 @@
 
 	    /* Jumping forward */
 	    sp->push_backpatch(i, lex->spcont->last_label());
+            sp->new_cont_backpatch(i);
             sp->add_instr(i);
             sp->restore_lex(YYTHD);
 	  }
@@ -2884,6 +2894,7 @@
 	    sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
 
 	    lex->sphead->add_instr(i);
+            lex->sphead->do_cont_backpatch();
 	  }
         | REPEAT_SYM sp_proc_stmts1 UNTIL_SYM 
           { Lex->sphead->reset_lex(YYTHD); }
@@ -2897,6 +2908,8 @@
                                                                lex);
             lex->sphead->add_instr(i);
             lex->sphead->restore_lex(YYTHD);
+            /* We can shortcut the cont_backpatch here */
+            i->m_cont_dest= ip+1;
 	  }
 	;
 

--- 1.77/sql/share/errmsg.txt	2006-01-27 03:07:29 +03:00
+++ 1.78/sql/share/errmsg.txt	2006-02-02 11:59:20 +03:00
@@ -5172,8 +5172,8 @@
 	eng "Incorrect number of FETCH variables"
 	ger "Falsche Anzahl von FETCH-Variablen"
 ER_SP_FETCH_NO_DATA 02000 
-	eng "No data to FETCH"
-	ger "Keine Daten mit FETCH abzuholen"
+	eng "No data - zero rows fetched, selected, or processed"
+	ger "Keine Daten - null Zeilen geholt (fetch), ausgewählt oder verarbeitet"
 ER_SP_DUP_PARAM 42000 
 	eng "Duplicate parameter: %s"
 	ger "Doppelter Parameter: %s"

--- 1.10/mysql-test/r/view_grant.result	2006-01-19 12:25:04 +03:00
+++ 1.11/mysql-test/r/view_grant.result	2006-02-02 11:59:18 +03:00
@@ -350,12 +350,12 @@
 f2()
 NULL
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 select * from v2;
 f2()
 NULL
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 select * from v3;
 ERROR HY000: View 'mysqltest.v3' references invalid table(s) or column(s) or function(s)
or definer/invoker of view lack rights to use them
 select * from v4;
@@ -396,12 +396,12 @@
 f2()
 NULL
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 select * from v4;
 f2()
 NULL
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 select * from v5;
 ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or function(s)
or definer/invoker of view lack rights to use them
 drop view v1, v2, v3, v4, v5;

--- 1.28/mysql-test/r/mysqltest.result	2006-01-31 15:07:42 +03:00
+++ 1.29/mysql-test/r/mysqltest.result	2006-02-02 11:59:18 +03:00
@@ -361,6 +361,7 @@
 mysqltest: In included file "./var/tmp/con.sql": At line 7: Connection limit exhausted -
increase MAX_CONS in mysqltest.c
 mysqltest: In included file "./var/tmp/con.sql": At line 3: connection 'test_con1' not
found in connection pool
 mysqltest: In included file "./var/tmp/con.sql": At line 2: Connection test_con1 already
exists
+connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
 Output from mysqltest-x.inc
 Output from mysqltest-x.inc
 Output from mysqltest-x.inc

--- 1.32/mysql-test/t/mysqltest.test	2006-01-31 06:58:13 +03:00
+++ 1.33/mysql-test/t/mysqltest.test	2006-02-02 11:59:18 +03:00
@@ -909,7 +909,13 @@
 --error 1
 --exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
 
-
+# connect when "disable_abort_on_error" caused "connection not found"
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--disable_abort_on_error
+connect (con1,localhost,root,,);
+connection default;
+connection con1;
+--enable_abort_on_error
 
 # ----------------------------------------------------------------------------
 # Test mysqltest arguments

--- 1.58/mysql-test/r/alter_table.result	2005-12-31 07:51:12 +03:00
+++ 1.59/mysql-test/r/alter_table.result	2006-02-02 11:59:17 +03:00
@@ -617,3 +617,7 @@
 i	v
 4	3r4f
 drop table t1;
+create table t1 (t varchar(255) default null, key t (t(80)))
+engine=myisam default charset=latin1;
+alter table t1 change t t text;
+drop table t1;

--- 1.77/mysql-test/r/variables.result	2005-11-23 23:47:25 +03:00
+++ 1.78/mysql-test/r/variables.result	2006-02-02 11:59:18 +03:00
@@ -537,10 +537,10 @@
 create table t1 (a int);
 select a into @x from t1;
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 show warnings;
 Level	Code	Message
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 drop table t1;
 set @@warning_count=1;
 ERROR HY000: Variable 'warning_count' is a read only variable

--- 1.45/mysql-test/t/alter_table.test	2005-12-31 07:49:41 +03:00
+++ 1.46/mysql-test/t/alter_table.test	2006-02-02 11:59:18 +03:00
@@ -439,3 +439,13 @@
 alter table t1 add unique key (i, v);
 select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
 drop table t1;
+
+#
+# Bug#6073 "ALTER table minor glich": ALTER TABLE complains that an index
+# without # prefix is not allowed for TEXT columns, while index
+# is defined with prefix.
+# 
+create table t1 (t varchar(255) default null, key t (t(80)))
+engine=myisam default charset=latin1;
+alter table t1 change t t text;
+drop table t1;

--- 1.176/client/mysqltest.c	2006-01-31 15:07:42 +03:00
+++ 1.177/client/mysqltest.c	2006-02-02 11:59:17 +03:00
@@ -2500,19 +2500,8 @@
     *create_conn= 0;
     goto err;
   }
-  else
-  {
-    handle_no_error(q);
 
-    /*
-      Fail if there was no error but we expected it.
-      We also don't want to have connection in this case.
-    */
-    mysql_close(con);
-    *create_conn= 0;
-    error= 1;
-    goto err;
-  }
+  handle_no_error(q);
 
   /*
    TODO: change this to 0 in future versions, but the 'kill' test relies on

--- 1.99/mysql-test/r/sp-error.result	2006-01-17 21:10:41 +03:00
+++ 1.100/mysql-test/r/sp-error.result	2006-02-02 11:59:18 +03:00
@@ -464,19 +464,6 @@
 call bug3294()|
 ERROR 42S02: Unknown table 't5'
 drop procedure bug3294|
-drop procedure if exists bug6807|
-create procedure bug6807()
-begin
-declare id int;
-set id = connection_id();
-kill query id;
-select 'Not reached';
-end|
-call bug6807()|
-ERROR 70100: Query execution was interrupted
-call bug6807()|
-ERROR 70100: Query execution was interrupted
-drop procedure bug6807|
 drop procedure if exists bug8776_1|
 drop procedure if exists bug8776_2|
 drop procedure if exists bug8776_3|

--- 1.182/mysql-test/r/sp.result	2006-02-01 18:56:20 +03:00
+++ 1.183/mysql-test/r/sp.result	2006-02-02 11:59:18 +03:00
@@ -522,7 +522,7 @@
 create table t3 ( s char(16), d int)|
 call into_test4()|
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 select * from t3|
 s	d
 into4	NULL
@@ -1787,10 +1787,10 @@
 call bug1863(10)|
 Warnings:
 Note	1051	Unknown table 'temp_t1'
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 call bug1863(10)|
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 select * from t4|
 f1	rc	t3
 2	0	NULL
@@ -2084,10 +2084,10 @@
 call bug4579_1()|
 call bug4579_1()|
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 call bug4579_1()|
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 drop procedure bug4579_1|
 drop procedure bug4579_2|
 drop table t3|
@@ -2507,7 +2507,7 @@
 var
 NULL
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 call bug7743("anotherword")|
 var
 2
@@ -2515,7 +2515,7 @@
 var
 NULL
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 drop procedure bug7743|
 drop table t4|
 delete from t3|
@@ -4296,6 +4296,90 @@
 2	NULL
 drop table t3|
 drop procedure bug15441|
+drop procedure if exists bug14498_1|
+drop procedure if exists bug14498_2|
+drop procedure if exists bug14498_3|
+drop procedure if exists bug14498_4|
+drop procedure if exists bug14498_5|
+create procedure bug14498_1()
+begin
+declare continue handler for sqlexception select 'error' as 'Handler';
+if v then
+select 'yes' as 'v';
+else
+select 'no' as 'v';
+end if;
+select 'done' as 'End';
+end|
+create procedure bug14498_2()
+begin
+declare continue handler for sqlexception select 'error' as 'Handler';
+while v do
+select 'yes' as 'v';
+end while;
+select 'done' as 'End';
+end|
+create procedure bug14498_3()
+begin
+declare continue handler for sqlexception select 'error' as 'Handler';
+repeat
+select 'maybe' as 'v';
+until v end repeat;
+select 'done' as 'End';
+end|
+create procedure bug14498_4()
+begin
+declare continue handler for sqlexception select 'error' as 'Handler';
+case v
+when 1 then
+select '1' as 'v';
+when 2 then
+select '2' as 'v';
+else
+select '?' as 'v';
+end case;
+select 'done' as 'End';
+end|
+create procedure bug14498_5()
+begin
+declare continue handler for sqlexception select 'error' as 'Handler';
+case
+when v = 1 then
+select '1' as 'v';
+when v = 2 then
+select '2' as 'v';
+else
+select '?' as 'v';
+end case;
+select 'done' as 'End';
+end|
+call bug14498_1()|
+Handler
+error
+End
+done
+call bug14498_2()|
+Handler
+error
+End
+done
+call bug14498_3()|
+v
+maybe
+Handler
+error
+End
+done
+call bug14498_5()|
+Handler
+error
+End
+done
+drop procedure bug14498_1|
+drop procedure bug14498_2|
+drop procedure bug14498_3|
+drop procedure bug14498_4|
+drop procedure bug14498_5|
 drop table if exists t3|
 drop procedure if exists bug15231_1|
 drop procedure if exists bug15231_2|
@@ -4340,7 +4424,7 @@
 xid	xdone
 1	0
 Warnings:
-Warning	1329	No data to FETCH
+Warning	1329	No data - zero rows fetched, selected, or processed
 call bug15231_3()|
 Result
 Missed it (correct)

--- 1.170/mysql-test/t/sp.test	2006-01-17 14:44:48 +03:00
+++ 1.171/mysql-test/t/sp.test	2006-02-02 11:59:18 +03:00
@@ -1444,11 +1444,11 @@
 call ifac(20)|
 select * from fac|
 drop table fac|
---replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
 show function status like '%f%'|
 drop procedure ifac|
 drop function fac|
---replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
 show function status like '%f%'|
 
 
@@ -1531,7 +1531,7 @@
   end while;
 end|
 show create procedure opp|
---replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
 show procedure status like '%p%'|
 
 # This isn't the fastest way in the world to compute prime numbers, so
@@ -1549,7 +1549,7 @@
 drop table primes|
 drop procedure opp|
 drop procedure ip|
---replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
 show procedure status like '%p%'|
 
 
@@ -1617,13 +1617,13 @@
 create procedure bar(x char(16), y int)
  comment "111111111111" sql security invoker
  insert into test.t1 values (x, y)|
---replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
 show procedure status like 'bar'|
 alter procedure bar comment "2222222222" sql security definer|
 alter procedure bar comment "3333333333"|
 alter procedure bar|
 show create procedure bar|
---replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
 show procedure status like 'bar'|
 drop procedure bar|
 
@@ -2573,7 +2573,6 @@
   show databases like 'foo';
   show errors;
   show columns from t1;
-  show grants for 'root'@'localhost';
   show keys from t1;
   show open tables like 'foo';
   show privileges;
@@ -2595,20 +2594,6 @@
 
 drop procedure bug4902|
 
-# We need separate SP for SHOW PROCESSLIST  since we want use replace_column
---disable_warnings
-drop procedure if exists bug4902_2|
---enable_warnings
-create procedure bug4902_2()
-begin
-  show processlist;
-end|
---replace_column 1 # 6 # 3 localhost
-call bug4902_2()|
---replace_column 1 # 6 # 3 localhost
-call bug4902_2()|
-drop procedure bug4902_2|
-
 #
 # BUG#4904
 #
@@ -2823,44 +2808,6 @@
 delete from t1|
 drop procedure bug4941|
 
-
-#
-# BUG#3583: query cache doesn't work for stored procedures
-#
---disable_warnings
-drop procedure if exists bug3583|
---enable_warnings
---disable_warnings
-drop procedure if exists bug3583|
---enable_warnings
-create procedure bug3583()
-begin
-  declare c int;
-
-  select * from t1;
-  select count(*) into c from t1;
-  select c;
-end|
-
-insert into t1 values ("x", 3), ("y", 5)|
-set @x = @@query_cache_size|
-set global query_cache_size = 10*1024*1024|
-
-flush status|
-flush query cache|
-show status like 'Qcache_hits'|
-call bug3583()|
-show status like 'Qcache_hits'|
-call bug3583()|
-call bug3583()|
-show status like 'Qcache_hits'|
-
-set global query_cache_size = @x|
-flush status|
-flush query cache|
-delete from t1|
-drop procedure bug3583|
-
 #
 # BUG#4905: Stored procedure doesn't clear for "Rows affected"
 #
@@ -3170,24 +3117,6 @@
 drop function bug5240|
 
 #
-# BUG#5278: Stored procedure packets out of order if SET PASSWORD.
-#
---disable_warnings
-drop function if exists bug5278|
---enable_warnings
-create function bug5278 () returns char
-begin
-  SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass');
-  return 'okay';
-end|
-
---error 1133
-select bug5278()|
---error 1133
-select bug5278()|
-drop function bug5278|
-
-#
 # BUG#7992: rolling back temporary Item tree changes in SP
 #
 --disable_warnings
@@ -4208,9 +4137,13 @@
 --error 1062
 select bug12379()|
 select 1|
+# statement-based binlogging will show warning which row-based won't;
+# so we hide it (this warning is already tested in rpl_stm_sp.test)
+--disable_warnings
 call bug12379_1()|
 select 2|
 call bug12379_2()|
+--enable_warnings
 select 3|
 --error 1062
 call bug12379_3()|
@@ -4784,24 +4717,6 @@
 call bug10100t(5)|
 
 #end of the stack checking
-set @@max_sp_recursion_depth=255|
-set @var=1|
-#disable log because error about stack overrun contains numbers which
-#depend on a system
--- disable_result_log
--- error ER_STACK_OVERRUN_NEED_MORE
-call bug10100p(255, @var)|
--- error ER_STACK_OVERRUN_NEED_MORE
-call bug10100pt(1,255)|
--- error ER_STACK_OVERRUN_NEED_MORE
-call bug10100pv(1,255)|
--- error ER_STACK_OVERRUN_NEED_MORE
-call bug10100pd(1,255)|
--- error ER_STACK_OVERRUN_NEED_MORE
-call bug10100pc(1,255)|
--- enable_result_log
-set @@max_sp_recursion_depth=0|
-
 deallocate prepare stmt2|
 
 drop function bug10100f|

--- 1.195/sql/sp_head.cc	2006-01-16 17:37:22 +03:00
+++ 1.196/sql/sp_head.cc	2006-02-02 11:59:18 +03:00
@@ -174,11 +174,11 @@
   case SQLCOM_SHOW_ERRORS:
   case SQLCOM_SHOW_FIELDS:
   case SQLCOM_SHOW_GRANTS:
-  case SQLCOM_SHOW_INNODB_STATUS:
+  case SQLCOM_SHOW_ENGINE_STATUS:
+  case SQLCOM_SHOW_ENGINE_LOGS:
+  case SQLCOM_SHOW_ENGINE_MUTEX:
   case SQLCOM_SHOW_KEYS:
-  case SQLCOM_SHOW_LOGS:
   case SQLCOM_SHOW_MASTER_STAT:
-  case SQLCOM_SHOW_MUTEX_STATUS:
   case SQLCOM_SHOW_NEW_MASTER:
   case SQLCOM_SHOW_OPEN_TABLES:
   case SQLCOM_SHOW_PRIVILEGES:
@@ -308,6 +308,9 @@
 {
   DBUG_ENTER("sp_eval_expr");
 
+  if (!expr_item)
+    DBUG_RETURN(TRUE);
+
   if (!(expr_item= sp_prepare_func_item(thd, &expr_item)))
     DBUG_RETURN(TRUE);
 
@@ -474,7 +477,7 @@
 sp_head::init_strings(THD *thd, LEX *lex, sp_name *name)
 {
   DBUG_ENTER("sp_head::init_strings");
-  uchar *endp;                  /* Used to trim the end */
+  const uchar *endp;                            /* Used to trim the end */
   /* During parsing, we must use thd->mem_root */
   MEM_ROOT *root= thd->mem_root;
 
@@ -675,7 +678,8 @@
   field_length= !m_return_field_def.length ?
                 field_max_length : m_return_field_def.length;
 
-  field= ::make_field((char*) 0,                    /* field ptr */
+  field= ::make_field(table->s,                     /* TABLE_SHARE ptr */
+                      (char*) 0,                    /* field ptr */
                       field_length,                 /* field [max] length */
                       (uchar*) "",                  /* null ptr */
                       0,                            /* null bit */
@@ -685,8 +689,10 @@
                       m_return_field_def.geom_type,
                       Field::NONE,                  /* unreg check */
                       m_return_field_def.interval,
-                      field_name ? field_name : (const char *) m_name.str,
-                      table);
+                      field_name ? field_name : (const char *) m_name.str);
+
+  if (field)
+    field->init(table);
   
   DBUG_RETURN(field);
 }
@@ -700,6 +706,9 @@
 
 /*
   StoredRoutinesBinlogging
+  This paragraph applies only to statement-based binlogging. Row-based
+  binlogging does not need anything special like this.
+
   Top-down overview:
 
   1. Statements
@@ -1267,56 +1276,62 @@
 
   thd->spcont= nctx;
 
-  binlog_save_options= thd->options;
-  need_binlog_call= mysql_bin_log.is_open() && (thd->options &
OPTION_BIN_LOG);
+  /*
+    If row-based binlogging, we don't need to binlog the function's call, let
+    each substatement be binlogged its way.
+  */
+  need_binlog_call= mysql_bin_log.is_open() &&
+    (thd->options & OPTION_BIN_LOG) && !binlog_row_based;
   if (need_binlog_call)
   {
     reset_dynamic(&thd->user_var_events);
     mysql_bin_log.start_union_events(thd);
+    binlog_save_options= thd->options;
+    thd->options&= ~OPTION_BIN_LOG;
   }
-    
-  thd->options&= ~OPTION_BIN_LOG;
+
   err_status= execute(thd);
-  thd->options= binlog_save_options;
-  
-  if (need_binlog_call)
-    mysql_bin_log.stop_union_events(thd);
 
-  if (need_binlog_call && thd->binlog_evt_union.unioned_events)
+  if (need_binlog_call)
   {
-    char buf[256];
-    String bufstr(buf, sizeof(buf), &my_charset_bin);
-    bufstr.length(0);
-    bufstr.append(STRING_WITH_LEN("DO "));
-    append_identifier(thd, &bufstr, m_name.str, m_name.length);
-    bufstr.append('(');
-    for (uint i=0; i < argcount; i++)
+    mysql_bin_log.stop_union_events(thd);
+    thd->options= binlog_save_options;
+    if (thd->binlog_evt_union.unioned_events)
     {
-      String str_value_holder;
-      String *str_value;
-
-      if (i)
-        bufstr.append(',');
-
-      str_value= sp_get_item_value(param_values[i], &str_value_holder);
+      char buf[256];
+      String bufstr(buf, sizeof(buf), &my_charset_bin);
+      bufstr.length(0);
+      bufstr.append(STRING_WITH_LEN("DO "));
+      append_identifier(thd, &bufstr, m_name.str, m_name.length);
+      bufstr.append('(');
+      for (uint i=0; i < argcount; i++)
+      {
+        String str_value_holder;
+        String *str_value;
 
-      if (str_value)
-        bufstr.append(*str_value);
-      else
-        bufstr.append(STRING_WITH_LEN("NULL"));
-    }
-    bufstr.append(')');
-    
-    Query_log_event qinfo(thd, bufstr.ptr(), bufstr.length(),
-                          thd->binlog_evt_union.unioned_events_trans, FALSE);
-    if (mysql_bin_log.write(&qinfo) && 
-        thd->binlog_evt_union.unioned_events_trans)
-    {
-      push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
-                   "Invoked ROUTINE modified a transactional table but MySQL "
-                   "failed to reflect this change in the binary log");
+        if (i)
+          bufstr.append(',');
+        
+        str_value= sp_get_item_value(param_values[i], &str_value_holder);
+
+        if (str_value)
+          bufstr.append(*str_value);
+        else
+          bufstr.append(STRING_WITH_LEN("NULL"));
+      }
+      bufstr.append(')');
+      
+      Query_log_event qinfo(thd, bufstr.ptr(), bufstr.length(),
+                            thd->binlog_evt_union.unioned_events_trans, FALSE);
+      if (mysql_bin_log.write(&qinfo) &&
+          thd->binlog_evt_union.unioned_events_trans)
+      {
+        push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
+                     "Invoked ROUTINE modified a transactional table but MySQL "
+                     "failed to reflect this change in the binary log");
+      }
+      reset_dynamic(&thd->user_var_events);
     }
-    reset_dynamic(&thd->user_var_events);
   }
 
   if (m_type == TYPE_ENUM_FUNCTION && !err_status)

--- 1.75/sql/sp_head.h	2006-01-16 17:25:36 +03:00
+++ 1.76/sql/sp_head.h	2006-02-02 11:59:18 +03:00
@@ -130,8 +130,7 @@
 
   create_field m_return_field_def; /* This is used for FUNCTIONs only. */
 
-  uchar *m_tmp_query;		// Temporary pointer to sub query string
-  uint m_old_cmq;		// Old CLIENT_MULTI_QUERIES value
+  const uchar *m_tmp_query;	// Temporary pointer to sub query string
   st_sp_chistics *m_chistics;
   ulong m_sql_mode;		// For SHOW CREATE and execution
   LEX_STRING m_qname;		// db.name
@@ -179,7 +178,7 @@
   */
   HASH m_sroutines;
   // Pointers set during parsing
-  uchar *m_param_begin, *m_param_end, *m_body_begin;
+  const uchar *m_param_begin, *m_param_end, *m_body_begin;
 
   /*
     Security context for stored routine which should be run under

--- 1.79/sql/sql_handler.cc	2006-01-16 16:26:27 +03:00
+++ 1.80/sql/sql_handler.cc	2006-02-02 11:59:18 +03:00
@@ -422,12 +422,13 @@
   if (!lock)
     goto err0; // mysql_lock_tables() printed error message already
 
-  if (cond && ((!cond->fixed &&
-                cond->fix_fields(thd, &cond)) || cond->check_cols(1)))
+  if (cond)
   {
     if (table->query_id != thd->query_id)
       cond->cleanup();                          // File was reopened
-    goto err0;
+    if ((!cond->fixed &&
+	 cond->fix_fields(thd, &cond)) || cond->check_cols(1))
+      goto err0;
   }
 
   if (keyname)
Thread
bk commit into 5.1 tree (konstantin:1.2131)Konstantin Osipov2 Feb