Commit 7cfb6540 authored by unknown's avatar unknown
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/home/my/mysql-5.0


sql/ha_ndbcluster.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Manual merge (trivial)
parents 36283ca2 d6c3d655
Loading
Loading
Loading
Loading
+63 −60
Original line number Diff line number Diff line
@@ -2468,25 +2468,26 @@ drop table t3|
#
# BUG#4318
#
#QQ Don't know if HANDLER commands can work with SPs, or at all...
# 
#create table t3 (s1 int)|
#insert into t3 values (3), (4)|
#
#--disable_warnings
#drop procedure if exists bug4318|
#--enable_warnings
#create procedure bug4318()
#  handler t3 read next|
#
#handler t3 open|
## Expect no results, as tables are closed, but there shouldn't be any errors
#call bug4318()|
#call bug4318()|
#handler t3 close|
#
#drop procedure bug4318|
#drop table t3|

--disable_parsing Don't know if HANDLER commands can work with SPs, or at all..
create table t3 (s1 int)|
insert into t3 values (3), (4)|

--disable_warnings
drop procedure if exists bug4318|
--enable_warnings
create procedure bug4318()
  handler t3 read next|

handler t3 open|
# Expect no results, as tables are closed, but there shouldn't be any errors
call bug4318()|
call bug4318()|
handler t3 close|

drop procedure bug4318|
drop table t3|
--enable_parsing

#
# BUG#4902: Stored procedure with SHOW WARNINGS leads to packet error
@@ -2834,26 +2835,27 @@ drop table t3|
#
# BUG#6022: Stored procedure shutdown problem with self-calling function.
#
# This part of test is disabled until we implement support for
# recursive stored functions.
#--disable_warnings
#drop function if exists bug6022|
#--enable_warnings
#
#--disable_warnings
#drop function if exists bug6022|
#--enable_warnings
#create function bug6022(x int) returns int
#begin
#  if x < 0 then
#    return 0;
#  else
#    return bug6022(x-1);
#  end if;
#end|
#
#select bug6022(5)|
#drop function bug6022|

--disable_parsing until we implement support for recursive stored functions.
--disable_warnings
drop function if exists bug6022|
--enable_warnings

--disable_warnings
drop function if exists bug6022|
--enable_warnings
create function bug6022(x int) returns int
begin
  if x < 0 then
    return 0;
  else
    return bug6022(x-1);
  end if;
end|

select bug6022(5)|
drop function bug6022|
--enable_parsing

#
# BUG#6029: Stored procedure specific handlers should have priority
@@ -3760,27 +3762,28 @@ drop procedure if exists bug7088_1|
drop procedure if exists bug7088_2|
--enable_warnings

# psergey: temporarily disabled until Bar fixes BUG#11986
# create procedure bug6063()
#   lbel: begin end|
# call bug6063()|
# # QQ Known bug: this will not show the label correctly.
# show create procedure bug6063|
# 
# set character set utf8|
# create procedure bug7088_1()
#   label1: begin end label1|
# create procedure bug7088_2()
#   läbel1: begin end|
# call bug7088_1()|
# call bug7088_2()|
# set character set default|
# show create procedure bug7088_1|
# show create procedure bug7088_2|
# 
# drop procedure bug6063|
# drop procedure bug7088_1|
# drop procedure bug7088_2|
--disable_parsing temporarily disabled until Bar fixes BUG#11986
create procedure bug6063()
  lbel: begin end|
call bug6063()|
# QQ Known bug: this will not show the label correctly.
show create procedure bug6063|

set character set utf8|
create procedure bug7088_1()
  label1: begin end label1|
create procedure bug7088_2()
  läbel1: begin end|
call bug7088_1()|
call bug7088_2()|
set character set default|
show create procedure bug7088_1|
show create procedure bug7088_2|

drop procedure bug6063|
drop procedure bug7088_1|
drop procedure bug7088_2|
--enable_parsing

