Valgrind complain for a test case from func_gconcat.test
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Critical
|
Timour Katchaounov |
Bug Description
Valgrind reports errors with the 5.3 tree for the following test case from func_gconcat.test
#
# Bug #36024: group_concat distinct in subquery crash
#
CREATE TABLE t1 (a INT, KEY(a));
CREATE TABLE t2 (b INT);
INSERT INTO t1 VALUES (NULL), (8), (2);
INSERT INTO t2 VALUES (4), (10);
set optimizer_
SELECT 1 FROM t1 WHERE t1.a NOT IN
(
SELECT GROUP_CONCAT(
FROM t1 WHERE t1.a IN
(
SELECT b FROM t2
)
AND NOT t1.a >= (SELECT t1.a FROM t1 LIMIT 1)
GROUP BY t1.a
);
DROP TABLE t1, t2;
If I put this test case into a separate file func_gconcat_1.test and run
./mysql-test-run --valgrind func_gconcat_1
I get:
igor@sophia:
Logging: ./mysql-test-run --valgrind func_gconcat_1
MariaDB Version 5.3.2
Turning on valgrind for all executables
Running valgrind with options " --show-
vardir: /home/igor/
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/
Installing system database...
Checking supported features...
- skipping ndbcluster
- SSL connections supported
- binaries are debug compiled
Using "../libtool" when running valgrind, strace or debugger
Collecting tests...
Using server port 50637
=======
TEST RESULT TIME (ms)
-------
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
main.func_gconcat_1 [ pass ] 1840
***Warnings generated in error logs during shutdown after running tests: main.func_gconcat_1
==30982== 1 bytes in 1 blocks are definitely lost in loss record 1 of 6
==30982== at 0x4C26C3A: malloc (in /usr/lib64/
==30982== by 0xC768D5: my_malloc (my_malloc.c:40)
==30982== by 0x868CAE: save_index(
==30982== by 0x866870: filesort(THD*, st_table*, st_sort_field*, unsigned int, SQL_SELECT*, unsigned long long, bool, unsigned long long*) (filesort.cc:248)
==30982== by 0x79F80F: create_
==30982== by 0x778ED3: JOIN::exec() (sql_select.
==30982== by 0x683417: subselect_
==30982== by 0x67C2EE: Item_subselect:
==30982== by 0x67C854: Item_in_
==30982== by 0x67E70E: Item_in_
==30982== by 0x6041C0: Item::val_
==30982== by 0x6394B5: Item_in_
==30982== by 0x604134: Item::val_
==30982== by 0x5FE5D6: Item_cache_
==30982== by 0x60977F: Item_cache_
==30982== by 0x5FB985: Item_cache_
==30982== 1 bytes in 1 blocks are definitely lost in loss record 2 of 6
==30982== at 0x4C26C3A: malloc (in /usr/lib64/
==30982== by 0xC768D5: my_malloc (my_malloc.c:40)
==30982== by 0x868CAE: save_index(
==30982== by 0x866870: filesort(THD*, st_table*, st_sort_field*, unsigned int, SQL_SELECT*, unsigned long long, bool, unsigned long long*) (filesort.cc:248)
==30982== by 0x79F80F: create_
==30982== by 0x778ED3: JOIN::exec() (sql_select.
==30982== by 0x683417: subselect_
==30982== by 0x67C2EE: Item_subselect:
==30982== by 0x67C854: Item_in_
==30982== by 0x67E70E: Item_in_
==30982== by 0x6041C0: Item::val_
==30982== by 0x63957D: Item_in_
==30982== by 0x604134: Item::val_
==30982== by 0x5FE5D6: Item_cache_
==30982== by 0x60977F: Item_cache_
==30982== by 0x5FB985: Item_cache_
==30982== 392 bytes in 1 blocks are definitely lost in loss record 5 of 6
==30982== at 0x4C26C3A: malloc (in /usr/lib64/
==30982== by 0xC768D5: my_malloc (my_malloc.c:40)
==30982== by 0x79F5FB: create_
==30982== by 0x778ED3: JOIN::exec() (sql_select.
==30982== by 0x683417: subselect_
==30982== by 0x67C2EE: Item_subselect:
==30982== by 0x67C854: Item_in_
==30982== by 0x67E70E: Item_in_
==30982== by 0x6041C0: Item::val_
==30982== by 0x6394B5: Item_in_
==30982== by 0x604134: Item::val_
==30982== by 0x5FE5D6: Item_cache_
==30982== by 0x60977F: Item_cache_
==30982== by 0x5FB985: Item_cache_
==30982== by 0x635514: Item_func_
==30982== by 0x797D37: evaluate_
==30982== 392 bytes in 1 blocks are definitely lost in loss record 6 of 6
==30982== at 0x4C26C3A: malloc (in /usr/lib64/
==30982== by 0xC768D5: my_malloc (my_malloc.c:40)
==30982== by 0x79F5FB: create_
==30982== by 0x778ED3: JOIN::exec() (sql_select.
==30982== by 0x683417: subselect_
==30982== by 0x67C2EE: Item_subselect:
==30982== by 0x67C854: Item_in_
==30982== by 0x67E70E: Item_in_
==30982== by 0x6041C0: Item::val_
==30982== by 0x63957D: Item_in_
==30982== by 0x604134: Item::val_
==30982== by 0x5FE5D6: Item_cache_
==30982== by 0x60977F: Item_cache_
==30982== by 0x5FB985: Item_cache_
==30982== by 0x635514: Item_func_
==30982== by 0x797D37: evaluate_
-------
The servers were restarted 0 times
Spent 1.840 of 16 seconds executing testcases
Warnings in log: All 1 tests were successful.
Errors/warnings were found in logfiles during server shutdown after running the
following sequence(s) of tests:
main.
mysql-test-run: *** ERROR: There where errors/warnings in server logs after running test cases.
There are no valgrind errors with the following setting:
set optimizer_
Related branches
Changed in maria: | |
status: | New → Confirmed |
importance: | Undecided → Critical |
assignee: | nobody → Timour Katchaounov (timour) |
milestone: | none → 5.3 |
Changed in maria: | |
status: | Confirmed → In Progress |
Changed in maria: | |
status: | In Progress → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
Simpler example:
CREATE TABLE t1 (a INT, KEY(a));
CREATE TABLE t2 (b INT);
INSERT INTO t1 VALUES (NULL), (8), (2);
INSERT INTO t2 VALUES (4), (10);
set @@optimizer_ switch= 'subquery_ cache=off' ;
SELECT 1
FROM t1
WHERE t1.a IN
(
SELECT GROUP_CONCAT(t1.a)
FROM t1
WHERE t1.a IN (SELECT b FROM t2)
GROUP BY t1.a
);
DROP TABLE t1, t2;