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