Issue Details (XML | Word | Printable)

Key: CORE-3165
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Maxim Kuzmin
Votes: 0
Watchers: 1
Operations

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

Incorrect record size when using computed fields

Created: 07/Oct/10 10:16 AM   Updated: 03/Feb/11 09:50 AM
Component/s: GBAK
Affects Version/s: 2.1.0, 2.1.1, 2.1.2, 2.1.3, 3.0 Initial, 2.5.0
Fix Version/s: None

Issue Links:
Relate
 


 Description  « Hide
CREATE TABLE TABLE1 (
    ID INTEGER,
    COMP1 COMPUTED BY (cast('' as varchar(25000))),
    COMP2 COMPUTED BY (cast('' as varchar(25000))),
    COMP3 COMPUTED BY (cast('' as varchar(25000)))
);

1. When "SELECT * FROM TABLE1", get error: "Implementation limit exceeded. block size exceeds implementation restriction".
2. Backup executed succesfully. But when restore database, get error:
gbak: committing metadata
gbak: ERROR:unsuccessful metadata update
gbak: ERROR: new record size of 75014 byte
gbak: ERROR: TABLE TABLE1
gbak:Exiting before completion due to errors

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Smirnoff Serg added a comment - 07/Oct/10 11:07 AM
3. When "SELECT COMP1, COMP2 FROM TABLE1" then OK.

Bert Herngreen added a comment - 07/Oct/10 11:43 AM - edited
The block size exceeds implementation restriction means in this case that the maximum rowsize has been exceeded.
3 x 25000 is larger than the Maximum row size of 64k, 2 x 25000 isn't.

So "SELECT COMP1, COMP2 FROM TABLE1" is OK, but "SELECT COMP1, COMP2, COMP3 FROM TABLE1" then fails.

See http://www.firebirdfaq.org/faq61/


Maxim Kuzmin added a comment - 07/Oct/10 12:12 PM
Bert Herngreen, i know the cause of the error. The idea is that Firebird allows to create such a situation, including unrestorable backup.

Dmitry Yemanov added a comment - 03/Feb/11 09:50 AM
This is a regression introduced when fixing inability to restore computed fields based on other metadata. The solution was to restore computed fields as regular ones (just without data) and then alter them to be computed. Unfortunately, the record length check fires for the first table format because of that.