Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not escaping slashes #54

Closed
ghost opened this issue Apr 1, 2014 · 4 comments
Closed

Not escaping slashes #54

ghost opened this issue Apr 1, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 1, 2014

ora2pg is generating this insert which fails:

INSERT INTO pp$provider_services (id,enabled,ext_service_id,priority,transform,provider_id,service_id,src,cdat,dealer_id) VALUES (30563049,'t',E'739556817',1,'t',25,499,E'var params;^M
var preparedParams;^M
preparedParams.put("phoneNumber", params.get("account"));^M
preparedParams.put("params[\''type\'']", "7");','2013-03-22 20:44:42',27249468);

Source text in Oracle for the SRC column is

var params;
var preparedParams;
preparedParams.put("phoneNumber", params.get("account"));
preparedParams.put("params[\'type\']", "7");

Proper escaping is:

=> select E'params[\\\'type\\\']';
 ?column?
------------------
 params[\'type\']
(1 row)

So basically for some reason ora2pg thinks the backslash should not be escaped at all, while the single quote should be doubled, which is wrong for E'' notation.

@ghost
Copy link
Author

ghost commented Apr 1, 2014

ora2pg v12.1
Oracle 10g

ora2pg config as in my other ticket, except the type is INSERT instead of COPY and I enabled file per table export.

@darold
Copy link
Owner

darold commented Apr 1, 2014

Hi Yuri,

That's right, last commit 872ad5b should fix this issue. Thanks for the report.

Best regards,

@ghost
Copy link
Author

ghost commented Apr 1, 2014

Thank you. Is it safe to use the build from that commit?

@darold
Copy link
Owner

darold commented Apr 1, 2014

Yes usually, the code on github is more stable than the tarball version.

@darold darold closed this as completed Apr 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant