summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2003-12-02 19:39:51 +0300
committerunknown <konstantin@mysql.com>2003-12-02 19:39:51 +0300
commita2bdd6218c7ed36bf245eb378fa3b128ebf266ce (patch)
treecbf6200a23df5fb40c74eb1e8e0cdde88a34063f /include
parent363c4e8a81af1ff8a08072dd18a62fb431e70f1b (diff)
downloadmariadb-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 'include')
-rw-r--r--include/my_global.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 349ac8ac82e..68c331aa414 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -603,11 +603,25 @@ extern double my_atof(const char*);
#define HAVE_LONG_LONG 1
#endif
+/*
+ Some pre-ANSI-C99 systems like AIX 5.1 and Linux/GCC 2.95 define
+ ULONGLONG_MAX, LONGLONG_MIN, LONGLONG_MAX; we use them if they're defined.
+*/
+
#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN)
#define LONGLONG_MIN ((long long) 0x8000000000000000LL)
#define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL)
#endif
+#if defined(HAVE_LONG_LONG) && !defined(ULONLONG_MAX)
+/* First check for ANSI C99 definition: */
+#ifdef ULLONG_MAX
+#define ULONGLONG_MAX ULLONG_MAX
+#else
+#define ULONGLONG_MAX ((unsigned long long)(~0ULL))
+#endif
+#endif /* defined (HAVE_LONG_LONG) && !defined(ULONLONG_MAX)*/
+
#if SIZEOF_LONG == 4
#define INT_MIN32 (long) 0x80000000L
#define INT_MAX32 (long) 0x7FFFFFFFL