Skip to content

Figure out type semantics to use for concatenation and similar cases #14719

@smitpatel

Description

@smitpatel

Suppose we have
var i = 5; //int parameter from closure
c.CustomerID which is mapped in database as nchar(5)
and when you have c.CustomerID + i in expression tree, we try to infer type.

  • Should type of parameter i be nchar(5)?
    • what if the value does not fit in length 5?
  • What should be type of resulting expression?
    • It cannot be nchar(5) because result of concatenation would be larger than that.
  • The translation generates this [c].[CustomerID] + CAST(@__i_0 AS nchar(5)) so we need to figure out exact type to use for casting purposes.

Few ideas around

  • Ignore length facets for string?
  • Ignore Fixed length too?

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions