Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote interface not checked in REM_receive and REM_fetch client supplied message length against length of format of message [CORE1349] #1768

Closed
firebird-automations opened this issue Jul 6, 2007 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @hvlad

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

Commits: 2dccd27 caa5194

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Fix Version: 2.0.2 [ 10130 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12521 ] => Firebird [ 15287 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment