Bug 121654 - New table created by SQL code is not displayed in tables until file is reopened
Summary: New table created by SQL code is not displayed in tables until file is reopened
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.3.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-23 09:17 UTC by Evgeny Kuznetsov
Modified: 2018-11-23 10:32 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeny Kuznetsov 2018-11-23 09:17:33 UTC
Description:
A new table created via SQL instruction (Tools -> SQL...) is not shown in Tables until database is closed and reloaded again.

Reproduced on:
LibreOffice 6.1.3.2 running on Debian 9 (package version 6.1.3-1~bpo9+2) 64-bit.
LibreOffice 5.3.7.2 running on Windows Vista 32-bit.

Steps to Reproduce:
1. Start LibreOffice Base.
2. Click "Next" without altering anything (creating new HSQLDB).
3. Click "Finish" without altering anything.
4. Use arbitrary filename (i.e. "test.odb") to save.
5. Use Menu: Tools -> SQL...
6. Enter command: CREATE TABLE "test" ("field1" INTEGER, "field2" VARCHAR(5))
7. Click "Execute".
8. Click "Close".
9. Click on "Tables" in the left panel.

Actual Results:
No tables are listed.

Expected Results:
A table named "test" is listed and can be accessed.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Closing LibreOffice Base and reopening the file created on Step 4 leads to expected behaviour.
Comment 1 Julien Nabet 2018-11-23 09:40:00 UTC
List of tables is loaded during opening of the file.
However, you can also refresh list of tables in View menu.
Comment 2 Alex Thurgood 2018-11-23 09:41:58 UTC
At step 9, click on View > Refresh Tables, then click on the Tables icon.

The newly created table will be displayed.
Comment 3 Evgeny Kuznetsov 2018-11-23 09:52:04 UTC
(In reply to Alex Thurgood from comment #2)
> At step 9, click on View > Refresh Tables, then click on the Tables icon.
> 
> The newly created table will be displayed.

While your point is valid, this behaviour is insonsistent with behaviour of Tables in other scenarios:

Table created using wizard -> visible immediately, no refresh needed.
Table created using desing mode -> visible immediately, no refresh needed.
Table created by SQL -> invisible until refresh.

Should the behaviour not be the same in all these scenarios?
Comment 4 Alex Thurgood 2018-11-23 10:29:44 UTC
(In reply to Evgeny Kuznetsov from comment #3)

 
> Should the behaviour not be the same in all these scenarios?

Ideally, yes, but for technical reasons lost in the mists of time, and in my vague recollection, the Refresh Tables menu entry came about as a result of the introduction of the Tools > SQL dialog allowing direct alteration of the DB via DDL instructions, but not providing any visual feedback.

I imagine that both the table creation wizard and design mode have a way of refreshing the connection and displaying the objects without the rigmarole of having to reload the db objects into memory - at a guess, something to do with the dbconnection context that is directly addressable from the UI (or vice-versa).
Comment 5 Alex Thurgood 2018-11-23 10:32:17 UTC
I suppose the point is that this will only change if someone can come along with some code that allows the table object UI view to be refreshed whilst being intelligent enough to distinguish between DDL and DML - currently that is not the case to my knowledge.