Skip to content

Conversation

@dmitry-lipetsk
Copy link
Contributor

@dmitry-lipetsk dmitry-lipetsk commented Nov 22, 2023

This is a fix for issue #7869 - a potential problem of writing into database the uninitialized value in RDB$RETURN_ARGUMENT and RDB$ARGUMENT_POSITION columns.

Of course, GBAK has a lot of equal problems for other columns but I want to fix a problem only with these ones.

UPD1. Symmetric problem in backup is fixed. Thanks to Adriano.

…T_POSITION to NULL value

This is a fix for issue FirebirdSQL#7869 - potential problem of writing into database the uninitialized value in RDB$RETURN_ARGUMENT and RDB$ARGUMENT_POSITION columns.

get_function
 - inits X.RDB$RETURN_ARGUMENT.NULL
    - IF >=DB_VERSION_DDL12
    - ELSE

get_function_arg
 - inits X.RDB$ARGUMENT_POSITION.NULL
     - IF >=DB_VERSION_DDL12
     - IF >=DB_VERSION_DDL10
     - ELSE
@aafemt
Copy link
Contributor

aafemt commented Nov 22, 2023

I'm still sure that fld_f_position must be not nullable to prevent UB in engine.

@dmitry-lipetsk
Copy link
Contributor Author

I'm still sure that fld_f_position must be not nullable to prevent UB in engine.

Me too but it is a change of ODS and I am too young to ask and suggest such changes.

@aafemt
Copy link
Contributor

aafemt commented Nov 22, 2023

Is it really an ODS change? No field added or deleted, no even unique index/constraint put here (though one won't hurt). Old code should work with new definition flawlessly and vice versa.

@asfernandes
Copy link
Member

In real life, this looks like more as a code improvement, and a partial one.
Why PR against v4 instead only master?

@dmitry-lipetsk
Copy link
Contributor Author

dmitry-lipetsk commented Nov 23, 2023

In real life, this looks like more as a code improvement, and a partial one. Why PR against v4 instead only master?

I can added these changes to master and fb5, too.

I want to add these changes to FB4, because I work with this version and they are needed to fix another problem with UDF SCALAR_ARRAY arguments (#7846, #7845)

…h NULL value. Thanks to Adriano.

This is a fix for symmetric problem with RDB$RETURN_ARGUMENT and RDB$ARGUMENT_POSITION in backup.

write_functions
write_function_args
@dmitry-lipetsk
Copy link
Contributor Author

Hello. Please, let me know if I must create equal PR for FB5 and master. It is not a problem for me. Thanks.

@dmitry-lipetsk dmitry-lipetsk changed the title [FB4, GBAK, restore] Initialization of RDB$RETURN_ARGUMENT and RDB$ARGUMET_POSITION to NULL value [FB4, GBAK] Correct handling of NULLs in RDB$RETURN_ARGUMENT and RDB$ARGUMENT_POSITION Nov 25, 2023
@dyemanov dyemanov merged commit 892d6bf into FirebirdSQL:v4.0-release Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants