MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / mapInOut

Method mapInOut

src/dsql/DsqlRequests.cpp:832–1019  ·  view source on GitHub ↗

Map data from external world into message or from message to external world.

Source from the content-addressed store, hash-verified

830
831// Map data from external world into message or from message to external world.
832void DsqlDmlRequest::mapInOut(thread_db* tdbb, bool toExternal, const dsql_msg* message,
833 IMessageMetadata* meta, UCHAR* dsql_msg_buf, const UCHAR* in_dsql_msg_buf)
834{
835 USHORT count = parseMetadata(meta, message->msg_parameters);
836
837 // Sanity check
838
839 if (count)
840 {
841 if (toExternal)
842 {
843 if (dsql_msg_buf == NULL)
844 {
845 ERRD_post(Arg::Gds(isc_dsql_sqlda_err) <<
846 Arg::Gds(isc_dsql_no_output_sqlda));
847 }
848 }
849 else
850 {
851 if (in_dsql_msg_buf == NULL)
852 {
853 ERRD_post(Arg::Gds(isc_dsql_sqlda_err) <<
854 Arg::Gds(isc_dsql_no_input_sqlda));
855 }
856 }
857 }
858
859 USHORT count2 = 0;
860
861 for (FB_SIZE_T i = 0; i < message->msg_parameters.getCount(); ++i)
862 {
863 dsql_par* parameter = message->msg_parameters[i];
864
865 if (parameter->par_index)
866 {
867 // Make sure the message given to us is long enough
868
869 dsc desc;
870 if (!req_user_descs.get(parameter, desc))
871 desc.clear();
872
873 /***
874 ULONG length = (IPTR) desc.dsc_address + desc.dsc_length;
875 if (length > msg_length)
876 {
877 ERRD_post(Arg::Gds(isc_dsql_sqlda_err) <<
878 Arg::Gds(isc_random) << "Message buffer too short");
879 }
880 ***/
881 if (!desc.dsc_dtype)
882 {
883 ERRD_post(Arg::Gds(isc_dsql_sqlda_err) <<
884 Arg::Gds(isc_dsql_datatype_err) <<
885 Arg::Gds(isc_dsql_sqlvar_index) << Arg::Num(parameter->par_index-1));
886 }
887
888 UCHAR* msgBuffer = req_msg_buffers[parameter->par_message->msg_buffer_number];
889

Callers 2

executeMethod · 0.80
fetchFromCacheMethod · 0.80

Calls 13

ERRD_postFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
MOVD_moveFunction · 0.85
getParentDbKeyMethod · 0.80
getDbKeyMethod · 0.80
getParentRequestMethod · 0.80
getParentRecVersionMethod · 0.80
getRecVersionMethod · 0.80
getCountMethod · 0.45
getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected