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

After-merge fixes (4.1 -> 5.0).


mysql-test/r/sp.result:
  Test results fixed: rewritten test for Bug#6129
mysql-test/r/view.result:
  Push a change to the result file from Sanja's patch.
mysql-test/t/sp.test:
  Rewrite the test for Bug#6129 (now that stored procedures don't
  evaluate system variables at parse, the test produced different results).
  The old test failed with 1 in the second invocation (the old
  result was wrong).
sql/item_func.cc:
  After-merge fix.
sql/item_func.h:
  After-merge fix.
sql/mysql_priv.h:
  After-merge fix.
sql/mysqld.cc:
  Rollback the patch for Bug#7403 (it breaks the test suite).
parent 40efb362
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -2657,16 +2657,22 @@ end|
call avg ()|
drop procedure avg|
drop procedure if exists bug6129|
set @@sql_mode = 'traditional'|
create procedure bug6129(mode text)
select @@sql_mode = mode|
call bug6129(@@sql_mode)|
@@sql_mode = mode
1
set @@sql_mode = ''|
call bug6129(@@sql_mode)|
@@sql_mode = mode
0
set @old_mode= @@sql_mode;
set @@sql_mode= "";
create procedure bug6129()
select @@sql_mode|
call bug6129()|
@@sql_mode

set @@sql_mode= "NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"|
call bug6129()|
@@sql_mode
NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO
set @@sql_mode= "NO_ZERO_IN_DATE"|
call bug6129()|
@@sql_mode
NO_ZERO_IN_DATE
set @@sql_mode=@old_mode;
drop procedure bug6129|
drop procedure if exists bug9856|
create procedure bug9856()
+1 −1
Original line number Diff line number Diff line
@@ -1836,7 +1836,7 @@ create table t2 (b timestamp default now());
create view v1 as select a,b,t1.a < now() from t1,t2 where t1.a < now();
SHOW CREATE VIEW v1;
View	Create View
v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select sql_no_cache `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b`,(`test`.`t1`.`a` < now()) AS `t1.a < now()` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` < now())
v1	CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select sql_no_cache `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b`,(`test`.`t1`.`a` < now()) AS `t1.a < now()` from (`test`.`t1` join `test`.`t2`) where (`test`.`t1`.`a` < now())
drop view v1;
drop table t1, t2;
CREATE TABLE t1 ( a varchar(50) );
+10 −9
Original line number Diff line number Diff line
@@ -3377,15 +3377,16 @@ drop procedure avg|
--disable_warnings
drop procedure if exists bug6129|
--enable_warnings
set @@sql_mode = 'traditional'|
create procedure bug6129(mode text)
  select @@sql_mode = mode|

# 1
call bug6129(@@sql_mode)|
set @@sql_mode = ''|
# 0
call bug6129(@@sql_mode)|
set @old_mode= @@sql_mode;
set @@sql_mode= "";
create procedure bug6129()
  select @@sql_mode|
call bug6129()|
set @@sql_mode= "NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"|
call bug6129()|
set @@sql_mode= "NO_ZERO_IN_DATE"|
call bug6129()|
set @@sql_mode=@old_mode;

drop procedure bug6129|

+1 −1
Original line number Diff line number Diff line
@@ -4229,7 +4229,7 @@ Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,


bool
Item_func_get_system_var::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
Item_func_get_system_var::fix_fields(THD *thd, Item **ref)
{
  Item *item= var->item(thd, var_type, &component);
  DBUG_ENTER("Item_func_get_system_var::fix_fields");
+4 −2
Original line number Diff line number Diff line
@@ -1210,15 +1210,17 @@ class Item_func_get_system_var :public Item_func
  Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
                           LEX_STRING *component_arg, const char *name_arg,
                           size_t name_len_arg);
  bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref);
  bool fix_fields(THD *thd, Item **ref);
  /*
    Stubs for pure virtual methods. Should never be called: this
    item is always substituted with a constant in fix_fields().
  */
  double val()              { DBUG_ASSERT(0); return 0.0; }
  double val_real()         { DBUG_ASSERT(0); return 0.0; }
  longlong val_int()        { DBUG_ASSERT(0); return 0; }
  String* val_str(String*)  { DBUG_ASSERT(0); return 0; }
  void fix_length_and_dec() { DBUG_ASSERT(0); }
  /* TODO: fix to support views */
  const char *func_name() const { return "get_system_var"; }
};


Loading