Skip to content

SqlFunctionExpression for to_char inverts the arguments in the generated sql if the function name is uppercased #384

@iulianb

Description

@iulianb

I'm implementing a custom db expression and I've noticed the issue mentioned in the title. I've worked out the source of the issue in the OracleQuerySqlGenerator class of the Oracle.EntityFrameworkCore.Query.Sql.Internal namespace, the function that handles the translation of the TO_CHAR function inverts the indexes of the arguments. Not sure if it's intentional, although I can't understand why it would be.

new SqlFunctionExpression(
     // if this is uppercased then its arguments are inverted in the generated sql, it works fine when 
     // lowercased because the translation code tests for equality on the uppercased version
     "to_char", 
     new SqlExpression[]
     {
           // ...
     },
     nullable: false,
     argumentsPropagateNullability: new[] { false, false },
     type: args[0].Type,
     typeMapping: args[0].TypeMapping)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions