[
https://issues.apache.org/jira/browse/CALCITE-7627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18111969#comment-18111969
]
Mihai Budiu commented on CALCITE-7627:
--------------------------------------
It would be nice to separate this into a supporting framework, and a
user-defined part. The goal would be to make the user-defined part as simple
and clean as possible. I.e., specifying new policies should be easy, and the
boilerplate should be handled by boilerplate code in the AssignmentPolicy.
With this view of the world, what would the user-defined part of the
configuration be for one type (e.g., CHAR(N)) with this design?
> Enumerable DML should reject assignments that may lose data
> -----------------------------------------------------------
>
> Key: CALCITE-7627
> URL: https://issues.apache.org/jira/browse/CALCITE-7627
> Project: Calcite
> Issue Type: Bug
> Reporter: zzwqqq
> Assignee: zzwqqq
> Priority: Major
> Labels: pull-request-available
>
> Enumerable DML currently accepts some assignments that may lose data.
> One example is assigning a longer string to a shorter VARCHAR column:
> {code:sql}
> CREATE TABLE dept (deptno INTEGER NOT NULL, name VARCHAR(10));
> INSERT INTO dept
> VALUES (30, 'Engineering');
> {code}
> The Enumerable/server path can insert the value now. With their default
> settings, PostgreSQL, MySQL, and Oracle reject this case:
> https://onecompiler.com/postgresql/44sf3dz68
> https://onecompiler.com/mysql/44sf3efz4
> https://onecompiler.com/oracle/44sf3ewmh
> The assignment should produce a runtime error rather than truncating or
> accepting the value.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)