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
ca3dbd26
Commit
ca3dbd26
authored
Jul 25, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into olga.mysql.com:/home/igor/mysql-5.0-opt
parents
d64f605e
bc6fd749
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
3 deletions
+46
-3
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+13
-0
mysql-test/t/func_gconcat.test
mysql-test/t/func_gconcat.test
+14
-0
sql/item_sum.cc
sql/item_sum.cc
+7
-1
sql/sql_select.cc
sql/sql_select.cc
+12
-2
No files found.
mysql-test/r/func_gconcat.result
View file @
ca3dbd26
...
@@ -641,3 +641,16 @@ select charset(group_concat(c1 order by c2)) from t1;
...
@@ -641,3 +641,16 @@ select charset(group_concat(c1 order by c2)) from t1;
charset(group_concat(c1 order by c2))
charset(group_concat(c1 order by c2))
latin1
latin1
drop table t1;
drop table t1;
CREATE TABLE t1 (a INT(10), b LONGTEXT, PRIMARY KEY (a));
SET GROUP_CONCAT_MAX_LEN = 20000000;
INSERT INTO t1 VALUES (1,REPEAT(CONCAT('A',CAST(CHAR(0) AS BINARY),'B'), 40000));
INSERT INTO t1 SELECT a + 1, b FROM t1;
SELECT a, CHAR_LENGTH(b) FROM t1;
a CHAR_LENGTH(b)
1 120000
2 120000
SELECT CHAR_LENGTH( GROUP_CONCAT(b) ) FROM t1;
CHAR_LENGTH( GROUP_CONCAT(b) )
240001
SET GROUP_CONCAT_MAX_LEN = 1024;
DROP TABLE t1;
mysql-test/t/func_gconcat.test
View file @
ca3dbd26
...
@@ -433,3 +433,17 @@ create table t1 (c1 varchar(10), c2 int);
...
@@ -433,3 +433,17 @@ create table t1 (c1 varchar(10), c2 int);
select
charset
(
group_concat
(
c1
order
by
c2
))
from
t1
;
select
charset
(
group_concat
(
c1
order
by
c2
))
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #16712: group_concat returns odd string instead of intended result
#
CREATE
TABLE
t1
(
a
INT
(
10
),
b
LONGTEXT
,
PRIMARY
KEY
(
a
));
SET
GROUP_CONCAT_MAX_LEN
=
20000000
;
INSERT
INTO
t1
VALUES
(
1
,
REPEAT
(
CONCAT
(
'A'
,
CAST
(
CHAR
(
0
)
AS
BINARY
),
'B'
),
40000
));
INSERT
INTO
t1
SELECT
a
+
1
,
b
FROM
t1
;
SELECT
a
,
CHAR_LENGTH
(
b
)
FROM
t1
;
SELECT
CHAR_LENGTH
(
GROUP_CONCAT
(
b
)
)
FROM
t1
;
SET
GROUP_CONCAT_MAX_LEN
=
1024
;
DROP
TABLE
t1
;
sql/item_sum.cc
View file @
ca3dbd26
...
@@ -377,7 +377,13 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table,
...
@@ -377,7 +377,13 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table,
case
INT_RESULT
:
case
INT_RESULT
:
return
new
Field_longlong
(
max_length
,
maybe_null
,
name
,
table
,
unsigned_flag
);
return
new
Field_longlong
(
max_length
,
maybe_null
,
name
,
table
,
unsigned_flag
);
case
STRING_RESULT
:
case
STRING_RESULT
:
if
(
max_length
/
collation
.
collation
->
mbmaxlen
>
255
&&
convert_blob_length
)
/*
Make sure that the blob fits into a Field_varstring which has
2-byte lenght.
*/
if
(
max_length
/
collation
.
collation
->
mbmaxlen
>
255
&&
max_length
/
collation
.
collation
->
mbmaxlen
<
UINT_MAX16
&&
convert_blob_length
)
return
new
Field_varstring
(
convert_blob_length
,
maybe_null
,
return
new
Field_varstring
(
convert_blob_length
,
maybe_null
,
name
,
table
,
name
,
table
,
collation
.
collation
);
collation
.
collation
);
...
...
sql/sql_select.cc
View file @
ca3dbd26
...
@@ -8034,7 +8034,12 @@ Field* create_tmp_field_from_field(THD *thd, Field* org_field,
...
@@ -8034,7 +8034,12 @@ Field* create_tmp_field_from_field(THD *thd, Field* org_field,
{
{
Field
*
new_field
;
Field
*
new_field
;
if
(
convert_blob_length
&&
(
org_field
->
flags
&
BLOB_FLAG
))
/*
Make sure that the blob fits into a Field_varstring which has
2-byte lenght.
*/
if
(
convert_blob_length
&&
convert_blob_length
<
UINT_MAX16
&&
(
org_field
->
flags
&
BLOB_FLAG
))
new_field
=
new
Field_varstring
(
convert_blob_length
,
new_field
=
new
Field_varstring
(
convert_blob_length
,
org_field
->
maybe_null
(),
org_field
->
maybe_null
(),
org_field
->
field_name
,
table
,
org_field
->
field_name
,
table
,
...
@@ -8116,8 +8121,13 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
...
@@ -8116,8 +8121,13 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
if
((
type
=
item
->
field_type
())
==
MYSQL_TYPE_DATETIME
||
if
((
type
=
item
->
field_type
())
==
MYSQL_TYPE_DATETIME
||
type
==
MYSQL_TYPE_TIME
||
type
==
MYSQL_TYPE_DATE
)
type
==
MYSQL_TYPE_TIME
||
type
==
MYSQL_TYPE_DATE
)
new_field
=
item
->
tmp_table_field_from_field_type
(
table
);
new_field
=
item
->
tmp_table_field_from_field_type
(
table
);
/*
Make sure that the blob fits into a Field_varstring which has
2-byte lenght.
*/
else
if
(
item
->
max_length
/
item
->
collation
.
collation
->
mbmaxlen
>
255
&&
else
if
(
item
->
max_length
/
item
->
collation
.
collation
->
mbmaxlen
>
255
&&
convert_blob_length
)
item
->
max_length
/
item
->
collation
.
collation
->
mbmaxlen
<
UINT_MAX16
&&
convert_blob_length
)
new_field
=
new
Field_varstring
(
convert_blob_length
,
maybe_null
,
new_field
=
new
Field_varstring
(
convert_blob_length
,
maybe_null
,
item
->
name
,
table
,
item
->
name
,
table
,
item
->
collation
.
collation
);
item
->
collation
.
collation
);
...
...
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