Bug 117813 - *.csv database: changing character set needs a disconnect, add function to drop and recreate default connection object after configuration change
Summary: *.csv database: changing character set needs a disconnect, add function to dr...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.4.7.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Data-SourceView
  Show dependency treegraph
 
Reported: 2018-05-26 08:49 UTC by Oliver Brinzing
Modified: 2018-09-22 17:54 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
demo data *.csv file (utf-8) (27.96 KB, application/vnd.ms-excel)
2018-05-26 08:49 UTC, Oliver Brinzing
Details
demo *.odb file (1.85 KB, application/vnd.sun.xml.base)
2018-05-26 08:50 UTC, Oliver Brinzing
Details
db properties (48.46 KB, image/jpeg)
2018-05-26 08:50 UTC, Oliver Brinzing
Details
screen shot after character set change (429.72 KB, image/png)
2018-06-19 18:01 UTC, Drew Jensen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Brinzing 2018-05-26 08:49:52 UTC
Created attachment 142286 [details]
demo data *.csv file (utf-8)

steps to reproduce:

- open Database Wizard and connect to attached *.csv file 
  (you cannot select character set at this time)
- open Calc and "Data Sources Browser" - check data
- select "Edit DataBase File..." from "Data Sources Browser"
  TreeView Context Menu and change character set from "system" to utf-8
  (Edit/DataBase/Properties.../Additional Settings)
- Save
- Check Data in "Data Sources Browser" view
  -> refresh/rebuild has no effect
  -> only a Disconnect will change the character set
Comment 1 Oliver Brinzing 2018-05-26 08:50:17 UTC
Created attachment 142287 [details]
demo *.odb file
Comment 2 Oliver Brinzing 2018-05-26 08:50:44 UTC
Created attachment 142288 [details]
db properties
Comment 3 Buovjaga 2018-06-19 15:12:39 UTC
(In reply to Oliver Brinzing from comment #0)
>   TreeView Context Menu and change character set from "system" to utf-8
>   (Edit/DataBase/Properties.../Additional Settings)

Edit - Database - Properties does not have Additional Settings :(

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: dc9ee533dc707cc10b99d537eaccc3ee5aa555fe
CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on June 16th 2018
Comment 4 Oliver Brinzing 2018-06-19 17:42:39 UTC
please have a look at attached picture "db_properties", tab "Additional Settings"
Comment 5 Buovjaga 2018-06-19 17:51:56 UTC
(In reply to Oliver Brinzing from comment #4)
> please have a look at attached picture "db_properties", tab "Additional
> Settings"

Yeah, I am missing the tab.
Comment 6 Drew Jensen 2018-06-19 18:01:36 UTC
Created attachment 142937 [details]
screen shot after character set change

(In reply to Oliver Brinzing from comment #4)
> please have a look at attached picture "db_properties", tab "Additional
> Settings"

it seems to be working for me here.

Ubuntu 18.04 and Libo 6.1Beta2

Downloaded the data files, registered the database, opened a new calc file and the data source window there.

Selected the datasource and opened it for editing, changed the character support from system to UTF-8. Saved and close the odb file.

Back in the beamer window I opened the table and the data displayed all appears as I would expect with UTF-8 as the character set. 

OK, so I went and opened the odb for editing, again from the context menu in the datasource window and changed the character set to (something else which I was pretty sure would not display the characters properly; cryllic), saved the file, refreshed the tables via the ODB interface and closed the ODB file.

Back in the Calc file, the data in the beamer grid has not changed, and I would not expect it to, Base has always IIRC used dirty reads for the table grid control.

However, I then grad the table item in the tree view and drag it to the calc sheet, and sure enough the data generates some rather odd looking characters.

Screen shot attached.

So, it looks to me like it is updating to the change
Comment 7 Drew Jensen 2018-06-30 18:34:00 UTC
It still remains though that if you want to see a change in the beamer grid after changing the character set configuration for an ODB datassource the only way is to disconnect and then reconnect by clicking on the Tables or Queries entry in the Database tree view. 

The same is true for the Base UI. After the connection is created a change to that configuration property will not affect the open connection. The refresh table operation will not update the connection object for this property either. The only option to see the change in a table grid is to drop and recreate the default connection with a macro or the easier, close and reopen the file.

In the beamer there are separate connection objects created it appears for viewing data in the beamer grid versus dragging (inserting) data into the sheet and that would explain why the change is picked up there.

Since a .CSV File datasource type lists all .csv files in a directory as tables it might be easy to see how a disconnect_reconnect feature would be useful feature. 

Perhaps not just with a UI exposure at the Beamer but in the Base UI also.

Setting the enhancement requests and status to new