diff options
author | unknown <konstantin@mysql.com> | 2003-12-02 19:39:51 +0300 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2003-12-02 19:39:51 +0300 |
commit | a2bdd6218c7ed36bf245eb378fa3b128ebf266ce (patch) | |
tree | cbf6200a23df5fb40c74eb1e8e0cdde88a34063f /sql/item_sum.h | |
parent | 363c4e8a81af1ff8a08072dd18a62fb431e70f1b (diff) | |
download | mariadb-git-a2bdd6218c7ed36bf245eb378fa3b128ebf266ce.tar.gz |
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.
include/my_global.h:
Added definition for ULONGLONG_MAX.
This is also a check that ULL type specifier
can be used on all supported platforms.
mysql-test/r/func_group.result:
bug #1790, post-review work: test results fixed
sql/item_sum.cc:
small cleanup
sql/item_sum.h:
few style fixes.
BIT_AND and BIT_OR now are both BIGINT UNSIGNED
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r-- | sql/item_sum.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h index c91abbded28..d3a328be032 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -361,10 +361,10 @@ public: class Item_sum_bit :public Item_sum_int { - protected: +protected: ulonglong reset_bits,bits; - public: +public: Item_sum_bit(Item *item_par,ulonglong reset_arg) :Item_sum_int(item_par),reset_bits(reset_arg),bits(reset_arg) {} enum Sumfunctype sum_func () const {return SUM_BIT_FUNC;} @@ -373,6 +373,8 @@ class Item_sum_bit :public Item_sum_int void reset_field(); void update_field(); unsigned int size_of() { return sizeof(*this);} + void fix_length_and_dec() + { decimals=0; max_length=21; unsigned_flag=1; maybe_null=null_value=0; } }; @@ -383,20 +385,16 @@ public: bool add(); const char *func_name() const { return "bit_or"; } unsigned int size_of() { return sizeof(*this);} - void fix_length_and_dec() - { decimals=0; max_length=21; unsigned_flag=1; maybe_null=null_value=0; } }; class Item_sum_and :public Item_sum_bit { - public: - Item_sum_and(Item *item_par) :Item_sum_bit(item_par, ~(ulonglong) LL(0)) {} +public: + Item_sum_and(Item *item_par) :Item_sum_bit(item_par, ULONGLONG_MAX) {} bool add(); const char *func_name() const { return "bit_and"; } unsigned int size_of() { return sizeof(*this);} - void fix_length_and_dec() - { decimals=0; max_length=21; unsigned_flag=0; maybe_null=null_value=0; } }; /* |