Followup: 20040131-- DBD:Oracle 1.15 fails for long.t test 195 to 198 (perl 5.8.3, oracle 8.1.7)

From: Gerard Tromp (Gerard.Tromp_at_sanger.med.wayne.edu)
Date: 02/01/04

  • Next message: Jared Still: "Re: How-To generate DDL for Oracle tables using Perl?"
    To: "Tim Bunce" <Tim.Bunce@pobox.com>
    Date: Sat, 31 Jan 2004 20:30:51 -0500
    
    

    Some additional data.

    When the tests are trimmed to 13 (see previous message below), the failure
    affects only 2 (9,11) or 3 (9,11,12) tests.
    The tests are:
    9 ok(0, $tmp = $sth->fetchall_arrayref, 1); # line 156
    11 ok(0, $tmp->[0],[1] eq .... # line 158
    12 ok(0, $tmp->[1],[1] eq .... # line 160

    I have tried both statically linked and dynamically linked perl binaries (no
    threading).

    It appears to make no difference whether "$dbh->{LongReadLen} = 20;" at line
    144, or "$dbh->{LongReadLen} = 80;" (with original oci8.c).

    The error message "ORA-01801: date format too long for internal buffer" is
    triggered intermittently when the tests are trimmed to 13. I am including
    the output below for a run of 100 sets of 13 tests to show the intermittent
    failure.
    Summary:
    In a run of 100 tests, the failures are sporadic.
    ================================================
    Sometimes 2 (9,11) tests fail, sometimes 3 (9,11,12)
    Failed: 31, 45, 58, 69, 70, 83
    Period: 31, 14, 13, 11, 1, 13
    Failures: 2, 3, 2, 2, 3, 2

    Gerard

    -----Original Message-----
    From: Gerard Tromp [mailto:Gerard.Tromp@sanger.med.wayne.edu]
    Sent: Friday, January 30, 2004 11:59
    To: Tim Bunce
    Cc: dbi-users@perl.org
    Subject: RE: DBD:Oracle 1.15 fails for long.t test 195 to 198 (perl
    5.8.3, oracle 8.1.7)

    Hello Tim, others,

    I pared down the tests as per the suggestion (push @tests) and reduced the
    tests to 13 by commenting out the remaining 80 tests in the ["LONG", 0, 0]
    set, i.e. the 80 tests in the set that passed.

    At this point an interesting phenomenon occurred: the tests started failing
    only intermittently. I explicitly ran the tests using the DBD::Oracle 1.15
    blib/lib and blib/arch components. By running the same tests with the
    DBD::Oracle 1.14 components I could also get intermittent failure.

    The intermittence of the failure in the context of fewer tests is consistent
    with some of the notes that Tim provided with his Google search. There, one
    person's workaround was to close the connection (db handle) and recreate it
    between inserts and selects. Thus far, the evidence is mounting in favor of
    an Oracle bug (as Tim suggested).

    I have yet to alter the LongReadLen. will keep everyone posted.

    Gerard

    -----Original Message-----
    From: Tim Bunce [mailto:Tim.Bunce@pobox.com]
    Sent: Thursday, January 29, 2004 13:36
    To: Gerard Tromp
    Cc: dbi-users@perl.org
    Subject: Re: DBD:Oracle 1.15 fails for long.t test 195 to 198 (perl
    5.8.3, oracle 8.1.7)

    On Wed, Jan 28, 2004 at 08:56:51PM -0500, Gerard Tromp wrote:
    >
    > DBD::Oracle 1.15 fails for tests 195, 196, 197 and 198
    > Oracle version 8.1.7.0.0 for both server and client.

    If there's anyone out there using Oracle 8.1.x could you please
    test DBD::Oracle 1.15 and let us know if it works or not for you?

    > Note that DBD::Oracle 1.14 is OK (somehwat fewer tests, so perhaps the bug
    > isn't triggered -- I have not yet delved into the differrences between the
    > test sets).
    >
    > The failure is peculiar. Oracle complains about the date format being
    wrong,
    > but as I understand it the date has been OK in previous and subsequent
    > queries.

    I thought I'd seen it before. A little googling turned up these:
    http://www.geocrawler.com/archives/3/183/2003/1/0/10305042/
    http://www.bitmechanic.com/mail-archives/dbi-users/Jun1999/0466.html
    http://archives.neohapsis.com/archives/php/2000-02/0000.html
     (search for "date format is too long for internal buffer" in that one)

    I can't see anything in the trace file you sent.

    Try running: perl -Mblib t/long.t

    and see for which LONG type you get the error, then try commenting
    out the "push @test_sets, ..." lines near the top to see if the
    error still happens when only that type is tested.

    Then also try altering the "$dbh->{LongReadLen} = 20;" at line 144
    (try using 80, but make sure you're using the original oci8.c file).

    Then try reducing the t/long.t file down till it's as small as
    possible but still generates the error.

    Tim.

    ======================
    Log of 100 runs of sets of 13 tests.

    Success:
    =======
    PERL_DL_NONLAZY=1 /opt/perl/bin/perl "-MExtUtils::Command::MM" "-e"
    "test_harness(1, '../DBD-Oracle-1.15/blib/lib',
    '../DBD-Oracle-1.15/blib/arch')" t/t_long.t

    t/t_long....create table dbd_ora__drop_me ( idx integer, lng LONG, dt date )
    1..13
    long_data0 length 10240
    long_data1 length 81920
    long_data2 length 71680
    create table dbd_ora__drop_me ( idx integer, lng LONG, dt date )
     --- insert some LONG data (ora_type 0)
    ok 1
    ok 2
    ok 3
    ok 4
    ok 5
     --- fetch LONG data back again -- truncated - LongTruncOk == 1
    LongReadLen 80, LongTruncOk 1
    ok 6
    ok 7
    ok 8
    ok 9
    ok 10
    ok 11
    ok 12
    ok 13
    ok
    All tests successful.
    Files=1, Tests=13, 1 wallclock secs ( 0.62 cusr + 0.11 csys = 0.73 CPU)

    Failure:
    =======
    PERL_DL_NONLAZY=1 /opt/perl/bin/perl5.8.3.static "-MExtUtils::Command::MM"
    "-e" "test_harness(1, '../DBD-Oracle-1.15/blib/lib',
    '../DBD-Oracle-1.15/blib/arch')" t/t_long.t

    t/t_long....create table dbd_ora__drop_me ( idx integer, lng LONG, dt date )
    1..13
    long_data0 length 10240
    long_data1 length 81920
    long_data2 length 71680
    create table dbd_ora__drop_me ( idx integer, lng LONG, dt date )
     --- insert some LONG data (ora_type 0)
    ok 1
    ok 2
    ok 3
    ok 4
    ok 5
     --- fetch LONG data back again -- truncated - LongTruncOk == 1
    LongReadLen 80, LongTruncOk 1
    ok 6
    ok 7
    DBD::Oracle::st fetchall_arrayref failed: ORA-01801: date format is too long
    for internal buffer (DBD ERROR: OCIStmtFetch) [for Statement "select * from
    dbd_ora__drop_me order by idx"] at t/t_long.t line 156.
    # failed test 9 at line 157.
    ok 8
    Use of uninitialized value in string eq at t/t_long.t line 160.
    Use of uninitialized value in length at t/t_long.t line 160.
    Use of uninitialized value in length at t/t_long.t line 438.
    Use of uninitialized value in string eq at t/t_long.t line 439.
    not ok 9
    # failed test 11 at line 160. Strings are of different lengths (0 vs 80),
    Len 0
    Use of uninitialized value in string eq at t/t_long.t line 162.
    Use of uninitialized value in length at t/t_long.t line 162.
    Use of uninitialized value in length at t/t_long.t line 438.
    ok 10
    Use of uninitialized value in string eq at t/t_long.t line 439.
    # failed test 12 at line 162. Strings are of different lengths (0 vs 80),
    Len 0

    Some tests for LONG data type handling failed. These are generally Oracle
    bugs.
    not ok 11
    Please report this to the dbi-users mailing list, and include the
    Oracle version number of both the client and the server.
    Please also include the output of the 'perl -V' command.
    (If you can, please study t/long.t to investigate the cause.
    Feel free to edit the tests to see what's happening in more detail.
    Especially by adding trace() calls around the failing tests.
    Run the tests manually using the command "perl -Mblib t/long.t")
    Meanwhile, if the other tests have passed you can use DBD::Oracle.

    not ok 12
    ok 13
    FAILED tests 9, 11-12
            Failed 3/13 tests, 76.92% okay
    Failed Test Stat Wstat Total Fail Failed List of Failed
    ----------------------------------------------------------------------------

    ---
    t/t_long.t                13    3  23.08%  9 11-12
    Failed 1/1 test scripts, 0.00% okay. 3/13 subtests failed, 76.92% okay.
    Test: 1
    Test: 2
    Test: 3
    Test: 4
    Test: 5
    Test: 6
    Test: 7
    Test: 8
    Test: 9
    Test: 10
    Test: 11
    Test: 12
    Test: 13
    Test: 14
    Test: 15
    Test: 16
    Test: 17
    Test: 18
    Test: 19
    Test: 20
    Test: 21
    Test: 22
    Test: 23
    Test: 24
    Test: 25
    Test: 26
    Test: 27
    Test: 28
    Test: 29
    Test: 30
    Test: 31
    FAILED tests 9, 12
    Test: 32
    Test: 33
    Test: 34
    Test: 35
    Test: 36
    Test: 37
    Test: 38
    Test: 39
    Test: 40
    Test: 41
    Test: 42
    Test: 43
    Test: 44
    Test: 45
    FAILED tests 9, 11-12
    Test: 46
    Test: 47
    Test: 48
    Test: 49
    Test: 50
    Test: 51
    Test: 52
    Test: 53
    Test: 54
    Test: 55
    Test: 56
    Test: 57
    Test: 58
    FAILED tests 9, 12
    Test: 59
    Test: 60
    Test: 61
    Test: 62
    Test: 63
    Test: 64
    Test: 65
    Test: 66
    Test: 67
    Test: 68
    Test: 69
    FAILED tests 9, 12
    Test: 70
    FAILED tests 9, 11-12
    Test: 71
    Test: 72
    Test: 73
    Test: 74
    Test: 75
    Test: 76
    Test: 77
    Test: 78
    Test: 79
    Test: 80
    Test: 81
    Test: 82
    Test: 83
    FAILED tests 9, 12
    Test: 84
    Test: 85
    Test: 86
    Test: 87
    Test: 88
    Test: 89
    Test: 90
    Test: 91
    Test: 92
    Test: 93
    Test: 94
    Test: 95
    Test: 96
    Test: 97
    Test: 98
    Test: 99
    Test: 100
    

  • Next message: Jared Still: "Re: How-To generate DDL for Oracle tables using Perl?"

    Relevant Pages