DATETIME(n) / TIMESTAMP(n) columns drop fractional seconds
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 52/100
調査の方向性
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
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WordPress/sqlite-database-integration のほかの issue
-
MySQL-on-SQLite does not translate DATE arithmetic with INTERVAL HOUR対応中かも @samuelmbabhazi が 23 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
WordPress/sqlite-database-integration#454 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 40/100
WordPress/sqlite-database-integration#531 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
WordPress/sqlite-database-integration#529 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
WordPress/sqlite-database-integration#528 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
WordPress/sqlite-database-integration#526 ·
メンテナーはふだん 1 日以内に返信
WordPress/sqlite-database-integration の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
scanaislop/aislop#482 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
humanmade/publication-checklist#73 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Werkstattl/OpenBlogware#92 ·