Bug #6939 update with a select (subquery)
Submitted: 2 Dec 2004 10:29 Modified: 2 Dec 2004 12:29
Reporter: Daniel Pereira Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.0-alpha OS:Linux (RedHat 8.0)
Assigned to: CPU Architecture:Any

[2 Dec 2004 10:29] Daniel Pereira
Description:
It appears to crash when i do the folowing query:
UPDATE `tblILSparam` SET `value`=`value`+60 WHERE `name`='nbCountTx1' AND (SELECT `value` FROM `tblILS` WHERE `name`='ndbTX1Selected') = '0'

This query is made by a perl script.

Thanks 

----------------------------------------------------------------------------------------------

[root@sado mysql]# myisamchk --silent --force */*.MYI
myisamchk: MyISAM file bdee/tblButton.MYI
myisamchk: warning: 2 clients is using or hasn't closed the table properly
[root@sado mysql]# mysqld
mysqld        mysqld_multi  mysqld_safe   mysqldump
[root@sado mysql]# mysqld --log
Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
041202 10:09:24  Aborting

041202 10:09:24  mysqld: Shutdown Complete

[root@sado mysql]# mysqld --log -p
mysqld: unknown option '-p'
[root@sado mysql]# mysqld -p --log
mysqld: unknown option '-p'
[root@sado mysql]# su - mysql
-bash-2.05b$ mysqld
mysqld_multi  mysqld_safe   mysqldump
-bash-2.05b$ mysqld --log
-bash: mysqld: command not found
-bash-2.05b$ /sbin/mysqld --log
-bash-2.05b$ exit
logout

[root@sado mysql]# which mysql
/usr/bin/mysql
[root@sado mysql]# which mysqld
/usr/sbin/mysqld
[root@sado mysql]# su - mysql
-bash-2.05b$ /usr/sbin/mysqld --log
041202 10:10:20  InnoDB: Started
/usr/sbin/mysqld: ready for connections.
Version: '4.1.0-alpha-log'  socket: '/usr/local/mysql/mysql.sock'  port: 3306
041202 10:10:23  Slave I/O thread: error connecting to master 'rep_user@172.16.53.138:3306': Error: 'Can't connect to MySQL server on '172.16.53.138' (113)'  errno: 2003  retry-time: 60  retries: 86400
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
sort_buffer_size=2097144
max_used_connections=6
max_connections=100
threads_connected=7
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=0x8896860
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=0xbfddf0e8, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x80835ca
0x82bb768
0x80de41d
0x80addf9
0x81129a0
0x80bc819
0x80c2895
0x8090af6
0x8093619
0x808e3f3
0x8094be0
0x808d337
0x82b8f1c
0x82ec73a
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://www.mysql.com/doc/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 0x88aa530 = UPDATE `tblILSparam` SET `value`=`value`+60 WHERE `name`='nbCountTx1' AND (SELECT `value` FROM `tblILS` WHERE `name`='ndbTX1Selected') = '0'
thd->thread_id=6

Successfully dumped variables, if you ran with --log, take a look at the
details of what thread 6 did to cause the crash.  In some cases of really
bad corruption, the values shown above may be invalid.

The manual page at http://www.mysql.com/doc/C/r/Crashing.html contains
information that should help you find out what is causing the crash.

How to repeat:
To repeat the bug simple use the query:
UPDATE `tblILSparam` SET `value`=`value`+60 WHERE `name`='nbCountTx1' AND (SELECT `value` FROM `tblILS` WHERE `name`='ndbTX1Selected') = '0'

This query don't crash always the mysql server.
[2 Dec 2004 12:29] Georg Richter
Thank you for taking the time to report a problem.  Unfortunately
you are not using a current version of the product your reported a
problem with -- the problem might already be fixed. Please download
a new version from http://www.mysql.com/downloads/

If you are able to reproduce the bug with one of the latest versions,
please change the version on this bug report to the version you
tested and change the status back to "Open".  Again, thank you for
your continued support of MySQL.