Commit 34a0de58 authored by unknown's avatar unknown
Browse files

Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime

into  weblab.(none):/home/marcsql/TREE/mysql-5.1-26503-merge


mysql-test/t/sp-error.test:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
parents fa57a563 cfcd27b3
Loading
Loading
Loading
Loading
+68 −0
Original line number Diff line number Diff line
@@ -2067,6 +2067,74 @@ drop function bug20701;
--echo End of 5.1 tests


#
# Bug#26503 (Illegal SQL exception handler code causes the server to crash)
#

delimiter //;

--error ER_SP_LILABEL_MISMATCH
create procedure proc_26503_error_1()
begin
retry:
  repeat
    begin
      declare continue handler for sqlexception
      begin
        iterate retry;
      end

      select "do something";
    end
  until true end repeat retry;
end//

--error ER_SP_LILABEL_MISMATCH
create procedure proc_26503_error_2()
begin
retry:
  repeat
    begin
      declare continue handler for sqlexception
        iterate retry;

      select "do something";
    end
  until true end repeat retry;
end//

--error ER_SP_LILABEL_MISMATCH
create procedure proc_26503_error_3()
begin
retry:
  repeat
    begin
      declare continue handler for sqlexception
      begin
        leave retry;
      end

      select "do something";
    end
  until true end repeat retry;
end//

--error ER_SP_LILABEL_MISMATCH
create procedure proc_26503_error_4()
begin
retry:
  repeat
    begin
      declare continue handler for sqlexception
        leave retry;

      select "do something";
    end
  until true end repeat retry;
end//

delimiter ;//

#
# BUG#NNNN: New bug synopsis
#
+3 −3
Original line number Diff line number Diff line
@@ -1143,9 +1143,9 @@ bool mysql_xa_recover(THD *thd)
  XID_STATE *xs;
  DBUG_ENTER("mysql_xa_recover");

  field_list.push_back(new Item_int("formatID",0,11));
  field_list.push_back(new Item_int("gtrid_length",0,11));
  field_list.push_back(new Item_int("bqual_length",0,11));
  field_list.push_back(new Item_int("formatID", 0, MY_INT32_NUM_DECIMAL_DIGITS));
  field_list.push_back(new Item_int("gtrid_length", 0, MY_INT32_NUM_DECIMAL_DIGITS));
  field_list.push_back(new Item_int("bqual_length", 0, MY_INT32_NUM_DECIMAL_DIGITS));
  field_list.push_back(new Item_empty_string("data",XIDDATASIZE));

  if (protocol->send_fields(&field_list,
+3 −3
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ void
Hybrid_type_traits_integer::fix_length_and_dec(Item *item, Item *arg) const
{
  item->decimals= 0;
  item->max_length= 21;
  item->max_length= MY_INT64_NUM_DECIMAL_DIGITS;
  item->unsigned_flag= 0;
}

@@ -2524,7 +2524,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
      item_result_type= REAL_RESULT;
      break;
    case INT_RESULT:
      set_int(*(longlong*)entry->value, 21);
      set_int(*(longlong*)entry->value, MY_INT64_NUM_DECIMAL_DIGITS);
      item_type= Item::INT_ITEM;
      item_result_type= INT_RESULT;
      break;
@@ -6622,7 +6622,7 @@ uint32 Item_type_holder::display_length(Item *item)
  case MYSQL_TYPE_SHORT:
    return 6;
  case MYSQL_TYPE_LONG:
    return 11;
    return MY_INT32_NUM_DECIMAL_DIGITS;
  case MYSQL_TYPE_FLOAT:
    return 25;
  case MYSQL_TYPE_DOUBLE:
+6 −3
Original line number Diff line number Diff line
@@ -1591,11 +1591,14 @@ class Item_int :public Item_num
{
public:
  longlong value;
  Item_int(int32 i,uint length=11) :value((longlong) i)
  Item_int(int32 i,uint length= MY_INT32_NUM_DECIMAL_DIGITS)
    :value((longlong) i)
    { max_length=length; fixed= 1; }
  Item_int(longlong i,uint length=21) :value(i)
  Item_int(longlong i,uint length= MY_INT64_NUM_DECIMAL_DIGITS)
    :value(i)
    { max_length=length; fixed= 1; }
  Item_int(ulonglong i, uint length= 21) :value((longlong)i)
  Item_int(ulonglong i, uint length= MY_INT64_NUM_DECIMAL_DIGITS)
    :value((longlong)i)
    { max_length=length; fixed= 1; unsigned_flag= 1; }
  Item_int(const char *str_arg,longlong i,uint length) :value(i)
    { max_length=length; name=(char*) str_arg; fixed= 1; }
+3 −2
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@ Field *Item_func::tmp_table_field(TABLE *table)

  switch (result_type()) {
  case INT_RESULT:
    if (max_length > 11)
    if (max_length > MY_INT32_NUM_DECIMAL_DIGITS)
      field= new Field_longlong(max_length, maybe_null, name, unsigned_flag);
    else
      field= new Field_long(max_length, maybe_null, name, unsigned_flag);
@@ -2333,7 +2333,8 @@ longlong Item_func_coercibility::val_int()

void Item_func_locate::fix_length_and_dec()
{
  maybe_null=0; max_length=11;
  maybe_null= 0;
  max_length= MY_INT32_NUM_DECIMAL_DIGITS;
  agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV, 1);
}

Loading