>Description: A SELECT statement fails if you have table aliases and use table locking with the LOCK command >How-To-Repeat: DROP TABLE IF EXISTS CK1; CREATE TABLE CK1 ( ID INT UNSIGNED NOT NULL, PRIMARY KEY(ID) ); LOCK TABLES CK1 READ; # you must have locking privileges SELECT * FROM CK1; # works SELECT * FROM CK1 AS SOME_ALIAS; # fails, error 1100: Table 'SOME_ALIAS' was not locked with LOCK TABLES UNLOCK TABLES; >Fix: Do not check for aliases, but for table names.
>Submitter-Id: <submitter ID> >Originator: Christian Kohlschuetter >Organization: NewsClub.de >MySQL support: none >Synopsis: Locking problem with SELECT-aliases >Severity: serious >Priority: high >Category: mysql >Class: sw-bug >Release: mysql-4.0.7-gamma (Official MySQL RPM) >Server: /usr//bin/mysqladmin Ver 8.38 Distrib 4.0.7-gamma, for pc-linux on i686 Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Server version 4.0.7-gamma-Max Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/lib/mysql/mysql.sock Uptime: 1 hour 1 min 51 sec Threads: 2 Questions: 1870 Slow queries: 0 Opens: 93 Flush tables: 1 Open tables: 7 Queries per second avg: 0.504 >C compiler: 2.95.3 >C++ compiler: 2.95.3 >Environment: System: Linux x1.localnet 2.4.19-16mdk #1 Fri Sep 20 18:15:05 CEST 2002 i686 unknown unknown GNU/Linux Architecture: i686 Some paths: /usr//bin/perl /usr//bin/make /usr//bin/gmake /usr//bin/gcc /usr//bin/cc GCC: Reading specs from /usr//bin/../lib/gcc-lib/i586-mandrake-linux-gnu/3.2.1/specs Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java --host=i586-mandrake-linux-gnu --with-system-zlib Thread model: posix gcc version 3.2.1 (Mandrake Linux 9.1 3.2.1-2mdk) Compilation info: CC='gcc' CFLAGS='-O6 -fno-omit-frame-pointer -mpentium' CXX='gcc' CXXFLAGS='-O6 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mpentium' LDFLAGS='' ASFLAGS='' LIBC: lrwxrwxrwx 1 root root 13 Jan 1 13:43 /lib/libc.so.6 -> libc-2.3.1.so -rwxr-xr-x 1 root root 1224712 Dez 24 10:57 /lib/libc-2.3.1.so -rw-r--r-- 1 root root 204 Dez 24 10:45 /usr/lib/libc.so Configure command: ./configure '--disable-shared' '--with-mysqld-ldflags=-all-static' '--with-client-ldflags=-all-static' '--without-berkeley-db' '--with-innodb' '--without-vio' '--without-openssl' '--enable-assembler' '--enable-local-infile' '--with-mysqld-user=mysql' '--with-unix-socket-path=/var/lib/mysql/mysql.sock' '--prefix=/' '--with-extra-charsets=complex' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--infodir=/usr/share/info' '--includedir=/usr/include' '--mandir=/usr/share/man' '--with-embedded-server' '--enable-thread-safe-client' '--with-comment=Official MySQL RPM' 'CC=gcc' 'CFLAGS=-O6 -fno-omit-frame-pointer -mpentium' 'CXXFLAGS=-O6 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mpentium' 'CXX=gcc' --------------------------------------------------------------------- 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