|
BugDB: View Bug 441
Detailed Description:
*** Initial description, Matthew Persico I am trying to get replication information out of our rep server. It doesn't work if AutoCommit is off. Any clues why? See the transcript below
## Previously connected to sybase rep server. Omitted for security...
## Auto commit is off DB<46> x $ldbh->{AutoCommit} 0 1
## Run the query DB<47> $xxx = $ldbh->selectall_arrayref('admin who,sqm');
## I got results. Snipped in the interests of bandwidth DB<48> x $xxx 0 ARRAY(0x47f2e0) 0 ARRAY(0x526dd0) 0 ' 8' 1 'Awaiting Message [snip]
## Reset DB<49> $xxx = 0
## and show it's been blanked DB<50> x $xxx 0 0
## $ldbh->{AutoCommit} = 0; DB<51> n
## Prove it DB<51> x $ldbh->{AutoCommit} 0 0
## Now watch DB<52> $xxx = $ldbh->selectall_arrayref('admin who,sqm'); no statement executing at /sa/perl/lib/site_perl/5.6.1/sun4-solaris/DBI.pm line 1400.
Huh? What does autocommit have to do with running 'admin who,sqm'
*** Reply 2002-04-08, Michael Peppler I think that you're hitting a Sybase bug, of sorts, and a DBD::Sybase bug as well:
DB<11> x $dbh->selectall_arrayref('admin who,sqm'); -> selectall_arrayref for DBD::Sybase::db (DBI::db=HASH(0x39cb64)~0x39cb70 'admin who,sqm') 2 -> prepare for DBD::Sybase::db (DBI::db=HASH(0x39cb70)~INNER 'admin who,sqm' undef) New DBI::st (for DBD::Sybase::st, parent=DBI::db=HASH(0x39cb70), id=) dbih_setup_handle(DBI::st=HASH(0x545b4c)=>DBI::st=HASH(0x5475a0), DBD::Sybase::st, 545b88, Null!) dbih_make_com(DBI::db=HASH(0x39cb70), DBD::Sybase::st, 396) 2 <- prepare= DBI::st=HASH(0x545b4c) at DBI.pm line 1194 via /sa/perl/lib/5.6.1/perl5db.pl line 1467 -> execute for DBD::Sybase::st (DBI::st=HASH(0x545b4c)~0x5475a0) syb_db_opentran() -> ct_command( BEGIN TRAN DBI39d008 ) = 1 syb_db_opentran() -> ct_send() = 1 syb_db_opentran() -> ct_results(4048) == 1 syb_db_opentran() -> ct_results(4046) == 1 syb_db_opentran() -> ct_results(4047) == 1 syb_db_opentran() -> ct_results(4046) == 1 !! ERROR: 37024 'Server message number=37024 severity=12 state=0 line=0 server=REPP text=CONNECT SOURCE permission is required to execute command.' <- execute= '0E0' at DBI.pm line 1196 via /sa/perl/lib/5.6.1/perl5db.pl line 1467 DB<11> x $dbh->selectall_arrayref('admin who,sqm'); -> selectall_arrayref for DBD::Sybase::db (DBI::db=HASH(0x39cb64)~0x39cb70 'admin who,sqm') 2 -> prepare for DBD::Sybase::db (DBI::db=HASH(0x39cb70)~INNER 'admin who,sqm' undef) New DBI::st (for DBD::Sybase::st, parent=DBI::db=HASH(0x39cb70), id=) dbih_setup_handle(DBI::st=HASH(0x545b4c)=>DBI::st=HASH(0x5475a0), DBD::Sybase::st, 545b88, Null!) dbih_make_com(DBI::db=HASH(0x39cb70), DBD::Sybase::st, 396) 2 <- prepare= DBI::st=HASH(0x545b4c) at DBI.pm line 1194 via /sa/perl/lib/5.6.1/perl5db.pl line 1467 -> execute for DBD::Sybase::st (DBI::st=HASH(0x545b4c)~0x5475a0) syb_db_opentran() -> ct_command( BEGIN TRAN DBI39d008 ) = 1 syb_db_opentran() -> ct_send() = 1 syb_db_opentran() -> ct_results(4048) == 1 syb_db_opentran() -> ct_results(4046) == 1 syb_db_opentran() -> ct_results(4047) == 1 syb_db_opentran() -> ct_results(4046) == 1 !! ERROR: 37024 'Server message number=37024 severity=12 state=0 line=0 server=REPP text=CONNECT SOURCE permission is required to execute command.' <- execute= '0E0' at DBI.pm line 1196 via /sa/perl/lib/5.6.1/perl5db.pl line 1467
1. Sybase should respond with a different error here (something like transactions not supported by rep.server., for example).
2. execute() should return undef, not 0E0 here (which would cause fetchall_arrayref() to fail cleanly instead of returning the 'no statement executing' message.
#1 can be fixed by either turning AutoCommit on for 'admin' requests, or by setting the syb_chained_txn flag to true (and syb_chained_txn *should* really be true by default - that's the internal AutoCommit setting for OpenClient.)
#2 - well I'll have to look into that :-)
Log Entries:
Oct 23 2002 10:39AM - mpeppler@peppler.org
Fixed incorrect return value so that an error in syb_db_opentran() will generate a return "undef" from $sth->execute.
|