Skip Menu |

This queue is for tickets about the DBD-AnyData CPAN distribution.

Report information
The Basics
Id: 63312
Status: open
Priority: 0/
Queue: DBD-AnyData

People
Owner: Nobody in particular
Requestors: dbialac [...] gmail.com
Cc:
AdminCc:

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



Subject: Bug with Fixed format files, file creation
Date: Wed, 24 Nov 2010 16:35:24 -0500
To: bug-dbd-anydata [...] rt.cpan.org
From: Dave Bialac <dbialac [...] gmail.com>
Hey I was trying out DBD::AnyData and I found a couple of bugs with it. Additionally, I have a feature request. 1) It won't create files on an insert. If I am executing an insert statement to a file that doesn't exist, it seems to me that rather than blowing up it should create the file. In other query types (select, update, delete) it should work as though the file is an empty table until data is inserted. 2) When outputing to a Fixed file and doing an insert on only some of the fields, the record is not written to the file correctly. It completely ignores any fields not provided in the insert clause. Ex: Format: a => 1 - 10 b => 11 - 16 c => 17-21 d => 22-25 pattern => 'A11 A6 A5 A4' col_names => 'a,b,c,d' insert into tablename (b, d) values ('123456', '1234') insert into tablename (a, c) values ('12345678901', '12345') results in a file that looks like this (quotes added for clarity): "1234561234" "1234567890112345" but it should look like this: " 123456 1234" "12345678901 12345 " Additionally, it places a newline character at the end of the record. Newline is NOT implied when working with fixed format files. Finally, a feature reqest: Add the ability to provide the col_names attribute as an array reference rather than a string Thanks -- ----- Dave Bialac
Subject: More bugs in Fixed format files
Date: Wed, 24 Nov 2010 18:15:26 -0500
To: bug-dbd-anydata <bug-dbd-anydata [...] rt.cpan.org>
From: Dave Bialac <dbialac [...] gmail.com>
I found some more bugs in fixed format files. They don't seem to work at all. Some examples Ex: Format: a => 1 - 10 b => 11 - 16 c => 17-21 d => 22-25 pattern => 'A11 A6 A5 A4' col_names => 'a,b,c,d' select b from tablename Gives: DBD::AnyData::st execute failed: Execution ERROR: No such column 'b' called from MYLIBRARY at MYLINENUMBER. at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBI/DBD/SqlEngine.pm line 793 However insert into tablename (b) values (123456) Does not generate that error ----- Bug 2: I found that when doing inserts, the pattern isn't used properly. Instead of using the field for the corresponding column name, it will instead use the field in place n, where n is the location of the column within the insert statement. Using the givens from above, insert into tablename (b) values (123456) gives (quotes added): "123456 " This is a correction from my previous bug report -- ----- Dave Bialac
On Wed Nov 24 18:15:36 2010, dbialac@gmail.com wrote: [...] Show quoted text
> > This is a correction from my previous bug report >
Hi Dave, thanks for the correction. If you want to do us a favor in future, then please add the corrections/additions/enhancements/clarifications/etc. direct to the correct RT ticket. /Jens
On Wed Nov 24 16:35:36 2010, dbialac@gmail.com wrote: Show quoted text
> Hey
Hi Dave, Show quoted text
> I was trying out DBD::AnyData and I found a couple of bugs with it.
For bugs, please read http://search.cpan.org/dist/SQL- Statement/lib/SQL/Statement.pm#SUPPORT :) I'm very limited on my free time, and I can neither accept nor reject reported bugs I can't reproduce. So please provide code snipsets which runs on their own for reproducing the bug. Show quoted text
> Additionally, I have a feature request. > > 1) It won't create files on an insert. If I am executing an insert statement > to a file that doesn't exist, it seems to me that rather than blowing up it > should create the file. In other query types (select, update, > delete) it should work as though the file is an empty table until data is > inserted. > 2) When outputing to a Fixed file and doing an insert on only some of the > fields, the record is not written to the file correctly. It > completely ignores any fields not provided in the insert clause. > > Ex: > Format: > a => 1 - 10 > b => 11 - 16 > c => 17-21 > d => 22-25 > > pattern => 'A11 A6 A5 A4' > col_names => 'a,b,c,d' > > insert into tablename (b, d) values ('123456', '1234') > insert into tablename (a, c) values ('12345678901', '12345') > > results in a file that looks like this (quotes added for clarity): > "1234561234" > "1234567890112345" > but it should look like this: > " 123456 1234" > "12345678901 12345 " > Additionally, it places a newline character at the end of the record. > Newline is NOT implied when working with fixed format files. > > Finally, a feature reqest: > Add the ability to provide the col_names attribute as an array reference > rather than a string
This feature request can be rejected for now. DBD::AnyData will receive a rework one fine day and base then on DBD::File. At this moment, you can use all features provided by DBD::File. Anyway, DBD::AnyData 0.110 bases on DBI::DBD::SqlEngine which supports dbh attributes via new hash interface which allows you to give col_names as an array. Jens