tarantool-module icon indicating copy to clipboard operation
tarantool-module copied to clipboard

Fix sequence deletion after nextval call

Open agscpp opened this issue 1 year ago • 7 comments

CREATE SEQUENCE serial_01 CYCLE;
SELECT nextval('serial_01');
DROP SEQUENCE serial_01;
Tarantool error: DropSequence: Can't drop sequence 'serial_01': the sequence has data

agscpp avatar Sep 24 '24 12:09 agscpp

Hi, @gmoshkin .

Can you please take a look at my pull request?

agscpp avatar Sep 24 '24 12:09 agscpp

Hi, thanks for the patch!

Could you explain, how are the provided SQL commands related to the test?

CREATE SEQUENCE serial_01 CYCLE; SELECT nextval('serial_01'); DROP SEQUENCE serial_01

The code in question will not be invoked when this SQL is executed.

Could you also add a test, so that we don't break the fix accidentally in the future.

gmoshkin avatar Sep 25 '24 15:09 gmoshkin

This is an abstract example that I used to compare the behavior with other DBMSs.

Okay, I'll write tests for this logic.

agscpp avatar Sep 26 '24 07:09 agscpp

@gmoshkin I wrote the tests

agscpp avatar Sep 26 '24 13:09 agscpp

Also please update CHANGELOG.md, we try keeping it up to date with every merge we make into the master branch.

gmoshkin avatar Sep 30 '24 10:09 gmoshkin

@gmoshkin

agscpp avatar Sep 30 '24 10:09 agscpp

@gmoshkin ping

agscpp avatar Oct 29 '24 10:10 agscpp