Issue Details (XML | Word | Printable)

Key: CORE-1349
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Vlad Khorsun
Votes: 0
Watchers: 0
Operations

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

Remote interface not checked in REM_receive and REM_fetch client supplied message length against length of format of message

Created: 06/Jul/07 07:58 AM   Updated: 29/Dec/07 08:38 AM
Component/s: API / Client Library
Affects Version/s: 1.5.4, 2.0.1, 2.1 Beta 1
Fix Version/s: 2.0.2, 2.1 Beta 2

Time Tracking:
Not Specified


 Description  « Hide
a) prepare bad database :

isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> CREATE DATABASE 'BUG.FDB';
SQL> CREATE TABLE T (TS TIMESTAMP);
SQL> COMMIT;
SQL> INSERT INTO T VALUES (CURRENT_DATE);
SQL> SELECT * FROM T;

                       TS
=========================
2007-07-06 00:00:00.0000

SQL> COMMIT;
SQL> SELECT R.RDB$FIELD_TYPE, R.RDB$FIELD_LENGTH
CON> FROM RDB$FIELDS R
CON> WHERE R.RDB$FIELD_NAME =
CON> (SELECT RF.RDB$FIELD_SOURCE FROM RDB$RELATION_FIELDS RF
CON> WHERE RF.RDB$RELATION_NAME = 'T'
CON> AND RF.RDB$FIELD_NAME = 'TS');

RDB$FIELD_TYPE RDB$FIELD_LENGTH
============== ================
            35 8

SQL> SHOW TABLE T;
TS TIMESTAMP Nullable

-- the next statement was issued by one of GUI tools to change field type to DATE (instead of ALTER TABLE ALTER COLUMN)
SQL> UPDATE RDB$FIELDS R SET R.RDB$FIELD_TYPE = 12
CON> WHERE R.RDB$FIELD_NAME =
CON> (SELECT RF.RDB$FIELD_SOURCE FROM RDB$RELATION_FIELDS RF
CON> WHERE RF.RDB$RELATION_NAME = 'T'
CON> AND RF.RDB$FIELD_NAME = 'TS');
SQL> COMMIT;
SQL> SHOW TABLE T;
TS DATE Nullable
SQL> SELECT * FROM T;

                       TS
=========================
2007-07-06 00:00:00.0000

SQL> SELECT R.RDB$FIELD_TYPE, R.RDB$FIELD_LENGTH
CON> FROM RDB$FIELDS R
CON> WHERE R.RDB$FIELD_NAME =
CON> (SELECT RF.RDB$FIELD_SOURCE FROM RDB$RELATION_FIELDS RF
CON> WHERE RF.RDB$RELATION_NAME = 'T'
CON> AND RF.RDB$FIELD_NAME = 'TS');

RDB$FIELD_TYPE RDB$FIELD_LENGTH
============== ================
            12 8

SQL> EXIT;



b) run gbak not using services API :

gbak -b -v localhost:bug.fdb bug.fbk
...
gbak: writing data for table T
gbak:0 records written
...

Table T of course contains records but none of them was put in backup !

c) run gbak using services API :

gbak -b -v bug.fdb bug.fbk -se service_mgr
...
gbak: ERROR:message length error (encountered 12, expected 8)
gbak: ERROR: gds_$receive failed
gbak:Exiting before completion due to errors

this is at least give the user chance to know about something weird with database

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.