Skip to content

INSERT overflow in stored procedure silently fails (no error, no data) with enable_insert_strict=true[Bug] #62746

@RuyimgByCN

Description

@RuyimgByCN

Search before asking

  • I had searched in the issues and found no similar issues.

Version

  • Apache Doris: doris-4.0.2-rc02-30d2df0459

  • version(): 5.7.99 (MySQL protocol compatibility value)

  • enable_insert_strict = true

  • sql_mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES

What's Wrong?

Environment:

  • Apache Doris: doris-4.0.2-rc02-30d2df0459
  • version(): 5.7.99 (MySQL protocol compatibility value)
  • enable_insert_strict = true
  • sql_mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES

Repro:

  1. Create table with sid DECIMAL(10,0)
  2. Direct INSERT of 10000000000 -> error
  3. Create procedure:
    DECLARE v_sid BIGINT DEFAULT 10000000000;
    INSERT INTO test_decimal_overflow(id, sid) VALUES (1, v_sid);
  4. CALL proc_test()

Actual:

  • CALL returns successfully
  • Updated Rows = 0
  • no row inserted
  • no visible error thrown to client

Expected:

  • same overflow error as direct INSERT, or at least an explicit error to client

What You Expected?

The stored procedure should throw the same overflow error as a direct INSERT when inserting an out-of-range value into a DECIMAL column.

Alternatively, the system should at least return an explicit error to the client instead of silently succeeding with 0 affected rows.

The behavior should be consistent with direct INSERT statements when enable_insert_strict=true.

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions