forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crosscluster/logical: handle user-defined types in SQL mode
Previously, using a user-defined type in SQL mode would fail because of a low level check in the execution engine that verifies that the input datum has the same type OID as the destination column. This does not work for LDR, since the input datums come directly from a source table in a different cluster, so user-defined types have different OIDs. This fixes it by setting the datum type to "unknown" before executing the insert query. The "unknown" type is what is normally used when any SQL statement is sent to CRDB without explicit type annotations/hints. When the execution engine sees this type, it will perform an automatic (and cheap) immutable assignment cast to change the datum to the appropriate type. Release note (ops change): Logical replication streams that reference tables with user-defined types can now be created with the `mode = immediate` option.
- Loading branch information
Showing
3 changed files
with
39 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters