using of mysqldump V 8.22 and table names with special character #

using of mysqldump V 8.22 and table names with special character #

am 19.03.2004 13:57:07 von Rik van Druten

I've noticed a problem and cannot resolve it:

It's possible to create a table with a column name like '#s'. Making of the
mysqldump wil work als expected. But when I'll try to put the generetad SQL
back into mysql. I'll get a syntax error 1064 at line.

I'll think the parser has a problem with the # character. I couldn't find
the right solution for this problem.

example:

CREATE TABLE uits2 (
klant_id int(11) NOT NULL default '0',
naam char(81) NOT NULL default '',
#'i` bigint(21) NOT NULL default '0',
geen_einde double(17,0) default NULL ) TYPE=MyISAM;

____________________________________________________________ _____
MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: using of mysqldump V 8.22 and table names with special character #

am 19.03.2004 17:52:55 von Sinisa Milivojevic

Rik van Druten writes:
> I've noticed a problem and cannot resolve it:
>
> It's possible to create a table with a column name like '#s'. Making of the
> mysqldump wil work als expected. But when I'll try to put the generetad SQL
> back into mysql. I'll get a syntax error 1064 at line.
>
> I'll think the parser has a problem with the # character. I couldn't find
> the right solution for this problem.
>
> example:
>
> CREATE TABLE uits2 (
> klant_id int(11) NOT NULL default '0',
> naam char(81) NOT NULL default '',
> #'i` bigint(21) NOT NULL default '0',
> geen_einde double(17,0) default NULL ) TYPE=MyISAM;
>
> ____________________________________________________________ _____
> MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl
>
>

Not a bug.

mysqldump can quote names if the option is used.

Also, '#' is not allowed in column and table names.

--

Sincerely,

--
For technical support contracts, go to https://order.mysql.com/?ref=msmi
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB
/_/ /_/\_, /___/\___\_\___/ Full time Developer and Support Coordinator
<___/ www.mysql.com Larnaca, Cyprus

Meet the MySQL at User Conference ! (April 14-16, 2004)
http://www.mysql.com/uc2004/


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: using of mysqldump V 8.22 and table names with special character #

am 21.03.2004 20:58:06 von Sergei Golubchik

Hi!

On Mar 19, Rik van Druten wrote:
> I've noticed a problem and cannot resolve it:
>
> It's possible to create a table with a column name like '#s'. Making of the
> mysqldump wil work als expected. But when I'll try to put the generetad SQL
> back into mysql. I'll get a syntax error 1064 at line.
>
> I'll think the parser has a problem with the # character. I couldn't find
> the right solution for this problem.
>
> example:
>
> CREATE TABLE uits2 (
> klant_id int(11) NOT NULL default '0',
> naam char(81) NOT NULL default '',
> #'i` bigint(21) NOT NULL default '0',
> geen_einde double(17,0) default NULL ) TYPE=MyISAM;

% mysqldump --help
....
-Q, --quote-names Quote table and column names with backticks (`).
....

You should use --quote-names in mysqldump (unless your server is at
least 4.1.2) if you have non-alphanumeric characters in identifiers.

Regards,
Sergei

--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
<___/ www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: using of mysqldump V 8.22 and table names with special character #

am 22.03.2004 11:05:08 von Sergei Golubchik

Hi!

On Mar 22, Rik van Druten wrote:
> >You should use --quote-names in mysqldump (unless your server is at
> >least 4.1.2) if you have non-alphanumeric characters in identifiers.
>
> CREATE TABLE `test` ( `klant_id` int(11) NOT NULL default '0',
> `#i` bigint(21) NOT NULL default '0',
> `#d` bigint(21) NOT NULL default '0' ) TYPE=MyISAM;
>
> When using for example phpmysql it's possible to create a table like this.
> Also with mysqldump and options --opt -Q > test.sql.
> But when restoring with mysql < test.sql (mysqld ver. 4.0.10-gamma). I
> still get this error. I yust think that its strange when you can create
> table names with the `#` but can't restore.

First - please, ALWAYS cc: bugs@lists.mysql.com, or better if you feel
you found a bug, use http://bugs.mysql.com to report it.

Then - unfortunately, I failed to repeat the bug.
I created a table with `#'i` field. mysqldump dumped it correctly,
then I loaded it back - no error, dumped again - and I got absolutely
the same dump, so the table was restored ok.

4.0.10 is too old version, try the latest 4.0.18

Regards,
Sergei

--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
<___/ www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org