crash in group_concat

Bug #1266980 reported by Sergei Glushchenko on 2014-01-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Invalid
Undecided
Sergei Glushchenko
5.1
Fix Released
High
Sergei Glushchenko
5.5
Invalid
Undecided
Sergei Glushchenko
5.6
Invalid
Undecided
Sergei Glushchenko

Bug Description

This MTR test case crashes the server

--error 1064
SELECT GROUP_CONCAT('\\\\\n* ', '\'',user,'\'@\'',host,'\'' ORDER BY user, host, .) AS user_spec FROM mysql.user;

SELECT GROUP_CONCAT('\\\\\n* ', '\'',user,'\'@\'',host,'\'' ORDER BY user, host) AS user_spec FROM mysql.user;

Related branches

likely an upstream also

Workaround is to avoid errors in statements with group_concat.

I do not see crashes in upstream (or recent PS 5.6.15 for that matter):

openxs@ao756:~/dbs/5.6/mysql-test$ ./mtr 1266980
Logging: ./mtr 1266980
2014-01-08 10:41:06 16582 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2014-01-08 10:41:06 16582 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)

2014-01-08 10:41:06 16582 [Note] Plugin 'FEDERATED' is disabled.
2014-01-08 10:41:06 16582 [Note] Binlog end
2014-01-08 10:41:06 16582 [Note] Shutting down plugin 'CSV'
2014-01-08 10:41:06 16582 [Note] Shutting down plugin 'MyISAM'
MySQL Version 5.6.15
Checking supported features...
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/openxs/dbs/5.6/mysql-test/var'...
Installing system database...
Using server port 48941

==============================================================================

TEST RESULT TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
main.1266980 [ pass ] 2
--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 0.002 of 13 seconds executing testcases

Completed: All 1 tests were successful.

openxs@ao756:~/dbs/5.6/mysql-test$ cat t/1266980.test
--error 1064
SELECT GROUP_CONCAT('\\\\\n* ', '\'',user,'\'@\'',host,'\'' ORDER BY user, host, .) AS user_spec FROM mysql.user;

SELECT GROUP_CONCAT('\\\\\n* ', '\'',user,'\'@\'',host,'\'' ORDER BY user, host) AS user_spec FROM mysql.user;

Can you tell me what I miss in this test?

Looks like it was fixed upstream

            revno: 0.18821.219
            committer: Tor Didriksen <email address hidden>
            branch nick: 5.5-bug16870783groupconcat
            timestamp: Mon 2013-09-09 12:43:08 +0200
            message:
              Bug#16870783 RECENT REGRESSION: CRASH WITH GROUP_CONCAT AND INVALID SEPARATOR

              Add missing initialization in lex_start()

=== modified file 'sql/sql_lex.cc'
--- sql/sql_lex.cc 2013-06-24 05:41:55 +0000
+++ sql/sql_lex.cc 2013-09-09 10:43:08 +0000
@@ -411,6 +411,7 @@
   lex->select_lex.ftfunc_list= &lex->select_lex.ftfunc_list_alloc;
   lex->select_lex.group_list.empty();
   lex->select_lex.order_list.empty();
+ lex->select_lex.gorder_list.empty();
   lex->duplicates= DUP_ERROR;
   lex->ignore= 0;
   lex->spname= NULL;

I was testing on 5.6.14.

I still see it in upstream 5.1.73, so reported there, just in case.

Download full text (4.6 KiB)

Clearly repeatable with recent PS 5.1 from bzr:

openxs@ao756:~/dbs/p5.1/mysql-test$ ./mtr --record 1266980
Logging: ./mtr --record 1266980
140108 12:13:42 [Note] Plugin 'FEDERATED' is disabled.
MySQL Version 5.1.73
Checking supported features...
 - skipping ndbcluster
 - SSL connections supported
Collecting tests...
vardir: /home/openxs/dbs/p5.1/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/openxs/dbs/p5.1/mysql-test/var'...
Installing system database...
Using server port 40374

==============================================================================

TEST RESULT TIME (ms)
------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
main.1266980 [ fail ]
        Test ended at 2014-01-08 12:13:45

CURRENT_TEST: main.1266980
mysqltest: At line 4: query 'SELECT GROUP_CONCAT('\\\\\n* ', '\'',user,'\'@\'',host,'\'' ORDER BY user, host) AS user_spec FROM mysql.user' failed: 2013: Lost connection to MySQL server during query

The result from queries just before the failure was:
SELECT GROUP_CONCAT('\\\\\n* ', '\'',user,'\'@\'',host,'\'' ORDER BY user, host, .) AS user_spec FROM mysql.user;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AS user_spec FROM mysql.user' at line 1

Server [mysqld.1 - pid: 27812, winpid: 27812, exit: 256] failed during test run
Server log from this test:
----------SERVER LOG START-----------
140108 13:13:44 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.
140108 13:13:44 [Note] Plugin 'FEDERATED' is disabled.
140108 13:13:44 [Note] Plugin 'InnoDB' is disabled.
140108 13:13:44 [Warning] /home/openxs/dbs/p5.1/libexec/mysqld: unknown variable 'loose-debug-sync-timeout=300'
140108 13:13:45 [Note] Event Scheduler: Loaded 0 events
140108 13:13:45 [Note] /home/openxs/dbs/p5.1/libexec/mysqld: ready for connections.
Version: '5.1.73-log' socket: '/home/openxs/dbs/p5.1/mysql-test/var/tmp/mysqld.1.sock' port: 13000 Source distribution
10:13:45 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Please help us make Percona Server better by reporting any
bugs at http://bugs.percona.com/

key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 60685 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x1be6c70
Attempting backtrace. You can use the fo...

Read more...

I do not see crash with recent PS 5.5.35 from bzr:

openxs@ao756:~/dbs/p5.5/mysql-test$ perl ./mysql-test-run.pl.BASE --record 1266980
Logging: ./mysql-test-run.pl.BASE --record 1266980
140108 12:42:05 [Note] Plugin 'FEDERATED' is disabled.
MySQL Version 5.5.35
Checking supported features...
 - SSL connections supported
Collecting tests...
Removing old var directory...
Creating var directory '/home/openxs/dbs/p5.5/mysql-test/var'...
Installing system database...
Using server port 58687

==============================================================================

TEST RESULT TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
main.1266980 [ pass ] 1
--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 0.001 of 13 seconds executing testcases

Completed: All 1 tests were successful.

It crashed with older PS 5.6.14*, but works with 5.6.15 based on all my tests.

tags: added: upstream

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3084

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.