Opened 6 years ago

Last modified 5 years ago

#3548 new defect

sql where statement encoding issue on windows

Reported by: martinl Owned by: grass-dev@…
Priority: major Milestone: 7.6.2
Component: Database Version: 7.4.0
Keywords: select, where, wingrass, encoding Cc:
CPU: Unspecified Platform: Unspecified

Description (last modified by martinl)

SQL WHERE statements with diacritics on Windows return no records. It seems to be a bug. Same command performed in GRASS GUI (no record, wrong) and SQLiteBrowser (one record, correct). See

.

It seems to be encoding issue, tested with Czech Windows 8.1 localization (cp1250). Strangely, records with diacritics appear correct in GRASS GUI. See

Attachments (2)

grass_bug_windows_encoding.png (29.0 KB ) - added by martinl 6 years ago.
grass_bug_windows_db_select.png (719.1 KB ) - added by martinl 6 years ago.

Download all attachments as: .zip

Change History (10)

by martinl, 6 years ago

by martinl, 6 years ago

comment:1 by martinl, 6 years ago

Description: modified (diff)

comment:2 by martinl, 6 years ago

Tested also from command line:

# no diacritics, works
C:\>db.select sql="select count(*) from obce where nazev='Kladno';
count(*)
2

# diacritics involved, fails
C:\>db.select sql="select count(*) from obce where nazev='Aš';
count(*)
0

Debug:

D2/5: path to db is C:\Users\landa\Documents\grassdata\ArcCR500\PERMANENT\sqlite

D3/5: Escaped SQL: select count(*) from obce where nazev='Aš';
D3/5: describe_table()
D4/5: this is not a table column
D3/5: sqltype = 3
D3/5: litetype = 1
D3/5: nkcols = 1
D4/5: this is not a table column
D3/5: sqltype = 3
D3/5: litetype = 1
D3/5: col: count(*), nkcols 0, litetype : 1, sqltype 3
count(*)
D3/5: fetch row = -1
D3/5: col 0, litetype 1, sqltype 3: val = '0'
D3/5: Row fetched
0
D3/5: fetch row = 0
D3/5: db_close_database()

comment:3 by martinl, 6 years ago

Tested also on Linux (same data, same import command). Works, seems to be really encoding issue on Windows.

comment:4 by neteler, 6 years ago

Milestone: 7.4.17.4.2

comment:5 by neteler, 6 years ago

Milestone: 7.4.27.4.3

Ticket retargeted after milestone closed

comment:6 by martinl, 5 years ago

Milestone: 7.4.37.4.4

Bump milestone to 7.4.4

comment:7 by neteler, 5 years ago

Milestone: 7.4.47.4.5

Ticket retargeted after milestone closed

comment:8 by martinl, 5 years ago

Milestone: 7.4.57.6.2
Note: See TracTickets for help on using tickets.