SLEEP rejects NULL and negative durations that MySQL accepts
Maintainers usually reply within 1 day
@XuPeng-SH is already working on this.
Since Nov 20, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with the sleepSeconds helper and the Sleep builtin, which the issue names as the places that reject NULL and negative arguments. The function is already marked Function_STRICT, so check whether the NULL check inside Sleep is redundant and whether negative values should return 0 without sleeping. Done when the repro queries SELECT SLEEP(NULL), SELECT SLEEP(-1) and SELECT SLEEP(0) return NULL, 0 and 0 without sleeping, and existing SLEEP tests still pass.
Written by the indexing model from the issue text.
Description
Bug
SLEEP() with a NULL or negative duration is rejected as an invalid argument. MySQL accepts both: SLEEP(NULL) returns NULL and does not sleep; SLEEP(-1) returns 0 and does not sleep.
Repro
SELECT SLEEP(NULL);
-- ERROR 20203: invalid argument sleep, bad value input contains null
SELECT SLEEP(-1);
-- ERROR 20203: invalid argument sleep, bad value input contains negative
SELECT SLEEP(0);
-- returns 0
Expected
SLEEP(NULL)returnsNULLand does not sleep.SLEEP(-1)andSLEEP(-0.5)return0and do not sleep.- Non-negative durations are unchanged (
SLEEP(0)still returns0).
Cause
sleepSeconds returns an error for any negative duration, and Sleep returns an error when the argument is NULL, instead of following the MySQL contract above. The function is already marked Function_STRICT, but the implementation still rejects NULL itself.
本操作由 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
-
[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
-
[Bug]: TestCreateAndDeleteHashBasedWithAccount times out creating its tenant database in Ubuntu CIPossibly taken @XuPeng-SH claimed this today. Openkind/bug needs-triage
matrixorigin/matrixone#33369 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in matrixorigin/matrixone
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pg-sharding/spqr#3314 ·
Maintainers usually reply within 1 day
-
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