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
1bf8e86a
Commit
1bf8e86a
authored
May 21, 2009
by
Alexey Kopytov
Browse files
Options
Browse Files
Download
Plain Diff
Automerge.
parents
295afc7a
958e896d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
mysql-test/r/func_compress.result
mysql-test/r/func_compress.result
+15
-0
mysql-test/t/func_compress.test
mysql-test/t/func_compress.test
+17
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+15
-1
No files found.
mysql-test/r/func_compress.result
View file @
1bf8e86a
...
...
@@ -117,4 +117,19 @@ Warnings:
Error 1259 ZLIB: Input data corrupted
Error 1259 ZLIB: Input data corrupted
drop table t1;
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1), (1111), (11111);
SELECT UNCOMPRESS(c1), UNCOMPRESSED_LENGTH(c1) FROM t1;
UNCOMPRESS(c1) UNCOMPRESSED_LENGTH(c1)
NULL NULL
NULL NULL
NULL 825307441
Warnings:
Error 1259 ZLIB: Input data corrupted
Error 1259 ZLIB: Input data corrupted
Error 1259 ZLIB: Input data corrupted
Error 1259 ZLIB: Input data corrupted
Error 1256 Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
EXPLAIN EXTENDED SELECT * FROM (SELECT UNCOMPRESSED_LENGTH(c1) FROM t1) AS s;
DROP TABLE t1;
End of 5.0 tests
mysql-test/t/func_compress.test
View file @
1bf8e86a
...
...
@@ -89,4 +89,21 @@ select *, uncompress(a) from t1;
select
*
,
uncompress
(
a
),
uncompress
(
a
)
is
null
from
t1
;
drop
table
t1
;
#
# Bug #44796: valgrind: too many my_longlong10_to_str_8bit warnings after
# uncompressed_length
#
CREATE
TABLE
t1
(
c1
INT
);
INSERT
INTO
t1
VALUES
(
1
),
(
1111
),
(
11111
);
SELECT
UNCOMPRESS
(
c1
),
UNCOMPRESSED_LENGTH
(
c1
)
FROM
t1
;
# We do not need the results, just make sure there are no valgrind errors
--
disable_result_log
EXPLAIN
EXTENDED
SELECT
*
FROM
(
SELECT
UNCOMPRESSED_LENGTH
(
c1
)
FROM
t1
)
AS
s
;
--
enable_result_log
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/item_strfunc.cc
View file @
1bf8e86a
...
...
@@ -3226,7 +3226,21 @@ longlong Item_func_uncompressed_length::val_int()
if
(
res
->
is_empty
())
return
0
;
/*
res->ptr() using is safe because we have tested that string is not empty,
If length is <= 4 bytes, data is corrupt. This is the best we can do
to detect garbage input without decompressing it.
*/
if
(
res
->
length
()
<=
4
)
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_ERROR
,
ER_ZLIB_Z_DATA_ERROR
,
ER
(
ER_ZLIB_Z_DATA_ERROR
));
null_value
=
1
;
return
0
;
}
/*
res->ptr() using is safe because we have tested that string is at least
5 bytes long.
res->c_ptr() is not used because:
- we do not need \0 terminated string to get first 4 bytes
- c_ptr() tests simbol after string end (uninitialiozed memory) which
...
...
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