mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Optimized code for setting user variables with := and fixed some bugs in old code (Bug #1194)
Use forced close of socket to make mysqld shutdown faster when used under valgrind
This commit is contained in:
@ -337,8 +337,8 @@ while test $# -gt 0; do
|
||||
;;
|
||||
--valgrind)
|
||||
VALGRIND="valgrind --alignment=8 --leak-check=yes --num-callers=16"
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc"
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||
SLEEP_TIME_AFTER_RESTART=10
|
||||
SLEEP_TIME_FOR_DELETE=120
|
||||
USE_RUNNING_SERVER=""
|
||||
|
@ -30,6 +30,7 @@ explain select * from t1 where i=@vv1;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ref i i 4 const 1 Using where
|
||||
drop table t1,t2;
|
||||
set @a=0,@b=0;
|
||||
select @a:=10, @b:=1, @a > @b, @a < @b;
|
||||
@a:=10 @b:=1 @a > @b @a < @b
|
||||
10 1 1 0
|
||||
@ -38,18 +39,18 @@ select @a:="10", @b:="1", @a > @b, @a < @b;
|
||||
10 1 1 0
|
||||
select @a:=10, @b:=2, @a > @b, @a < @b;
|
||||
@a:=10 @b:=2 @a > @b @a < @b
|
||||
10 2 1 0
|
||||
10 2 0 1
|
||||
select @a:="10", @b:="2", @a > @b, @a < @b;
|
||||
@a:="10" @b:="2" @a > @b @a < @b
|
||||
10 2 0 1
|
||||
10 2 1 0
|
||||
select @a:=1;
|
||||
@a:=1
|
||||
1
|
||||
select @a, @a:=1;
|
||||
@a @a:=1
|
||||
1 1
|
||||
create table t1 (id int);
|
||||
insert into t1 values (1);
|
||||
create table t1 (id int, d double, c char(10));
|
||||
insert into t1 values (1,2.0, "test");
|
||||
select @c:=0;
|
||||
@c:=0
|
||||
0
|
||||
@ -70,7 +71,29 @@ select @c:=0;
|
||||
select @c:=@c+1;
|
||||
@c:=@c+1
|
||||
1
|
||||
select @d,(@d:=id),@d from t1;
|
||||
@d (@d:=id) @d
|
||||
NULL 1 1
|
||||
select @e,(@e:=d),@e from t1;
|
||||
@e (@e:=d) @e
|
||||
NULL 2 2
|
||||
select @f,(@f:=c),@f from t1;
|
||||
@f (@f:=c) @f
|
||||
NULL test test
|
||||
set @g=1;
|
||||
select @g,(@g:=c),@g from t1;
|
||||
@g (@g:=c) @g
|
||||
1 test test
|
||||
select @c, @d, @e, @f;
|
||||
@c @d @e @f
|
||||
1 1 2 test
|
||||
select @d:=id, @e:=id, @f:=id, @g:=@id from t1;
|
||||
@d:=id @e:=id @f:=id @g:=@id
|
||||
1 1 1 NULL
|
||||
select @c, @d, @e, @f, @g;
|
||||
@c @d @e @f @g
|
||||
1 1 1 1 NULL
|
||||
drop table t1;
|
||||
select @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b, @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b;
|
||||
@a:=10 @b:=2 @a>@b @a:="10" @b:="2" @a>@b @a:=10 @b:=2 @a>@b @a:="10" @b:="2" @a>@b
|
||||
10 2 1 10 2 0 10 2 1 10 2 0
|
||||
10 2 1 10 2 1 10 2 1 10 2 1
|
||||
|
@ -19,8 +19,11 @@ explain select * from t1 where i=@vv1;
|
||||
drop table t1,t2;
|
||||
|
||||
# Check types of variables
|
||||
set @a=0,@b=0;
|
||||
select @a:=10, @b:=1, @a > @b, @a < @b;
|
||||
# Note that here a and b will be avaluated as number
|
||||
select @a:="10", @b:="1", @a > @b, @a < @b;
|
||||
# Note that here a and b will be avaluated as strings
|
||||
select @a:=10, @b:=2, @a > @b, @a < @b;
|
||||
select @a:="10", @b:="2", @a > @b, @a < @b;
|
||||
|
||||
@ -28,8 +31,8 @@ select @a:="10", @b:="2", @a > @b, @a < @b;
|
||||
select @a:=1;
|
||||
select @a, @a:=1;
|
||||
|
||||
create table t1 (id int);
|
||||
insert into t1 values (1);
|
||||
create table t1 (id int, d double, c char(10));
|
||||
insert into t1 values (1,2.0, "test");
|
||||
select @c:=0;
|
||||
update t1 SET id=(@c:=@c+1);
|
||||
select @c;
|
||||
@ -38,7 +41,15 @@ update t1 set id=(@c:=@c+1);
|
||||
select @c;
|
||||
select @c:=0;
|
||||
select @c:=@c+1;
|
||||
select @d,(@d:=id),@d from t1;
|
||||
select @e,(@e:=d),@e from t1;
|
||||
select @f,(@f:=c),@f from t1;
|
||||
set @g=1;
|
||||
select @g,(@g:=c),@g from t1;
|
||||
select @c, @d, @e, @f;
|
||||
select @d:=id, @e:=id, @f:=id, @g:=@id from t1;
|
||||
select @c, @d, @e, @f, @g;
|
||||
drop table t1;
|
||||
|
||||
# just fof fun :)
|
||||
select @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b, @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b;
|
||||
# just for fun :)
|
||||
select @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b, @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b;
|
||||
|
Reference in New Issue
Block a user