summaryrefslogtreecommitdiff
path: root/strings
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 /strings
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 'strings')
-rw-r--r--strings/ctype-simple.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 020bfd0035a..288f5fdd49d 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1619,7 +1619,10 @@ exp: /* [ E [ <sign> ] <unsigned integer> ] */
if ((negative_exp= (*str == '-')) || *str=='+')
{
if (++str == end)
+ {
+ str-= 2; /* 'e-' or 'e+' not followed by digits */
goto ret_sign;
+ }
}
for (exponent= 0 ;
str < end && (ch= (uchar) (*str - '0')) < 10;
@@ -1629,6 +1632,8 @@ exp: /* [ E [ <sign> ] <unsigned integer> ] */
}
shift+= negative_exp ? -exponent : exponent;
}
+ else
+ str--; /* 'e' not followed by digits */
}
if (shift == 0) /* No shift, check addon digit */