Commit daf8cc67 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/jimw/my/mysql-4.1-clean

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


mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/lowercase_table2.result:
  Auto merged
mysql-test/r/rpl_failed_optimize.result:
  Auto merged
vio/viossl.c:
  Auto merged
mysql-test/t/func_str.test:
  Merge from 4.1
sql/item_func.cc:
  Merge from 4.1
sql/sql_table.cc:
  Merge from 4.1
parents 2b3a1494 b4953598
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -794,3 +794,9 @@ id aes_decrypt(str, 'bar')
1	foo
2	NULL
DROP TABLE t1, t2;
select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0);
field(0,NULL,1,0)	field("",NULL,"bar","")	field(0.0,NULL,1.0,0.0)
3	3	3
select field(NULL,1,2,NULL), field(NULL,1,2,0);
field(NULL,1,2,NULL)	field(NULL,1,2,0)
0	0
+6 −6
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ T1 CREATE TABLE `T1` (
RENAME TABLE T1 TO T2;
SHOW TABLES LIKE "T2";
Tables_in_test (T2)
t2
T2
SELECT * FROM t2;
a
1
@@ -83,25 +83,25 @@ t3
RENAME TABLE T3 TO T1;
SHOW TABLES LIKE "T1";
Tables_in_test (T1)
t1
T1
ALTER TABLE T1 add b int;
SHOW TABLES LIKE "T1";
Tables_in_test (T1)
t1
T1
ALTER TABLE T1 RENAME T2;
SHOW TABLES LIKE "T2";
Tables_in_test (T2)
t2
T2
LOCK TABLE T2 WRITE;
ALTER TABLE T2 drop b;
SHOW TABLES LIKE "T2";
Tables_in_test (T2)
t2
T2
UNLOCK TABLES;
RENAME TABLE T2 TO T1;
SHOW TABLES LIKE "T1";
Tables_in_test (T1)
t1
T1
SELECT * from T1;
a
1
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ BEGIN;
INSERT INTO t1 VALUES (1);
OPTIMIZE TABLE t1;
Table	Op	Msg_type	Msg_text
test.t1	optimize	error	Lock wait timeout exceeded; try restarting transaction
test.t1	optimize	status	Operation failed
Warnings:
Error	1205	Lock wait timeout exceeded; try restarting transaction
+6 −0
Original line number Diff line number Diff line
@@ -523,3 +523,9 @@ SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id
 ORDER BY t1.id;

DROP TABLE t1, t2;

#
# Bug #10944: Mishandling of NULL arguments in FIELD()
#
select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0);
select field(NULL,1,2,NULL), field(NULL,1,2,0);
+8 −12
Original line number Diff line number Diff line
@@ -2322,11 +2322,13 @@ void Item_func_locate::print(String *str)
longlong Item_func_field::val_int()
{
  DBUG_ASSERT(fixed == 1);

  if (args[0]->is_null())
    return 0;

  if (cmp_type == STRING_RESULT)
  {
    String *field;
    if (!(field=args[0]->val_str(&value)))
      return 0;					// -1 if null ?
    for (uint i=1 ; i < arg_count ; i++)
    {
      String *tmp_value=args[i]->val_str(&tmp);
@@ -2337,11 +2339,9 @@ longlong Item_func_field::val_int()
  else if (cmp_type == INT_RESULT)
  {
    longlong val= args[0]->val_int();
    if (args[0]->is_null())
      return 0;
    for (uint i=1; i < arg_count ; i++)
    {
      if (val == args[i]->val_int() && ! args[i]->is_null())
      if (!args[i]->is_null() && val == args[i]->val_int())
        return (longlong) (i);
    }
  }
@@ -2349,8 +2349,6 @@ longlong Item_func_field::val_int()
  {
    my_decimal dec_arg_buf, *dec_arg,
               dec_buf, *dec= args[0]->val_decimal(&dec_buf);
    if (args[0]->is_null())
      return 0;
    for (uint i=1; i < arg_count; i++)
    {
      dec_arg= args[i]->val_decimal(&dec_arg_buf);
@@ -2361,11 +2359,9 @@ longlong Item_func_field::val_int()
  else
  {
    double val= args[0]->val_real();
    if (args[0]->is_null())
      return 0;
    for (uint i=1; i < arg_count ; i++)
    {
      if (val == args[i]->val_real() && ! args[i]->is_null())
      if (!args[i]->is_null() && val == args[i]->val_real())
        return (longlong) (i);
    }
  }
Loading