BIT_OR(), BIT_AND() and BIT_XOR() aggregates are not supported
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start by reading the SQLite function translation and registration code, especially the existing UDFs and any aggregate translations; the issue does not name specific files or tests. Then check how the project tests SQL compatibility and the pdo_sqlite integer limits described here. Done means BIT_OR(), BIT_AND(), and BIT_XOR() produce MySQL-compatible results, including NULLs, empty sets, and unsigned 64-bit values.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Reproduction
CREATE TABLE b (x INT);
INSERT INTO b (x) VALUES (1), (4), (NULL);
SELECT BIT_OR(x), BIT_AND(x), BIT_XOR(x) FROM b;
-- SQLSTATE[HY000]: General error: 1 no such function: BIT_OR
Expected (MySQL 8): 5, 0, 5. Over an empty set, MySQL returns 0 for BIT_OR and BIT_XOR, and 18446744073709551615 for BIT_AND. NULLs are ignored, and the result type is BIGINT UNSIGNED.
Reproduced on trunk (3.1.0) with PHP 8.3 and SQLite 3.45.1.
Implementation question
Registering PHP aggregates through createAggregate() / sqliteCreateAggregate() looks natural next to the existing UDFs, but one constraint makes the design a maintainers' call: pdo_sqlite passes integers into and out of PHP callbacks as 32 bits (verified on PHP 8.3: an argument of 4294967297 arrives as 1, and a returned 4294967297 comes back as 1). Correct 64-bit results would need either:
- a translation that passes the argument as text (
CAST(expr AS TEXT)) and returns the result as text, plus a decision on how values above 2^63 (for example the empty-setBIT_AND) should surface; or - a pure-SQL translation per bit (for example
COALESCE(MAX((expr >> n) & 1), 0) << nsummed over the 64 bits forBIT_OR), which is exact but large.
A PHP aggregate limited to 32-bit values would cover common flag columns, but would silently return wrong results for wider ones, so I haven't proposed one. Happy to contribute a PR for whichever direction you prefer.
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 26 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ó 4/5 1-2 ngày Mức phù hợp với người mới 52/100
WordPress/sqlite-database-integration#527 ·
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Featured image not passed to checks in the Tasks column or publish blocksCó thể đã có người làm @roborourke đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
humanmade/publication-checklist#100 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug customer-reported
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
MagnaCapax/PMSS#1072 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
hestiacp/hestiacp#5800 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 68/100
components-web-app/docs#244 ·