Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 56561
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: daxim [...] cpan.org
Cc: HMBRAND [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.610_90
Fixed in: (no value)



Subject: DBD::DBM: Execution ERROR: Table '...' already exists..

Message body is not shown because it is too large.

A first glance makes me belief that the file cannot be created because the directory is missing. The error returned is just misleading: $ perl -MDBI -wle'DBI->connect("dbi:DBM:f_dir=/tmp/somewhere/not_yet/ existing/far/far/away")->do(q{create table users (id integer, name varchar (64))})' DBD::DBM::db do failed: Execution ERROR: Table 'users' already exists.. [for Statement "create table users (id integer, name varchar (64))"] at - e line 1.
This is worse than it looks. nb09:/tmp 116 > ll users.* ls: cannot access users.*: No such file or directory Exit 2 nb09:/tmp 117 > perl -MDBI -wle'DBI->connect("dbi:DBM:f_dir=/tmp/ somewhere/not_yet/existing/far/far/away")->do(q{create table users (id integer, name varchar (64))})' DBD::DBM::db do failed: Execution ERROR: Table 'users' already exists.. [for Statement "create table users (id integer, name varchar (64))"] at -e line 1. nb09:/tmp 118 > ll users.* 6374543 -rw-rw-rw- 1 merijn users 0 2010-04-13 15:47 users.dir 6373461 -rw-rw-rw- 1 merijn users 0 2010-04-13 15:47 users.lck 6374542 -rw-rw-rw- 1 merijn users 0 2010-04-13 15:47 users.pag nb09:/tmp 119 > There seems to be no check if f_dir exists, and if it doesn't exist, it silently uses "."
One more thing. Moving f_dir to attributes will show that DBD::DBM ignores a few errors too: perl -Ilib -MDBI -wle'DBI->connect("dbi:DBM:",undef,undef,{f_dir=>"/tmp/ somewhere/not_yet/existing/far/far/away"})->do(q{create table users (id integer, name varchar (64))})' Use of uninitialized value in sprintf at lib/DBI/SQL/Nano.pm line 25. DBD::DBM::db STORE failed: No such directory '/tmp/somewhere/not_yet/ existing/far/far/away' at /pro/lib/perl5/site_perl/5.10.0/i686- linux-64int/DBI.pm line 708. DBD::DBM::db do failed: Execution ERROR: Cannot CREATE './users.pag' because it already exists at lib/DBD/File.pm line 571 called from -e at 1. [for Statement "create table users (id integer, name varchar (64))"] at -e line 1. FWIW, DBM.pm still uses "die" instead of "croak" Sorry I do not have time to fix right now
Issue resolved with the release of DBI-1.612 and SQL-Statement-1.28