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 ===
'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 ===
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 ===
'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 ===
X'000001'
{noformat}