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
929c97db
Commit
929c97db
authored
Sep 20, 2011
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY
parent
0595b00a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
2 deletions
+59
-2
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+35
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+19
-0
strings/dtoa.c
strings/dtoa.c
+5
-2
No files found.
mysql-test/r/func_str.result
View file @
929c97db
...
...
@@ -2785,5 +2785,40 @@ format(123,2,'no_NO')
123,00
DROP TABLE t1;
#
# Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY
#
SELECT (rpad(1.0,2048,1)) IS NOT FALSE;
(rpad(1.0,2048,1)) IS NOT FALSE
1
SELECT ((+0) IN
((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)),
(32767.1)));
((+0) IN
((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)),
(32767.1)))
0
SELECT ((rpad(1.0,2048,1)) = ('4(') ^ (0.1));
((rpad(1.0,2048,1)) = ('4(') ^ (0.1))
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '4('
SELECT
pow((rpad(1.0,2048,1)),(b'1111111111111111111111111111111111111111111'));
ERROR 22003: DOUBLE value is out of range in 'pow(rpad(1.0,2048,1),0x07ffffffffff)'
SELECT ((rpad(1.0,2048,1)) + (0) ^ ('../'));
((rpad(1.0,2048,1)) + (0) ^ ('../'))
1.011111111111111
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '../'
SELECT stddev_samp(rpad(1.0,2048,1));
stddev_samp(rpad(1.0,2048,1))
NULL
SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)));
((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)))
1
SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc));
((0xf3) * (rpad(1.0,2048,1)) << (0xcc))
0
#
# End of 5.5 tests
#
mysql-test/t/func_str.test
View file @
929c97db
...
...
@@ -1436,6 +1436,25 @@ SHOW CREATE TABLE t1;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY
--
echo
#
SELECT
(
rpad
(
1.0
,
2048
,
1
))
IS
NOT
FALSE
;
SELECT
((
+
0
)
IN
((
0b111111111111111111111111111111111111111111111111111
),(
rpad
(
1.0
,
2048
,
1
)),
(
32767.1
)));
SELECT
((
rpad
(
1.0
,
2048
,
1
))
=
(
'4('
)
^
(
0.1
));
--
error
1690
SELECT
pow
((
rpad
(
1.0
,
2048
,
1
)),(
b
'1111111111111111111111111111111111111111111'
));
SELECT
((
rpad
(
1.0
,
2048
,
1
))
+
(
0
)
^
(
'../'
));
SELECT
stddev_samp
(
rpad
(
1.0
,
2048
,
1
));
SELECT
((
127.1
)
not
in
((
rpad
(
1.0
,
2048
,
1
)),(
''
),(
-
1.1
)));
SELECT
((
0xf3
)
*
(
rpad
(
1.0
,
2048
,
1
))
<<
(
0xcc
));
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
strings/dtoa.c
View file @
929c97db
...
...
@@ -46,7 +46,7 @@
see if it is possible to get rid of malloc().
this constant is sufficient to avoid malloc() on all inputs I have tried.
*/
#define DTOA_BUFF_SIZE (4
2
0 * sizeof(void *))
#define DTOA_BUFF_SIZE (4
6
0 * sizeof(void *))
/* Magic value returned by dtoa() to indicate overflow */
#define DTOA_OVERFLOW 9999
...
...
@@ -659,6 +659,7 @@ typedef struct Stack_alloc
static
Bigint
*
Balloc
(
int
k
,
Stack_alloc
*
alloc
)
{
Bigint
*
rv
;
DBUG_ASSERT
(
k
<=
Kmax
);
if
(
k
<=
Kmax
&&
alloc
->
freelist
[
k
])
{
rv
=
alloc
->
freelist
[
k
];
...
...
@@ -1005,7 +1006,7 @@ static Bigint p5_a[]=
static
Bigint
*
pow5mult
(
Bigint
*
b
,
int
k
,
Stack_alloc
*
alloc
)
{
Bigint
*
b1
,
*
p5
,
*
p51
;
Bigint
*
b1
,
*
p5
,
*
p51
=
NULL
;
int
i
;
static
int
p05
[
3
]
=
{
5
,
25
,
125
};
...
...
@@ -1037,6 +1038,8 @@ static Bigint *pow5mult(Bigint *b, int k, Stack_alloc *alloc)
p5
=
p51
;
}
}
if
(
p51
)
Bfree
(
p51
,
alloc
);
return
b
;
}
...
...
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