Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c8226d73
Commit
c8226d73
authored
Dec 01, 2007
by
kaa@polly.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge polly.(none):/home/kaa/src/maint/bug26788/my50-bug26788
into polly.(none):/home/kaa/src/maint/bug26788/my51-bug26788
parents
777df295
55acce75
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
14 deletions
+18
-14
mysql-test/r/insert.result
mysql-test/r/insert.result
+12
-12
mysql-test/t/cast.test
mysql-test/t/cast.test
+2
-0
mysql-test/t/insert.test
mysql-test/t/insert.test
+3
-1
sql/field.cc
sql/field.cc
+1
-1
No files found.
mysql-test/r/insert.result
View file @
c8226d73
...
...
@@ -538,23 +538,23 @@ Warnings:
Warning 1265 Data truncated for column 'c' at row 1
SELECT * FROM t1;
a b c
9.999999
000000000748
10 10
9.999999 10 10
1.225e-05 1.2e-05 1e-0
0.0001225 0.00012 NULL
0.122
499999999999998
0.1225 NULL
0.122587
699999999994
0.12259 NULL
0.122
5
0.1225 NULL
0.122587
7
0.12259 NULL
12.25 12.25 NULL
12.25 12.25 12.2
122500 122500 NULL
12250000000 1.2e+10 NULL
1
225000000000000
1.2e+15 NULL
1
.225e+15
1.2e+15 NULL
5000000 5000000 NULL
1.25e+78 1.2e+78 NULL
1.25e-94 1.2e-94 NULL
1.25e+203 1e+203 NULL
1.25e-175 1e-175 NULL
1.225
000000000000089
NULL 1.23
1.37
0000000000000107
NULL 1.37
1.225 NULL 1.23
1.37 NULL 1.37
-1.37 NULL -1.3
0.00187 NULL 0.00
-0.0187 NULL -0.0
...
...
@@ -592,23 +592,23 @@ INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
SELECT * FROM t1;
a b c
9.999999
000000000748
10 9.999
9.999999 10 9.999
1.225e-05 1.2e-05 1e-05
0.0001225 0.00012 NULL
0.122
499999999999998
0.1225 NULL
0.122587
699999999994
0.12259 NULL
0.122
5
0.1225 NULL
0.122587
7
0.12259 NULL
12.25 12.25 NULL
12.25 12.25 12.25
122500 122500 NULL
12250000000 1.2e+10 NULL
1
225000000000000
1.2e+15 NULL
1
.225e+15
1.2e+15 NULL
5000000 5000000 NULL
1.25e+78 1.2e+78 NULL
1.25e-94 1.2e-94 NULL
1.25e+203 1e+203 NULL
1.25e-175 1e-175 NULL
1.225
000000000000089
NULL 1.225
1.37
0000000000000107
NULL 1.37
1.225 NULL 1.225
1.37 NULL 1.37
-1.37 NULL -1.37
0.00187 NULL 0.002
-0.0187 NULL -0.01
...
...
mysql-test/t/cast.test
View file @
c8226d73
...
...
@@ -177,6 +177,8 @@ select cast(1.0e+300 as signed int);
CREATE
TABLE
t1
(
f1
double
);
INSERT
INTO
t1
SET
f1
=
-
1.0e+30
;
INSERT
INTO
t1
SET
f1
=
+
1.0e+30
;
# Expected result is +-1e+30, but Windows returns +-1e+030.
--
replace_result
1
e
+
030
1
e
+
30
SELECT
f1
AS
double_val
,
CAST
(
f1
AS
SIGNED
INT
)
AS
cast_val
FROM
t1
;
DROP
TABLE
t1
;
...
...
mysql-test/t/insert.test
View file @
c8226d73
...
...
@@ -420,7 +420,9 @@ INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
INSERT
INTO
t1
(
a
,
c
)
VALUES
(
-
1.87e-2
,
-
1.87e-2
);
INSERT
INTO
t1
(
a
,
c
)
VALUES
(
5000
e
+
0
,
5000
e
+
0
);
INSERT
INTO
t1
(
a
,
c
)
VALUES
(
-
5000
e
+
0
,
-
5000
e
+
0
);
# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and
# "1.3e+78" due to different rounding rules
--
replace_result
12.3
12.2
1.3e+78
1.2e+78
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
...
...
sql/field.cc
View file @
c8226d73
...
...
@@ -6306,7 +6306,7 @@ int Field_str::store(double nr)
if
(
exp
>=
(
int
)
digits
||
exp
<
-
4
)
digits
=
max
(
0
,
(
int
)
(
max_length
-
5
-
(
exp
>=
100
||
exp
<=
-
100
)));
length
=
(
uint
)
my_sprintf
(
buff
,
(
buff
,
"%-.*g"
,
digits
,
nr
));
length
=
(
uint
)
my_sprintf
(
buff
,
(
buff
,
"%-.*g"
,
min
(
digits
,
DBL_DIG
)
,
nr
));
#ifdef __WIN__
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment