Commit 5fe9f0f7 authored by kaa@polly.(none)'s avatar kaa@polly.(none)

Merge polly.(none):/home/kaa/src/maint/bug30453/my50-bug28878

into  polly.(none):/home/kaa/src/maint/bug30453/my51-bug28878
parents 7bd5aa9b e0691da0
...@@ -499,4 +499,18 @@ i ...@@ -499,4 +499,18 @@ i
2 2
2 2
DROP TABLE t1, t2; DROP TABLE t1, t2;
CREATE TABLE t1 (c1 INT NOT NULL);
INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500),
('4188.32999999999992724042385816574096679687500'), (4188);
SELECT * FROM t1;
c1
4188
4188
4188
CREATE TABLE t2 (c1 BIGINT);
INSERT INTO t2 VALUES('15449237462.0000000000');
SELECT * FROM t2;
c1
15449237462
DROP TABLE t1, t2;
End of 5.0 tests. End of 5.0 tests.
...@@ -387,5 +387,20 @@ SELECT * FROM t2; ...@@ -387,5 +387,20 @@ SELECT * FROM t2;
DROP TABLE t1, t2; DROP TABLE t1, t2;
#
# Bug #30453: String not cast to int correctly
#
CREATE TABLE t1 (c1 INT NOT NULL);
INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500),
('4188.32999999999992724042385816574096679687500'), (4188);
SELECT * FROM t1;
CREATE TABLE t2 (c1 BIGINT);
INSERT INTO t2 VALUES('15449237462.0000000000');
SELECT * FROM t2;
DROP TABLE t1, t2;
--echo End of 5.0 tests. --echo End of 5.0 tests.
...@@ -1561,16 +1561,20 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), ...@@ -1561,16 +1561,20 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
} }
else else
addon= (*str >= '5'); addon= (*str >= '5');
for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++)
{
if (!dot) if (!dot)
shift++; {
} for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; shift++, str++);
if (str < end && *str == '.' && !dot) if (str < end && *str == '.')
{ {
str++; str++;
for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++); for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++);
} }
}
else
{
shift= dot - str;
for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++);
}
goto exp; goto exp;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment