Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Executive summary: Do not upgrade DBD::DB2 unless you have verified that your application works as expected with the new version. There is no test suite to help you detect errors or unexpected results.

DBD::DB2 is the database driver for IBM DB2 UDB. The database runs on a variety of platforms, including Unix (AIX), Windows, Linux and z/OS.

To my big surprise, DBD::DB2 has no real test suite, and recently there was discovered a bug where newer versions of the module return incorrect results for certain versions of the database for the clob data-type.

I claim that this bug could have easily been discovered during development if the module had even the simplest of tests (which in this case would be to insert a value, then retrieve the value, and test for equality), e.g. like this:

# -- Prepare test data: # create table dbddb2_clob ( # id integer not null, # data clob not null , # constraint pk_dbddb2_clob primary key (id) # ); # insert into dbddb2_clob values (1, 'fubar_clob'); my $sth = $dbh->prepare(q{select id,data from dbddb2_clob}); $sth->execute(); is_deeply($sth->fetchall_arrayref(), [[1,'fubar_clob']], q{Expect 1 row (1,'fubar_clob') returned});

Citing dhoss (here):

The benefit of test driven development is, you *know* your code will work before you ship it.
I will turn that around: The benefit of test driven development is, you detect when your code does not work as expected.

Let this serve as a reminder of how important it is to have a test suite, and a kind request to the module maintainers to start building one.

Update Fri Mar 20 12:21:46 CET 2009: The IBM OPENDEV team has responded to the bug and produced a patch that seems to fix the problem, and they deserve credit for doing so.

In reply to DBD::DB2 truncates clob values - on the importance testing by andreas1234567

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2022-05-27 12:42 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (94 votes). Check out past polls.