Skip to content

Dolt raises an internal child-count error for CURRENT_TIME(precision) #11543

Description

@Yibo-Dong

What happened

Dolt exhibits this behavior: CURRENT_TIME(precision) window expression raises an internal child-count error.

Environment

Dolt main (commit c3b5ce3c67f8677ca08a0a58d8c03cdc95bff8b7). MySQL version 8.0.43.

How to reproduce

Run the corresponding SQL in a fresh Dolt repository.

SELECT FIRST_VALUE(LENGTH(CURRENT_TIME(6))) OVER (ROWS BETWEEN CURRENT ROW AND CURRENT ROW) AS length_now,
       FIRST_VALUE(CURRENT_TIME(6)) OVER (ROWS BETWEEN CURRENT ROW AND CURRENT ROW) AS current_time_value;

Expected Result

MySQL 8.0.43 fresh run:

length_now	current_time_value
15	17:35:21.730245

The clock value varies, but the six fractional digits are present and its string length is 15.

Actual Result

The query fails before returning a row:

*function.CurrTime: invalid children number, got 1, expected 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcorrectnessWe don't return the same result as MySQLcustomer issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions