Issue Details (XML | Word | Printable)

Key: CORE-5414
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Cristiano Ferrari
Votes: 0
Watchers: 3
Operations

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

Error restoring on FB 3.0 from FB 2.5: bugcheck 221 (cannot remap)

Created: 07/Dec/16 01:30 AM   Updated: 01/Feb/17 05:23 AM
Component/s: API / Client Library
Affects Version/s: 3.0.1
Fix Version/s: 3.0.2, 4.0 Alpha 1

File Attachments: 1. Text File firebird.log (44 kB)

Environment: backup was made on linux Debian 7 (kernel 3.2.0-4-amd64; glibc 2.13.38) under a FB 2.5.4.26856, in transportable mode. trying to restore on ubuntu 16.10 (kernel 4.4.0-45-generic x86_64; glibc 2.23) under a FB 3.0.1.32609.

QA Status: Done successfully


 Description  « Hide
I'm trying to restore a FB 2.5.4 backup (transportable) on a FB 3.0.1 and having this error:

gbak: 0.004 committing metadata
gbak: ERROR:Error while parsing procedure FZ_ESTOQUECONSOLIDADO's BLR
gbak: ERROR: Error while parsing procedure LISTASALDOSECUSTOS2's BLR
gbak: ERROR: internal Firebird consistency check ((CMP) copy: cannot remap (221), file: RecordSourceNodes.cpp line: 594)
gbak:Exiting before completion due to errors
gbak: ERROR:internal Firebird consistency check (can't continue after bugcheck)

I've tried to run gbak -C with -n and -m (and both) options and this error remain. Many procedures call UDFs from two 3rd part librarys: cpf_udf.so, rfunc.so, tbudf.so, all of then compiled for 64 bits.

I already tried to change the owner for UDF folder (and all files inside it) to firebird:firebird.

The full source code for this SPs and the UDFs librarys is here: https://drive.google.com/drive/folders/0BxCWYNjpA1-SRll4QjZuOThWdzQ?usp=sharing

 UPDATE: after post, I've tried to do gbak -C again plus the -fix_fss_m win1252 and now I have this error:

gbak: 0.000 restoring privilege for user FZ_APURAÇAO_PIS_COFINS_ENT_SAI
gbak: ERROR:arithmetic exception, numeric overflow, or string truncation
gbak: ERROR: string right truncation
gbak: ERROR: expected length 31, actual 31
gbak:Exiting before completion due to errors

UPDATE 2: in this last restore (using -fix_fss_m win1252) I noticed that there are many messages in firebird.log like this

RDB$FLAGS for trigger CHECK_284 in RDB$TRIGGERS is corrupted (304)

But, the original datadabase in FB 2.5 doesn't show any consistence problem.

The firebird.log with all theses messages is in attachment.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 07/Dec/16 02:48 PM
Can you send a minimal metadata backup or tables and views DDL to reproduce it?

Cristiano Ferrari added a comment - 07/Dec/16 04:50 PM
>> Can you send a minimal metadata backup or tables and views DDL to reproduce it?

Sure. I can send you all the metadata, but can't attach to this task, because the procedures/triggers sources have 3rd part code protected by copyright restrictions.

I'm sending in your e-mail address.

Tks a lot.

Adriano dos Santos Fernandes added a comment - 08/Dec/16 02:47 PM
This bug is reproduced with this simple command:

select 1 from rdb$database a full join rdb$database b on (exists(select 1 from rdb$database));

v3 optimizer clone nodes where v2 does not.

Dmitry, could you look at it?

Dmitry Yemanov added a comment - 08/Dec/16 02:51 PM
I will.

Cristiano Ferrari added a comment - 16/Jan/17 12:03 AM - edited
Tested with 3.0.2.32668-0.amd64 snapshot build and restore done OK