Bug #14617 | Executing procedure from other database which has error, results in crash | ||
---|---|---|---|
Submitted: | 3 Nov 2005 18:29 | Modified: | 25 Jan 2006 14:19 |
Reporter: | Geert Vanderkelen | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S2 (Serious) |
Version: | 5.0.16-BK, 5.0.15 | OS: | Linux (Linux, Windows) |
Assigned to: | Magnus BlÄudd | CPU Architecture: | Any |
[3 Nov 2005 18:29]
Geert Vanderkelen
[4 Nov 2005 7:43]
Valeriy Kravchuk
Verified also on Windows XP with 5.0.15 and Fedora Core 1 Linux with 5.0.16-BK (ChangeSet@1.1957.1.11, 2005-11-01 12:15:08-08:00, jimw@mysql.com), just as described: [openxs@Fedora 5.0]$ bin/mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 5.0.16 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> DROP PROCEDURE IF EXISTS test.telephone_dir; Query OK, 0 rows affected, 1 warning (0,13 sec) mysql> DROP TABLE IF EXISTS test.employees; Query OK, 0 rows affected, 1 warning (0,07 sec) mysql> vCREATE TABLE test.employees ( name varchar(20), telephone varchar(20)); Query OK, 0 rows affected (0,02 sec) mysql> DELIMITER // mysql> CREATE PROCEDURE test.telephone_dir (OUT param1 INT) -> BEGIN -> SELECT name, telephone INTO param1 FROM employees; -> END; -> // Query OK, 0 rows affected (0,03 sec) mysql> DELIMITER ; mysql> SET @c = 0; Query OK, 0 rows affected (0,05 sec) mysql> CALL test.telephone_dir(@c); ERROR 2013 (HY000): Lost connection to MySQL server during query mysql> Number of processes running now: 0 051104 10:32:35 mysqld restarted This produced the following in the error log: 051104 10:23:07 InnoDB: Started; log sequence number 0 26172849 051104 10:23:07 [Note] /home/openxs/dbs/5.0/libexec/mysqld: ready for connections. Version: '5.0.16' socket: '/tmp/mysql.sock' port: 3306 Source distribution 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. key_buffer_size=8388600 read_buffer_size=131072 max_used_connections=1 max_connections=100 threads_connected=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 225791 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. thd=0x924e7a0 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... Cannot determine thread, fp=0xb8dea83c, backtrace may not be correct. Stack range sanity check OK, backtrace follows: 0x814d6c5 0x64ef18 0x2 0x80fff7f 0x823b282 0x8165473 0x8167ea6 0x815f1b6 0x815ed71 0x815e1de 0x64879c 0x49527a New value of fp=(nil) failed sanity check, terminating stack trace! Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved stack trace is much more helpful in diagnosing the problem, so please do resolve it Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 0x927e040 = CALL test.telephone_dir(@c) thd->thread_id=1 The manual page at http://www.mysql.com/doc/en/Crashing.html contains information that should help you find out what is causing the crash. Number of processes running now: 0 051104 10:32:35 mysqld restarted
[25 Jan 2006 14:19]
Konstantin Osipov
This must have been fixed already, probably is a duplicate of Bug#13587: kostja@dragonfly:~> mysql5 -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 5.0.19-valgrind-max-debug Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> USE world; Database changed mysql> mysql> DROP PROCEDURE IF EXISTS test.telephone_dir; Query OK, 0 rows affected (0.00 sec) mysql> DROP TABLE IF EXISTS test.employees; Query OK, 0 rows affected (0.00 sec) mysql> CREATE TABLE test.employees ( name varchar(20), telephone varchar(20)); Query OK, 0 rows affected (0.02 sec) mysql> mysql> -- Following SP produces an error when executing it: mysql> -- ERROR 1222 (21000) at line 23: The used SELECT statements have a mysql> -- different number of columns mysql> DELIMITER // mysql> CREATE PROCEDURE test.telephone_dir (OUT param1 INT) -> BEGIN -> SELECT name, telephone INTO param1 FROM employees; -> END; -> // Query OK, 0 rows affected (0.00 sec) mysql> DELIMITER ; mysql> mysql> -- Now call the procedure from the test database. mysql> -- Note: we are still in 'world' database, or have no current database. mysql> SET @c = 0; Query OK, 0 rows affected (0.00 sec) mysql> CALL test.telephone_dir(@c); ERROR 1222 (21000): The used SELECT statements have a different number of columns mysql> SELECT @c; +------+ | @c | +------+ | 0 | +------+ 1 row in set (0.00 sec) mysql> CALL test.telephone_dir(@c); ERROR 1222 (21000): The used SELECT statements have a different number of columns mysql> select version(); +---------------------------+ | version() | +---------------------------+ | 5.0.19-valgrind-max-debug | +---------------------------+ 1 row in set (0.00 sec) mysql>