ColdMillenium / jwpl

Automatically exported from code.google.com/p/jwpl
0 stars 0 forks source link

Importing sql #125

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run revisionmachine producing sql output
2. bzcat output_1.sql.bz2 | mysql jwpl_enwiki
3. boom

What is the expected output? What do you see instead?

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the 
manual that corresponds to your MariaDB server version for the right syntax to 
use near 'TYPE = MyISAM DEFAULT CHARSET utf8 COLLATE utf8_general_ci' at line 1

The line is:
CREATE TABLE IF NOT EXISTS revisions (PrimaryKey INT UNSIGNED NOT NULL 
AUTO_INCREMENT, FullRevisionID INTEGER UNSIGNED NOT NULL, RevisionCounter 
INTEGER UNSIGNED NOT NULL, RevisionID INTEGER UNSIGNED NOT NULL, ArticleID 
INTEGER UNSIGNED NOT NULL, Timestamp BIGINT NOT NULL, Revision MEDIUMTEXT NOT 
NULL, Comment MEDIUMTEXT, Minor TINYINT NOT NULL, ContributorName TEXT NOT 
NULL, ContributorId INTEGER UNSIGNED, ContributorIsRegistered TINYINT NOT NULL, 
PRIMARY KEY(PrimaryKey)) TYPE = MyISAM DEFAULT CHARSET utf8 COLLATE 
utf8_general_ci;

What version of the product are you using? On what operating system?
I want to import to MariaDB 5.5.36 on debian wheezy.

Original issue reported on code.google.com by lbene...@googlemail.com on 26 May 2014 at 5:20

GoogleCodeExporter commented 9 years ago
So far, we have only tested the DB import with mysql, not mariadb.
There might be subtle differences in the way the sql is handled.

Could you try importing in mysql in order to see whether this is really the 
reason.

-Torsten

Original comment by torsten....@gmail.com on 26 May 2014 at 6:55

GoogleCodeExporter commented 9 years ago
Creating the table 'by hand' 
[https://code.google.com/p/jwpl/wiki/InstructionsCSVImport] and piping 
everything but the first line didn't result in an error.

bzcat output_1.sql.bz2 | tail --line=+2 | mysql jwpl_enwiki

another way was calling mysql with parameter -f (force, Continue even if we get 
an SQL error. Sets abort-source-on-error to 0)

Original comment by lbene...@googlemail.com on 26 May 2014 at 8:40

GoogleCodeExporter commented 9 years ago
ok, great. So there seems to be some incompatibility with regard to SQL output, 
but there are two good solutions. Thanks for solving this.

Original comment by torsten....@gmail.com on 26 May 2014 at 9:02