Skip to content

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

@dddddddcoconut

Description

@dddddddcoconut

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions