Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

DATETIME(n) / TIMESTAMP(n) columns drop fractional seconds

オープン
#527 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
mysql, php, sqlite
領域
database

調査の方向性

Start by tracing the write and comparison paths that cast DATETIME and TIMESTAMP values through SQLite's DATETIME(), then check how declared precision is represented. The report reproduces the issue with DATETIME(6) and provides a fractional-second equality query to use when investigating. Done means values retain the expected fractional seconds on read and comparisons against the inserted value match; the report leaves the implementation approach open.

索引モデルが issue の本文から書いたものです。

説明

Reproduction

CREATE TABLE d (id INT, ts DATETIME(6));
INSERT INTO d (id, ts) VALUES (1, '2026-06-22 07:16:00.123456');
SELECT ts FROM d;
-- '2026-06-22 07:16:00'   (MySQL: '2026-06-22 07:16:00.123456')
SELECT COUNT(*) FROM d WHERE ts = '2026-06-22 07:16:00.123456';
-- 0                       (MySQL: 1)

Reproduced on trunk (3.1.0) with PHP 8.3 and SQLite 3.45.1.

Values written to DATETIME/TIMESTAMP columns are cast through SQLite's DATETIME(), which has no fractional part, so the column's declared precision is ignored. A value read back loses its fraction, and an equality or IN comparison against the value as written matches nothing. For example, an outbox that deletes processed rows by (id, queued_at) never deletes them.

Relation to #508

#508 adds MySQL-compatible date/time parsing and formatting, including fractional seconds, in the same code paths. Would you prefer this fixed on top of #508 (honoring DATETIME_PRECISION when casting on write, with MySQL's rounding or TIME_TRUNCATE_FRACTIONAL), or separately? I'm happy to contribute a PR in whichever direction fits.

Found while running WooCommerce on WordPress Playground.

Use of AI

This report was prepared with Claude Code.

主要言語
PHP
スター
362
フォーク
69
平均マージ
4日 7時間
マージ済み PR(30日)
9

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WordPress/sqlite-database-integration のほかの issue

WordPress/sqlite-database-integration の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。