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
3da7ffe6
Commit
3da7ffe6
authored
Nov 14, 2008
by
Matthias Leich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for Bug#40644 main.group_concat_max_len_func random failures
+ minor improvements
parent
15d03999
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
69 deletions
+88
-69
mysql-test/r/group_concat_max_len_func.result
mysql-test/r/group_concat_max_len_func.result
+42
-32
mysql-test/t/group_concat_max_len_func.test
mysql-test/t/group_concat_max_len_func.test
+46
-37
No files found.
mysql-test/r/group_concat_max_len_func.result
View file @
3da7ffe6
SET @save = @@global.group_concat_max_len;
SET @save = @@global.group_concat_max_len;
drop table if exists
t1;
DROP TABLE IF EXISTS
t1;
## Creating new table t1 ##
## Creating new table t1 ##
CREATE TABLE t1
CREATE TABLE t1
(
(
id INT NOT NULL
auto_increment
,
id INT NOT NULL
AUTO_INCREMENT
,
PRIMARY KEY (id),
PRIMARY KEY (id),
rollno
int
NOT NULL,
rollno
INT
NOT NULL,
name VARCHAR(30)
name VARCHAR(30)
);
);
'#--------------------FN_DYNVARS_034_01-------------------------#'
'#--------------------FN_DYNVARS_034_01-------------------------#'
## Setting initial value of variable to 4 ##
## Setting initial value of variable to 4 ##
SET @@global.group_concat_max_len = 4;
SET @@global.group_concat_max_len = 4;
## Inserting some rows in table ##
## Inserting some rows in table ##
INSERT into t1(rollno, name) values(1, 'Record_1');
INSERT INTO t1(rollno, name) VALUES(1, 'Record_1');
INSERT into t1(rollno, name) values(2, 'Record_2');
INSERT INTO t1(rollno, name) VALUES(2, 'Record_2');
INSERT into t1(rollno, name) values(1, 'Record_3');
INSERT INTO t1(rollno, name) VALUES(1, 'Record_3');
INSERT into t1(rollno, name) values(3, 'Record_4');
INSERT INTO t1(rollno, name) VALUES(3, 'Record_4');
INSERT into t1(rollno, name) values(1, 'Record_5');
INSERT INTO t1(rollno, name) VALUES(1, 'Record_5');
INSERT into t1(rollno, name) values(3, 'Record_6');
INSERT INTO t1(rollno, name) VALUES(3, 'Record_6');
INSERT into t1(rollno, name) values(4, 'Record_7');
INSERT INTO t1(rollno, name) VALUES(4, 'Record_7');
INSERT into t1(rollno, name) values(4, 'Record_8');
INSERT INTO t1(rollno, name) VALUES(4, 'Record_8');
SELECT * FROM t1 ORDER BY id;
id rollno name
1 1 Record_1
2 2 Record_2
3 1 Record_3
4 3 Record_4
5 1 Record_5
6 3 Record_6
7 4 Record_7
8 4 Record_8
## Creating two new connections ##
## Creating two new connections ##
'#--------------------FN_DYNVARS_034_02-------------------------#'
'#--------------------FN_DYNVARS_034_02-------------------------#'
## Connecting with test_con1 ##
## Connecting with test_con1 ##
## Accessing data and using group_concat on column whose value is greater than 4 ##
## Accessing data and using group_concat on column whose value is greater than 4 ##
SELECT id, rollno,
group_concat
(name) FROM t1 GROUP BY rollno;
SELECT id, rollno,
GROUP_CONCAT
(name) FROM t1 GROUP BY rollno;
id rollno
group_concat
(name)
id rollno
GROUP_CONCAT
(name)
1 1 Reco
1 1 Reco
2 2 Reco
2 2 Reco
4 3 Reco
4 3 Reco
...
@@ -35,8 +45,8 @@ Warning 1260 4 line(s) were cut by GROUP_CONCAT()
...
@@ -35,8 +45,8 @@ Warning 1260 4 line(s) were cut by GROUP_CONCAT()
## Changing session value of variable and verifying its behavior, ##
## Changing session value of variable and verifying its behavior, ##
## warning should come here ##
## warning should come here ##
SET @@session.group_concat_max_len = 10;
SET @@session.group_concat_max_len = 10;
SELECT id, rollno,
group_concat
(name) FROM t1 GROUP BY rollno;
SELECT id, rollno,
GROUP_CONCAT
(name) FROM t1 GROUP BY rollno;
id rollno
group_concat
(name)
id rollno
GROUP_CONCAT
(name)
1 1 Record_1,R
1 1 Record_1,R
2 2 Record_2
2 2 Record_2
4 3 Record_4,R
4 3 Record_4,R
...
@@ -54,8 +64,8 @@ SELECT @@session.group_concat_max_len = 4;
...
@@ -54,8 +64,8 @@ SELECT @@session.group_concat_max_len = 4;
SET @@session.group_concat_max_len = 20;
SET @@session.group_concat_max_len = 20;
## Verifying value of name column, it should not me more than 20 characters ##
## Verifying value of name column, it should not me more than 20 characters ##
## Warning should come here ##
## Warning should come here ##
SELECT id, rollno,
group_concat
(name) FROM t1 GROUP BY rollno;
SELECT id, rollno,
GROUP_CONCAT
(name) FROM t1 GROUP BY rollno;
id rollno
group_concat
(name)
id rollno
GROUP_CONCAT
(name)
1 1 Record_1,Record_3,Re
1 1 Record_1,Record_3,Re
2 2 Record_2
2 2 Record_2
4 3 Record_4,Record_6
4 3 Record_4,Record_6
...
@@ -67,13 +77,13 @@ Warning 1260 1 line(s) were cut by GROUP_CONCAT()
...
@@ -67,13 +77,13 @@ Warning 1260 1 line(s) were cut by GROUP_CONCAT()
## because the value after concatination is less than 30 ##
## because the value after concatination is less than 30 ##
SET @@session.group_concat_max_len = 26;
SET @@session.group_concat_max_len = 26;
## Verifying value of name column, it should not give warning now ##
## Verifying value of name column, it should not give warning now ##
SELECT id, rollno,
group_concat
(name) FROM t1 GROUP BY rollno;
SELECT id, rollno,
GROUP_CONCAT
(name) FROM t1 GROUP BY rollno;
id rollno
group_concat
(name)
id rollno
GROUP_CONCAT
(name)
1 1 Record_1,Record_3,Record_5
1 1 Record_1,Record_3,Record_5
2 2 Record_2
2 2 Record_2
4 3 Record_4,Record_6
4 3 Record_4,Record_6
7 4 Record_7,Record_8
7 4 Record_7,Record_8
## Dropping table t1 ##
## Dropping table t1 ##
DROP
table
t1;
DROP
TABLE
t1;
## Disconnecting both the connection ##
## Disconnecting both the connection ##
SET @@global.group_concat_max_len = @save;
SET @@global.group_concat_max_len = @save;
mysql-test/t/group_concat_max_len_func.test
View file @
3da7ffe6
...
@@ -11,18 +11,23 @@
...
@@ -11,18 +11,23 @@
# Creation Date: 2008-03-07 #
# Creation Date: 2008-03-07 #
# Author: Salman Rawala #
# Author: Salman Rawala #
# #
# #
# Last modification: #
# 2008-11-14 mleich Fix Bug#40644 main.group_concat_max_len_func random #
# failures #
# + minor improvements #
# #
# Description: Test Cases of Dynamic System Variable group_concat_max_len #
# Description: Test Cases of Dynamic System Variable group_concat_max_len #
# that checks the functionality of this variable #
# that checks the functionality of this variable #
# #
# #
# Reference:
http://dev.mysql.com/doc/refman/5.1/en/
#
# Reference:
#
#
server-system-variables.html
#
#
http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html
#
# #
# #
###############################################################################
###############################################################################
SET
@
save
=
@@
global
.
group_concat_max_len
;
SET
@
save
=
@@
global
.
group_concat_max_len
;
--
disable_warnings
--
disable_warnings
drop
table
if
exists
t1
;
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
--
enable_warnings
#########################
#########################
...
@@ -32,9 +37,9 @@ drop table if exists t1;
...
@@ -32,9 +37,9 @@ drop table if exists t1;
--
echo
## Creating new table t1 ##
--
echo
## Creating new table t1 ##
CREATE
TABLE
t1
CREATE
TABLE
t1
(
(
id
INT
NOT
NULL
auto_increment
,
id
INT
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
),
PRIMARY
KEY
(
id
),
rollno
int
NOT
NULL
,
rollno
INT
NOT
NULL
,
name
VARCHAR
(
30
)
name
VARCHAR
(
30
)
);
);
...
@@ -48,18 +53,22 @@ name VARCHAR(30)
...
@@ -48,18 +53,22 @@ name VARCHAR(30)
SET
@@
global
.
group_concat_max_len
=
4
;
SET
@@
global
.
group_concat_max_len
=
4
;
--
echo
## Inserting some rows in table ##
--
echo
## Inserting some rows in table ##
INSERT
into
t1
(
rollno
,
name
)
values
(
1
,
'Record_1'
);
INSERT
INTO
t1
(
rollno
,
name
)
VALUES
(
1
,
'Record_1'
);
INSERT
into
t1
(
rollno
,
name
)
values
(
2
,
'Record_2'
);
INSERT
INTO
t1
(
rollno
,
name
)
VALUES
(
2
,
'Record_2'
);
INSERT
into
t1
(
rollno
,
name
)
values
(
1
,
'Record_3'
);
INSERT
INTO
t1
(
rollno
,
name
)
VALUES
(
1
,
'Record_3'
);
INSERT
into
t1
(
rollno
,
name
)
values
(
3
,
'Record_4'
);
INSERT
INTO
t1
(
rollno
,
name
)
VALUES
(
3
,
'Record_4'
);
INSERT
into
t1
(
rollno
,
name
)
values
(
1
,
'Record_5'
);
INSERT
INTO
t1
(
rollno
,
name
)
VALUES
(
1
,
'Record_5'
);
INSERT
into
t1
(
rollno
,
name
)
values
(
3
,
'Record_6'
);
INSERT
INTO
t1
(
rollno
,
name
)
VALUES
(
3
,
'Record_6'
);
INSERT
into
t1
(
rollno
,
name
)
values
(
4
,
'Record_7'
);
INSERT
INTO
t1
(
rollno
,
name
)
VALUES
(
4
,
'Record_7'
);
INSERT
into
t1
(
rollno
,
name
)
values
(
4
,
'Record_8'
);
INSERT
INTO
t1
(
rollno
,
name
)
VALUES
(
4
,
'Record_8'
);
# The following "auxiliary" select ensures that all records are on disk
# = result sets got by parallel sessions cannot suffer from effects
# caused by the MyISAM feature "concurrent_inserts".
SELECT
*
FROM
t1
ORDER
BY
id
;
--
echo
## Creating two new connections ##
--
echo
## Creating two new connections ##
CONNECT
(
test_con1
,
localhost
,
root
,,);
connect
(
test_con1
,
localhost
,
root
,,);
CONNECT
(
test_con2
,
localhost
,
root
,,);
connect
(
test_con2
,
localhost
,
root
,,);
--
echo
'#--------------------FN_DYNVARS_034_02-------------------------#'
--
echo
'#--------------------FN_DYNVARS_034_02-------------------------#'
...
@@ -68,16 +77,16 @@ CONNECT (test_con2,localhost,root,,);
...
@@ -68,16 +77,16 @@ CONNECT (test_con2,localhost,root,,);
###############################################################################
###############################################################################
--
echo
## Connecting with test_con1 ##
--
echo
## Connecting with test_con1 ##
CONNECTION
test_con1
;
connection
test_con1
;
--
echo
## Accessing data and using group_concat on column whose value is greater than 4 ##
--
echo
## Accessing data and using group_concat on column whose value is greater than 4 ##
SELECT
id
,
rollno
,
group_concat
(
name
)
FROM
t1
GROUP
BY
rollno
;
SELECT
id
,
rollno
,
GROUP_CONCAT
(
name
)
FROM
t1
GROUP
BY
rollno
;
--
echo
## Changing session value of variable and verifying its behavior, ##
--
echo
## Changing session value of variable and verifying its behavior, ##
--
echo
## warning should come here ##
--
echo
## warning should come here ##
SET
@@
session
.
group_concat_max_len
=
10
;
SET
@@
session
.
group_concat_max_len
=
10
;
SELECT
id
,
rollno
,
group_concat
(
name
)
FROM
t1
GROUP
BY
rollno
;
SELECT
id
,
rollno
,
GROUP_CONCAT
(
name
)
FROM
t1
GROUP
BY
rollno
;
--
echo
'#--------------------FN_DYNVARS_034_03-------------------------#'
--
echo
'#--------------------FN_DYNVARS_034_03-------------------------#'
...
@@ -97,7 +106,7 @@ SET @@session.group_concat_max_len = 20;
...
@@ -97,7 +106,7 @@ SET @@session.group_concat_max_len = 20;
--
echo
## Verifying value of name column, it should not me more than 20 characters ##
--
echo
## Verifying value of name column, it should not me more than 20 characters ##
--
echo
## Warning should come here ##
--
echo
## Warning should come here ##
SELECT
id
,
rollno
,
group_concat
(
name
)
FROM
t1
GROUP
BY
rollno
;
SELECT
id
,
rollno
,
GROUP_CONCAT
(
name
)
FROM
t1
GROUP
BY
rollno
;
--
echo
'#--------------------FN_DYNVARS_034_04-------------------------#'
--
echo
'#--------------------FN_DYNVARS_034_04-------------------------#'
...
@@ -111,7 +120,7 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
...
@@ -111,7 +120,7 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
SET
@@
session
.
group_concat_max_len
=
26
;
SET
@@
session
.
group_concat_max_len
=
26
;
--
echo
## Verifying value of name column, it should not give warning now ##
--
echo
## Verifying value of name column, it should not give warning now ##
SELECT
id
,
rollno
,
group_concat
(
name
)
FROM
t1
GROUP
BY
rollno
;
SELECT
id
,
rollno
,
GROUP_CONCAT
(
name
)
FROM
t1
GROUP
BY
rollno
;
############################################################
############################################################
...
@@ -119,11 +128,11 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
...
@@ -119,11 +128,11 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
############################################################
############################################################
--
echo
## Dropping table t1 ##
--
echo
## Dropping table t1 ##
DROP
table
t1
;
DROP
TABLE
t1
;
--
echo
## Disconnecting both the connection ##
--
echo
## Disconnecting both the connection ##
DISCONNECT
test_con2
;
disconnect
test_con2
;
DISCONNECT
test_con1
;
disconnect
test_con1
;
connection
default
;
connection
default
;
...
...
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