>Description:
The following sequencee of statements should cause a deadlock.

transaction | operation | object
------------+-----------+-------
          1 | write     | a
          2 | write     | b
          2 | read      | a
          1 | read      | b

It fails to do so with mysql-3.23.32 compiled with db-3.2.3h.
Instead the last read returns an empty set, although "b" exists --
it is just locked.

>How-To-Repeat:
Setup:
create table ta (id integer, x integer) type=BDB;
create table tb (id integer, x integer) type=BDB;
insert into ta values(0, 0);
insert into tb values(0, 0);

Then open 2 "mysql" shells end set AUTOCOMMIT=0 in both of them.
Then type in the first:
update ta set x = 1 where id = 0;

Then in the second:
update tb set x = 1 where id = 0;
select x from ta where id = 0;

And then in the first again:
select x from tb where id = 0;

This will return "Empty set (0.00 sec)", but it should detected
a deadlock.

>Fix:
I didn't look at the MySQL/BDB code.

>Submitter-Id:  <submitter ID>
>Originator:    Stefan Proels
>Organization:  i-TV-T AG
>MySQL support: none
>Synopsis:      Fails to detect a deadlock and returns an empty set instead.
>Severity:      critical
>Priority:      high
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-3.23.32 (Source distribution)

>Environment:
System: Linux itvt1 2.2.14 #1 Mon Mar 13 10:51:48 GMT 2000 i686 unknown
Architecture: i686

Some paths:  /usr/local/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
LIBC: 
lrwxrwxrwx   1 root     root           13 Mar  4  2000 /lib/libc.so.4 -> libc.so.4.7.6
-rwxr-xr-x   1 root     root       634880 Apr 29  1996 /lib/libc.so.4.7.6
-rwxr-xr-x   1 root     root      4061504 Mar 11  2000 /lib/libc.so.6
-rw-r--r--   1 root     root     19182842 Mar 11  2000 /usr/lib/libc.a
-rw-r--r--   1 root     root          178 Mar 11  2000 /usr/lib/libc.so
Configure command: ./configure  --with-tcp-port=3406 
--with-unix-socket-path=/tmp/mysql-bdb.sock --prefix=/usr/local/mysql-bdb
Perl: This is perl, version 5.005_03 built for i586-linux

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to