[Bug]: DECIMAL/FLOAT/DOUBLE scale > precision error always names a hard-coded column 'a'
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #33364 by @MatrixAdventurer — closed without merging
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
The issue identifies five checks in mysql_sql.y; start by reading those type rules and how parser errors receive column names for regular columns and CAST targets. Compare the resulting errors with the MySQL 8.4 examples in the issue, including the stray ). Done means the error reports the appropriate column name (empty for CAST) without the extra parenthesis.
Written by the indexing model from the issue text.
Description
Is there an existing issue for the same bug?
- I have checked the existing issues (searched
M must be >= D,column 'a',decimal(M,D)).
Branch Name
main (9bf005bf)
Describe the bug
When a DECIMAL/NUMERIC/FLOAT/DOUBLE type has a scale larger than its precision, the parser error always names a column 'a'. It does this for every column name, and also for a CAST target, which has no column at all. The message also has a stray ).
The five M must be >= D checks in mysql_sql.y all use the literal string "... M must be >= D (column 'a'))". The type rule does not know the column name, so the name is just a hard-coded placeholder. Users looking at a wide table get pointed at a column that may not exist.
Steps to reproduce
CREATE TABLE t (id INT PRIMARY KEY, price DECIMAL(5,6));
CREATE TABLE t2 (ratio DOUBLE(3,4));
SELECT CAST(1 AS DECIMAL(10,11));
Expected behavior
The error must not name a column that the statement does not have. MySQL 8.4 reports error 1427 For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'price'). (and (column '') for CAST).
Actual behavior (MatrixOne main 9bf005bf)
CREATE TABLE t (id INT PRIMARY KEY, price DECIMAL(5,6));
-- ERROR 1064: SQL parser error: ... For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'a')) at line 1 column 54 near "));";
SELECT CAST(1 AS DECIMAL(10,11));
-- ERROR 1064: SQL parser error: ... M must be >= D (column 'a')) at line 1 column 31 near "));";
Additional information
Single-node mo-service -launch etc/launch/launch.toml.
本操作由 LW 授权的 Grok Bot 智能体执行。
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 312
- Avg merge
- 22h 59m
- Merged PRs (30d)
- 736
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from matrixorigin/matrixone
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
matrixorigin/matrixone#33363 ·
Maintainers usually reply within 1 day
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
matrixorigin/matrixone#33362 ·
Maintainers usually reply within 1 day
-
SLEEP rejects NULL and negative durations that MySQL acceptsPossibly taken @XuPeng-SH claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
matrixorigin/matrixone#32653 ·
Maintainers usually reply within 1 day
-
[Bug]: TestChangeWatchProxy loses its first tenant connection during PingContext in Ubuntu CIPossibly taken @XuPeng-SH claimed this today. Openkind/bug needs-triage
matrixorigin/matrixone#33371 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug]: TestDaemonClaimSQLRoundTrip exhausts its shared deadline during the stale claim update in Ubuntu CIPossibly taken @XuPeng-SH claimed this today. Openkind/bug needs-triage
matrixorigin/matrixone#33370 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in matrixorigin/matrixone
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zalando/postgres-operator#3257 ·
Maintainers usually reply within 2 days
-
[inputs.internal] README lists go_version tag on internal_gather instead of internal_agentPossibly taken @cvas22 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
influxdata/telegraf#20264 ·
Maintainers usually reply within 1 day
-
[Bug] Standalone migration breaks existing Ingress routes using the envoy-http Service port nameOpenaccepted bug wg/enterprise-environment
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#7483 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
stacklok/toolhive-catalog#2076 ·
Maintainers usually reply within 1 day