[
https://issues.apache.org/jira/browse/CASSANDRA-17693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Avi Kivity updated CASSANDRA-17693:
-----------------------------------
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.
was:
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.
> Missing type checking on reused bind variables
> ----------------------------------------------
>
> Key: CASSANDRA-17693
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17693
> Project: Cassandra
> Issue Type: Bug
> Reporter: Avi Kivity
> Priority: Normal
> Attachments: bind-var-type-conflict.py
>
>
> 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.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]