Issue Details (XML | Word | Printable)

Key: CORE-949
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dimitry Sibiryakov
Reporter: Dank? Gy?rgy
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Restore with UDF in 'COMPUTED BY' fields fails

Created: 08/Oct/06 05:12 PM   Updated: 25/Apr/08 06:10 AM
Component/s: GBAK
Affects Version/s: 2.0 RC4
Fix Version/s: 2.1 Beta 1

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: 0 minutes
Time Spent - 30 minutes
Time Spent: 30 minutes
Time Spent - 30 minutes

Environment: Windows XP Professional, Suse Linux 10.1
Issue Links:
Relate
 


 Description  « Hide
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 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.


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Cisar added a comment - 15/Apr/07 11:19 AM
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.