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

Single quote escape convention #1275

Closed
Eclesia opened this issue Jan 11, 2013 · 1 comment
Closed

Single quote escape convention #1275

Eclesia opened this issue Jan 11, 2013 · 1 comment

Comments

@Eclesia
Copy link

Eclesia commented Jan 11, 2013

In SQL to escape a single quote, a solution is to double the quote.

Currently in OrientDB we must use \'

Here are different cases where orientdb sql parser fails :

final OSchema schema = db.getMetadata().getSchema();
final OClass clazz = schema.createClass("test");
clazz.createProperty("strAtt", OType.STRING);

db.command(new OCommandSQL("INSERT INTO test(numericAtt) VALUES ('some escaped '' cote')")).execute();
// double single quote in the middle = fail -> will store the two quotes in the field value

db.command(new OCommandSQL("INSERT INTO test(numericAtt) VALUES ('some escaped cote''')")).execute();
// double single quote at the beginning = fail -> parsing error
db.command(new OCommandSQL("INSERT INTO test(numericAtt) VALUES ('''some escaped cote')")).execute();
// double single quote at the end =fail -> parsing error

I know orientdb sql is not a true sql, but preserving well knowned writings would be appreciated by users.

@lvca lvca added this to the 2.1 milestone Oct 4, 2014
@lvca lvca modified the milestones: 2.1-rc1, 2.1-rc2 Apr 1, 2015
@lvca lvca modified the milestones: 2.1-rc2, 2.1 GA May 5, 2015
@luigidellaquila luigidellaquila modified the milestones: 2.2, 2.1 GA Jul 7, 2015
@lvca lvca modified the milestones: 2.2.0-beta, 2.2.0-rc1 Dec 13, 2015
@lvca lvca modified the milestones: 2.2.0-rc1, 2.2.0 GA May 7, 2016
@robfrank robfrank modified the milestones: 2.2.0 GA, 2.2.1 May 18, 2016
@robfrank robfrank modified the milestones: 2.2.1, 2.2.x (next hotfix) Jun 8, 2016
@luigidellaquila
Copy link
Member

Sorry, this won't be implemented.

Thanks

Luigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants