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

Fatal error when working with bookmarked queries in a different database #12965

Closed
ibennetch opened this Issue Feb 7, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@ibennetch
Member

ibennetch commented Feb 7, 2017

Steps to reproduce

  1. From the SQL tab where a bookmarked query is accessible
  2. Select the bookmarked query from the dropdown
  3. Attempt to "view only" or "Submit"

Expected behaviour

It should do what I ask.

Actual behaviour

The error is shown:

( ! ) Fatal error: Call to a member function getQuery() on null in /var/www/pma-dev/fork/import.php on line 374
Call Stack
#	Time	Memory	Function	Location
1	0.0001	136664	{main}( )	../import.php:0

Server configuration

Operating system:

Web server:

Database:

PHP version:
5.5.54
phpMyAdmin version:
QA_4_7

Client configuration

Browser:
Mac
Operating system:
MacOS

@poush

This comment has been minimized.

Show comment
Hide comment
@poush

poush Feb 7, 2017

Contributor

No such issues on master as well as in https://demo.phpmyadmin.net/QA_4_7/

I created a bookmark. From the SQL tab selected a bookmark then tried submitting as well viewing and both worked well as expected.

Contributor

poush commented Feb 7, 2017

No such issues on master as well as in https://demo.phpmyadmin.net/QA_4_7/

I created a bookmark. From the SQL tab selected a bookmark then tried submitting as well viewing and both worked well as expected.

@ibennetch

This comment has been minimized.

Show comment
Hide comment
@ibennetch

ibennetch Feb 7, 2017

Member

Thanks for testing.

I've done a bit more looking in to this and it seems that the problem occurs when a bookmark is accessed from a different database than the one in which it was created. Does that help with reproduction?

For instance, I have a test database with a bunch of tables, and I bookmarked a simple query SHOW TABLES;. This query should be able to run from any database, but when I switch to my 12965 database I get the error.

Whether the bookmark should be hidden when in a different database or should run regardless of the database can be debated, but either way we should catch this failure mode.

Member

ibennetch commented Feb 7, 2017

Thanks for testing.

I've done a bit more looking in to this and it seems that the problem occurs when a bookmark is accessed from a different database than the one in which it was created. Does that help with reproduction?

For instance, I have a test database with a bunch of tables, and I bookmarked a simple query SHOW TABLES;. This query should be able to run from any database, but when I switch to my 12965 database I get the error.

Whether the bookmark should be hidden when in a different database or should run regardless of the database can be debated, but either way we should catch this failure mode.

@ibennetch ibennetch changed the title from Fatal error working with bookmarked queries to Fatal error when working with bookmarked queries in a different database Feb 7, 2017

@poush

This comment has been minimized.

Show comment
Hide comment
@poush

poush Feb 8, 2017

Contributor

@ibennetch Yes, I am able to reproduce it. All shared queries are not executing on other databases. Should I try for catching the error for now?
Also, one suggestion could be introducing another field stating that this bookmark is shared with other databases or not as currently, We have only option to share among other users which state that this bookmark is limited to this database only and can be shared among other users of this database.

Contributor

poush commented Feb 8, 2017

@ibennetch Yes, I am able to reproduce it. All shared queries are not executing on other databases. Should I try for catching the error for now?
Also, one suggestion could be introducing another field stating that this bookmark is shared with other databases or not as currently, We have only option to share among other users which state that this bookmark is limited to this database only and can be shared among other users of this database.

@nijel nijel added the bug label Feb 14, 2017

@nijel

This comment has been minimized.

Show comment
Hide comment
@nijel

nijel Oct 20, 2017

Member

This is pretty much outcome of #13761 - the bookmarks for other database should not be listed. This is now fixed.

Member

nijel commented Oct 20, 2017

This is pretty much outcome of #13761 - the bookmarks for other database should not be listed. This is now fixed.

@nijel nijel closed this Oct 20, 2017

@nijel nijel self-assigned this Oct 20, 2017

@nijel nijel added this to the 4.7.5 milestone Oct 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment