Different results for QUOTE() with control characters between SQLite3 Fiddle and sqlite-jdbc

Aperta
#1,390 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java, sqlite
Ambito
database

Direzione di ricerca

The report names QUOTE() behavior in sqlite-jdbc and compares it with SQLite3 Fiddle, but it does not identify a source file or test. Start by checking how the bundled SQLite version handles QUOTE() for the provided control characters, then compare the query output with the reported results. Done means determining whether the outputs are expected and documenting or correcting the discrepancy; the issue has had no activity for 220 days.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

troubleshooting

Describe the bug
I noticed inconsistent behavior for the QUOTE() function when the input string contains control characters. The same query produces different results in SQLite3 Fiddle and sqlite-jdbc.

To Reproduce
Run the following SQL query:
SELECT QUOTE('L' || char(0x17) || 'A' || char(0x13) || '2');
In SQLite3 Fiddle and sqlite-jdbc, this query returns different outputs.

Expected behavior
I expected QUOTE() to produce identical output across both environments.
Is this difference expected, or could it indicate an inconsistency in how control characters are handled?

Logs
Result in sqlite-jdbc
'L A 2'

results in SQLite3 Fiddle
unistr('''L\u0017A\u00132''')

Environment (please complete the following information):
OS: Windows 11
CPU architecture: x86_64
sqlite-jdbc version: 3.51.2.0

Additional context
The difference seems to occur specifically when the input string contains control characters. It is unclear whether this is intended behavior or a potential inconsistency between environments.

Image
Lingua principale
Java
Stelle
3.3k
Fork
676
Merge medio
1g 15h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di xerial/sqlite-jdbc

Tutte le issue di xerial/sqlite-jdbc

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.