You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Istvan Toth (Jira)" <ji...@apache.org> on 2021/10/18 17:01:00 UTC
[jira] [Resolved] (PHOENIX-6574) Executing "DROP TABLE" drops all
sequences
[ https://issues.apache.org/jira/browse/PHOENIX-6574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Istvan Toth resolved PHOENIX-6574.
----------------------------------
Fix Version/s: 5.1.3
4.16.2
5.2.0
4.17.0
Resolution: Fixed
Pushed to all active branches.
Thanks for the report and repro [~alejandro_anadon@hotmail.com], and thanks for the review [~gjacoby].
> Executing "DROP TABLE" drops all sequences
> ------------------------------------------
>
> Key: PHOENIX-6574
> URL: https://issues.apache.org/jira/browse/PHOENIX-6574
> Project: Phoenix
> Issue Type: Bug
> Components: core
> Affects Versions: 4.16.1, 4.17.0, 5.2.0, 5.1.2
> Reporter: Alejandro Anadon
> Assignee: Istvan Toth
> Priority: Blocker
> Fix For: 4.17.0, 5.2.0, 4.16.2, 5.1.3
>
>
> It is a very strange behavior (to my understanding). If I create a table and delete it immediately afterwards, it deletes the sequences from the catalog. Moreover, depending on whether I have used them or not, itdisappears completely or not..
> In the following sequence of instructions you see what I mean (My starting point is an empty bbdd):
> -first case (not using the sequence):
> SELECT * FROM SYSTEM."SEQUENCE";
> // empty data
>
> CREATE SEQUENCE SEQUENCENAME;
> SELECT * FROM SYSTEM."SEQUENCE";
> // there is the secuence
> CREATE TABLE DUMMYTABLE (FIELD1 BIGINT, FIELD2 VARCHAR(255), ID BIGINT NOT NULL, CONSTRAINT PK PRIMARY KEY (ID));
> //we create a table
>
> SELECT * FROM SYSTEM."SEQUENCE";
> //The sequence is still there
>
> DROP TABLE IF EXISTS DUMMYTABLE;
> //delete the table
>
> SELECT * FROM SYSTEM."SEQUENCE";
> // hey!! the sequence has disappeared !!! why?!?
> SELECT NEXT VALUE FOR SEQUENCENAME;
> //It throws an exception because the squence does not exists
>
> -secondcase (using the sequence):
> SELECT * FROM SYSTEM."SEQUENCE";
> CREATE SEQUENCE SEQUENCENAME2;
> SELECT * FROM SYSTEM."SEQUENCE";
> SELECT NEXT VALUE FOR SEQUENCENAME2;
> // this is the little diference: we are using the secuence
> SELECT * FROM SYSTEM."SEQUENCE";
> CREATE TABLE DUMMYTABLE (FIELD1 BIGINT, FIELD2 VARCHAR(255), ID BIGINT NOT NULL, CONSTRAINT PK PRIMARY KEY (ID));
> SELECT * FROM SYSTEM."SEQUENCE";
> DROP TABLE IF EXISTS DUMMYTABLE;
> SELECT * FROM SYSTEM."SEQUENCE";
> //The sequence also disapears. It should not be usable.
> SELECT NEXT VALUE FOR SEQUENCENAME2;
> //it does NOT throws an exception even it does not exists
> SELECT * FROM SYSTEM."SEQUENCE";
>
> Maybe there is something that I am missing, but I think that this is critical a bug.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)