Skip to content

[Bug]: mo支持下year类型 #23310

Closed
Closed

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

38fe250

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

https://dev.mysql.com/doc/refman/8.4/en/year.html

Expected Behavior

No response

Steps to Reproduce

无

Additional information

No response

Activity

  1. added this to the MO-202512 milestone on Dec 18, 2025
  2. added
    kind/bug
    severity/s0
    on Dec 18, 2025
  3. added theissue type on Dec 18, 2025
  4. removed their assignment
    on Dec 24, 2025
  5. ghost added a commit that references this issue on Jan 13, 2026
  6. Repository owner unassigned on Feb 9, 2026
  7. Ariznawlll commented on Mar 5, 2026

    @Ariznawlll
    CollaboratorAuthor

    测试结果:

    测试环境

    • MySQL 版本: 8.0.45
    • MatrixOne 连接: 127.0.0.1:6001
    • 测试日期: 2026-03-05

    测试结果

    ✅ 基础功能测试

    功能 MySQL 8.0 MatrixOne 结果
    CREATE TABLE with YEAR ✅ ✅ 一致
    YEAR(4) 语法 ✅ ✅ 一致
    插入四位数年份 (2024) ✅ ✅ 一致
    插入字符串年份 ('2025') ✅ ✅ 一致
    插入两位数 (70 → 1970) ✅ ✅ 一致
    插入两位数 (69 → 2069) ✅ ✅ 一致
    插入零值 (0 → 0000) ✅ ✅ 一致
    最小值 (1901) ✅ ✅ 一致
    最大值 (2155) ✅ ✅ 一致

    ✅ 高级功能测试

    功能 MySQL 8.0 MatrixOne 结果
    算术运算 (year + 1) ✅ ✅ 一致
    比较运算 (WHERE y > 2000) ✅ ✅ 一致
    BETWEEN 查询 ✅ ✅ 一致
    YEAR() 函数提取 ✅ ✅ 一致
    DESC 显示类型 YEAR YEAR(4) 一致

    数据对比

    插入和查询结果

    MySQL 8.0 和 MatrixOne 的输出完全一致:
    
    id  y     description
    1   2024  Four digit year
    2   2025  String four digit
    3   0000  Zero value
    4   0000  String zero
    5   1970  Two digit 70 (1970)
    6   2069  Two digit 69 (2069)
    7   1901  Min valid year
    8   2155  Max valid year
    

    两位数年份转换规则

    • 00-69 → 2000-2069 ✅
    • 70-99 → 1970-1999 ✅

    结论

    MatrixOne 已经完全支持 YEAR 类型!

    测试表明 MatrixOne 对 YEAR 类型的支持与 MySQL 8.0 完全一致,包括:

    1. ✅ 基本的 YEAR 和 YEAR(4) 类型定义
    2. ✅ 各种输入格式(四位数、两位数、字符串、零值)
    3. ✅ 两位数年份的自动转换规则
    4. ✅ 算术和比较运算
    5. ✅ YEAR() 函数支持
    6. ✅ 有效范围 (1901-2155, 0000)

    测试通过

  8. added a commit that references this issue on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions