mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Post-review fixes for bug #1790 'BIT_AND() result in GROUP BY different when
SQL_BIG_RESULT used': - BIT_AND now returns BIGINT UNSIGNED - in case there were no matching rows BIT_AND returns 18446744073709551615 (but not NULL), BIT_OR returns 0 (but not NULL). That's how Monty wants it and how is described in our docs.
This commit is contained in:
@ -47,7 +47,7 @@ sum(all a) count(all a) avg(all a) std(all a) bit_or(all a) bit_and(all a) min(a
|
||||
21 6 3.5000 1.7078 7 0 1 6 E
|
||||
select grp, sum(a),count(a),avg(a),std(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp;
|
||||
grp sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c)
|
||||
NULL NULL 0 NULL NULL 0 -1 NULL NULL
|
||||
NULL NULL 0 NULL NULL 0 18446744073709551615 NULL NULL
|
||||
1 1 1 1.0000 0.0000 1 1 1 1 a a
|
||||
2 5 2 2.5000 0.5000 3 2 2 3 b c
|
||||
3 15 3 5.0000 0.8165 7 4 4 6 C E
|
||||
@ -218,8 +218,8 @@ insert into t1 values (1,null);
|
||||
insert into t1 values (2,null);
|
||||
select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
|
||||
a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b)
|
||||
1 0 NULL NULL NULL NULL NULL -1 0
|
||||
2 0 NULL NULL NULL NULL NULL -1 0
|
||||
1 0 NULL NULL NULL NULL NULL 18446744073709551615 0
|
||||
2 0 NULL NULL NULL NULL NULL 18446744073709551615 0
|
||||
select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
|
||||
a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b)
|
||||
1 0 NULL NULL NULL NULL NULL -1 0
|
||||
@ -227,7 +227,7 @@ a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b)
|
||||
insert into t1 values (2,1);
|
||||
select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
|
||||
a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b)
|
||||
1 0 NULL NULL NULL NULL NULL -1 0
|
||||
1 0 NULL NULL NULL NULL NULL 18446744073709551615 0
|
||||
2 1 1 1.0000 0.0000 1 1 1 1
|
||||
select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
|
||||
a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b)
|
||||
@ -236,7 +236,7 @@ a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b)
|
||||
insert into t1 values (3,1);
|
||||
select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
|
||||
a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b)
|
||||
1 0 NULL NULL NULL NULL NULL -1 0
|
||||
1 0 NULL NULL NULL NULL NULL 18446744073709551615 0
|
||||
2 1 1 1.0000 0.0000 1 1 1 1
|
||||
3 1 1 1.0000 0.0000 1 1 1 1
|
||||
select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
|
||||
|
Reference in New Issue
Block a user