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

Restore with UDF in 'COMPUTED BY' fields fails [CORE949] #1350

Closed
firebird-issue-importer opened this issue Oct 8, 2006 · 12 comments
Closed

Restore with UDF in 'COMPUTED BY' fields fails [CORE949] #1350

firebird-issue-importer opened this issue Oct 8, 2006 · 12 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Oct 8, 2006

Submitted by: Dank? Gy?rgy (dgy)

Assigned to: @aafemt

Relate to CORE1865
Relate to CORE5143

I created a database with table definitions like these.

DECLARE EXTERNAL FUNCTION ROUND
DOUBLE PRECISION,
INTEGER
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'fn_round' MODULE_NAME 'rfunc';

CREATE TABLE TABLE1 (
ID INTEGER NOT NULL PRIMARY KEY,
FIELD1 DOUBLE PRECISION
);

CREATE TABLE TABLE2 (
ID INTEGER NOT NULL PRIMARY KEY,
TABLE1_ID INTEGER DEFAULT 0,
FIELD1 COMPUTED BY ((SELECT ROUND(FIELD1, 2) FROM TABLE1 WHERE http://TABLE1.ID = TABLE1_ID))
);

When I tried backup/restore, I got an error. When the tables contain data, the restore is not possible.

// GBAK backup log

IBE: Starting backup. Current time: 10:08:52
gbak:readied database /demo/demo.gdb for backup
gbak:creating file /demo/demo.fbk
gbak:starting transaction
gbak:database /demo/demo.gdb has a page size of 8192 bytes.
gbak:writing domains
gbak: writing domain RDB$7
gbak: writing domain RDB$3
gbak: writing domain RDB$4
gbak: writing domain RDB$5
gbak: writing domain RDB$10
gbak:writing shadow files
gbak:writing tables
gbak: writing table TABLE1
gbak: writing column FIELD1
gbak: writing column ID
gbak: writing table TABLE2
gbak: writing column FIELD1
gbak: writing column TABLE1_ID
gbak: writing column ID
gbak:writing functions
gbak: writing function ROUND
gbak: writing argument for function ROUND
gbak: writing argument for function ROUND
gbak: writing argument for function ROUND
gbak:writing types
gbak:writing filters
gbak:writing id generators
gbak:writing stored procedures
gbak:writing exceptions
gbak:writing character sets
gbak:writing collations
gbak: writing index PK_TABLE2
gbak: writing data for table TABLE2
gbak:1 records written
gbak: writing index PK_TABLE1
gbak: writing data for table TABLE1
gbak:1 records written
gbak:writing triggers
gbak:writing trigger messages
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user PUBLIC
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak:writing table constraints
gbak:writing constraint INTEG_2
gbak:writing constraint PK_TABLE1
gbak:writing constraint INTEG_3
gbak:writing constraint PK_TABLE2
gbak:writing referential constraints
gbak:writing check constraints
gbak:writing SQL roles
gbak:closing file, committing, and finishing. 2560 bytes written

IBE: Backup completed. Current time: 10:08:53. Elapsed time: 00:00:00

// GBAK restore log

IBE: Starting restore. Current time: 10:30:15
gbak:opened file C:\demo.fbk
gbak:transportable backup -- data in XDR format
gbak: backup file is compressed
gbak:created database c:\demo.gdb, page_size 8192 bytes
gbak:started transaction
gbak:restoring domain RDB$1
gbak:restoring domain RDB$2
gbak:restoring domain RDB$3
gbak:restoring domain RDB$4
gbak:restoring domain RDB$5
gbak:restoring table TABLE1
gbak: restoring column FIELD1
gbak: restoring column ID
gbak:committing metadata for table TABLE1
gbak:restoring table TABLE2
gbak: restoring column FIELD1
gbak: restoring column TABLE1_ID
gbak: restoring column ID
gbak:committing metadata for table TABLE2
gbak: error committing metadata for table TABLE2
gbak:restoring function ROUND
IBE: Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.
action cancelled by trigger (0) to preserve data integrity.
could not find table/procedure for GRANT.
IBE: Restore completed. Current time: 10:30:15. Elapsed time: 00:00:00

I think this error occures because of wrong order of the restoring. Gbak restores the tables first and only after that restores the UDFs instead of reverse process.

Commits: bc6a913

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

See test for CORE1865

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 27, 2007

Modified by: @aafemt

timespent: 1800 [ 1800 ]

timeestimate: 0 [ 0 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 13, 2007

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 2.1 Beta 1 [ 10141 ]

Fix Version: 2.1.0 [ 10041 ]

assignee: Dimitry Sibiryakov [ aafemt ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 15, 2007

Commented by: @pcisar

When this issue was classified as critical, shouldn't we backport it into 2.0.x ? It was reported on 2.0 RC4, so it's strange it slipped the 2.0.1 maintenance. You should either downgrade it from critical or schedule the fix also for 2.0.2.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 16, 2007

Modified by: @dyemanov

priority: Critical [ 2 ] => Major [ 3 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 26, 2007

Modified by: @pcisar

Fix Version: 2.1.0 [ 10041 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 16, 2007

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2008

Modified by: @pcisar

Workflow: jira [ 11240 ] => Firebird [ 15345 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 25, 2008

Modified by: @dyemanov

Link: This issue relate to CORE1865 [ CORE1865 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 27, 2016

Modified by: @dyemanov

Link: This issue relate to CORE5143 [ CORE5143 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 9, 2018

Modified by: @pavel-zotov

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

QA Status: No test => Not enough information

Test Details: Sent letters to dimitr, 09.03.18 00:30. Waiting for reply.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 10, 2018

Modified by: @pavel-zotov

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

QA Status: Not enough information => Covered by another test(s)

Test Details: Sent letters to dimitr, 09.03.18 00:30. Waiting for reply. => See test for CORE1865

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant