Skip to content

OrderBy is enclosed in double-quotes twice #45

@ivanmir

Description

@ivanmir

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions