[ 
https://issues.apache.org/jira/browse/CALCITE-7627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18109282#comment-18109282
 ] 

Mihai Budiu commented on CALCITE-7627:
--------------------------------------

What is "valid" data depends clearly on the system under consideration. Each 
system has different limits for the values it supports, for example. So a 
plug-in based design would make most sense.

If there is a plug-in (hook) design, the question is "how are the policies 
expressed and how are they injected in the code generation data path"?

> 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)

Reply via email to