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
020731f7
Commit
020731f7
authored
Sep 14, 2004
by
joerg@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/M41/mysql-4.1
parents
41aadd90
3997051d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
9 deletions
+26
-9
mysql-test/r/func_compress.result
mysql-test/r/func_compress.result
+4
-0
mysql-test/t/func_compress.test
mysql-test/t/func_compress.test
+7
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+9
-3
strings/ctype-ucs2.c
strings/ctype-ucs2.c
+6
-6
No files found.
mysql-test/r/func_compress.result
View file @
020731f7
...
@@ -68,3 +68,7 @@ Warnings:
...
@@ -68,3 +68,7 @@ Warnings:
Error 1259 ZLIB: Input data corrupted
Error 1259 ZLIB: Input data corrupted
Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
drop table t1;
drop table t1;
set @@max_allowed_packet=1048576*100;
select length(compress(repeat('aaaaaaaaaa', 10000000)));
length(compress(repeat('aaaaaaaaaa', 10000000)))
97214
mysql-test/t/func_compress.test
View file @
020731f7
...
@@ -35,3 +35,10 @@ select length(a) from t1;
...
@@ -35,3 +35,10 @@ select length(a) from t1;
select
length
(
uncompress
(
a
))
from
t1
;
select
length
(
uncompress
(
a
))
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #5497: a problem with large strings
#
set
@@
max_allowed_packet
=
1048576
*
100
;
select
length
(
compress
(
repeat
(
'aaaaaaaaaa'
,
10000000
)));
sql/item_strfunc.cc
View file @
020731f7
...
@@ -2731,11 +2731,17 @@ String *Item_func_compress::val_str(String *str)
...
@@ -2731,11 +2731,17 @@ String *Item_func_compress::val_str(String *str)
compress(compress(compress(...)))
compress(compress(compress(...)))
I.e. zlib give number 'at least'..
I.e. zlib give number 'at least'..
*/
*/
ulong
new_size
=
(
ulong
)((
res
->
length
()
*
120
)
/
100
)
+
12
;
ulong
new_size
=
res
->
length
()
+
res
->
length
()
/
5
+
12
;
buffer
.
realloc
((
uint32
)
new_size
+
4
+
1
);
// Will check new_size overflow: new_size <= res->length()
Byte
*
body
=
((
Byte
*
)
buffer
.
ptr
())
+
4
;
if
(((
uint32
)
new_size
<=
res
->
length
())
||
buffer
.
realloc
((
uint32
)
new_size
+
4
+
1
))
{
null_value
=
1
;
return
0
;
}
Byte
*
body
=
((
Byte
*
)
buffer
.
ptr
())
+
4
;
// As far as we have checked res->is_empty() we can use ptr()
// As far as we have checked res->is_empty() we can use ptr()
if
((
err
=
compress
(
body
,
&
new_size
,
if
((
err
=
compress
(
body
,
&
new_size
,
...
...
strings/ctype-ucs2.c
View file @
020731f7
...
@@ -1345,10 +1345,10 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
...
@@ -1345,10 +1345,10 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
}
}
if
(
ptr
[
0
]
==
'\0'
&&
ptr
[
1
]
==
w_one
)
/* '_' in SQL */
if
(
ptr
[
0
]
==
'\0'
&&
ptr
[
1
]
==
w_one
)
/* '_' in SQL */
{
{
*
min_str
++=
(
char
)
cs
->
min_sort_char
>>
8
;
*
min_str
++=
(
char
)
(
cs
->
min_sort_char
>>
8
)
;
*
min_str
++=
(
char
)
cs
->
min_sort_char
&
255
;
*
min_str
++=
(
char
)
(
cs
->
min_sort_char
&
255
)
;
*
max_str
++=
(
char
)
cs
->
max_sort_char
>>
8
;
*
max_str
++=
(
char
)
(
cs
->
max_sort_char
>>
8
)
;
*
max_str
++=
(
char
)
cs
->
max_sort_char
&
255
;
*
max_str
++=
(
char
)
(
cs
->
max_sort_char
&
255
)
;
continue
;
continue
;
}
}
if
(
ptr
[
0
]
==
'\0'
&&
ptr
[
1
]
==
w_many
)
/* '%' in SQL */
if
(
ptr
[
0
]
==
'\0'
&&
ptr
[
1
]
==
w_many
)
/* '%' in SQL */
...
@@ -1358,8 +1358,8 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
...
@@ -1358,8 +1358,8 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
do
{
do
{
*
min_str
++
=
0
;
*
min_str
++
=
0
;
*
min_str
++
=
0
;
*
min_str
++
=
0
;
*
max_str
++
=
(
char
)
cs
->
max_sort_char
>>
8
;
*
max_str
++
=
(
char
)
(
cs
->
max_sort_char
>>
8
)
;
*
max_str
++
=
(
char
)
cs
->
max_sort_char
&
255
;
*
max_str
++
=
(
char
)
(
cs
->
max_sort_char
&
255
)
;
}
while
(
min_str
+
1
<
min_end
);
}
while
(
min_str
+
1
<
min_end
);
return
0
;
return
0
;
}
}
...
...
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