You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Shengkai Fang (Jira)" <ji...@apache.org> on 2022/10/24 07:01:00 UTC
[jira] [Comment Edited] (FLINK-29677) Prevent dropping the current catalog
[ https://issues.apache.org/jira/browse/FLINK-29677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17622637#comment-17622637 ]
Shengkai Fang edited comment on FLINK-29677 at 10/24/22 7:00 AM:
-----------------------------------------------------------------
Merged into the master: 271ef7b7dfac195b43abced8b81c38998855dabf
Merged into the release-1.16: cc17d700dd6ec1708ed6b32e6051f0b00371669f
was (Author: fsk119):
Merged into the master: 271ef7b7dfac195b43abced8b81c38998855dabf
> Prevent dropping the current catalog
> ------------------------------------
>
> Key: FLINK-29677
> URL: https://issues.apache.org/jira/browse/FLINK-29677
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API
> Affects Versions: 1.16.0, 1.15.2, 1.14.6
> Reporter: Jane Chan
> Assignee: Jane Chan
> Priority: Major
> Labels: pull-request-available
> Attachments: image-2022-10-18-16-55-38-525.png, image-2022-10-18-17-02-30-318.png
>
>
> h3. Issue Description
> Currently, the drop catalog statement
>
> {code:java}
> DROP CATALOG my_cat{code}
>
> does not reset the current catalog. As a result, if dropping a catalog in use, then the following statements will yield different results.
>
> {code:java}
> SHOW CURRENT CATALOG
> SHOW CATALOGS
> {code}
>
> h3. How to Reproduce
> !image-2022-10-18-16-55-38-525.png|width=444,height=421!
>
> h3. Proposed Fix Plan
> The root cause is that `CatalogManager#unregisterCatalog` does not reset `currentCatalogName`.
> Regarding this issue, I checked MySQL and PG's behavior.
> For MySQL, it is allowed to drop a database current-in-use and set the current database to NULL.
> !image-2022-10-18-17-02-30-318.png|width=288,height=435!
>
> For PG, it is not allowed to drop the database currently in use.
>
> I think both behaviors are reasonable, while for simplicity I suggest adhering to PG, that throw an Exception when dropping the current catalog.
> cc [~jark] [~fsk119]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)