Skip to content

MySQL function not implemented: ADDTIME #22964

Closed
Closed

Description

@dengn

Function Information

Function Name: ADDTIME
Category: date

MySQL Function Description

MySQL ADDTIME function:
ADDTIME(expr1, expr2) - ADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time or datetime expression, and expr2 is a time expression.

Expected Behavior

Expected behavior:
According to MySQL documentation, the function should return correct results.

Current Behavior in MatrixOne

This function is not implemented in MatrixOne.

Error Message: (20105, "not supported: function or operator 'addtime'")

Test Case

SELECT ADDTIME('2007-12-31 23:59:59.999999', '1 1:1:1.000002') AS result1

MySQL Documentation

Request

Please implement the ADDTIME function to improve MySQL compatibility.

Activity

  1. added
    priority/p0
    kind/compatibility
    ai-easy
    on Nov 21, 2025
  2. added this to the MO-202511 milestone on Nov 21, 2025
  3. added a commit that references this issue on Nov 21, 2025
  4. fengttt commented on Nov 22, 2025

    @fengttt
    Contributor

    Note from MySQL documentation, so the return type of ADDTIME(vharchar, varchar) is not deterministic.
    We will simply return DATETIME type.

    If the first argument is a dynamic parameter (such as in a prepared statement), the return type is TIME.
    
    Otherwise, the resolved type of the function is derived from the resolved type of the first argument.
    
    mysql> SELECT ADDTIME('2007-12-31 23:59:59.999999', '1 1:1:1.000002');
            -> '2008-01-02 01:01:01.000001'
    mysql> SELECT ADDTIME('01:00:00.999999', '02:00:00.999998');
            -> '03:00:01.999997'
    
  5. fengttt commented on Nov 24, 2025

    @fengttt
    Contributor

    We want to fix ADDTIME and SUBTIME, to that the return type is the same as the first parameter.

    Esp, the test files should be updated.

  6. XuPeng-SH commented on Nov 26, 2025

    @XuPeng-SH
    Contributor

    fixed

  7. Repository owner unassigned on Dec 5, 2025
  8. Ariznawlll commented on Dec 5, 2025

    @Ariznawlll
    Collaborator

    verified

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-easykind/compatibilitypriority/p0

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions