Menu

#56 [Perl]Method of bind_param can't support inserting binary data.

open
nobody
None
5
2012-01-10
2012-01-10
Jira Trac
No

Test Build:CUBRID 2008 R4.0 (8.4.0.2019) (64bit release build for linux_gnu)
OS: Linux 64
Description: Method of bind_param can't support inserting binary data.

Repro Steps
perl bind_param_5.pl

statements in bind_param_5.pl:
$dbh - do(CREATE TABLE image_t (doc_id VARCHAR(64) PRIMARY KEY, image BLOB);)
my $sth=$dbh-prepare(insert into image_t values(?,?);) or die delete error: $dbh-errstr;
my $bdRs1=$sth-bind_param(1,'id1') or die bind_param error: $dbh-errstr;
my $bdRs2=$sth-bind_param(2,BIT_TO_BLOB(X'000010'),SQL_BLOB) or die bind_param error: $dbh-errstr;
or: my $bdRs2=$sth-bind_param(2,X'000010',SQL_BLOB) or die bind_param error: $dbh-errstr;
or: my $bdRs2=$sth-bind_param(2,X\'000010\',SQL_BLOB) or die bind_param error: $dbh-errstr;

Actual result:
{noformat}
csql -udba demodb;
select * from image_t;

=== Result of SELECT Command in Line 5 ===

doc_id image

'id1' file:/home/perl/CUBRID/databases/demodb/lob/ces_097/image_t.00001326166063063713_4220

select BLOB_TO_BIT(image) from image_t;
=== Result of SELECT Command in Line 4 ===

blob_to_bit(image)

X'4249545f544f5f424c4f422858273030303031302729'

{noformat}

Expect result:
{noformat}
csql -udba demodb;
CREATE TABLE image_t (image_id VARCHAR(36) PRIMARY KEY, image BLOB);
INSERT INTO image_t VALUES ('id1', BIT_TO_BLOB(X'000001'));
select * from image_t;
=== Result of SELECT Command in Line 1 ===

image_id image

'id1' file:/home/perl/CUBRID/databases/demodb/lob/ces_155/image_t.00001326166307061620_0381

select BLOB_TO_BIT(image) from image_t;
=== Result of SELECT Command in Line 1 ===

blob_to_bit(image)

X'000001'
{noformat}

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.