Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Using standard testsuites

by rir (Vicar)
on Apr 29, 2009 at 17:23 UTC ( #760924=note: print w/replies, xml ) Need Help??

in reply to Using standard testsuites

It is in DBD::CSV's documentation that it does not handle types correctly. Your specific bug is mentioned.

I believe it was a DBI design decision to not require stringent type handling of database drivers because that would have made it more difficult to create them and because lots of the backends are not strictly compliant. A CSV file doesn't not have an SQL compliant typing system. You may want to type all your fields; the next player may just want it to work.

Be well,

Replies are listed 'Best First'.
Re^2: Using standard testsuites
by Tux (Canon) on Apr 29, 2009 at 19:42 UTC

    I think that specifically binding types to parameters/variables - and accepting them in the calls - kinda promises the end-user that the types will be honored. In this case, the bug isn't really in DBD::CSV, but in DBD::File, and I have meanwhile commited a patch that applies basic types in these cases when they are requested.

    Unless speified in one way or another, DBD::CSV would of course not be able to set those types itself when reading/analyzing files.

    I'm now done with the conversion to Test::More, and found out that this process at least fixed one RT bug along the way.

    Devel::Cover by the way is a great tool to craft TODO lists :).

    Update: More important, related to the original post, it was tested for, so even the original author was expecting it to work, but the tests didn't test what it was supposed to test, and thus hiding the bug. Documented or not, this is very very unwanted behaviour.

    Enjoy, Have FUN! H.Merijn
      binding types ... kinda promises ... the types will be honored.

      You are right but there are other aspects. If I pull a record, change someone's middle initial, then update the record; do I want a ' 4' to be corrected to a canonical '4'? Will all the other programs using my CSV file approve? There That is an argument for least change.

      When one tightens up on type handling, little problems start popping up. Often they keep popping up.

      Incidentally, the test changed: SQL_INTEGER() and &SQL_INTEGER can differ semantically.

      Be well,

        A middle initial is rather unlikely bound to be an initial, right? If unbound. nothing changes.

        I have no intention to break anything. I want to fix bugs, and extend features.

        Enjoy, Have FUN! H.Merijn

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://760924]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2021-04-13 00:44 GMT
Find Nodes?
    Voting Booth?

    No recent polls found