apache / apache/doris

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

Open
#62,746 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
15.9k
Forks
3.9k
Avg merge
2d 23h
Merged PRs (30d)
520

Description

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) 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

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.