Skip Menu |

This queue is for tickets about the Bot-BasicBot-Pluggable CPAN distribution.

Report information
The Basics
Id: 21693
Status: resolved
Worked: 40 min
Priority: 0/
Queue: Bot-BasicBot-Pluggable

People
Owner: MDOM [...] cpan.org
Requestors: BROQ [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.50
Fixed in: (no value)



Subject: DB related bugs
A few bugs here, one major and two minor: * The major bug is that because complex structures are serialized as binary data and SQLite is the default data source things break. This is because SQLite doesn't handle binary data very well (at least as of version 2.8.16 and probably up to version 3.0). My solution was to switch to MySQL but I imagine some kind of binary twiddling function would do the job too as the only problem is with the embedded NULLs in the binary data strings. * Whenever a new data source object is instantiated a table creation attempt is made so spurious errors are spewed after the first (successful) call. * When fetching an id from new_id it can break if nothing is returned from the fetchrow_arrayref. I've supplied a patch for the two minor bugs. Cheers, Dan Brook
Subject: DBI.pm.patch
53c53,55 < $self->dbh->do("CREATE TABLE $table ( --- > my $dbh = $self->dbh; > local $dbh->{PrintError}; > $dbh->do("CREATE TABLE $table ( 61c63 < $self->dbh->do("CREATE INDEX lookup ON $table ( namespace(10), store_key(10) )"); --- > $dbh->do("CREATE INDEX lookup ON $table ( namespace(10), store_key(10) )"); 92c94 < my $id = $sth->fetchrow_arrayref->[0] || "0"; --- > my $id = eval { $sth->fetchrow_arrayref->[0] } || "0";
Hello, first i want to thank you for the error report and the supplied patch. Show quoted text
> * The major bug is that because complex structures are serialized as > binary data and SQLite is the default data source things break. Thisis > because SQLite doesn't handle binary data very well (at least as of > version 2.8.16 and probably up to version 3.0). My solution was to > switch to MySQL but I imagine some kind of binary twiddling function > would do the job too as the only problem is with the embedded NULLs in > the binary data strings.
Do you have any example for this so i can try to solve these problems? I've never had any problem with sqlite in this regard ... but ask me about sqlite on nfs... :) But i am also not that happy about using sqlite as default storage driver. Maybe i change that in the future, but i can't do anything about this now without breaking a lot of code. Show quoted text
> * Whenever a new data source object is instantiated a table creation > attempt is made so spurious errors are spewed after the first > (successful) call.
Okay, i fixed this by using table_info first in order to check for an already existing table. Seems to work. It's in our github repository for now and will became part of our next release. Show quoted text
> * When fetching an id from new_id it can break if nothing is returned > from the fetchrow_arrayref.
Mhh, i haven't checked the old code, but this case is catched in our code now. Best whishes, Mario