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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0e78354b
Commit
0e78354b
authored
Dec 02, 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/mysql-5.0-maint
parents
2a52bb82
d905aade
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
mysql-test/t/insert.test
mysql-test/t/insert.test
+3
-0
mysql-test/t/variables.test
mysql-test/t/variables.test
+2
-0
sql/field.cc
sql/field.cc
+4
-1
No files found.
mysql-test/t/insert.test
View file @
0e78354b
...
@@ -423,6 +423,9 @@ INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
...
@@ -423,6 +423,9 @@ 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
);
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
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
...
...
mysql-test/t/variables.test
View file @
0e78354b
...
@@ -51,6 +51,8 @@ select @test, @`test`, @TEST, @`TEST`, @"teSt";
...
@@ -51,6 +51,8 @@ select @test, @`test`, @TEST, @`TEST`, @"teSt";
set
@
select
=
2
,
@
t5
=
1.23456
;
set
@
select
=
2
,
@
t5
=
1.23456
;
select
@
`select`
,
@
not_used
;
select
@
`select`
,
@
not_used
;
set
@
test_int
=
10
,
@
test_double
=
1
e
-
10
,
@
test_string
=
"abcdeghi"
,
@
test_string2
=
"abcdefghij"
,
@
select
=
NULL
;
set
@
test_int
=
10
,
@
test_double
=
1
e
-
10
,
@
test_string
=
"abcdeghi"
,
@
test_string2
=
"abcdefghij"
,
@
select
=
NULL
;
# Expected result "1e-10", windows returns "1e-010"
--
replace_result
1
e
-
010
1
e
-
10
select
@
test_int
,
@
test_double
,
@
test_string
,
@
test_string2
,
@
select
;
select
@
test_int
,
@
test_double
,
@
test_string
,
@
test_string2
,
@
select
;
set
@
test_int
=
"hello"
,
@
test_double
=
"hello"
,
@
test_string
=
"hello"
,
@
test_string2
=
"hello"
;
set
@
test_int
=
"hello"
,
@
test_double
=
"hello"
,
@
test_string
=
"hello"
,
@
test_string2
=
"hello"
;
select
@
test_int
,
@
test_double
,
@
test_string
,
@
test_string2
;
select
@
test_int
,
@
test_double
,
@
test_string
,
@
test_string2
;
...
...
sql/field.cc
View file @
0e78354b
...
@@ -5953,8 +5953,11 @@ int Field_str::store(double nr)
...
@@ -5953,8 +5953,11 @@ int Field_str::store(double nr)
*/
*/
if
(
exp
>=
(
int
)
digits
||
exp
<
-
4
)
if
(
exp
>=
(
int
)
digits
||
exp
<
-
4
)
digits
=
max
(
0
,
(
int
)
(
max_length
-
5
-
(
exp
>=
100
||
exp
<=
-
100
)));
digits
=
max
(
0
,
(
int
)
(
max_length
-
5
-
(
exp
>=
100
||
exp
<=
-
100
)));
/* Limit precision to DBL_DIG to avoid garbage past significant digits */
set_if_smaller
(
digits
,
DBL_DIG
);
length
=
(
uint
)
my_sprintf
(
buff
,
(
buff
,
"%-.*g"
,
min
(
digits
,
DBL_DIG
)
,
nr
));
length
=
(
uint
)
my_sprintf
(
buff
,
(
buff
,
"%-.*g"
,
digits
,
nr
));
#ifdef __WIN__
#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