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

OrderBy is enclosed in double-quotes twice #45

Open
ivanmir opened this issue Oct 15, 2020 · 0 comments
Open

OrderBy is enclosed in double-quotes twice #45

ivanmir opened this issue Oct 15, 2020 · 0 comments

Comments

@ivanmir
Copy link

ivanmir commented Oct 15, 2020

If you have columns A, B, C & D in a table, then the function quoteIdentifierIfNecessary from common.js will only work if you don't use the orderby clause. In that case, the code will execute twice and thus it will enclose the same string in double-quotes twice.
I've fixed this by changing the function to:

exports.quoteIdentifierIfNecessary = function quoteIdentifierIfNecessary(identifier){
if (!/^[A-Z_][A-Z_\d]+$/g.test(identifier)){
identifier = identifier.replace(/['"]+/g, '');
identifier = "\"" + identifier + "\"";
}
return identifier;
};

I'm pretty sure this is not the best way to fix this, but it works.
BTW: OData works with $select and $orderby parameters without double-quoted column names.

Maybe you could fix it - for those people that are still working on Hana 1.0 SP12 or even on SCP-Neo.

Best regards,
Ivan

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