Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#16219 Add popup suggested to reload metadata if ddl query was executed #18754

Draft
wants to merge 8 commits into
base: devel
Choose a base branch
from

Conversation

E1izabeth
Copy link
Member

@E1izabeth E1izabeth commented Jan 12, 2023

2023-01-12.16-55-06.mp4

Please, check

  • script execution with ddl and select statements mixed
  • single statement execution
  • execution of script from the position (available in context menu)

with cases when

  • connection is opened in navigator
  • project with connection is closed
  • script is not assigned to any data source

@E1izabeth E1izabeth linked an issue Jan 12, 2023 that may be closed by this pull request
@LonwoLonwo
Copy link
Member

I hope we will not see users annoyed by this notification...

@E1izabeth E1izabeth linked an issue Jan 13, 2023 that may be closed by this pull request
@Matvey16
Copy link
Member

This doesn't fix the initial problem and the error is still shown

org.jkiss.dbeaver.DBException: Table '11122233' not found in schema 'public'
	at org.jkiss.dbeaver.ext.postgresql.model.PostgreStructureAssistant$1.resolveObject(PostgreStructureAssistant.java:216)
	at org.jkiss.dbeaver.ui.editors.entity.EntityHyperlink$ObjectFinder.run(EntityHyperlink.java:92)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

image

And in some case I even got an NPE while moving a cursor to table name with pressed ctrl key

java.lang.NullPointerException
	at org.jkiss.dbeaver.ext.postgresql.PostgreUtils.getRealSchemaName(PostgreUtils.java:812)
	at org.jkiss.dbeaver.ext.postgresql.model.PostgreStructureAssistant.findObjectsByMask(PostgreStructureAssistant.java:123)
	at org.jkiss.dbeaver.ext.postgresql.model.PostgreStructureAssistant.findObjectsByMask(PostgreStructureAssistant.java:1)
	at org.jkiss.dbeaver.ui.editors.sql.syntax.SQLContextInformer$TablesFinderJob.findTables(SQLContextInformer.java:391)
	at org.jkiss.dbeaver.ui.editors.sql.syntax.SQLContextInformer$TablesFinderJob.lambda$0(SQLContextInformer.java:283)
	at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:173)
	at org.jkiss.dbeaver.ui.editors.sql.syntax.SQLContextInformer$TablesFinderJob.run(SQLContextInformer.java:281)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

@Matvey16
Copy link
Member

Now this this warning appears in the log and table can't be opened with ctrl + click

java.lang.NullPointerException
	at org.jkiss.dbeaver.ext.postgresql.PostgreUtils.getRealSchemaName(PostgreUtils.java:812)
	at org.jkiss.dbeaver.ext.postgresql.model.PostgreStructureAssistant.findObjectsByMask(PostgreStructureAssistant.java:123)
	at org.jkiss.dbeaver.ext.postgresql.model.PostgreStructureAssistant.findObjectsByMask(PostgreStructureAssistant.java:1)
	at org.jkiss.dbeaver.ui.editors.sql.syntax.SQLContextInformer$TablesFinderJob.findTables(SQLContextInformer.java:391)
	at org.jkiss.dbeaver.ui.editors.sql.syntax.SQLContextInformer$TablesFinderJob.lambda$0(SQLContextInformer.java:283)
	at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:173)
	at org.jkiss.dbeaver.ui.editors.sql.syntax.SQLContextInformer$TablesFinderJob.run(SQLContextInformer.java:281)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

STR:

  1. Write a simple query CREATE TABLE foo AS SELECT 1;
  2. Execute the query
  3. Click on notification to refresh the metadata
  4. ctrl + click on the table name

Nothing will happen and the above warning will show up in the log.

Reproducible only on Postgre databases

@Matvey16
Copy link
Member

Works only for a default database/schema. If non default schema is set for SQLEditor, it will be reset after refresh

dbeaver_DnRu7PcdiF

@E1izabeth E1izabeth marked this pull request as draft August 22, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better ctrl+click implementation automatically update objects tree after DDL command
4 participants