diff options
author | Alexander Barkov <bar@mariadb.org> | 2015-09-17 11:05:07 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2015-09-17 11:05:07 +0400 |
commit | d9b25ae3db8584bde809c0ab3230cbe151fa489b (patch) | |
tree | cb0ae8c91d4f1bcd614c3c1b2d7847f3ef7a130f /strings | |
parent | c69cf93bfb3a221d9106f3695aa16e11f7e8b7fb (diff) | |
download | mariadb-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.c | 5 |
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 */ |