summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2009-09-30 12:25:50 +0200
committerGuilhem Bichot <guilhem@mysql.com>2009-09-30 12:25:50 +0200
commitb3886f46da6278b511de9f07cbfa884ef09e18bb (patch)
treeed4d4bd9316c084770e810815274ca29e6434ffb /include
parent70cb38ec825243d6930bcadde0669cecd246d1f5 (diff)
downloadmariadb-git-b3886f46da6278b511de9f07cbfa884ef09e18bb.tar.gz
Fix for BUG#42980 "Client doesn't set NUM_FLAG for DECIMAL and TIMESTAMP":
DECIMAL and TIMESTAMP used to have NUM_FLAG, but NEWDECIMAL was forgotten. It's correct that TIMESTAMP does not have the flag nowadays (manual will be updated, connectors developers will be notified).
Diffstat (limited to 'include')
-rw-r--r--include/mysql.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/mysql.h b/include/mysql.h
index d114afb6c93..70faf3cb2c1 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -86,9 +86,11 @@ extern char *mysql_unix_port;
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
-#define IS_NUM(t) ((t) <= MYSQL_TYPE_INT24 || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
-#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
-#define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_INT24 && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR)
+/**
+ Returns true if the value is a number which does not need quotes for
+ the sql_lex.cc parser to parse correctly.
+*/
+#define IS_NUM(t) (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING)