{"action":"created","issue":{"url":"https://api.github.com/repos/dbeaver/dbeaver/issues/4581","repository_url":"https://api.github.com/repos/dbeaver/dbeaver","labels_url":"https://api.github.com/repos/dbeaver/dbeaver/issues/4581/labels{/name}","comments_url":"https://api.github.com/repos/dbeaver/dbeaver/issues/4581/comments","events_url":"https://api.github.com/repos/dbeaver/dbeaver/issues/4581/events","html_url":"https://github.com/dbeaver/dbeaver/issues/4581","id":378766344,"node_id":"MDU6SXNzdWUzNzg3NjYzNDQ=","number":4581,"title":"DBeaver changes active database after running stored procedure (MariaDB)","user":{"login":"queueseven","id":3126597,"node_id":"MDQ6VXNlcjMxMjY1OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/3126597?v=4","gravatar_id":"","url":"https://api.github.com/users/queueseven","html_url":"https://github.com/queueseven","followers_url":"https://api.github.com/users/queueseven/followers","following_url":"https://api.github.com/users/queueseven/following{/other_user}","gists_url":"https://api.github.com/users/queueseven/gists{/gist_id}","starred_url":"https://api.github.com/users/queueseven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queueseven/subscriptions","organizations_url":"https://api.github.com/users/queueseven/orgs","repos_url":"https://api.github.com/users/queueseven/repos","events_url":"https://api.github.com/users/queueseven/events{/privacy}","received_events_url":"https://api.github.com/users/queueseven/received_events","type":"User","site_admin":false},"labels":[{"id":275893724,"node_id":"MDU6TGFiZWwyNzU4OTM3MjQ=","url":"https://api.github.com/repos/dbeaver/dbeaver/labels/question","name":"question","color":"bfe5bf","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-08T14:52:16Z","updated_at":"2018-12-07T08:34:15Z","closed_at":null,"author_association":"NONE","body":"I'm connected to a server with a lot of databases.\r\nI select one database (something_something_develop) in the database navigator with Databases -> set as active object (or something like that, I don't know, I use German: Aktives Objekt festlegen).\r\n\r\nI call a stored procedure and select an out variable, something like this:\r\n\r\n```\r\nCALL sp_my_awesome_procedure(foo, bar, outvalue);\r\nSELECT @outvalue;\r\n```\r\n\r\nAfter displaying the results, DBeaver changes the selected database without my interaction. I can see that the highlighted database in the database navigator changes.\r\n\r\nHere's a screenshot of the query manager:\r\n\r\n![grafik](https://user-images.githubusercontent.com/3126597/48206175-13080300-e36e-11e8-9e15-06ff90d66280.png)\r\n"},"comment":{"url":"https://api.github.com/repos/dbeaver/dbeaver/issues/comments/445160430","html_url":"https://github.com/dbeaver/dbeaver/issues/4581#issuecomment-445160430","issue_url":"https://api.github.com/repos/dbeaver/dbeaver/issues/4581","id":445160430,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTE2MDQzMA==","user":{"login":"queueseven","id":3126597,"node_id":"MDQ6VXNlcjMxMjY1OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/3126597?v=4","gravatar_id":"","url":"https://api.github.com/users/queueseven","html_url":"https://github.com/queueseven","followers_url":"https://api.github.com/users/queueseven/followers","following_url":"https://api.github.com/users/queueseven/following{/other_user}","gists_url":"https://api.github.com/users/queueseven/gists{/gist_id}","starred_url":"https://api.github.com/users/queueseven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queueseven/subscriptions","organizations_url":"https://api.github.com/users/queueseven/orgs","repos_url":"https://api.github.com/users/queueseven/repos","events_url":"https://api.github.com/users/queueseven/events{/privacy}","received_events_url":"https://api.github.com/users/queueseven/received_events","type":"User","site_admin":false},"created_at":"2018-12-07T08:34:15Z","updated_at":"2018-12-07T08:34:15Z","author_association":"NONE","body":"I tried with a new connection, and I tried enabling/disabling this option multiple times in the connection settings and in the global settings. It still happens (DBeaver 5.2.5).\r\n\r\nI also think this is a critical bug since you can never be sure if the SQL you run inside a non-trivial script is executed on the very database you selected, or on another one.\r\n\r\nHere's how I can replicate this with a minimal example:\r\n\r\n- Start DBeaver.\r\n- Select a database (FOO).\r\n- Run the following SQL:\r\n\r\n```\r\nDELIMITER //\r\nCREATE PROCEDURE tmpproc()\r\n  BEGIN\r\n\t\r\n  END//\r\nDELIMITER ;\r\nCALL tmpproc();\r\nDROP PROCEDURE tmpproc;\r\n```\r\n- Everything is fine\r\n- Change the database (BAR)\r\n- Run the SQL again\r\n- The script will fail: the  procedure will be created on BAR, but between the `CREATE `and `CALL `DBeaver will change the active database to FOO again and try to call `FOO.tmpproc` instead of `BAR.tmpproc`\r\n"}}
{"actor":{"display_login":"queueseven"}}