CONCAT produces extra trailing bytes for a BLOB argument in a UTF-16le database
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start by reproducing the SQL script against a newly created database, setting UTF-16le encoding before creating tables; compare the HEX results for the direct cast and CONCAT. The issue names no source files or tests, so trace CONCAT's handling of BLOB arguments and BLOB-to-text conversion in the SQLite code bundled with sqlite-jdbc. Done means the single-argument CONCAT result matches the expected text without trailing bytes, with the UTF-16le case verified.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I observed unexpected trailing bytes when passing a BLOB argument to CONCAT() in a UTF-16le database.
Reproduction
Run this script against a newly created, empty database. The encoding must be set before creating any tables.
PRAGMA encoding = 'UTF-16le';
CREATE TABLE t(x);
INSERT INTO t VALUES(960613696.0);
PRAGMA encoding;
SELECT
HEX(CAST(CAST(x AS BLOB) AS TEXT)) AS direct_text,
HEX(CONCAT(CAST(x AS BLOB))) AS concatenated
FROM t;
SELECT sqlite_version(), sqlite_source_id();
Actual result
direct_text:
3900360030003600310033003600390036002E003000
concatenated:
3900360030003600310033003600390036002E00300000000300000000000000000000000000000000000000
The CONCAT result contains the expected prefix followed by additional bytes.
Expected result
I would expect CONCAT() with this single non-NULL argument to produce the same text content as the explicit conversion to TEXT, without additional trailing bytes.
Version tested
SQLite 3.51.1
2025-11-28 17:28:25
281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88
I also tested a development Fiddle build:
SQLite 3.54.0
2026-10-05 14:22:13
4bfc6e53a95d710b7f40fa9c80d8cdd1df50d69ed8614e9800f7e6a1ca5a3c29
However, that test produced UTF-8 output, so it did not reproduce the same encoding conditions. I have not yet verified whether the issue persists in the development build with a UTF-16le database.
Is this a known or already-fixed issue involving CONCAT(), BLOB-to-text conversion, and UTF-16 database encoding?
- Lenguaje dominante
- Java
- Estrellas
- 3.3k
- Forks
- 676
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 18
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de xerial/sqlite-jdbc
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
xerial/sqlite-jdbc#1515 ·
Los mantenedores suelen responder en 1 día
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
xerial/sqlite-jdbc#1514 ·
Los mantenedores suelen responder en 1 día
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
xerial/sqlite-jdbc#1513 ·
Los mantenedores suelen responder en 1 día
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
xerial/sqlite-jdbc#1512 ·
Los mantenedores suelen responder en 1 día
-
SIGSEGV (exit 134) in bundled `rightstr()` when the length argument is a large negative numberPosiblemente ocupada @sarthakdev143-lite la tomó hace 2 días. Abiertohelp wanted impacts:JNI
Dificultad 4/5 1-2 días Aptitud para principiantes 38/100
xerial/sqlite-jdbc#1508 ·
Los mantenedores suelen responder en 1 día
Todos los issues de xerial/sqlite-jdbc
Issues similares
-
hermes-queue
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
chrisalunlloyd2-sudo/mindpalace#403 ·
Los mantenedores suelen responder en 1 día
-
Area/Configuration Type/Improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ballerina-platform/static-code-analysis-tool#217 ·
Los mantenedores suelen responder en 1 día
-
SequenceEncoder: a value ending with a backslash swallows the tokens after it (“No state for trait”)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
vassalengine/vassal#15337 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eclipse-dirigible/dirigible#8636 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug severity-medium XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
nikolas-charalambidis/facepalm-maven-plugin#291 ·
Los mantenedores suelen responder en 1 día