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

Restoring databases into 4.0 causing automation addition default 0 sentences to NOT NULL fields [CORE5856] #6116

Closed
firebird-automations opened this issue Jun 22, 2018 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: bazilio (bazilio77)

1. Backup 3.0 database
2. Restore into 4.0 server

Field declaration
X INTEGER NOT NULL
will be transformed in 4.0
as
X INTEGER NOT NULL default 0

This behavior will cause problems with BEFORE INSERT triggers
containing

if (new.X is null)

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

Did backup on WI-V3.0.1.32609 (date of snapshot: 27-sep-2016), then restore on WI-T4.0.0.563 (date of snapshot: 18-mar-2017).
Got after restore proper DDL:
...
CREATE TABLE TEST (X INTEGER NOT NULL);
...

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

On a trivial sample (single table with single field) i.e.

create table x(y int not null);

did not reproduce - in FB4 after restore I get

$ ./isql -z notNull.fdb
ISQL Version: LI-T4.0.0.1038-dev Firebird 4.0 Alpha 1
Server version:
LI-T4.0.0.1038-dev Firebird 4.0 Alpha 1
Database: notNull.fdb, User: ALEX
SQL> show table x;
Y INTEGER Not Null
SQL>

Please provide test case to reproduce.

@firebird-automations
Copy link
Collaborator Author

Commented by: bazilio (bazilio77)

Sorry. It seems was a problem of some older builds. Now all works ok. Please close this issue.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Not enough information

Test Details: Did backup on WI-V3.0.1.32609 (date of snapshot: 27-sep-2016), then restore on WI-T4.0.0.563 (date of snapshot: 18-mar-2017).
Got after restore proper DDL:
...
CREATE TABLE TEST (X INTEGER NOT NULL);
...

@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
Projects
None yet
Development

No branches or pull requests

2 participants