DATETIME(n) / TIMESTAMP(n) columns drop fractional seconds
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- PHP
- Star
- 362
- Fork
- 69
- Merge trung bình
- 3 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của WordPress/sqlite-database-integration
-
MySQL-on-SQLite does not translate DATE arithmetic with INTERVAL HOURCó thể đã có người làm @samuelmbabhazi đã nhận 24 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
WordPress/sqlite-database-integration#454 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 40/100
WordPress/sqlite-database-integration#531 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
WordPress/sqlite-database-integration#529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
WordPress/sqlite-database-integration#528 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
WordPress/sqlite-database-integration#526 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của WordPress/sqlite-database-integration
Issue tương tự
-
sync-en
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Перевод устарел
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
-
feature request
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
home php
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
vincent-peugnet/wcms#670 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
freescout-help-desk/freescout#5731 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày