Firebird News

Thursday, August 06, 2015

Let's go back to the c , Firebird embedded backup service works

I have used an c based example for services api and seems that it works without a need for auth user



gcc backup_service.c -lfbembed

./a.out employee.fdb employee.fbk

Attach succeed

Start succeed

gbak:readied database employee.fdb for backup gbak:creating file employee.fbk

...

gbak:writing SQL roles gbak:writing names mapping gbak:closing file, committing, and finishing. 74752 bytes written

I will split the backup service function in two one for backup and one for restore then i will compare with my service example , maybe is a buffer truncation issue


Wednesday, July 15, 2015

Update firebird to version 2.5.4 is applied into LibreOffice master

There was a small issue with tinderbox and was reverted and then re-applied to master.

Rebuilding of indexes function is now removed from master (Using firebird backup format for .odb there is no need for rebuild indexes).

Thursday, July 02, 2015

JDK issues on OSX , ran the tests without Java

To run all the dbaccess tests On OSX I had to install jre 6 then jdk/jre 8 but still
dbaccess tests wouldn't run java popup still appeared even if the java -version showed
the proper 8 version , so for the moment i have disabled the java tests

./autogen.sh --without-java

Update:

Tests are finished and Firebird 2.5.4 update patch on gerrit is up for review
https://gerrit.libreoffice.org/16703

Tested on OSX 10.10.4 , Win 10 , Ubuntu 14.04

Wednesday, July 01, 2015

Debugging with ddd : crashes in rtl_ImplGetFastUTF8UnicodeLen

Found it where it crashes at line 645 in Connection.cxx
OUString aData(pResults + 3,
                           isc_vax_integer(pResults, 2),
                           RTL_TEXTENCODING_UTF8);
            
and here is the backtrace at line 634 in ustring.cxx
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b7aebd in rtl_ImplGetFastUTF8UnicodeLen (pStr=0x7ffffffff000 , nLen=11582, ascii=0x7fffffffc4b8) at /home/mariuz/work/libo/sal/rtl/ustring.cxx:634
(gdb) frame 4
#4  0x00007fff96c9bce2 in connectivity::firebird::Connection::runBackupService (this=0x7fffac0a1400, nAction=1) at /home/mariuz/work/libo/connectivity/source/drivers/firebird/Connection.cxx:645
(gdb) frame 24
#24 0x00007ffff195e906 in SalFrame::CallCallback (this=0x10a7680, nEvent=22, pEvent=0x15fd5d0) at /home/mariuz/work/libo/vcl/inc/salframe.hxx:246
(gdb) frame 23
#23 0x00007ffff1586e00 in ImplWindowFrameProc (_pWindow=0x10a6ce0, nEvent=22, pEvent=0x15fd5d0) at /home/mariuz/work/libo/vcl/source/window/winproc.cxx:2578
(gdb) frame 5
#5  0x00007fff96c9c99c in connectivity::firebird::Connection::documentEventOccured (this=0x7fffac0a1400, _Event=...) at /home/mariuz/work/libo/connectivity/source/drivers/firebird/Connection.cxx:814
(gdb) frame 4
#4  0x00007fff96c9bce2 in connectivity::firebird::Connection::runBackupService (this=0x7fffac0a1400, nAction=1) at /home/mariuz/work/libo/connectivity/source/drivers/firebird/Connection.cxx:645

Tuesday, June 30, 2015

Backup file firebird.fbk file inside odb is 0 length

That could be the reason gerrit wasn't merged Connection::runBackupService didn't quite worked:
(Currently doesn't actually work, the backup service fails with gbak:Exiting before completion due to errors and no further error messages).
I need to debug the isc_action_svc_backup error

On odb save event now saves fbk instead of fdb

XDocumentEventListener documentEventOccured was registered for when save button is pressed

It was done on this line in Connection.cxx :
xBroadcaster->addDocumentEventListener(this);

The issue was on this part of the code 
xInputStream = OStorageHelper::GetInputStreamFromURL(m_sFirebirdURL, xContext);
Now replaced with
xInputStream = OStorageHelper::GetInputStreamFromURL(m_sFBKPath, xContext);

m_sFirebirdURL is the original fdb path 

m_sFirebirdURL = m_pDatabaseFileDir->GetFileName() + "/firebird.fdb";
m_sFBKPath = m_pDatabaseFileDir->GetFileName() + "/firebird.fbk";



Friday, June 26, 2015

Semi good news : New Database.odb contains firebird.fbk

The semi good news is that New Database.odb contains fbk file saved when a table is created and saved from Base
Here is the unziped New Database.odb



The bad news is the firebird.fbk is in fact firebird.fdb file , so the saved file is the database file instead of backup file (i renamed the fbk to fdb and can be open in flamerobin)

When i loaded the New Database.odb i got this backtrace

rogram received signal SIGSEGV, Segmentation fault.
0x00007ffff7b7b99d in rtl_ImplGetFastUTF8UnicodeLen (pStr=0x7ffffffff000 , nLen=18238, ascii=0x7fffffffb658) at /home/mariuz/work/libo/sal/rtl/ustring.cxx:610
610             unsigned char c = (unsigned char)*pStr;
(gdb) 

So i need to work on the save fbk to odb part

Thursday, June 25, 2015

The good news

The good news is firebird_empty.odb simple test is is ok (fdb file is created in tmp area and queries work) as seen in the trace https://gist.github.com/mariuz/ecfbab056136b8736bda
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Driver.cxx:54: FirebirdDriver_CreateInstance()
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Driver.cxx:166: connect(), URL: sdbc:embedded:firebird
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Connection.cxx:173: Temporary .fdb location:  /tmp/lu3385bwxulf.tmp/firebird.fdb
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/DatabaseMetaData.cxx:851: getTypeInfo()
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Connection.cxx:883: buildTypeInfo(). Type info built.
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Connection.cxx:891: buildTypeInfo(). Closed.
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/Statement.cxx:111: executeQuery(SELECT DISTINCT indices.RDB$INDEX_NAME FROM RDB$INDICES indices JOIN RDB$INDEX_SEGMENTS index_segments ON (indices.RDB$INDEX_NAME = index_segments.RDB$INDEX_NAME) JOIN RDB$RELATION_FIELDS relation_fields ON (index_segments.RDB$FIELD_NAME = relation_fields.RDB$FIELD_NAME) JOIN RDB$FIELDS fields ON (relation_fields.RDB$FIELD_SOURCE = fields.RDB$FIELD_NAME) WHERE (indices.RDB$SYSTEM_FLAG = 0) AND ((fields.RDB$FIELD_TYPE = 14)      OR (fields.RDB$FIELD_TYPE = 37)) AND (indices.RDB$INDEX_INACTIVE IS NULL OR indices.RDB$INDEX_INACTIVE = 0) )
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/ResultSet.cxx:79: OResultSet().
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/StatementCommonBase.cxx:111: close
info:connectivity.firebird:3385:1:connectivity/source/drivers/firebird/StatementCommonBase.cxx:111: close
We need to modify the file firebird_integer_x64le.odb used in the qa tests (dbaccess/qa/unit/firebird.cxx) to include a fbk instead of fdb http://lists.freedesktop.org/archives/libreoffice-commits/2013-September/057217.html