Issue Details (XML | Word | Printable)

Key: CORE-1991
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dimitry Sibiryakov
Reporter: Klaus Mühlböck
Votes: 0
Watchers: 1
Operations

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

UDF BLOB as parameter error

Created: 13/Jul/08 01:10 PM   Updated: 12/Nov/09 05:20 PM
Component/s: Engine, UDF
Affects Version/s: 2.0.0, 1.5.4, 2.0.1, 2.0.2, 2.0.3, 1.5.5, 2.1.0, 2.0.4, 2.5 Alpha 1, 2.1.1, 2.0.5, 2.1.2, 2.5 Beta 1, 2.5 Beta 2
Fix Version/s: 2.5 RC1

Time Tracking:
Not Specified

Environment:
fbserver.exe 2.1.0.17798
Delphi 2005

Planning Status: Unspecified


 Description  « Hide
DECLARE EXTERNAL FUNCTION FN_BLOBCAT
BLOB, BLOB
RETURNS BLOB
ENTRY_POINT 'BlobCat' MODULE_NAME 'mydll.dll';

  IBQuery1.SQL.Text := 'select FN_BLOBCAT(:B1,:B2) from rdb$database';
  IBQuery1.ParamByName('B1').asBlob := '12345';
  IBQuery1.ParamByName('B2').asBlob := '67890';
  IBQuery1.Open;

runtime error at Open: message length error (encountered @1, expected @2)


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dimitry Sibiryakov added a comment - 18/Sep/09 08:28 AM
This error is caused by RDB$FUNCTION_PARAMETERS.RDB$FIELD_LENGTH containing NULL.

Proposed path:

--- ddl.cpp Fri Sep 18 23:03:18 2009
+++ ddl.cpp.new Fri Sep 18 22:09:54 2009
@@ -6038,6 +6038,10 @@
  }
  statement->append_number(isc_dyn_fld_segment_length, field->fld_seg_length);
  }
+ else
+ {
+ statement->append_number(isc_dyn_fld_length, sizeof(ISC_QUAD));
+ }
  if (field->fld_sub_type == isc_blob_text) {
  statement->append_number(isc_dyn_fld_character_set, field->fld_character_set_id);
  statement->append_number(isc_dyn_fld_collation, field->fld_collation_id);