Re: [libdbi-users] sqlite and binary

2010-12-23 Thread Vikram Ambrose
On 12/23/2010 02:35 PM, markus.hoeni...@mhoenicka.de wrote:
> Vikram Ambrose writes:
>   >  I can't seem to get BLOBs to work with SQLite.
>   >
>   >  Here is some test code.
>   >  http://en.pastebin.ca/2026862
>   >
>   >  Output on my machine is;
>   >
>   >  dbi_conn_connect: rv = 0:
>   >  data = ERROR
>   >
>   >  What am I doing wrong?
>
> Could you test sqlite3 as well just to see whether it is a problem of your box
> or indeed a problem of the driver.
>

Interestingly enough the test code works fine under sqlite3. Looks like 
a bug in the sqlite(2) driver so far.

> Did you run make check in libdbi-drivers after building and installing
> the drivers? The test program includes checks for blob handling, so if
> there is a problem in the driver it should report errors. Runs fine here.
>

make check gives me an error. Missing dependency probably?

test_dbi.c:33: fatal error: cgreen/cgreen.h: No such file or directory


> Also, could you send a few specs of your OS and libdbi/libdbi-drivers
> versions?


Using CVS versions of both. Check'd out yesterday.

The strlen() was used because I knew what the input data was.

On a side note, in general, I often use BLOB instead of VARCHAR/STRING 
for clear text strings as its much easier to deal with character 
encoding/locale at the application level than messing around with it at 
the DB level.

I suppose I'll just switchover to sqlite3. Doesn't make a difference to 
me really. Just needed a database that could be used for a test run 
without the user requiring administrative privileges.

thanks,


Vikram.


--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


[libdbi-users] sqlite and binary

2010-12-23 Thread markus . hoenicka
Vikram Ambrose writes:
 > I can't seem to get BLOBs to work with SQLite.
 > 
 > Here is some test code.
 > http://en.pastebin.ca/2026862
 > 
 > Output on my machine is;
 > 
 > dbi_conn_connect: rv = 0:
 > data = ERROR
 > 
 > What am I doing wrong?

Probably nothing, at least not in your own code. Your test code prints
the following on my box:

$ ./sqlite_binary_test
dbi_conn_connect: rv = 0: 
dbi_conn_query: 
data = close your eyes, this is binary

All I changed is the driver. I've used sqlite3 as I currently don't
have sqlite installed. However, as far as I can see there is no
difference between those drivers in terms of blob handling. Could you
test sqlite3 as well just to see whether it is a problem of your box
or indeed a problem of the driver.

Did you run make check in libdbi-drivers after building and installing
the drivers? The test program includes checks for blob handling, so if
there is a problem in the driver it should report errors. Runs fine here.

Also, could you send a few specs of your OS and libdbi/libdbi-drivers
versions?

regards,
Markus

P.S. your code contains a strlen() call on binary data. I assume you
are aware that this wouldn't work with arbitrary binary data.

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users


[libdbi-users] sqlite and binary

2010-12-22 Thread Vikram Ambrose
I can't seem to get BLOBs to work with SQLite.

Here is some test code.
http://en.pastebin.ca/2026862

Output on my machine is;

dbi_conn_connect: rv = 0:
data = ERROR

What am I doing wrong?



Vikram.


--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users