summaryrefslogtreecommitdiff
path: root/sql/my_decimal.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-09-17 11:05:07 +0400
committerAlexander Barkov <bar@mariadb.org>2015-09-17 11:05:07 +0400
commitd9b25ae3db8584bde809c0ab3230cbe151fa489b (patch)
treecb0ae8c91d4f1bcd614c3c1b2d7847f3ef7a130f /sql/my_decimal.h
parentc69cf93bfb3a221d9106f3695aa16e11f7e8b7fb (diff)
downloadmariadb-git-d9b25ae3db8584bde809c0ab3230cbe151fa489b.tar.gz
MDEV-8466 CAST works differently for DECIMAL/INT vs DOUBLE for empty strings
MDEV-8468 CAST and INSERT work differently for DECIMAL/INT vs DOUBLE for a string with trailing spaces
Diffstat (limited to 'sql/my_decimal.h')
-rw-r--r--sql/my_decimal.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index a2cce862f1a..78c71d54b6d 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -366,13 +366,23 @@ int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end)
int str2my_decimal(uint mask, const char *from, uint length,
- CHARSET_INFO *charset, my_decimal *decimal_value);
+ CHARSET_INFO *charset, my_decimal *decimal_value,
+ const char **end);
+
+inline int str2my_decimal(uint mask, const char *from, uint length,
+ CHARSET_INFO *charset, my_decimal *decimal_value)
+{
+ const char *end;
+ return str2my_decimal(mask, from, length, charset, decimal_value, &end);
+}
#if defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
inline
int string2my_decimal(uint mask, const String *str, my_decimal *d)
{
- return str2my_decimal(mask, str->ptr(), str->length(), str->charset(), d);
+ const char *end;
+ return str2my_decimal(mask, str->ptr(), str->length(), str->charset(),
+ d, &end);
}