Hi Amro,

Back in 2014 you did some work on the FirebirdClientDriver to make it add
cast clauses around SQL parameters for Firebird. I'm hoping you may be able
to weigh in on this:

Consider these two SQL statements:

 select ... from StringClass stringclas0_
    where stringclas0_.StringValue like @p0;

 select ... from StringClass stringclas0_
    where stringclas0_.StringValue = @p0;

Given the way the regexp in FirebirdClientDriver is written, a cast will be
inserted for the parameter to like, but not for equality.

Without the cast, the second query fails with "arithmetic exception,
numeric overflow, or string truncation" if the parameter value is longer
than the length of the mapped column. Yes, if the query were executed, it
would return an empty result set, but I believe that is preferable to
getting an exception, considering that the parameter value may be entered
by a user. GT and LT raise the same error.

What's your take on this? Any particular reason to exclude this from the
regexp? Any suggestion?

Btw, the regexp from the driver is:
(?<![=<>]\s?|first\s?|skip\s?|between\s|between\s@
\bp\w+\b\sand\s)@\bp\w+\b(?!\s?[=<>])


/Oskar

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to