Bug #78335 handle_fatal_signal (sig=6) in st_select_lex::print
Submitted: 5 Sep 2015 3:41 Modified: 29 Sep 2015 22:56
Reporter: Roel Van de Paar Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S6 (Debug Builds)
Version:5.7.8 (RC2) OS:Any
Assigned to: CPU Architecture:Any
Tags: opt

[5 Sep 2015 3:41] Roel Van de Paar
Description:
+bt
#0  0x00007f3c3f7bf771 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000001721318 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:247
#2  0x0000000000dd6008 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f3c3e3c35d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f3c3e3c4cc8 in __GI_abort () at abort.c:90
#6  0x00007f3c3e3bc546 in __assert_fail_base (fmt=0x7f3c3e50c128 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x1e64a69 "0", file=file@entry=0x1e64c58 "/git/mysql-server_dbg/sql/sql_lex.cc", line=line@entry=3148, function=function@entry=0x1e661a0 <st_select_lex::print(THD*, String*, enum_query_type)::__PRETTY_FUNCTION__> "void st_select_lex::print(THD*, String*, enum_query_type)") at assert.c:92
#7  0x00007f3c3e3bc5f2 in __GI___assert_fail (assertion=0x1e64a69 "0", file=0x1e64c58 "/git/mysql-server_dbg/sql/sql_lex.cc", line=3148, function=0x1e661a0 <st_select_lex::print(THD*, String*, enum_query_type)::__PRETTY_FUNCTION__> "void st_select_lex::print(THD*, String*, enum_query_type)") at assert.c:101
#8  0x00000000013ee866 in st_select_lex::print (this=0x7f3c0082dd28, thd=0x7f3c0081a000, str=0x7f3c3fd75bf0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB)) at /git/mysql-server_dbg/sql/sql_lex.cc:3148
#9  0x00000000012e5264 in subselect_single_select_engine::print (this=0x7f3c008b9e58, str=0x7f3c3fd75bf0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB)) at /git/mysql-server_dbg/sql/item_subselect.cc:3519
#10 0x00000000012dd0be in Item_subselect::print (this=0x7f3c008b9d30, str=0x7f3c3fd75bf0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB)) at /git/mysql-server_dbg/sql/item_subselect.cc:757
#11 0x0000000000e8fe47 in Item_equal::print (this=0x7f3c008bac98, str=0x7f3c3fd75bf0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB)) at /git/mysql-server_dbg/sql/item_cmpfunc.cc:7512
#12 0x0000000000e8b071 in Item_cond::print (this=0x7f3c0082d3c8, str=0x7f3c3fd75bf0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB)) at /git/mysql-server_dbg/sql/item_cmpfunc.cc:5967
#13 0x00000000013427ae in Opt_trace_struct::do_add (this=0x7f3c3fd75e70, key=0x1e7a8ce "resulting_condition", item=0x7f3c0082d3c8) at /git/mysql-server_dbg/sql/opt_trace.cc:372
#14 0x0000000000e3043b in Opt_trace_struct::add (this=0x7f3c3fd75e70, key=0x1e7a8ce "resulting_condition", item=0x7f3c0082d3c8) at /git/mysql-server_dbg/sql/opt_trace.h:594
#15 0x00000000014114a1 in optimize_cond (thd=0x7f3c0081a000, conds=0x7f3c0082d3c8, cond_equal=0x7f3c008babc0, join_list=0x7f3c0082c250, build_equalities=true, cond_value=0x7f3c0082c198) at /git/mysql-server_dbg/sql/sql_optimizer.cc:9745
#16 0x00000000013f9bc7 in JOIN::optimize (this=0x7f3c008ba8b0) at /git/mysql-server_dbg/sql/sql_optimizer.cc:230
#17 0x000000000146ed24 in st_select_lex::optimize (this=0x7f3c0082c0b0, thd=0x7f3c0081a000) at /git/mysql-server_dbg/sql/sql_select.cc:1012
#18 0x000000000146d46a in handle_query (thd=0x7f3c0081a000, lex=0x7f3c0081c210, result=0x7f3c008ba380, added_options=0, removed_options=0) at /git/mysql-server_dbg/sql/sql_select.cc:164
#19 0x0000000001424906 in execute_sqlcom_select (thd=0x7f3c0081a000, all_tables=0x7f3c0082d668) at /git/mysql-server_dbg/sql/sql_parse.cc:4843
#20 0x000000000141e332 in mysql_execute_command (thd=0x7f3c0081a000) at /git/mysql-server_dbg/sql/sql_parse.cc:2521
#21 0x000000000142584f in mysql_parse (thd=0x7f3c0081a000, parser_state=0x7f3c3fd77680) at /git/mysql-server_dbg/sql/sql_parse.cc:5255
#22 0x000000000141b458 in dispatch_command (thd=0x7f3c0081a000, com_data=0x7f3c3fd77dc0, command=COM_QUERY) at /git/mysql-server_dbg/sql/sql_parse.cc:1272
#23 0x000000000141a10e in do_command (thd=0x7f3c0081a000) at /git/mysql-server_dbg/sql/sql_parse.cc:852
#24 0x0000000001541c80 in handle_connection (arg=0x7f3c2e7ff260) at /git/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:300
#25 0x000000000174e31f in pfs_spawn_thread (arg=0x7f3c357e8e20) at /git/mysql-server_dbg/storage/perfschema/pfs.cc:2178
#26 0x00007f3c3f7badf5 in start_thread (arg=0x7f3c3fd78700) at pthread_create.c:308
#27 0x00007f3c3e4841ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
The attached tarball (1441419786.tar.gz) gives the testcase as an exact match of our system, including some handy utilities

$ vi 1441419786_mybase     # STEP1: Update the base path in this file (usually the only change required!). If you use a non-binary distribution, please update SOURCE_DIR location also
$ ./1441419786_init        # STEP2: Initializes the data dir
$ ./1441419786_start       # STEP3: Starts mysqld
$ ./1441419786_cl          # STEP4: To check mysqld is up
$ ./1441419786_run         # STEP5: Run the testcase with the mysql CLI (may not reproduce the issue, as the pquery binary was used for the original testcase reduction)
$ ./1441419786_run_pquery  # OPTIONAL: Run the testcase with the pquery binary
$ vi /dev/shm/1441419786/error.log.out  # STEP6: Verify the error log
$ ./1441419786_gdb         # OPTIONAL: Brings you to a gdb prompt with gdb attached to the used mysqld and attached to the generated core
$ ./1441419786_parse_core  # STEP7: Create 1441419786_STD.gdb and 1441419786_FULL.gdb; standard and full variables gdb stack traces
[5 Sep 2015 3:42] Roel Van de Paar
This bug is not reproducible using copy/paste of the SQL. Must use testcase outline above.
[5 Sep 2015 6:59] MySQL Verification Team
please upload the testcase ;)
[7 Sep 2015 9:04] Roel Van de Paar
Bug bundle :)

Attachment: 1441419786_bug_bundle.tar.gz (application/x-gzip, text), 999.04 KiB.

[9 Sep 2015 11:55] MySQL Verification Team
Hi Roel,

Thank you for the report and test case.
Observed that only 5.7.8 debug build is affected but 5.6.26/5.7.9/5.8.0 are not affected. I'll check internally on which bug fixed and keep posted you.

Thanks,
Umesh
[9 Sep 2015 11:56] MySQL Verification Team
// 5.7.8  only debug build affected

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-5.7.8-rc --datadir=/export/umesh/server/binaries/mysql-5.7.8-rc/78335 -v
bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/mysql-5.7.8-rc --datadir=/export/umesh/server/binaries/mysql-5.7.8-rc/78335 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.7.8-rc/78335/log.err 2>&1 &

-- release build

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8-rc: bin/mysql  -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.8-rc MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> DROP DATABASE test;CREATE DATABASE test;USE test;
ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist
Query OK, 1 row affected (0.00 sec)

Database changed
mysql> SET @@session.optimizer_trace="enabled=on";
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE t2(a BIGINT UNSIGNED);
Query OK, 0 rows affected (0.02 sec)

mysql> CREATE TEMPORARY TABLE t1(a INT,b INT);
Query OK, 0 rows affected (0.00 sec)

mysql> insert INTO t1(b)values (1),(2),(2),(2),(2);
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM t2 WHERE a=(SELECT a FROM t1)AND a=_LATIN1'';
ERROR 1242 (21000): Subquery returns more than 1 row
mysql>
mysql> SELECT * FROM t2 WHERE a=(SELECT a FROM t1)AND a=_LATIN1'';
ERROR 1242 (21000): Subquery returns more than 1 row
mysql> SELECT * FROM t2 WHERE a=(SELECT a FROM t1)AND a=_LATIN1'';
ERROR 1242 (21000): Subquery returns more than 1 row
mysql> SELECT * FROM t2 WHERE a=(SELECT a FROM t1)AND a=_LATIN1'';
ERROR 1242 (21000): Subquery returns more than 1 row
mysql> SELECT * FROM t2 WHERE a=(SELECT a FROM t1)AND a=_LATIN1'';
ERROR 1242 (21000): Subquery returns more than 1 row
mysql> SELECT * FROM t2 WHERE a=(SELECT a FROM t1)AND a=_LATIN1'';
ERROR 1242 (21000): Subquery returns more than 1 row

or even with pquery:

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8-rc/prn: ./1441419786_run_pquery
Executing testcase ./1441419786.sql against mysqld with socket /dev/shm/1441419786/socket.sock using pquery...
Infile is ./1441419786.sql
Database is test
Starting with 1 threads
User is root
Socket is /tmp/mysql_ushastry.sock
MySQL Connection Info: Localhost via UNIX socket
MySQL Client Info: 5.6.23-72.1
MySQL Server Info: 5.7.8-rc
* SUMMARY: 3/6 queries failed (50.00% were successful)

--debug build

// 5.7.8 

