Bug 166681 - mysqldump does not properly backtick table or column names
mysqldump does not properly backtick table or column names
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: mysql (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
RHEL3U7NAK
:
Depends On:
Blocks: 170417
  Show dependency treegraph
 
Reported: 2005-08-24 12:06 EDT by Jeff Blasius
Modified: 2013-07-02 23:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-19 14:55:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeff Blasius 2005-08-24 12:06:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050816 Firefox/1.0.6

Description of problem:
I need to transfer a ~1GB mysql DB from an AS3 box to AS4. When the db is dumped using "mysqldump -a --all-databases -uxxxxxx -pxxxx > file" or "mysqldump --opt --all-databases -uxxxxxx -pxxxx > file" the database, table, and columns are not properly quoted using backticks. So when I load the .sql I get the error below.   

# mysql -uroot < /tmp/mysql_dump.sql
ERROR 1064 (42000) at line 38: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'before 1975 tinyint(4) default NULL,
  1975-1994 tinyint(4) default NULL,
  1995' at line 7

The table it's trying to load looks like this:
-- MySQL dump 8.23
--
-- Host: localhost    Database:
---------------------------------------------------------
-- Server version       3.23.58

CREATE TABLE raceexam (
  article varchar(200) default NULL,
  title varchar(200) default NULL,
  author varchar(100) default NULL,
  author2 varchar(200) default NULL,
  year varchar(50) default NULL,
  before 1975 tinyint(4) default NULL,
  1975-1994 tinyint(4) default NULL,
  1995-1999 tinyint(4) default NULL,
  2000- tinyint(4) default NULL,
  volume/page# varchar(50) default NULL,
  suggested pages varchar(50) default NULL,
  publisher varchar(100) default NULL,
  originating school varchar(50) default NULL,
  originating year varchar(50) default NULL,
  multiple lists tinyint(4) default NULL,
  delete? tinyint(4) default NULL,
  African Americans tinyint(4) default NULL,
  Latino/as tinyint(4) default NULL,
  Asian Americans tinyint(4) default NULL,
  Native Americans tinyint(4) default NULL,
  methodology tinyint(4) default NULL,
  race/ethnicity theory tinyint(4) default NULL,
  (general) racial and ethnic politics tinyint(4) default NULL,
  Comparative Politics tinyint(4) default NULL,
  public opinion tinyint(4) default NULL,
  political psychology tinyint(4) default NULL,
  history tinyint(4) default NULL,
  cross-group coalitions tinyint(4) default NULL,
  political participation tinyint(4) default NULL,
  social movements tinyint(4) default NULL,
  Parties tinyint(4) default NULL,
  Federalism/Intergovernmental Relations tinyint(4) default NULL,
  Institutions/APD tinyint(4) default NULL,
  Congress/representation tinyint(4) default NULL,
  Presidency tinyint(4) default NULL,
  Courts/Law tinyint(4) default NULL,
  Critical Race Theory tinyint(4) default NULL,
  Political Theory/Thought tinyint(4) default NULL,
  Race and Classical Western Thought tinyint(4) default NULL,
  Feminist Theory tinyint(4) default NULL,
  queer theory tinyint(4) default NULL,
  Marxist Analysis tinyint(4) default NULL,
  multiculturalism tinyint(4) default NULL,
  post-colonial theory tinyint(4) default NULL,
  nationalism tinyint(4) default NULL,
  Conservatives of Color tinyint(4) default NULL,
  public policy tinyint(4) default NULL,
  urban politics tinyint(4) default NULL,
  group consciousness tinyint(4) default NULL,
  (im)migration tinyint(4) default NULL,
  institutions tinyint(4) default NULL,
  International Relations tinyint(4) default NULL,
  id int(11) NOT NULL auto_increment,
  PRIMARY KEY  (id)
) TYPE=MyISAM;



Version-Release number of selected component (if applicable):
mysql-3.23.58-15.RHEL3.1

How reproducible:
Always

Steps to Reproduce:
1. Create a database and table with spaces or special characters
2. Dump the database using mysqldump
3. Load the database on another machine.
  

Additional info:
Comment 1 Tom Lane 2005-08-24 13:00:14 EDT
Thanks for the report.  Unfortunately we're past the window for new minor fixes
for the next quarterly update, so it'll be a few months before a fix makes it
out the door.  In the meantime, you might try using mysqlhotcopy to transfer the
data, instead.
Comment 5 RHEL Product and Program Management 2007-10-19 14:55:27 EDT
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
 
For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/
 
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

Note You need to log in before you can comment on or make changes to this bug.