mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/usr/home/ram/work/mysql-4.0
This commit is contained in:
@@ -25,3 +25,14 @@ select -1 >> 0, -1 << 0;
|
|||||||
select -1 >> 1, -1 << 1;
|
select -1 >> 1, -1 << 1;
|
||||||
-1 >> 1 -1 << 1
|
-1 >> 1 -1 << 1
|
||||||
9223372036854775807 18446744073709551614
|
9223372036854775807 18446744073709551614
|
||||||
|
drop table if exists t1,t2;
|
||||||
|
create table t1(a int);
|
||||||
|
create table t2(a int, b int);
|
||||||
|
insert into t1 values (1), (2), (3);
|
||||||
|
insert into t2 values (1, 7), (3, 7);
|
||||||
|
select t1.a, t2.a, t2.b, bit_count(t2.b) from t1 left join t2 on t1.a=t2.a;
|
||||||
|
a a b bit_count(t2.b)
|
||||||
|
1 1 7 3
|
||||||
|
2 NULL NULL NULL
|
||||||
|
3 3 7 3
|
||||||
|
drop table t1, t2;
|
||||||
|
@@ -14,3 +14,15 @@ select 1 | -1, 1 ^ -1, 1 & -1;
|
|||||||
select 0 | -1, 0 ^ -1, 0 & -1;
|
select 0 | -1, 0 ^ -1, 0 & -1;
|
||||||
select -1 >> 0, -1 << 0;
|
select -1 >> 0, -1 << 0;
|
||||||
select -1 >> 1, -1 << 1;
|
select -1 >> 1, -1 << 1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug 13044: wrong bit_count() results
|
||||||
|
#
|
||||||
|
|
||||||
|
drop table if exists t1,t2;
|
||||||
|
create table t1(a int);
|
||||||
|
create table t2(a int, b int);
|
||||||
|
insert into t1 values (1), (2), (3);
|
||||||
|
insert into t2 values (1, 7), (3, 7);
|
||||||
|
select t1.a, t2.a, t2.b, bit_count(t2.b) from t1 left join t2 on t1.a=t2.a;
|
||||||
|
drop table t1, t2;
|
||||||
|
@@ -1138,11 +1138,8 @@ longlong Item_func_find_in_set::val_int()
|
|||||||
longlong Item_func_bit_count::val_int()
|
longlong Item_func_bit_count::val_int()
|
||||||
{
|
{
|
||||||
ulonglong value= (ulonglong) args[0]->val_int();
|
ulonglong value= (ulonglong) args[0]->val_int();
|
||||||
if (args[0]->null_value)
|
if ((null_value= args[0]->null_value))
|
||||||
{
|
|
||||||
null_value=1; /* purecov: inspected */
|
|
||||||
return 0; /* purecov: inspected */
|
return 0; /* purecov: inspected */
|
||||||
}
|
|
||||||
return (longlong) my_count_bits(value);
|
return (longlong) my_count_bits(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user