mysqldump SQL error on table named "table"

mysqldump SQL error on table named "table"

am 16.07.2002 20:28:53 von mysql.com

>Description:

mysqldump issues 'error in your SQL syntax' and dies when it encounters
a table named 'table' during complete dump.

>How-To-Repeat:

Create a table named 'table' (one field type text should suffice), then
attempt to run -

mysqldump --all-databases --opt > something.dump

mysqldump exits with -

/opt/mysql/bin/mysqldump: Got error: 1064: You have an error in your SQL
syntax near 'table READ /*!32311 LOCAL */' at line 1 when using LOCK
TABLES

>Fix:

Remove table named 'table'.

>Release: mysql-3.23.51 (Source distribution)

>Environment:
System: Linux 2.2.18 #1 Wed Feb 28 09:45:21 CST 2001 i686 unknown
Architecture: i686

Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc
/usr/bin/cc
GCC: Reading specs from
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Compilation info: CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS=''
LDFLAGS=''
LIBC:
lrwxrwxrwx 1 root root 13 Dec 21 2000 /lib/libc.so.6
-> libc-2.1.3.so
-rwxr-xr-x 1 root root 4105868 Dec 8 2001
/lib/libc-2.1.3.so
-rw-r--r-- 1 root root 20299228 Dec 8 2001 /usr/lib/libc.a
-rw-r--r-- 1 root root 178 Dec 8 2001 /usr/lib/libc.so
Configure command: ./configure --prefix=/opt/mysql --mandir=/usr/man
--enable-assembler --with-mysqld-user=mysqld --without-debug
Perl: This is perl, version 5.005_03 built for i386-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 bugs-thread12189@lists.mysql.com
To unsubscribe, e-mail

Re: mysqldump SQL error on table named "table"

am 16.07.2002 21:44:28 von Sinisa Milivojevic

mysql.com@ragweed.net writes:
> >Description:
>
> mysqldump issues 'error in your SQL syntax' and dies when it encounters
> a table named 'table' during complete dump.
>
> >How-To-Repeat:
>
> Create a table named 'table' (one field type text should suffice), then
> attempt to run -
>
> mysqldump --all-databases --opt > something.dump
>
> mysqldump exits with -
>
> /opt/mysql/bin/mysqldump: Got error: 1064: You have an error in your SQL
> syntax near 'table READ /*!32311 LOCAL */' at line 1 when using LOCK
> TABLES
>

Hi!

Can you get us a full query text ?

--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com


------------------------------------------------------------ ---------
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 bugs-thread12191@lists.mysql.com
To unsubscribe, e-mail

Re: mysqldump SQL error on table named "table"

am 16.07.2002 22:28:12 von mysql.com

As a test, I created a new database (bunk) with a single table called
'table', one field, type text. The outcome is the same regardless of the
'--all-databases --opt' arguments.

Started mysql with --log=/var/log/mysql.log -

-----

# /opt/mysql/bin/mysqldump bunk > something.dump
/opt/mysql/bin/mysqldump: Can't get info about table: 'table'
error: You have an error in your SQL syntax near 'table' at line 1
And the log contents -

-----
/opt/mysql/libexec/mysqld, Version: 3.23.51-log, started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
020716 15:18:36 4 Connect root@localhost on
4 Init DB bunk
4 Query show tables
4 Query SET OPTION SQL_QUOTE_SHOW_CREATE=0
4 Query show create table `table`
4 Query show fields from table
4 Quit
-----

# /opt/mysql/bin/mysqldump --opt bunk > something.dump
/opt/mysql/bin/mysqldump: Got error: 1064: You have an error in your SQL
syntax near 'table READ /*!32311 LOCAL */' at line 1 when using LOCK
TABLES


-----

020716 15:21:00 14 Connect root@localhost on
14 Init DB bunk
14 Query show tables
14 Query LOCK TABLES table READ /*!32311 LOCAL */
14 Quit

And in case there was any doubt,
/opt/mysql/bin/mysqldump Ver 8.22 Distrib 3.23.51, for pc-linux-gnu
(i686)

-----
mysql> use bunk;
Database changed
mysql> show tables;
+----------------+
| Tables_in_bunk |
+----------------+
| table |
+----------------+
1 row in set (0.00 sec)

mysql> show fields from table;
ERROR 1064: You have an error in your SQL syntax near 'table' at line 1
mysql> show fields from 'table';
ERROR 1064: You have an error in your SQL syntax near ''table'' at line
1
-----

Please let me know if you need anything else. Thanks for your
assistance.