rm -rf 78335
bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-5.7.8-rc --datadir=/export/umesh/server/binaries/mysql-5.7.8-rc/78335 -v
bin/mysqld-debug --no-defaults --basedir=/export/umesh/server/binaries/mysql-5.7.8-rc --datadir=/export/umesh/server/binaries/mysql-5.7.8-rc/78335 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.7.8-rc/78335/log.err 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8-rc: bin/mysql  -uroot -S /tmp/mysql_ushastry.sock                                                                                       Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.8-rc-debug MySQL Community Server - Debug (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@session.optimizer_trace="enabled=on";
Query OK, 1 row affected (0.01 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
mysql> SET @@session.optimizer_trace="enabled=on";
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE t2(a BIGINT UNSIGNED);
CREATE TEMPORARY TABLE t1(a INT,b INT);
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TEMPORARY TABLE t1(a INT,b INT);
Query OK, 0 rows affected (0.01 sec)

mysql> insert INTO t1(b)values (1),(2),(2),(2),(2);
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM t2 WHERE a=(SELECT a FROM t1)AND a=_LATIN1'';
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> \q
Bye
[1]+  Aborted                 (core dumped) bin/mysqld-debug --no-defaults --basedir=/export/umesh/server/binaries/mysql-5.7.8-rc --datadir=/export/umesh/server/binaries/mysql-5.7.8-rc/78335 --core-file --socket=/tmp/mysql_ushastry.sock --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.7.8-rc/78335/log.err 2>&1
[9 Sep 2015 11:56] MySQL Verification Team
-- 5.7.8

(gdb) bt
#0  0x00007f8e1d31f771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x000000000178dcb9 in my_write_core (sig=6) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/mysys/stacktrace.c:247
#2  0x0000000000dfe1c8 in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f8e1bf255c9 in raise () from /lib64/libc.so.6
#5  0x00007f8e1bf26cd8 in abort () from /lib64/libc.so.6
#6  0x00007f8e1bf1e536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f8e1bf1e5e2 in __assert_fail () from /lib64/libc.so.6
#8  0x0000000001448491 in st_select_lex::print (this=0x7f8dac007158, thd=0x7f8dac000bc0, str=0x7f8defd685b0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB))
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_lex.cc:3148
#9  0x00000000013396fa in subselect_single_select_engine::print (this=0x7f8dac023f58, str=0x7f8defd685b0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB))
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/item_subselect.cc:3519
#10 0x00000000013311b6 in Item_subselect::print (this=0x7f8dac023e30, str=0x7f8defd685b0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB))
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/item_subselect.cc:757
#11 0x0000000000ebb25f in Item_equal::print (this=0x7f8dac024d98, str=0x7f8defd685b0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB))
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/item_cmpfunc.cc:7512
#12 0x0000000000eb621b in Item_cond::print (this=0x7f8dac0067f8, str=0x7f8defd685b0, query_type=(QT_TO_SYSTEM_CHARSET | QT_SHOW_SELECT_NUMBER | QT_NO_DEFAULT_DB))
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/item_cmpfunc.cc:5967
#13 0x0000000001398d21 in Opt_trace_struct::do_add (this=0x7f8defd68690, key=0x1fe9fce "resulting_condition", item=0x7f8dac0067f8)
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/opt_trace.cc:372
#14 0x0000000000e59da3 in Opt_trace_struct::add (this=0x7f8defd68690, key=0x1fe9fce "resulting_condition", item=0x7f8dac0067f8)
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/opt_trace.h:594
#15 0x000000000146bd65 in optimize_cond (thd=0x7f8dac000bc0, conds=0x7f8dac0067f8, cond_equal=0x7f8dac024cc0, join_list=0x7f8dac005680, build_equalities=true, cond_value=0x7f8dac0055c8)
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_optimizer.cc:9745
#16 0x00000000014539c7 in JOIN::optimize (this=0x7f8dac0249b0) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_optimizer.cc:230
#17 0x00000000014cb51b in st_select_lex::optimize (this=0x7f8dac0054e0, thd=0x7f8dac000bc0) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_select.cc:1012
#18 0x00000000014c9c18 in handle_query (thd=0x7f8dac000bc0, lex=0x7f8dac002c48, result=0x7f8dac024480, added_options=0, removed_options=0)
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_select.cc:164
#19 0x000000000148040d in execute_sqlcom_select (thd=0x7f8dac000bc0, all_tables=0x7f8dac006a98) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_parse.cc:4843
#20 0x00000000014791f8 in mysql_execute_command (thd=0x7f8dac000bc0) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_parse.cc:2521
#21 0x00000000014812c1 in mysql_parse (thd=0x7f8dac000bc0, parser_state=0x7f8defd6a5e0) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_parse.cc:5255
#22 0x000000000147617b in dispatch_command (thd=0x7f8dac000bc0, com_data=0x7f8defd6ae10, command=COM_QUERY)
    at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_parse.cc:1272
#23 0x0000000001474b8e in do_command (thd=0x7f8dac000bc0) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/sql_parse.cc:852
#24 0x00000000015a2c18 in handle_connection (arg=0x3969580) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/sql/conn_handler/connection_handler_per_thread.cc:300
#25 0x0000000001819bef in pfs_spawn_thread (arg=0x3a642d0) at /export/home/pb2/build/sb_0-15961582-1437395640.67/mysql-5.7.8-rc/storage/perfschema/pfs.cc:2178
#26 0x00007f8e1d31adf3 in start_thread () from /lib64/libpthread.so.0
#27 0x00007f8e1bfe647d in clone () from /lib64/libc.so.6
(gdb)

or even with pquery:

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8-rc/prn: ./1441419786_run_pquery
Executing testcase ./1441419786.sql against mysqld with socket /dev/shm/1441419786/socket.sock using pquery...
Infile is ./1441419786.sql
Database is test
Starting with 1 threads
User is root
Socket is /tmp/mysql_ushastry.sock
Error 2002: Can't connect to local MySQL server through socket '/tmp/mysql_ushastry.sock' (111)
* PQUERY: Unable to continue [2], exiting
[9 Sep 2015 11:57] MySQL Verification Team
// 5.7.9 - release/debug build not affected

rm -rf 78335
bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.9 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.9/78335 -v
bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.9 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.9/78335 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.7.9/78335/log.err 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9/prn: ./1441419786_run_pquery
Executing testcase ./1441419786.sql against mysqld with socket /dev/shm/1441419786/socket.sock using pquery...
Infile is ./1441419786.sql
Database is test
Starting with 1 threads
User is root
Socket is /tmp/mysql_ushastry.sock
MySQL Connection Info: Localhost via UNIX socket
MySQL Client Info: 5.6.23-72.1
MySQL Server Info: 5.7.9-enterprise-commercial-advanced
* SUMMARY: 3/6 queries failed (50.00% were successful)

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9/prn: ./1441419786_run_pquery
Executing testcase ./1441419786.sql against mysqld with socket /dev/shm/1441419786/socket.sock using pquery...
Infile is ./1441419786.sql
Database is test
Starting with 1 threads
User is root
Socket is /tmp/mysql_ushastry.sock
MySQL Connection Info: Localhost via UNIX socket
MySQL Client Info: 5.6.23-72.1
MySQL Server Info: 5.7.9-enterprise-commercial-advanced-debug
* SUMMARY: 3/6 queries failed (50.00% were successful)
[9 Sep 2015 20:44] Roel Van de Paar
Umesh, the pquery testcase has a connect failure
[9 Sep 2015 20:45] Roel Van de Paar
(The 5.7.8 one that is)
[29 Sep 2015 8:54] MySQL Verification Team
I'm still not seeing this issue with 5.7.9/5.7.10 debug/release builds with COPY/PASTE or CLI or even with pquery(only observed with 5.7.8 debug build):

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.10 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.10/78335 -v
bin/mysqld --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.10 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.10/78335 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.7.10/78335/log.err 2>&1 &

-- 5.7.10 release build

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10: bin/mysqld --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.10 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.10/78335 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.7.10/78335/log.err 2>&1 &
[1] 8490
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10: bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.10-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> source prn/1441419786.sql;
ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist
Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

ERROR 1242 (21000): Subquery returns more than 1 row
mysql> source prn/1441419786.sql;
Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

ERROR 1050 (42S01): Table 't1' already exists
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

ERROR 1242 (21000): Subquery returns more than 1 row
mysql> source prn/1441419786.sql;
Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

ERROR 1050 (42S01): Table 't1' already exists
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

ERROR 1242 (21000): Subquery returns more than 1 row
mysql>

// debug build

bin/mysqld-debug --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.10 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.10/78335 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.7.10/78335/log.err 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10: bin/mysqld-debug --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.10 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.10/78335 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.7.10/78335/log.err 2>&1 &
[1] 8854
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10:
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10: bin/mysql -uroot -S /tmp/mysql_ushastry.sock                                                                                 Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.10-enterprise-commercial-advanced-debug MySQL Enterprise Server - Advanced Edition Debug (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> source prn/1441419786.sql;
Query OK, 1 row affected (0.01 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

ERROR 1242 (21000): Subquery returns more than 1 row
mysql> source prn/1441419786.sql;
Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.01 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

ERROR 1050 (42S01): Table 't1' already exists
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

ERROR 1242 (21000): Subquery returns more than 1 row
mysql> source prn/1441419786.sql;
Query OK, 1 row affected (0.01 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

ERROR 1050 (42S01): Table 't1' already exists
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

ERROR 1242 (21000): Subquery returns more than 1 row
mysql> source prn/1441419786.sql;
Query OK, 1 row affected (0.01 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

ERROR 1050 (42S01): Table 't1' already exists
Query OK, 5 rows affected (0.01 sec)
Records: 5  Duplicates: 0  Warnings: 0

ERROR 1242 (21000): Subquery returns more than 1 row
mysql>

## with pquery

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10/prn: ./1441419786_run_pquery
Executing testcase ./1441419786.sql against mysqld with socket /dev/shm/1441419786/socket.sock using pquery...
Infile is ./1441419786.sql
Database is test
Starting with 1 threads
User is root
Socket is /tmp/mysql_ushastry.sock
MySQL Connection Info: Localhost via UNIX socket
MySQL Client Info: 5.6.23-72.1
MySQL Server Info: 5.7.10-enterprise-commercial-advanced-debug
* SUMMARY: 3/6 queries failed (50.00% were successful)
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10/prn: ./1441419786_run_pquery
Executing testcase ./1441419786.sql against mysqld with socket /dev/shm/1441419786/socket.sock using pquery...
Infile is ./1441419786.sql
Database is test
Starting with 1 threads
User is root
Socket is /tmp/mysql_ushastry.sock
MySQL Connection Info: Localhost via UNIX socket
MySQL Client Info: 5.6.23-72.1
MySQL Server Info: 5.7.10-enterprise-commercial-advanced-debug
* SUMMARY: 3/6 queries failed (50.00% were successful)
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10/prn: ./1441419786_run_pquery
Executing testcase ./1441419786.sql against mysqld with socket /dev/shm/1441419786/socket.sock using pquery...
Infile is ./1441419786.sql
Database is test
Starting with 1 threads
User is root
Socket is /tmp/mysql_ushastry.sock
MySQL Connection Info: Localhost via UNIX socket
MySQL Client Info: 5.6.23-72.1
MySQL Server Info: 5.7.10-enterprise-commercial-advanced-debug
* SUMMARY: 3/6 queries failed (50.00% were successful)
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10/prn:
[29 Sep 2015 22:56] Roel Van de Paar
Hi Umesh,

Okay - pquery output looks good now.

Thanks for the additional verification test!!