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
9800aa29
Commit
9800aa29
authored
Jun 02, 2009
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
5.0-bugteam->5.1-bugteam merge
parents
13f7a81b
83ec6e05
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+7
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+9
-0
sql/item_func.cc
sql/item_func.cc
+2
-2
No files found.
mysql-test/r/func_math.result
View file @
9800aa29
...
...
@@ -437,6 +437,13 @@ a ROUND(a)
-1e+16 -10000000000000002
1e+16 10000000000000002
DROP TABLE t1;
CREATE TABLE t1(f1 LONGTEXT) engine=myisam;
INSERT INTO t1 VALUES ('a');
SELECT 1 FROM (SELECT ROUND(f1) AS a FROM t1) AS s WHERE a LIKE 'a';
1
SELECT 1 FROM (SELECT ROUND(f1, f1) AS a FROM t1) AS s WHERE a LIKE 'a';
1
DROP TABLE t1;
End of 5.0 tests
SELECT 1e308 + 1e308;
1e308 + 1e308
...
...
mysql-test/t/func_math.test
View file @
9800aa29
...
...
@@ -269,6 +269,15 @@ SELECT a, ROUND(a) FROM t1;
DROP
TABLE
t1
;
#
# Bug#45152 crash with round() function on longtext column in a derived table
#
CREATE
TABLE
t1
(
f1
LONGTEXT
)
engine
=
myisam
;
INSERT
INTO
t1
VALUES
(
'a'
);
SELECT
1
FROM
(
SELECT
ROUND
(
f1
)
AS
a
FROM
t1
)
AS
s
WHERE
a
LIKE
'a'
;
SELECT
1
FROM
(
SELECT
ROUND
(
f1
,
f1
)
AS
a
FROM
t1
)
AS
s
WHERE
a
LIKE
'a'
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
#
...
...
sql/item_func.cc
View file @
9800aa29
...
...
@@ -1944,8 +1944,8 @@ void Item_func_round::fix_length_and_dec()
unsigned_flag
=
args
[
0
]
->
unsigned_flag
;
if
(
!
args
[
1
]
->
const_item
())
{
max_length
=
args
[
0
]
->
max_length
;
decimals
=
args
[
0
]
->
decimals
;
max_length
=
float_length
(
decimals
);
if
(
args
[
0
]
->
result_type
()
==
DECIMAL_RESULT
)
{
max_length
++
;
...
...
@@ -1965,8 +1965,8 @@ void Item_func_round::fix_length_and_dec()
if
(
args
[
0
]
->
decimals
==
NOT_FIXED_DEC
)
{
max_length
=
args
[
0
]
->
max_length
;
decimals
=
min
(
decimals_to_set
,
NOT_FIXED_DEC
);
max_length
=
float_length
(
decimals
);
hybrid_type
=
REAL_RESULT
;
return
;
}
...
...
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