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
invalid BLOB type for operation (x86_64) [CORE2377] #2799
Comments
Commented by: @AlexPeshkoff How is defined BLOB in your UDF? Where from is BLOB definition taken? |
Commented by: Alexander (coopht) BLOB is defined as followed in my UDF |
Commented by: @AlexPeshkoff X64 played rather typical joke with you. You have declared a few entities as long: Please confirm - did it fix your problem or not. |
Commented by: Alexander (coopht) I defined BLOB type as followed, and fixed the problem . typedef struct blob { Thank you for your help. P.S. There no any information about ISC_BLOB_CALLBACK structure in Developers guide, that is why i did not use it. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Commented by: SITA VINCENZO (sita) Hello, I tried to do the same with lazarus for firebird64 but il doesn't work. Thank you New declaration New declaration New declaration New declaration Old declaration //Example of IB_EXTERNALS.PAS how it was before (* {$IFDEF FPC} { Some structures, declarations that we need for the IB stuff to work, but {$IFDEF FPC} type { C Date/Time Structure } PCTimeStructure = ^TCTimeStructure; TISC_VARYING = record {***************************} TISC_BlobPutSegment = procedure(BlobHandle: PInt; Buffer: PChar; BufferLength: Short); cdecl; TBlob = record const procedure InitializeTCTimeStructure(var tm_record: TCTimeStructure); implementation procedure InitializeTCTimeStructure(var tm_record: TCTimeStructure); end. |
Commented by: @asfernandes Are you sure that "Int = LongInt; // 32 bit signed" really defines it as 32 bit integer? |
Commented by: SITA VINCENZO (sita) No but I'don't know which type i shut use in free-pascal. |
Commented by: @asfernandes Integer? |
Commented by: SITA VINCENZO (sita) I've tried but without sucess. |
Commented by: SITA VINCENZO (sita) Hello I ask me if you have an idea why --> Getsegment works
with Blob^ do and PutSegment don't works
thank you |
Commented by: @asfernandes Blob handle is not pointer, it's 32 bit value. You shall better move your questions to the support list. |
Submitted by: Alexander (coopht)
I recieve this error only x86_64 architecture,
on the same firebird version, but on X86 Gentoo linux everithing is fine.
I have following UDF function:
void my_func (BLOB b, BLOB out))
{
char *buf = NULL;
short length = 0;
short actual_length = 0;
if (!b->blob_handle)
return;
length = (short) (b->blob_max_segment);
buf = malloc (length + 1L);
(*b->blob_get_segment) (b->blob_handle, buf, length, &actual_length);
buf [actual_length] = 0;
if (buf)
free (buf);
}
declare query:
DECLARE EXTERNAL FUNCTION BSTR
BLOB, BLOB
RETURNS PARAMETER 2
ENTRY_POINT 'my_func' MODULE_NAME 'my_udf.so'
Creating table for input blob:
CREATE TABLE test_table (B BLOB (80,1))
Insert blob into table:
INSERT INTO test_table VALUES (?)
I insert blob into test table from my program, and it is a TEXT BLOB, and it is correct,
because i can view it's content with flamerobin.
And when i execute select:
SELECT BSTR (B) FROM test_table
i got such error:
*** IBPP::SQLException ***
Context: Statement::Fetch
Message: isc_dsql_fetch failed.
SQL Message : -685
invalid ARRAY or BLOB operation
Engine Code : 335544465
Engine Message :
invalid BLOB type for operation
The text was updated successfully, but these errors were encountered: