[Bug]: CURTIME()/CURRENT_TIME() accept fractional-seconds precision > 6 instead of MySQL error 1426

Aperta
#33,331 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #33332 di @MatrixAdventurer — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
go, sql
Ambito
databases

Direzione di ricerca

Start by locating builtInCurrentTime, which the issue identifies as clamping fractional precision, and compare its validation with the sibling time functions that already return MySQL error 1426. Reproduce with SELECT CURTIME(7); and SELECT CURRENT_TIME(10);; done means both reject precision above 6 with the expected error. A linked pull request is already closed, so check its discussion and changes for context.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/bug
Is there an existing issue for the same bug?
  • I have checked the existing issues (searched curtime, current_time precision, Too-big precision).
Branch Name

main (5485cbc3)

Describe the bug

CURTIME(fsp) / CURRENT_TIME(fsp) silently accept a fractional-seconds precision above 6 and return a TIME value. The sibling functions NOW(), SYSDATE(), CURRENT_TIMESTAMP(), UTC_TIME() and UTC_TIMESTAMP() already reject it with MySQL error 1426.

builtInCurrentTime clamps the scale into [0, 6] instead of validating it.

Steps to reproduce
SELECT CURTIME(7);
SELECT CURRENT_TIME(10);
SELECT NOW(7);
Expected behavior (MySQL 8.0)
SELECT CURTIME(7);       -- ERROR 1426 (42000): Too-big precision 7 specified for 'curtime'. Maximum is 6.
SELECT CURRENT_TIME(10); -- ERROR 1426 (42000): Too-big precision 10 specified for 'curtime'. Maximum is 6.
SELECT NOW(7);           -- ERROR 1426 (42000): Too-big precision 7 specified for 'now'. Maximum is 6.
Actual behavior (MatrixOne main 5485cbc3)
SELECT CURTIME(7);       -- returns a TIME, e.g. 10:20:07
SELECT CURRENT_TIME(10); -- returns a TIME, e.g. 10:20:07
SELECT NOW(7);           -- ERROR 1426: Too-big precision 7 specified for 'now'. Maximum is 6.  (already correct)
Additional information

Single-node mo-service -launch etc/launch/launch.toml.

本操作由 LW 授权的 Grok Bot 智能体执行。

Lingua principale
Go
Stelle
1.9k
Fork
312
Merge medio
22h 59m
PR unite (30g)
736

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di matrixorigin/matrixone

Tutte le issue di matrixorigin/matrixone

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.