On Tue, 2002-07-16 at 14:44, Sinisa Milivojevic wrote:
> mysql.com@ragweed.net writes:
> > >Description:
> >
> > mysqldump issues 'error in your SQL syntax' and dies when it encounters
> > a table named 'table' during complete dump.
> >
> > >How-To-Repeat:
> >
> > Create a table named 'table' (one field type text should suffice), then
> > attempt to run -
> >
> > mysqldump --all-databases --opt > something.dump
> >
> > mysqldump exits with -
> >
> > /opt/mysql/bin/mysqldump: Got error: 1064: You have an error in your SQL
> > syntax near 'table READ /*!32311 LOCAL */' at line 1 when using LOCK
> > TABLES
> >
>
> Hi!
>
> Can you get us a full query text ?
>
> --
> Regards,
> __ ___ ___ ____ __
> / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
> /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
> <___/ www.mysql.com
>


------------------------------------------------------------ ---------
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 bugs-thread12192@lists.mysql.com
To unsubscribe, e-mail

Re: mysqldump SQL error on table named "table"

am 17.07.2002 01:00:15 von Arthur Fuller

One can only assume that your intention is to subvert the tool. Any
intelligent user would avoid keywords. It's like naming some columns SELECT,
GROUPBY and FROM, and expecting the tool to respond intelligently. Why waste
your time? Your problem reminds me of the old sentence designed to derail AI
software: Bill sent me a Bill. Or upping the ante a bit, Buffalo buffalo
Buffalo buffalo Buffalo buffalo -- which is both a logically and
semantically correct sentence in English, but so what? Only my
capitalization helps you make sense of it, and you are a human not a parsing
program. What's the point of your problem? Rename the table to TableName or
something. Sheesh! Why are you wasting bandwidth with this non-problem?

Arthur

----- Original Message -----
From:
To:
Sent: Tuesday, July 16, 2002 2:28 PM
Subject: mysqldump SQL error on table named 'table'


> >Description:
>
> mysqldump issues 'error in your SQL syntax' and dies when it encounters
> a table named 'table' during complete dump.
>
> >How-To-Repeat:
>
> Create a table named 'table' (one field type text should suffice), then
> attempt to run -
>
> mysqldump --all-databases --opt > something.dump
>
> mysqldump exits with -
>
> /opt/mysql/bin/mysqldump: Got error: 1064: You have an error in your SQL
> syntax near 'table READ /*!32311 LOCAL */' at line 1 when using LOCK
> TABLES
>
> >Fix:
>
> Remove table named 'table'.
>
> >Release: mysql-3.23.51 (Source distribution)
>
> >Environment:
> System: Linux 2.2.18 #1 Wed Feb 28 09:45:21 CST 2001 i686 unknown
> Architecture: i686
>
> Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc
> /usr/bin/cc
> GCC: Reading specs from
> /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
> gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
> Compilation info: CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS=''
> LDFLAGS=''
> LIBC:
> lrwxrwxrwx 1 root root 13 Dec 21 2000 /lib/libc.so.6
> -> libc-2.1.3.so
> -rwxr-xr-x 1 root root 4105868 Dec 8 2001
> /lib/libc-2.1.3.so
> -rw-r--r-- 1 root root 20299228 Dec 8 2001 /usr/lib/libc.a
> -rw-r--r-- 1 root root 178 Dec 8 2001 /usr/lib/libc.so
> Configure command: ./configure --prefix=/opt/mysql --mandir=/usr/man
> --enable-assembler --with-mysqld-user=mysqld --without-debug
> Perl: This is perl, version 5.005_03 built for i386-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 bugs-thread12189@lists.mysql.com
> To unsubscribe, e-mail
>


------------------------------------------------------------ ---------
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 bugs-thread12193@lists.mysql.com
To unsubscribe, e-mail

Re: mysqldump SQL error on table named "table"

am 17.07.2002 04:11:54 von mysql.com

The table was created by an inexperienced user, and in any case,
mysqldump (imho) should skip over any such tables.

My apologies for whatever outside situation generated such a
nonproductive response.

