SCM

Forum: bugs

Monitor Forum | Start New Thread Start New Thread
RE: Some bugs [ reply ]
By: Jose Duarte on 2008-08-04 14:17
[forum:1003825]
Hi Charlie

Re the year data type problem I'm not sure if I understand what's the problem exactly. Could you post an example of your input and the output you are getting.

Cheers

Jose

RE: Some bugs [ reply ]
By: joe speigle on 2008-08-03 17:08
[forum:1003822]
Charlie,

this is actually good news from our perspective. No major problems with major design structures of the mysql2pgsql.perl file in over a year, now that's progress. The little messed up substitutions, we can handle ~~~

As for the foreign-key constraints, there is a comandline flag which allows them to be written to a separate file.

The 'year' datatype problem hasn't been reported, guess not many out there using that datatype.

Problem, is how to fix them. I uploaded a file here and it wiped out lots of statistics about how many downloads we had, so we had to start again from zero. So, even if we could fix the little one-liner bugs, it might not be in the project's best interest as a whole. We've had problems getting set up here at pgfoundry, I still don't have lots of access and I don't think CVS is working yet, but I'm not sure. That was a while ago.

Some bugs [ reply ]
By: Charlie Clark on 2008-08-03 12:20
[forum:1003821]
In general mysql2pgsql does an excellent job, much better than mysqldump Postgres compatability mode. But I've just hit a couple of bugs:

Solution for MySQL's "year" type has a problem with $constraint_table_name

create table "kinopolis_film_"jahr"_constraint_table"

More interestingly is why you've gone with varchars for the data type as opposed to some form of integer.

I had one other error:

DROP TABLE IF EXISTS `kinopolis_filmGruppe`;
CREATE TABLE `kinopolis_filmGruppe` (
`id` int(10) unsigned NOT NULL auto_increment,
`film` varchar(50) NOT NULL,
`name` varchar(255) NOT NULL,
`sortorder` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` USING BTREE (`name`),
KEY `film` (`film`),
CONSTRAINT `film_gruppe` FOREIGN KEY (`film`) REFERENCES `kinopolis_film` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1113 DEFAULT CHARSET=utf8;

which leads to a single error in the unique constraint:

CREATE SEQUENCE "kinopolis_filmgruppe_id_seq" START WITH 1113 ;

CREATE TABLE "kinopolis_filmgruppe" (
"id" integer DEFAULT nextval('"kinopolis_filmgruppe_id_seq"') NOT NULL,
"film" varchar(50) NOT NULL,
"name" varchar(255) NOT NULL,
"sortorder" int NOT NULL,
primary key ("id"),
"unique" KEY name USING BTREE (name)
) ;
CREATE INDEX "kinopolis_filmgruppe_film_idx" ON "kinopolis_filmgruppe" USING btree ("film");
ALTER TABLE "kinopolis_filmgruppe" ADD FOREIGN KEY ("film") REFERENCES "kinopolis_film" ("id");

But my biggest problem is that the foreign key constraints are declared just after the table creation and will be ignored if the reference tables have not yet been created. Would it be possible to move all such alter statements to the end of the file?

Thanks

Charlie

Powered By FusionForge