summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-06-10 16:04:26 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-06-10 16:04:26 -0400
commitb441c510a7ea731e2da0fa9b4cf3e7f1275f841b (patch)
tree7147fc480bff17dc310cb3c03494777ad1878071 /include
parentd3b2e780d6ddee9a4f434ba9928f77127bbbeeb1 (diff)
parent6d75570e99fbf070cdbeefdfbcfc94d1c7b3ad1f (diff)
downloadmariadb-git-b441c510a7ea731e2da0fa9b4cf3e7f1275f841b.tar.gz
bzr merge -rtag:mariadb-5.5.38 maria/5.5
Diffstat (limited to 'include')
-rw-r--r--include/errmsg.h6
-rw-r--r--include/my_global.h1
-rw-r--r--include/my_time.h9
3 files changed, 13 insertions, 3 deletions
diff --git a/include/errmsg.h b/include/errmsg.h
index 64ec2df395c..5655883466c 100644
--- a/include/errmsg.h
+++ b/include/errmsg.h
@@ -1,7 +1,7 @@
#ifndef ERRMSG_INCLUDED
#define ERRMSG_INCLUDED
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,7 +32,9 @@ extern const char *client_errors[]; /* Error messages */
#define CR_MIN_ERROR 2000 /* For easier client code */
#define CR_MAX_ERROR 2999
#if !defined(ER)
-#define ER(X) client_errors[(X)-CR_MIN_ERROR]
+#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \
+ client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR])
+
#endif
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
diff --git a/include/my_global.h b/include/my_global.h
index 7607e02ce3f..09adc9989ef 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -483,6 +483,7 @@ typedef unsigned short ushort;
#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; }
#define test(a) ((a) ? 1 : 0)
+#define MY_TEST(a) ((a) ? 1 : 0)
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
diff --git a/include/my_time.h b/include/my_time.h
index f9893fa2d01..bcf1a8cb215 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -79,6 +79,13 @@ typedef long my_time_t;
#define MYSQL_TIME_WARN_TRUNCATED 1
#define MYSQL_TIME_WARN_OUT_OF_RANGE 2
+#define MYSQL_TIME_NOTE_TRUNCATED 16
+
+#define MYSQL_TIME_WARN_WARNINGS (MYSQL_TIME_WARN_TRUNCATED|MYSQL_TIME_WARN_OUT_OF_RANGE)
+#define MYSQL_TIME_WARN_NOTES (MYSQL_TIME_NOTE_TRUNCATED)
+
+#define MYSQL_TIME_WARN_HAVE_WARNINGS(x) MY_TEST((x) & MYSQL_TIME_WARN_WARNINGS)
+#define MYSQL_TIME_WARN_HAVE_NOTES(x) MY_TEST((x) & MYSQL_TIME_WARN_NOTES)
/* Limits for the TIME data type */
#define TIME_MAX_HOUR 838
@@ -112,7 +119,7 @@ longlong double_to_datetime(double nr, MYSQL_TIME *ltime, uint flags, int *cut)
ltime, flags, cut);
}
-int number_to_time(my_bool neg, longlong nr, ulong sec_part,
+int number_to_time(my_bool neg, ulonglong nr, ulong sec_part,
MYSQL_TIME *ltime, int *was_cut);
ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *);
ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *);