You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Compatibility]: LAST_INSERT_ID(expr) is rejected in ODKU assignments #28163
@fengttt Agreed: we should not proceed with adding LAST_INSERT_ID(expr) solely to match MySQL. The compatibility difference is real, but this issue currently provides no concrete customer or framework dependency that justifies the expression's session-state side effects and their execution/retry/protocol maintenance cost.
I am pausing PR #28531 and keeping it Draft. The proposed product direction is to retain rejection of the one-argument form. The existing zero-argument LAST_INSERT_ID() behavior and its correctness work remain separate.
We can reconsider if a requirement supplies the actual application/framework and version, generated SQL, and why a transactionally correct alternative is unacceptable. A separate auto-commit UPDATE followed by SELECT is not a generally equivalent replacement for allocating a counter value.
The implementation is retained for reference; there is no request to resume CI repair or merge preparation while this direction stands. This records a scope decision, not a successful implementation or QA result. The issue remains open pending final disposition of the compatibility requirement; any eventual not-planned closure should describe that explicitly rather than claim the feature was fixed.
Following @fengttt's recommendation, we accept retaining rejection of LAST_INSERT_ID(expr) as an intentional MySQL compatibility limitation. The reported difference is valid, but no concrete customer or framework dependency has been provided to justify the session-state side effects and their execution, retry, and protocol maintenance cost.
This supersedes the earlier pending-decision note. Issue #28163 and PR #28531 are now closed; the proposed implementation was not merged. Closure records a decision not to add support, not a successful feature implementation or QA result.
The scope is the one-argument form, including standalone expressions, ODKU assignments, and prepared execution. The supported zero-argument LAST_INSERT_ID() and its correctness work remain separate. No particular error code or wording change is promised by this disposition.
We can reconsider if a concrete requirement provides the application/framework and version, actual SQL, and why a transactionally correct alternative is unacceptable. Existing implementation history remains available for reference.
Linux x86_64 standalone official binary, 4 CPUs, ~16 GiB container memory limit. SELECT VERSION() = 8.0.30-MatrixOne-v4.2.5. PyMySQL 1.2.3 client. Only fresh owned test schemas were used for SQL probes; the native Airflow diagnostic is a read-only SELECT against the retained test fixture.
Actual Behavior
Native application impact: 归档序列原分配方式失败。
ERROR 20203: invalid argument function last_insert_id, bad value [BIGINT]
Expected Behavior
Support LAST_INSERT_ID(expr), including setting and returning the connection-scoped value.
Steps to Reproduce
Use a dedicated fresh test schema (create one without DROP DATABASE), then run:
SELECT LAST_INSERT_ID(1);
Additional information
Native applications: Matomo.
This is release v4.2.5 evidence, not a claim that the same failure remains on current main.
Observation family MO-OBS-011. App-side workarounds do not constitute an engine fix.
All disclosed values are owned synthetic fixtures; no passwords, tokens, application cookies or raw private logs are attached.
Built and actually ran upstream main 02a2823c2007d5e4fb4ada148e93743df337551a, with git_version() = 02a2823, Go 1.27.1, Linux amd64, the official make build CPU entrypoint, gcc/g++, and separate fresh main cluster storage. Binary SHA-256: ce8b149f0da8c8a06ec8786c4d311795e6893420bd15be29d6e6b9cab44bb2f5. SQL checks ran 2026-10-12 06:04 UTC; upstream main was re-read before execution and still resolved to this SHA.
Comparison: official v4.2.5 / 1a44f3db3056e32975fde86ca0ab69a094996a3f (git_version() = 1a44f3d). Both sides used fresh owned schemas and identical regression fixture hashes. This checks the disclosed reproducer; complete native application workflows have not been rerun on main. No issue is being closed automatically.
SQL-LAST-INSERT-ID-ARG: stable known_failure → main known_failure
The same expected error signature still reproduces on main.
Fixture SHA-256: ce2bb1b927c579ff75f6d99643840783c248753d079f483b6cd56f8327ea6e81. A fresh SELECT 1 after the trigger succeeded: True.
SELECT LAST_INSERT_ID(1);
20203: invalid argument function last_insert_id, bad value [BIGINT]
Activity
Ariznawlll commentedon Sep 5, 2026
补充范围:该缺口并不局限于 ODKU assignment。最新
main(e7bb0572235ec4bac81eb098eb0ad8900f0065ab)连独立的一参数形式也会拒绝:MySQL 8.3 的第一条返回 4242,同时把当前会话的
LAST_INSERT_ID()设为 4242。PreparedStatement 和 ODKU 只是这一缺失 overload 的下游使用场景;根本范围是LAST_INSERT_ID(expr)整体不可用。fengttt commentedon Sep 13, 2026
It is not clear WHY we want to support this. Last_Insert_Id(expr) is an anti-feature that we should simply reject as error/not supported/invalid
VioletQwQ-0 commentedon Sep 15, 2026
@fengttt Agreed: we should not proceed with adding
LAST_INSERT_ID(expr)solely to match MySQL. The compatibility difference is real, but this issue currently provides no concrete customer or framework dependency that justifies the expression's session-state side effects and their execution/retry/protocol maintenance cost.I am pausing PR #28531 and keeping it Draft. The proposed product direction is to retain rejection of the one-argument form. The existing zero-argument
LAST_INSERT_ID()behavior and its correctness work remain separate.We can reconsider if a requirement supplies the actual application/framework and version, generated SQL, and why a transactionally correct alternative is unacceptable. A separate auto-commit UPDATE followed by SELECT is not a generally equivalent replacement for allocating a counter value.
The implementation is retained for reference; there is no request to resume CI repair or merge preparation while this direction stands. This records a scope decision, not a successful implementation or QA result. The issue remains open pending final disposition of the compatibility requirement; any eventual not-planned closure should describe that explicitly rather than claim the feature was fixed.
VioletQwQ-0 commentedon Sep 15, 2026
Final disposition: not planned
Following @fengttt's recommendation, we accept retaining rejection of
LAST_INSERT_ID(expr)as an intentional MySQL compatibility limitation. The reported difference is valid, but no concrete customer or framework dependency has been provided to justify the session-state side effects and their execution, retry, and protocol maintenance cost.This supersedes the earlier pending-decision note. Issue #28163 and PR #28531 are now closed; the proposed implementation was not merged. Closure records a decision not to add support, not a successful feature implementation or QA result.
The scope is the one-argument form, including standalone expressions, ODKU assignments, and prepared execution. The supported zero-argument
LAST_INSERT_ID()and its correctness work remain separate. No particular error code or wording change is promised by this disposition.We can reconsider if a concrete requirement provides the application/framework and version, actual SQL, and why a transactionally correct alternative is unacceptable. Existing implementation history remains available for reference.
dengn commentedon Oct 11, 2026
Application compatibility replay on official v4.2.5
Branch Name
Official stable release
v4.2.5; current main has not been retested for this report.Commit ID
1a44f3db3056e32975fde86ca0ab69a094996a3f(SELECT git_version()returns1a44f3d).Other Environment Information
Linux x86_64 standalone official binary, 4 CPUs, ~16 GiB container memory limit.
SELECT VERSION()=8.0.30-MatrixOne-v4.2.5. PyMySQL 1.2.3 client. Only fresh owned test schemas were used for SQL probes; the native Airflow diagnostic is a read-only SELECT against the retained test fixture.Actual Behavior
Native application impact: 归档序列原分配方式失败。
Expected Behavior
Support LAST_INSERT_ID(expr), including setting and returning the connection-scoped value.
Steps to Reproduce
Use a dedicated fresh test schema (create one without DROP DATABASE), then run:
Additional information
MO-OBS-011. App-side workarounds do not constitute an engine fix.dengn commentedon Oct 12, 2026
Runtime recheck on current main
Built and actually ran upstream main
02a2823c2007d5e4fb4ada148e93743df337551a, withgit_version()=02a2823, Go 1.27.1, Linux amd64, the officialmake buildCPU entrypoint, gcc/g++, and separate fresh main cluster storage. Binary SHA-256:ce8b149f0da8c8a06ec8786c4d311795e6893420bd15be29d6e6b9cab44bb2f5. SQL checks ran 2026-10-12 06:04 UTC; upstream main was re-read before execution and still resolved to this SHA.Comparison: official v4.2.5 /
1a44f3db3056e32975fde86ca0ab69a094996a3f(git_version()=1a44f3d). Both sides used fresh owned schemas and identical regression fixture hashes. This checks the disclosed reproducer; complete native application workflows have not been rerun on main. No issue is being closed automatically.SQL-LAST-INSERT-ID-ARG: stable
known_failure→ mainknown_failureThe same expected error signature still reproduces on main.
Fixture SHA-256:
ce2bb1b927c579ff75f6d99643840783c248753d079f483b6cd56f8327ea6e81. A freshSELECT 1after the trigger succeeded:True.Detailed SQL, assertions, source/build identity and JSON evidence (organization regression repository): https://github.com/matrixorigin/matrixone-app-regression/tree/01517d2f73abb5021ca545193c2af38ef653f278/evidence/main-02a2823