← Back to team overview

maria-developers team mailing list archive

Need to lock temporary tables?

 

>Description:
	InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock()
>How-To-Repeat:
	create table foo ( data int );

	create temporary table tmp_foo (select  * from foo limit 0);
	insert into tmp_foo (data) values (1);

	lock tables foo write;
	# add ", tmp_foo read" to the above, to avoid the error.
	#"LOCK TABLES is permitted (but ignored) for a TEMPORARY table."
	#    -- http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html

	delete from foo;
	# The next statement causes
	# InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock()
	insert into foo (select * from tmp_foo);
	unlock tables;

	drop table tmp_foo;
	drop table foo;

>Fix:
	Lock the temporary table, though mysql docs say you shouldn't have to.

>Submitter-Id:	<submitter ID>
>Originator:	
>Organization:
 
>MySQL support: [none | licence | email support | extended email support ]
>Synopsis:	temporary table wants a lock
>Severity:	non-critical
>Priority:	low
>Category:	mysql
>Class:		
>Release:	mysql-5.3.5-MariaDB-ga-mariadb113~squeeze ((MariaDB - http://mariadb.com/))
>C compiler:    gcc-4.4.real (Debian 4.4.5-8) 4.4.5
>C++ compiler:  g++-4.4.real (Debian 4.4.5-8) 4.4.5
>Environment:
	
System: Linux machibashiri 2.6.32-5-amd64 #1 SMP Mon Mar 7 21:35:22 UTC 2011 x86_64 GNU/Linux
Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc
GCC: Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8) 
Compilation info (call): CC='gcc -static-libgcc'  CFLAGS='-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized'  CXX='g++ -static-libgcc'  CXXFLAGS='-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized'  LDFLAGS=''  ASFLAGS=''
Compilation info (used): CC='gcc -static-libgcc'  CFLAGS=' -O2 -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized   -DUNIV_LINUX -DUNIV_LINUX'  CXX='g++ -static-libgcc'  CXXFLAGS=' -O2 -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized   -fno-implicit-templates -fno-exceptions -fno-rtti'  LDFLAGS=' -rdynamic '  ASFLAGS=''
LIBC: 
lrwxrwxrwx 1 root root 14 Apr 13  2011 /lib/libc.so.6 -> libc-2.11.2.so
-rwxr-xr-x 1 root root 1432968 Jan 23  2011 /lib/libc-2.11.2.so
-rw-r--r-- 1 root root 4433334 Jan 23  2011 /usr/lib/libc.a
-rw-r--r-- 1 root root 247 Jan 23  2011 /usr/lib/libc.so
Configure command: ../configure  '--build=x86_64-linux-gnu' '--host=x86_64-linux-gnu' '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-server-suffix=-mariadb113~squeeze' '--with-comment=(MariaDB - http://mariadb.com/)' '--with-system-type=debian-linux-gnu' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-pstack' '--with-fast-mutexes' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-big-tables' '--without-docs' '--with-extra-charsets=all' '--with-libwrap' '--with-ssl=/usr' '--with-libevent' '--without-readline' '--with-zlib-dir=' '--with-embedded-server' '--with-embedded-privilege-control' '--with-plugins=max-no-ndb' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CC=gcc -static-libgcc' 'CFLAGS=-O2!
  -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized' 'LDFLAGS=' 'CPPFLAGS=' 'CXX=g++ -static-libgcc' 'CXXFLAGS=-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized'