At 10:33 +1100 11/10/04, Daniel Kasak wrote:
Russell E Glaue wrote:

'order' is a reserved word.
I would rename that field, pronto!
In my opinion the bug is not in mysqldump, but in mysql allowing you to use a fieldname that is a reserved word.
And yes I know about the backticks that mysqlcc uses, but surely this causes more problems than it solves. See above example.


So if a word is reserved, a table with that same spelling cannot exist?

That's right. You can't ( you *shouldn't* be able to ) use reserved for table or field names.

If this is so, then why did mysql allow it to be created?

I really don't know. See my above comments.

order is indeed a reserved word, but it is easily possible to create a table that has order (or any other reserved word) as a column name if you quote it with identifier quoting characters (backticks):

http://dev.mysql.com/doc/mysql/en/Legal_names.html

As for mysqldump, if you use the command "mysqldump --help",
you get a list of alowable options.  One of them is this:

  -Q, --quote-names   Quote table and column names with a `

So if you add -Q or --quote-names to your mysqldump command, you should
get dump output that can be imported without the problems that you are
seeing.

This option is on by default in MySQL 4.1, by the way, which helps
forestall the issue.  It remains off in 4.0 by default so as not to
break existing 4.0 scripts that use mysqldump.

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to