8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

[GBAK] Correct handling of NULLs in RDB$RETURN_ARGUMENT and RDB$ARGUMENT_POSITION (#7875)

It is a fix for issue #7869
This commit is contained in:
Dmitry Kovalenko 2024-01-29 19:00:40 +03:00 committed by GitHub
parent 4cd3b0e47a
commit 06aedb9efb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 5 deletions

View File

@ -2839,7 +2839,10 @@ void write_functions()
BURP_verbose (147, temp);
// msg 147 writing function %.*s
put_source_blob (att_function_description2, att_function_description, X.RDB$DESCRIPTION);
put_int32 (att_function_return_arg, X.RDB$RETURN_ARGUMENT);
if (!X.RDB$RETURN_ARGUMENT.NULL)
put_int32 (att_function_return_arg, X.RDB$RETURN_ARGUMENT);
put_int32 (att_function_type, X.RDB$FUNCTION_TYPE);
PUT_TEXT (att_function_query_name, X.RDB$QUERY_NAME);
@ -2893,7 +2896,10 @@ void write_functions()
put_source_blob (att_function_description2, att_function_description, X.RDB$DESCRIPTION);
PUT_TEXT (att_function_module_name, X.RDB$MODULE_NAME);
PUT_TEXT (att_function_entrypoint, X.RDB$ENTRYPOINT);
put_int32 (att_function_return_arg, X.RDB$RETURN_ARGUMENT);
if (!X.RDB$RETURN_ARGUMENT.NULL)
put_int32 (att_function_return_arg, X.RDB$RETURN_ARGUMENT);
put_int32 (att_function_type, X.RDB$FUNCTION_TYPE);
PUT_TEXT (att_function_query_name, X.RDB$QUERY_NAME);
put(tdgbl, att_end);
@ -2955,7 +2961,9 @@ void write_function_args(const GDS_NAME package, GDS_NAME funcptr)
BURP_verbose (141, temp);
// msg 141 writing argument for function %s
put_int32 (att_functionarg_position, X.RDB$ARGUMENT_POSITION);
if (!X.RDB$ARGUMENT_POSITION.NULL)
put_int32 (att_functionarg_position, X.RDB$ARGUMENT_POSITION);
put_int32 (att_functionarg_passing_mechanism, X.RDB$MECHANISM);
put_int32 (att_functionarg_field_type, X.RDB$FIELD_TYPE);
put_int32 (att_functionarg_field_scale, X.RDB$FIELD_SCALE);
@ -3006,7 +3014,10 @@ void write_function_args(const GDS_NAME package, GDS_NAME funcptr)
MISC_terminate (X.RDB$FUNCTION_NAME, temp, l, sizeof(temp));
BURP_verbose (141, temp);
// msg 141 writing argument for function %s
put_int32 (att_functionarg_position, X.RDB$ARGUMENT_POSITION);
if (!X.RDB$ARGUMENT_POSITION.NULL)
put_int32 (att_functionarg_position, X.RDB$ARGUMENT_POSITION);
put_int32 (att_functionarg_passing_mechanism, X.RDB$MECHANISM);
put_int32 (att_functionarg_field_type, X.RDB$FIELD_TYPE);
put_int32 (att_functionarg_field_scale, X.RDB$FIELD_SCALE);
@ -3034,7 +3045,10 @@ void write_function_args(const GDS_NAME package, GDS_NAME funcptr)
MISC_terminate (X.RDB$FUNCTION_NAME, temp, l, sizeof(temp));
BURP_verbose (141, temp);
// msg 141 writing argument for function %s
put_int32 (att_functionarg_position, X.RDB$ARGUMENT_POSITION);
if (!X.RDB$ARGUMENT_POSITION.NULL)
put_int32 (att_functionarg_position, X.RDB$ARGUMENT_POSITION);
put_int32 (att_functionarg_passing_mechanism, X.RDB$MECHANISM);
put_int32 (att_functionarg_field_type, X.RDB$FIELD_TYPE);
put_int32 (att_functionarg_field_scale, X.RDB$FIELD_SCALE);

View File

@ -4384,6 +4384,7 @@ bool get_function(BurpGlobals* tdgbl)
X.RDB$OWNER_NAME.NULL = TRUE;
X.RDB$MODULE_NAME.NULL = TRUE;
X.RDB$ENTRYPOINT.NULL = TRUE;
X.RDB$RETURN_ARGUMENT.NULL = TRUE;
X.RDB$SYSTEM_FLAG.NULL = FALSE;
X.RDB$SYSTEM_FLAG = 0;
@ -4440,6 +4441,7 @@ bool get_function(BurpGlobals* tdgbl)
break;
case att_function_return_arg:
X.RDB$RETURN_ARGUMENT.NULL = FALSE;
X.RDB$RETURN_ARGUMENT = (USHORT) get_int32(tdgbl);
break;
@ -4599,6 +4601,7 @@ bool get_function(BurpGlobals* tdgbl)
STORE (TRANSACTION_HANDLE local_trans
REQUEST_HANDLE tdgbl->handles_get_function_req_handle1)
X IN RDB$FUNCTIONS
X.RDB$RETURN_ARGUMENT.NULL = TRUE;
X.RDB$SYSTEM_FLAG = 0;
X.RDB$SYSTEM_FLAG.NULL = FALSE;
X.RDB$DESCRIPTION.NULL = TRUE;
@ -4634,6 +4637,7 @@ bool get_function(BurpGlobals* tdgbl)
break;
case att_function_return_arg:
X.RDB$RETURN_ARGUMENT.NULL = FALSE;
X.RDB$RETURN_ARGUMENT = (USHORT) get_int32(tdgbl);
break;
@ -4851,6 +4855,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments)
STORE (TRANSACTION_HANDLE local_trans
REQUEST_HANDLE tdgbl->handles_get_function_arg_req_handle1)
X IN RDB$FUNCTION_ARGUMENTS
X.RDB$ARGUMENT_POSITION.NULL = TRUE;
X.RDB$FIELD_SUB_TYPE.NULL = TRUE;
X.RDB$CHARACTER_SET_ID.NULL = TRUE;
X.RDB$FIELD_PRECISION.NULL = TRUE;
@ -4894,6 +4899,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments)
break;
case att_functionarg_position:
X.RDB$ARGUMENT_POSITION.NULL = FALSE;
X.RDB$ARGUMENT_POSITION = (USHORT) get_int32(tdgbl);
break;
@ -5061,6 +5067,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments)
STORE (TRANSACTION_HANDLE local_trans
REQUEST_HANDLE tdgbl->handles_get_function_arg_req_handle1)
X IN RDB$FUNCTION_ARGUMENTS
X.RDB$ARGUMENT_POSITION.NULL = TRUE;
X.RDB$FIELD_SUB_TYPE.NULL = TRUE;
X.RDB$CHARACTER_SET_ID.NULL = TRUE;
X.RDB$FIELD_PRECISION.NULL = TRUE;
@ -5078,6 +5085,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments)
break;
case att_functionarg_position:
X.RDB$ARGUMENT_POSITION.NULL = FALSE;
X.RDB$ARGUMENT_POSITION = (USHORT) get_int32(tdgbl);
break;
@ -5175,6 +5183,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments)
STORE (TRANSACTION_HANDLE local_trans
REQUEST_HANDLE tdgbl->handles_get_function_arg_req_handle1)
X IN RDB$FUNCTION_ARGUMENTS
X.RDB$ARGUMENT_POSITION.NULL = TRUE;
X.RDB$FIELD_SUB_TYPE.NULL = TRUE;
X.RDB$CHARACTER_SET_ID.NULL = TRUE;
@ -5191,6 +5200,7 @@ void get_function_arg(BurpGlobals* tdgbl, bool skip_arguments)
break;
case att_functionarg_position:
X.RDB$ARGUMENT_POSITION.NULL = FALSE;
X.RDB$ARGUMENT_POSITION = (USHORT) get_int32(tdgbl);
break;