#
# BUG#9565: "Wrong locking in stored procedure if a sub-sequent procedure
+5 −13
Original line number Diff line number Diff line
@@ -958,8 +958,6 @@ int ha_berkeley::write_row(byte * record)
  {
    DB_TXN *sub_trans = transaction;
    /* Don't use sub transactions in temporary tables */
    ulong thd_options= (table->s->tmp_table == NO_TMP_TABLE ?
                        table->in_use->options : 0);
    for (uint retry=0 ; retry < berkeley_trans_retry ; retry++)
    {
      key_map changed_keys(0);
@@ -1070,7 +1068,7 @@ int ha_berkeley::key_cmp(uint keynr, const byte * old_row,
int ha_berkeley::update_primary_key(DB_TXN *trans, bool primary_key_changed,
				    const byte * old_row, DBT *old_key,
				    const byte * new_row, DBT *new_key,
				    ulong thd_options, bool local_using_ignore)
                                    bool local_using_ignore)
{
  DBT row;
  int error;
@@ -1119,8 +1117,7 @@ int ha_berkeley::update_primary_key(DB_TXN *trans, bool primary_key_changed,
int ha_berkeley::restore_keys(DB_TXN *trans, key_map *changed_keys,
			      uint primary_key,
			      const byte *old_row, DBT *old_key,
			      const byte *new_row, DBT *new_key,
			      ulong thd_options)
			      const byte *new_row, DBT *new_key)
{
  int error;
  DBT tmp_key;
@@ -1130,7 +1127,7 @@ int ha_berkeley::restore_keys(DB_TXN *trans, key_map *changed_keys,
  /* Restore the old primary key, and the old row, but don't ignore
     duplicate key failure */
  if ((error=update_primary_key(trans, TRUE, new_row, new_key,
				old_row, old_key, thd_options, FALSE)))
				old_row, old_key, FALSE)))
    goto err; /* purecov: inspected */

  /* Remove the new key, and put back the old key
@@ -1167,8 +1164,6 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
  DBT prim_key, key, old_prim_key;
  int error;
  DB_TXN *sub_trans;
  ulong thd_options= (table->s->tmp_table == NO_TMP_TABLE ?
                      table->in_use->options : 0);
  bool primary_key_changed;
  DBUG_ENTER("update_row");
  LINT_INIT(error);
@@ -1204,7 +1199,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
    if (!(error=update_primary_key(sub_trans, primary_key_changed,
				   old_row, &old_prim_key,
				   new_row, &prim_key,
				   thd_options, using_ignore)))
				   using_ignore)))
    {
      // Update all other keys
      for (uint keynr=0 ; keynr < table->s->keys ; keynr++)
@@ -1239,8 +1234,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
	int new_error = 0;
        if (!changed_keys.is_clear_all())
	  new_error=restore_keys(transaction, &changed_keys, primary_key,
				 old_row, &old_prim_key, new_row, &prim_key,
				 thd_options);
				 old_row, &old_prim_key, new_row, &prim_key);
	if (new_error)
	{
          /* This shouldn't happen */
@@ -1342,8 +1336,6 @@ int ha_berkeley::delete_row(const byte * record)
  int error;
  DBT row, prim_key;
  key_map keys= table->s->keys_in_use;
  ulong thd_options= (table->s->tmp_table == NO_TMP_TABLE ?
                      table->in_use->options : 0);
  DBUG_ENTER("delete_row");
  statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);

+2 −3
Original line number Diff line number Diff line
@@ -74,13 +74,12 @@ class ha_berkeley: public handler
		  DBT *prim_key, key_map *keys);
  int restore_keys(DB_TXN *trans, key_map *changed_keys, uint primary_key,
		   const byte *old_row, DBT *old_key,
		   const byte *new_row, DBT *new_key,
		   ulong thd_options);
		   const byte *new_row, DBT *new_key);
  int key_cmp(uint keynr, const byte * old_row, const byte * new_row);
  int update_primary_key(DB_TXN *trans, bool primary_key_changed,
			 const byte * old_row, DBT *old_key,
			 const byte * new_row, DBT *prim_key,
			 ulong thd_options, bool local_using_ignore);
			 bool local_using_ignore);
  int read_row(int error, char *buf, uint keynr, DBT *row, DBT *key, bool);
  DBT *get_pos(DBT *to, byte *pos);

+2 −0
Original line number Diff line number Diff line
@@ -6997,6 +6997,8 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond,
      break;
    Ndb_item *a= cond->next->ndb_item;
    Ndb_item *b, *field, *value= NULL;
    LINT_INIT(field);

    switch (cond->ndb_item->argument_count()) {
    case 1:
      field= 
+1 −2
Original line number Diff line number Diff line
@@ -39,12 +39,11 @@ void unireg_init(ulong options)
#endif

  VOID(strmov(reg_ext,".frm"));
  specialflag=SPECIAL_SAME_DB_NAME;
  specialflag=SPECIAL_SAME_DB_NAME | options;  /* Set options from argv */
  /* Make a tab of powers of 10 */
  for (i=0,nr=1.0; i < array_elements(log_10) ; i++)
  {					/* It's used by filesort... */
    log_10[i]= nr ; nr*= 10.0;
  }
  specialflag|=options;			/* Set options from argv */
  DBUG_VOID_RETURN;
}
Loading