Skip to content

Fix JSON function error handling when called from DuckDB engine#139

Merged
p1p1bear merged 1 commit into
alibaba:masterfrom
p1p1bear:fix_issue_136
Apr 9, 2026
Merged

Fix JSON function error handling when called from DuckDB engine#139
p1p1bear merged 1 commit into
alibaba:masterfrom
p1p1bear:fix_issue_136

Conversation

@p1p1bear
Copy link
Copy Markdown
Contributor

@p1p1bear p1p1bear commented Apr 9, 2026

When JSON functions (json_overlaps, json_depth, json_unquote) are called from DuckDB engine with invalid input, they previously triggered MySQL error handling (my_error) which is not appropriate in the DuckDB context.

This fix adds a m_caller_is_duckdb flag to the relevant JSON function classes so that when called from DuckDB, errors are thrown as C++ exceptions (duckdb::InvalidInputException) instead of MySQL errors, allowing DuckDB to handle them properly.

Fixes #136

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

When JSON functions (json_overlaps, json_depth, json_unquote) are called
from DuckDB engine with invalid input, they previously triggered MySQL
error handling (my_error) which is not appropriate in the DuckDB context.

This fix adds a `m_caller_is_duckdb` flag to the relevant JSON function
classes so that when called from DuckDB, errors are thrown as C++
exceptions (duckdb::InvalidInputException) instead of MySQL errors,
allowing DuckDB to handle them properly.

Fixes alibaba#136

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@p1p1bear p1p1bear merged commit 68ebfb1 into alibaba:master Apr 9, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mysqld crash at json_is_valid with release builds

2 participants