Skip to content
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

Unique constraint not working in encrypted database on first command [CORE5673] #5939

Closed
firebird-automations opened this issue Nov 28, 2017 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @cincuranet

I have a weird behavior here. Database after b&r, no errors. I try to insert non-unique value into table with unique constraint and it fails as it should. I encrypt it (AES128 from IBPhoenix) and the same statement does not fail. Only the next one will throw unique violation.

Commits: 992554a 8c68ef5

====== Test Details ======

Could not check reproducing of bug on FB 3.0.2 because there is no encryption plugin for this (too old) version.
Decided only to ensure that exception will be catched on recent FB version for each attempt to insert duplicate.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

reporter: Alexander Peshkov [ alexpeshkoff ] => Jiri Cincura [ cincura_net ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

description: I have a weird behavior here. Database after b&r, no errors. I try to
insert non-unique value into table with unique constraint and it fails
as it should. I encrypt it (AES128 from IBPhoenix) and the same
statement does not fail. Only the next one will throw unique violation.

=>

I have a weird behavior here. Database after b&r, no errors. I try to insert non-unique value into table with unique constraint and it fails as it should. I encrypt it (AES128 from IBSurgeon) and the same statement does not fail. Only the next one will throw unique violation.

environment: IBPhoenix AES128 plugin
Specific DB which cannot be attached here

=>

IBSurgeon AES128 plugin
Specific DB which cannot be attached here

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

description: I have a weird behavior here. Database after b&r, no errors. I try to insert non-unique value into table with unique constraint and it fails as it should. I encrypt it (AES128 from IBSurgeon) and the same statement does not fail. Only the next one will throw unique violation.

=>

I have a weird behavior here. Database after b&r, no errors. I try to insert non-unique value into table with unique constraint and it fails as it should. I encrypt it (AES128 from IBPhoenix) and the same statement does not fail. Only the next one will throw unique violation.

environment: IBSurgeon AES128 plugin
Specific DB which cannot be attached here

=>

IBPhoenix AES128 plugin
Specific DB which cannot be attached here

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Error happened because tdbb_status_vector with constraint violation error was cleared by crypt plugin. That's not a plugin error. Even with newer programming style in plugin which does not assume full vector cleanup on each call code invoking plugin was wrong. In case of 2 errors (both in constraint and in plugin) instead merged status vector with both errors we got only plugin error in it.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0.3 [ 10810 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

Test Details: Could not check reproducing of bug on FB 3.0.2 because there is no encryption plugin for this (too old) version.
Decided only to ensure that exception will be catched on recent FB version for each attempt to insert duplicate.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment