BIT_OR(), BIT_AND() and BIT_XOR() aggregates are not supported
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- PHP
- Stelle
- 363
- Fork
- 72
- Merge medio
- 3g 7h
- PR unite (30g)
- 13
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WordPress/sqlite-database-integration
-
MySQL-on-SQLite does not translate DATE arithmetic with INTERVAL HOURForse già presa @samuelmbabhazi l’ha presa 27 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WordPress/sqlite-database-integration#454 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
WordPress/sqlite-database-integration#538 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 40/100
WordPress/sqlite-database-integration#531 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
WordPress/sqlite-database-integration#529 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
WordPress/sqlite-database-integration#528 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di WordPress/sqlite-database-integration
Issue simili
-
create:theme --tailwind scaffolds version.yaml at 1.0.0 while the LESS variant scaffolds 1.0.1Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
PHP workflow streaming requests buffer the full SSE responseForse già presa @Winoren l’ha presa oggi. Apertareview: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
langgenius/dify#44270 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug customer-reported
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
MagnaCapax/PMSS#1085 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
nunomaduro/collision#375 ·