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

Abierto
#33,331 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #33332 de @MatrixAdventurer — cerrado sin fusionar

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
go, sql
Área
databases

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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 智能体执行。

Lenguaje dominante
Go
Estrellas
1.9k
Forks
312
Merge medio
22 h 59 min
PR fusionados (30 d)
736

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de matrixorigin/matrixone

Todos los issues de matrixorigin/matrixone

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.