sql: gate functions in views and descriptor expressions in mixed-version state #70442
Labels
A-schema-descriptors
Relating to SQL table/db descriptor handling.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Describe the problem
Cockroach stores sql expressions in a number of places: views, default expressions, computed expressions, index predicates, on update expressions etc. These expressions may invoke functions. Functions (and probably other syntactic elements) can be introduced in new versions. Unfortunately, there's no code which exists today to validate that an expression uses only functions or syntax that is available at the current version. This is a problem in a mixed-version state where the gateway processing the SQL is using code newer than the current active cluster version.
To Reproduce
Let's consider the following in the
v20.2
<->v21.1
mixed state. Node 1 is running 21.1, other are running 20.2.soundex
is a new function in21.1
.Other node:
Expected behavior
We should probably prevent the creation of this table.
Additional context
This seems to not be so bad. The entity is unusable for writes, but things aren't really worse than that.
This was noted by @nvanbenschoten in #70204 (comment).
Jira issue: CRDB-10077
The text was updated successfully, but these errors were encountered: