Opened 19 months ago

Last modified 7 months 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 19 months ago.
grass_bug_windows_db_select.png (719.1 KB) - added by martinl 19 months ago.

Download all attachments as: .zip

Change History (10)

Changed 19 months ago by martinl

Changed 19 months ago by martinl

comment:1 Changed 19 months ago by martinl

Description: modified (diff)

comment:2 Changed 19 months ago by martinl

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 Changed 19 months ago by martinl

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

comment:4 Changed 17 months ago by neteler

Milestone: 7.4.17.4.2

comment:5 Changed 13 months ago by neteler

Milestone: 7.4.27.4.3

Ticket retargeted after milestone closed

comment:6 Changed 11 months ago by martinl

Milestone: 7.4.37.4.4

Bump milestone to 7.4.4

comment:7 Changed 10 months ago by neteler

Milestone: 7.4.47.4.5

Ticket retargeted after milestone closed

comment:8 Changed 7 months ago by martinl

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