>Description:
MySQL doesn't allow me to use a sub-select in an update if
the subselect happens to be from the same table.
>How-To-Repeat:
mysql> use test;
mysql> create table T(lfd int, foo int);
mysql> insert into T (lfd, foo) values ( ( select max( lfd ) + 1 from T), 123);
ERROR 1093: You can't specify target table 'T' for update in FROM clause
>Fix:
Use PostgreSQL or Oracle or ..., it works with them ?!?
>Submitter-Id: <submitter ID>
>Originator: Matthias Urlichs
>Organization:
noris network AG, Nuernberg, Germany
>MySQL support: licence
>Synopsis: Update with sub-select from same table fails
>Severity: serious
>Priority: medium
>Category: mysql
>Class: sw-bug
>Release: mysql-4.1.0-alpha (from BitKeeper, as of 2003-03-01)
>C compiler: gcc.real (GCC) 3.2.3 20030221 (Debian prerelease)
>C++ compiler: g++.real (GCC) 3.2.3 20030221 (Debian prerelease)
>Environment:
System: Linux play.smurf.noris.de 2.4.19-586tsc #1 Sun Oct 6 18:00:21 EST 2002 i686
unknown unknown GNU/Linux
Architecture: i686
Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu
--enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.3 20030221 (Debian prerelease)
Compilation info: CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' LDFLAGS='' ASFLAGS=''
LIBC:
lrwxrwxrwx 1 root root 13 2003-02-28 17:59 /lib/libc.so.6 ->
libc-2.3.1.so
-rwxr-xr-x 1 root root 1104072 2003-02-25 14:46 /lib/libc-2.3.1.so
-rw-r--r-- 1 root root 2337976 2003-02-25 14:47 /usr/lib/libc.a
-rw-r--r-- 1 root root 178 2003-02-25 14:47 /usr/lib/libc.so
Configure command: ./configure '--prefix=/usr' '--exec-prefix=/usr'
'--libexecdir=/usr/sbin' '--datadir=/usr/share' '--sysconfdir=/etc/mysql'
'--localstatedir=/var/lib/mysql' '--includedir=/usr/include'
'--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-shared'
'--enable-static' '--enable-thread-safe-client' '--enable-assembler'
'--enable-local-infile' '--with-raid'
'--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql'
'--with-libwrap' '--with-client-ldflags=-lstdc++' '--with-embedded-server'
'--with-vio' '--with-openssl' '--without-docs' '--without-bench' '--without-readline'
'--with-extra-charsets=all' '--with-debug' '--with-innodb'
---------------------------------------------------------------------
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