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

Re: My MSSQL query fails the second time.

by moritz (Cardinal)
on Apr 30, 2013 at 17:52 UTC ( #1031440=note: print w/ replies, xml ) Need Help??


in reply to My MSSQL query fails the second time.

One thing you can always try is enable tracing. The DBI docs have a whole section on tracing.

If it's really a bug in the DBD module, that might not be very conclusive, but it's still worth a try.


Comment on Re: My MSSQL query fails the second time.
Re^2: My MSSQL query fails the second time.
by kyle (Abbot) on Apr 30, 2013 at 19:26 UTC

    Here's some delicious DBI_TRACE=3

    ok 2 - The object isa DBI::st -> execute for DBD::Sybase::st (DBI::st=HASH(0x8bc9234)~0x8bc9284) + thr#897b008 syb_alloc_cmd() -> CS_COMMAND 8bcb778 for CS_CONNECTION 8b85e60 cmd_execute() -> ct_command() OK cmd_execute() -> ct_send() OK cmd_execute() -> set inUse flag st_next_result() -> ct_results(4040) == 1 ct_res_info() returns 1 columns STORE DBI::st=HASH(0x8bc9284) 'NUM_OF_FIELDS' => 1 ct_describe(0): type = 8, maxlen = 4 describe() -> col 0, type 8, realtype 8 describe() retcode = 1 st_next_result() -> lasterr = 0, lastsev = 0 <- execute= ( -1 ) [1 items] at t/dbi-bug-pm.t line 36 via at t/d +bi-bug-pm.t line 23 ok 3 - defined: '-1' -> finish for DBD::Sybase::st (DBI::st=HASH(0x8bc9234)~0x8bc9284) +thr#897b008 syb_st_finish() -> ct_cancel(CS_CANCEL_ALL) clear_sth_flags() -> resetting ACTIVE, moreResults, dyn_execed, ex +ec_done clear_sth_flags() -> reset inUse flag <- finish= ( 1 ) [1 items] at t/dbi-bug-pm.t line 42 via at t/dbi +-bug-pm.t line 23 ok 4 - $sth->finish -> prepare_cached in DBD::_::db for DBD::Sybase::db (DBI::db=HASH( +0x8b98148)~0x8b98094 'SELECT 1') thr#897b008 -> FETCH for DBD::Sybase::st (DBI::st=HASH(0x8bc9234)~0x8bc9284 'A +ctive') thr#897b008 .. FETCH DBI::st=HASH(0x8bc9284) 'Active' = '' <- FETCH= ( '' ) [1 items] at /usr/lib/perl5/DBI.pm line 1699 via + at t/dbi-bug-pm.t line 33 <- prepare_cached= ( DBI::st=HASH(0x8bc9234) ) [1 items] at t/dbi- +bug-pm.t line 33 via at t/dbi-bug-pm.t line 28 -> execute for DBD::Sybase::st (DBI::st=HASH(0x8bc9234)~0x8bc9284) + thr#897b008 cmd_execute() -> ct_command() OK cmd_execute() -> ct_send() failed <- execute= ( undef ) [1 items] at t/dbi-bug-pm.t line 36 via at +t/dbi-bug-pm.t line 28 not ok 6 - defined: '' # Failed test 'defined: ''' # at t/dbi-bug-pm.t line 39. -> finish for DBD::Sybase::st (DBI::st=HASH(0x8bc9234)~0x8bc9284) +thr#897b008 <- finish= ( 1 ) [1 items] at t/dbi-bug-pm.t line 42 via at t/dbi +-bug-pm.t line 28 ok 7 - $sth->finish

    What stands out to me is cmd_execute() -> ct_send() failed, so I Googled ct_send. It says, among other things, that it fails if there are results pending. That sounds like my problem, but $sth->finish seems too simple to fail.

    Anyway, that was fun, but I'm still stumped.

        Yes. My original test did that, but I took it out to make my post more succinct.

      I ran the test against Sybase with the Sybase client libs, and this appeared to work as expected - so I would assume that you've hit some sort of bug in the FreeTDS client libs.

      Michael

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2015-07-01 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (24 votes), past polls