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
DeActivate/Activate INDEX or RESTORE not possible with NULL in unique index. [CORE3937] #4270
Comments
Commented by: @hvlad Reproduced in 2.5.1 Could you try 2.5.2 and confirm ? |
Commented by: Bjarne Rasmussen (bimmer_r) Tested i 2.5.2 RC1 - and it works !! Thx. Vlad |
Commented by: Bjarne Rasmussen (bimmer_r) Test process: Base backup was done in existing 2.5.1 Restore on a stand alone windows 7 - 64 bit - (32 bit FireBird 2.5.2 RC1). Restore with 2.5.2 GBAK : OK. Hope this explains my test a bit more :-) |
Modified by: @dyemanovsecurity: Developers [ 10012 ] => |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done with caveats Test Details: Could NOT reproduce error on WI-V2.5.1.26351 (SuperClassic). |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Bjarne Rasmussen (bimmer_r)
Duplicates CORE3675
1) create empty database (or just use any test db at hand)
2) Run script :
SET SQL DIALECT 3;
CREATE GENERATOR GEN_NEW_TABLE_ID;
CREATE TABLE TESTTABLE (
ID INTEGER NOT NULL,
FIELD1 INTEGER NOT NULL,
FIELD2 INTEGER NOT NULL,
FIELD3 VARCHAR(10),
FIELD4 VARCHAR(10)
);
ALTER TABLE TESTTABLE ADD CONSTRAINT PK_TESTTABLE PRIMARY KEY (ID);
CREATE UNIQUE INDEX TESTTABLE_IDX1 ON TESTTABLE (FIELD1, FIELD2, FIELD3, FIELD4);
ALTER INDEX TESTTABLE_IDX1 INACTIVE;
SET TERM ^ ;
/* Trigger: TESTTABLE_BI */
CREATE OR ALTER TRIGGER TESTTABLE_BI FOR TESTTABLE
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (http://NEW.id IS NULL) THEN
http://NEW.id = GEN_ID(gen_new_table_id,1);
END
^
SET TERM ; ^
3) Table is created with KEY, INDEX, GENERATOR and a Trigger ... lets put some data in.
INSERT INTO TESTTABLE (FIELD1, FIELD2, FIELD3, FIELD4) VALUES (1, 2, NULL, NULL);
INSERT INTO TESTTABLE (FIELD1, FIELD2, FIELD3, FIELD4) VALUES (1, 2, '', '');
COMMIT WORK;
4) Now we are ready to test the INDEX.
a. DeActivate index : ALTER INDEX TESTTABLE_IDX1 INACTIVE. (result is OK)
b. Activate index : ALTER INDEX TESTTABLE_IDX1 ACTIVE. <--------------------------- THIS FAILS ??????
Error is : "attempt to store duplicate value(visible to active transactions) in unique index "TESTTABLE_IDX1".
====== Test Details ======
Could NOT reproduce error on WI-V2.5.1.26351 (SuperClassic).
The text was updated successfully, but these errors were encountered: