SCM

Forum: bugs

Monitor Forum | Start New Thread Start New Thread
RE: segfault [ reply ]
By: Eric Harris-Braun on 2008-12-12 04:31
[forum:1004409]
What I did to get this to work was replace the offending regular expression with:

s/\\'/%%%%%/g; # convert quoted ' to %%%%%
s/'([^']*)'([),])/E'$1'$2/g; # replace 'string' with E'string'
s/%%%%%/\\'/g; # restore quoted '

It ain't pretty but it worked on my large dataset


RE: segfault [ reply ]
By: Ken Johanson on 2008-02-01 06:36
[forum:1003086]
It's also noteworthy that new default behavior of mysqldump (overrideable with --skip-extended-insert), is to create one insert statement per-table (no matter how large), which exacerbates the problem. And for some reason those stmnts dont segfault, they just get ignored (only a DDL statment is created for the table, the insert stmnt is missing)

RE: segfault [ reply ]
By: Ken Johanson on 2008-02-01 06:19
[forum:1003085]
Is there a way to, say, increases perl's mem limit to prevent this?

These are not large strings (for databases esp. with medium/large char columns) by any stretch, so its hard to use mysql2pgsql on large datasets.

RE: segfault [ reply ]
By: joe speigle on 2008-01-20 11:00
[forum:1003053]
I can reproduce the seg fault by making the insert string much longer than that.

http://osdir.com/ml/text.yaml.general/2005-02/msg00007.html

seems like long variables can cause perl to dump

and segfault. The above link has the same problem.


in our case, we have no included modules, so it should be easier to track down.
It is this line


s/'((?:.*?(?:\\')?.*?)*)'([),])/E'$1'$2/g;
# for the E'' see http://www.postgresql.org/docs/8.2/interactive/release-8-1.html

The regular expression in there is saying "anything and escaped qutoes and anything (repeated,repeated)" within single quotes.....is our string.
replacing that line with

s/'(.*?)'([),])/E'$1'$2/g;


does the trick. Just simplify the regular expression. But that converts

VALUES ('3\',5\' cAMP

to

(E'3\',5\E' cAMP

i.e. it escapes the escaped single apostrophe in the inserted value.

so the regular expression needs work.



segfault [ reply ]
By: David Bauman on 2008-01-20 10:15
[forum:1003050]
I'm getting a segfault when trying to convert a large mysql dump to pgsql... I've been able to recreate this using the following data, however, here's the odd part: it doesn't *always* segfault. It seems to have a 50% change of doing so. Increasing the data length in the INSERT part by a character or two will cause it to segfault every time on my system.

Here's the contents of my test.sql file which I'm able to reproduce this:

INSERT INTO `test_database` VALUES (12,345,6,7,8901234567,'1234567890123456789012345','12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234');

Powered By FusionForge