On Tue, 2002-07-16 at 18:00, Arthur Fuller wrote:
> One can only assume that your intention is to subvert the tool. Any
> intelligent user would avoid keywords. It's like naming some columns SELECT,
> GROUPBY and FROM, and expecting the tool to respond intelligently. Why waste
> your time? Your problem reminds me of the old sentence designed to derail AI
> software: Bill sent me a Bill. Or upping the ante a bit, Buffalo buffalo
> Buffalo buffalo Buffalo buffalo -- which is both a logically and
> semantically correct sentence in English, but so what? Only my
> capitalization helps you make sense of it, and you are a human not a parsing
> program. What's the point of your problem? Rename the table to TableName or
> something. Sheesh! Why are you wasting bandwidth with this non-problem?
>
> Arthur
>
> ----- Original Message -----
> From:
> To:
> Sent: Tuesday, July 16, 2002 2:28 PM
> Subject: mysqldump SQL error on table named 'table'
>
>
> > >Description:
> >
> > mysqldump issues 'error in your SQL syntax' and dies when it encounters
> > a table named 'table' during complete dump.
> >
> > >How-To-Repeat:
> >
> > Create a table named 'table' (one field type text should suffice), then
> > attempt to run -
> >
> > mysqldump --all-databases --opt > something.dump
> >
> > mysqldump exits with -
> >
> > /opt/mysql/bin/mysqldump: Got error: 1064: You have an error in your SQL
> > syntax near 'table READ /*!32311 LOCAL */' at line 1 when using LOCK
> > TABLES
> >
> > >Fix:
> >
> > Remove table named 'table'.
> >
> > >Release: mysql-3.23.51 (Source distribution)
> >
> > >Environment:
> > System: Linux 2.2.18 #1 Wed Feb 28 09:45:21 CST 2001 i686 unknown
> > Architecture: i686
> >
> > Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc
> > /usr/bin/cc
> > GCC: Reading specs from
> > /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
> > gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
> > Compilation info: CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS=''
> > LDFLAGS=''
> > LIBC:
> > lrwxrwxrwx 1 root root 13 Dec 21 2000 /lib/libc.so.6
> > -> libc-2.1.3.so
> > -rwxr-xr-x 1 root root 4105868 Dec 8 2001
> > /lib/libc-2.1.3.so
> > -rw-r--r-- 1 root root 20299228 Dec 8 2001 /usr/lib/libc.a
> > -rw-r--r-- 1 root root 178 Dec 8 2001 /usr/lib/libc.so
> > Configure command: ./configure --prefix=/opt/mysql --mandir=/usr/man
> > --enable-assembler --with-mysqld-user=mysqld --without-debug
> > Perl: This is perl, version 5.005_03 built for i386-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 bugs-thread12189@lists.mysql.com
> > To unsubscribe, e-mail
> >
>


------------------------------------------------------------ ---------
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 bugs-thread12194@lists.mysql.com
To unsubscribe, e-mail

Re: mysqldump SQL error on table named "table"

am 17.07.2002 13:37:50 von Sinisa Milivojevic

mysql.com@ragweed.net writes:
> As a test, I created a new database (bunk) with a single table called
> 'table', one field, type text. The outcome is the same regardless of the
> '--all-databases --opt' arguments.
>
> Started mysql with --log=/var/log/mysql.log -
>

[skip]


Thank you for your contribution. This is our bug and we shall fix it
as soon as possible.

--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com


------------------------------------------------------------ ---------
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 bugs-thread12201@lists.mysql.com
To unsubscribe, e-mail

Re: mysqldump SQL error on table named "table"

am 17.07.2002 13:40:57 von Sinisa Milivojevic

mysql.com@ragweed.net writes:
> As a test, I created a new database (bunk) with a single table called
> 'table', one field, type text. The outcome is the same regardless of the
> '--all-databases --opt' arguments.
>
> Started mysql with --log=/var/log/mysql.log -
>
> -----
>
> # /opt/mysql/bin/mysqldump bunk > something.dump
> /opt/mysql/bin/mysqldump: Can't get info about table: 'table'
> error: You have an error in your SQL syntax near 'table' at line 1
> And the log contents -
>
> -----
> /opt/mysql/libexec/mysqld, Version: 3.23.51-log, started with:
> Tcp port: 3306 Unix socket: /tmp/mysql.sock
> Time Id Command Argument
> 020716 15:18:36 4 Connect root@localhost on
> 4 Init DB bunk
> 4 Query show tables
> 4 Query SET OPTION SQL_QUOTE_SHOW_CREATE=0
> 4 Query show create table `table`
> 4 Query show fields from table
> 4 Quit

Sorry, upon closer scrutiny I realised you used a reserved word for
your table name.

You can circumvent a problem by adding --quote-names in mysqldump options.

--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com


------------------------------------------------------------ ---------
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 bugs-thread12202@lists.mysql.com
To unsubscribe, e-mail