Bug 131330 - Firebird/View-editor: Views aren't shown in table directly after creating a view
Summary: Firebird/View-editor: Views aren't shown in table directly after creating a view
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.4.2.1 rc
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:7.4.0 target:7.3.1
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-13 15:56 UTC by Robert Großkopf
Modified: 2022-01-31 09:40 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 Robert Großkopf 2020-03-13 15:56:39 UTC
Open a Firebird database.
Go to Tables > Create View...
Create a simple view of a table with the view (query) editor.
Save the view.
The editor will close automatically.
The view won't be shown in the "Tables" section.

Go to View > Refresh Tables and click on it.
The view will be shown.

Expected behavior: The vie will directly be shown after I have created it by the view.
Refresh tables should only be needed for creating views (or tables) by Tools > SQL
Comment 1 Julien Nabet 2020-03-14 12:34:38 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

I noticed this on console:
warn:dbaccess:180512:180512:dbaccess/source/ui/browser/genericcontroller.cxx:990: DBG_UNHANDLED_EXCEPTION in void dbaui::OGenericUnoController::OnAsyncCloseTask(void *) exception: com.sun.star.uno.RuntimeException message: unsatisfied query for interface of type com.sun.star.util.XCloseable!
Comment 2 Julien Nabet 2020-03-14 14:26:21 UTC
Contrary to embedded hsqldb, with Firebird we enter in the if:
1408      // if we successfully saved a view we were creating, then close the designer
1409      if ( bSuccess && editingView() && !m_xAlterView.is() )
1410      {
1411          closeTask();
1412      }
See https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/querydesign/querycontroller.cxx?r=131d5cdb#1408

because m_xAlterView.is() is false.

It's due to the fact that:
1374                  if ( xElements->hasByName( m_sName ) )
1375                      m_xAlterView.set( xElements->getByName( m_sName ), UNO_QUERY );

it doesn't set m_xAlterView
If I replace "UNO_QUERY" by "UNO_QUERY_THROW", I get:
warn:dbaccess:185477:185477:dbaccess/source/ui/querydesign/querycontroller.cxx:1411: DBG_UNHANDLED_EXCEPTION in bool dbaui::OQueryController::doSaveAsDoc(bool) exception: com.sun.star.uno.RuntimeException message: unsatisfied query for interface of type com.sun.star.sdbcx.XAlterView!

In brief, XAlterView should be implemented
Comment 3 Julien Nabet 2022-01-26 22:11:09 UTC
I gave a try here:
https://gerrit.libreoffice.org/c/core/+/129011
Comment 4 Commit Notification 2022-01-27 16:36:32 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0adff3f2476f797843fb62d6810de90bfb333e10

tdf#126960, tdf#131330: FB make views editable+refresh auto after creation

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Julien Nabet 2022-01-27 16:47:05 UTC
For 7.3, patch waiting for review here:
https://gerrit.libreoffice.org/c/core/+/129067
Comment 6 Julien Nabet 2022-01-27 20:36:58 UTC
The patch doesn't build on 7.3 branch and don't want to dig so I abandoned it.
If someone wants to try, don't hesitate.
Comment 7 Commit Notification 2022-01-31 09:40:57 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/e7c652b90c44d9615a89e88ad3aa195b1fa6fbf7

tdf#126960, tdf#131330: FB make views editable+refresh auto after creation

It will be available in 7.3.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.