Skip to content

テーブル日付がtimestamp型いっぱいで2038年問題に直面 #896

@masaton0216

Description

@masaton0216

概要

  • timestamp型は「2038年1月19日3時14分7秒」を過ぎると内部値がオーバーフローする為、誤動作を引き起こす可能性がある。
  • Connect-CMSのmigrationを検索したところ、共通日付項目と個別日付項目で散見されます。
    • created_at(共通日付項目)
    • updated_at(共通日付項目)
    • deleted_at(共通日付項目)
    • ※全調査はしてません(個別日付項目)

参考

https://qiita.com/ucan-lab/items/99ee14ad6bb24614980c

再現手順

一例として再現しやすいところだと、先日、追加したフレーム公開設定の日付をうっかりtimestamp型にしてしまってたので、上記日付を超える日付を入力するとInsertエラーが発生します。

Invalid datetime format: 1292 Incorrect datetime value: '2045-06-09 14:00:00' for column 'content_open_date_to' at row 1 (SQL: update frames set frame_title = ?, frame_design = none, frame_col = 0, template = default, browser_width = ?, disable_whatsnews = 0, page_only = 0, default_hidden = 0, classname = ?, plug_name = ?, none_hidden = 0, content_open_type = 3, content_open_date_from = 2021-06-09 14:00:00, content_open_date_to = 2045-06-09 14:00:00, frames.updated_at = 2021-06-10 09:51:15 where id = 139)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions