Details
-
Bug
-
Status: Open
-
Normal
-
Resolution: Unresolved
-
None
-
Correctness - API / Semantic Implementation
-
Normal
-
Normal
-
User Report
-
All
-
None
Description
A bind variable gets its type from its context (e.g. in INSERT INTO tab(a) VALUES(:var), :var has the same type as tab.a. But what if the same variable is used in contexts that have different types? Assume a and b have incompatible types:
INSERT INTO ks.tab (id, a, b) VALUES(:id, :a, :a)
The server should reject the query, but it doesn't.
I think what happens is that one :a shadows the other, so the other :a can't even get a value.
More complete reproducer attached.