Commit ee380a07 authored by unknown's avatar unknown
Browse files

Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort

Fix for bug #14536: SELECT @a,@a:=... fails with prepared statements


mysql-test/r/func_sapdb.result:
  Correct tests after reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
mysql-test/r/type_newdecimal.result:
  Correct tests after reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
mysql-test/r/user_var.result:
  More test with SELECT @a:=
mysql-test/t/disabled.def:
  Enable user_var.test for
mysql-test/t/user_var.test:
  More test with SELECT @a:=
sql/item.cc:
  Simple optimization during review of new code
sql/item_func.cc:
  Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
sql/item_timefunc.h:
  timediff() can return NULL for not NULL arguments
sql/sql_base.cc:
  Remove usage of current_thd() in mysql_make_view()
sql/sql_lex.h:
  Remove usage of current_thd() in mysql_make_view()
sql/sql_select.cc:
  Fix for bug #14536: SELECT @a,@a:=... fails with prepared statements
sql/sql_view.cc:
  Remove usage of current_thd() in mysql_make_view()
  Simple optimization of new code
sql/sql_view.h:
  Remove usage of current_thd() in mysql_make_view()
sql/table.cc:
  Simple optimization of new code
parent f9dbcd55
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -180,8 +180,8 @@ Field Type Null Key Default Extra
f1	date	NO		0000-00-00	
f2	datetime	YES		NULL	
f3	time	YES		NULL	
f4	time	NO		00:00:00	
f5	time	NO		00:00:00	
f4	time	YES		NULL	
f5	time	YES		NULL	
f6	time	NO		00:00:00	
f7	datetime	YES		NULL	
f8	date	YES		NULL	
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ Table Create Table
t1	CREATE TABLE `t1` (
  `round(15.4,-1)` decimal(3,0) unsigned NOT NULL default '0',
  `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL default '0',
  `abs(-1.1)` decimal(2,1) default NULL,
  `abs(-1.1)` decimal(2,1) NOT NULL default '0.0',
  `-(-1.1)` decimal(2,1) NOT NULL default '0.0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+11 −0
Original line number Diff line number Diff line
@@ -123,6 +123,17 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
0	1	1	0
1	3	2	0
3	6	3	0
set @a=0;
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
@a	@a:="hello"	@a	@a:=3	@a	@a:="hello again"
0	hello	0	3	0	hello again
0	hello	0	3	0	hello again
0	hello	0	3	0	hello again
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
@a	@a:="hello"	@a	@a:=3	@a	@a:="hello again"
hello again	hello	hello again	3	hello again	hello again
hello again	hello	hello again	3	hello again	hello again
hello again	hello	hello again	3	hello again	hello again
drop table t1;
set @a=_latin2'test';
select charset(@a),collation(@a),coercibility(@a);
+0 −1
Original line number Diff line number Diff line
@@ -16,4 +16,3 @@ rpl_until : Unstable test case, bug#12429
rpl_deadlock    : Unstable test case, bug#12429
kill            : Unstable test case, bug#9712
archive_gis     : The test fails on 32bit Linux
user_var        : Ramil should fix this soon
+4 −0
Original line number Diff line number Diff line
@@ -70,6 +70,10 @@ create table t1 (i int not null);
insert t1 values (1),(2),(2),(3),(3),(3);
select @a:=0; select @a, @a:=@a+count(*), count(*), @a from t1 group by i;
select @a:=0; select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;

set @a=0;
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
drop table t1;

#
Loading