[freetds] done_handling

Frediano Ziglio freddyz77 at tin.it
Thu Jul 6 15:14:33 EDT 2006


This is the results of done_handling "test" using a sybase 11.9.2 server

compiled with

gcc -O0 -g -I/opt/sybase-11.9.2/include -I../../../include
-DHAVE_CONFIG_H -I. -L/opt/sybase-11.9.2/lib -o test common.c ctype.c
-lsybdb done_handling.c



found freddy.tempdb for sa in "../../../PWD"
Msg 5701, Level 0, State 2

        Changed database context to 'master'.
Msg 5703, Level 0, State 1

        Changed language setting to 'us_english'.
query: create table #dummy (s char(10))
query: insert into #dummy values('xxx')
query: drop proc done_test
Msg 3701, Level 11, State 1

        Cannot drop the procedure 'done_test', because it doesn't exist
in the system catalogs.
DB-Library error (severity 5):
        General SQL Server error: Check messages from the SQL Server.
query: create proc done_test @a varchar(10) output as select * from
#dummy
query: create proc done_test2 as select * from #dummy where s = 'aaa'
select * from #dummy
test query select * from #dummy
sqlexec State
nextrow State
nextrow State
results State COLS(1)
nextrow State COLS(1) ROWS(1) IDLE
nextrow State IDLE
results
State
nextrow State
results
State
State
query: set nocount on
test query select * from #dummy
sqlexec State
nextrow State
nextrow State
results State COLS(1)
nextrow State COLS(1)
nextrow State COLS(1)
results
State COLS(1)
State COLS(1)
query: set nocount off
test query select * from #dummy where 0=1
sqlexec State
nextrow State
nextrow State
results State COLS(1) ROWS(0)
nextrow State COLS(1) ROWS(0)
nextrow State COLS(1) ROWS(0)
results
State COLS(1) ROWS(0)
State COLS(1) ROWS(0)
test query select dklghdlgkh from #dummy
sqlexec Msg 207, Level 16, State 2

        Invalid column name 'dklghdlgkh'.
DB-Library error (severity 5):
        General SQL Server error: Check messages from the SQL Server.
State
nextrow State
nextrow State
results State
nextrow State
nextrow State
results
State
State
test query declare @s varchar(10) exec done_test @s output
sqlexec State
nextrow State
nextrow State
results State COLS(1)
nextrow State COLS(1) ROWS(1) PARAMS
nextrow State COLS(1) ROWS(1) PARAMS
results
State COLS(1) ROWS(1) PARAMS
State COLS(1) ROWS(1) PARAMS
test query declare @i int
sqlexec State
nextrow State
nextrow State
results State
nextrow State
nextrow State
results
State
State
test query exec done_test2
sqlexec State
nextrow State
nextrow State
results State COLS(1) ROWS(0)
nextrow State COLS(1) ROWS(0)
nextrow State COLS(1) ROWS(0)
results
State COLS(1)
nextrow State COLS(1) ROWS(1)
results
State COLS(1) ROWS(1)
State COLS(1) ROWS(1)
test query declare @i int
sqlexec State
nextrow State
nextrow State
results State
nextrow State
nextrow State
results
State
State
query: drop proc done_test
query: drop proc done_test2



This is the same test compiled with FreeTDS



found local.tempdb for sa in "../../../PWD"
Msg 5701, Level 10, State 2

        Changed database context to 'master'.

query: create table #dummy (s char(10))
query: insert into #dummy values('xxx')
query: drop proc done_test
Msg 3701, Level 11, State 1

        Cannot drop the procedure 'done_test', because it doesn't exist
in the system catalogs.

DB-Library error (severity 5):
        General SQL Server error: Check messages from the SQL Server.
query: create proc done_test @a varchar(10) output as select * from
#dummy
query: create proc done_test2 as select * from #dummy where s = 'aaa'
select * from #dummy
test query select * from #dummy
sqlexec State
nextrow State
nextrow State
results State COLS(1)
nextrow State COLS(1) IDLE
nextrow State IDLE
results
State
nextrow State
results
State
State
query: set nocount on
test query select * from #dummy
sqlexec State
nextrow State
nextrow State
results State COLS(1)
nextrow State COLS(1)
nextrow State COLS(1)
results
State
State
query: set nocount off
test query select * from #dummy where 0=1
sqlexec State
nextrow State
nextrow State
results State COLS(1) ROWS(0)
nextrow State COLS(1) ROWS(0)
nextrow State COLS(1) ROWS(0)
results
State ROWS(0)
State ROWS(0)
test query select dklghdlgkh from #dummy
sqlexec Msg 207, Level 16, State 2

        Invalid column name 'dklghdlgkh'.

DB-Library error (severity 5):
        General SQL Server error: Check messages from the SQL Server.
State
nextrow State
nextrow State
results State
nextrow State
nextrow State
results
State
State
test query declare @s varchar(10) exec done_test @s output
sqlexec State
nextrow State
nextrow State
results State COLS(1)
nextrow State COLS(1) PARAMS
nextrow State COLS(1) PARAMS
results
State
State
test query declare @i int
sqlexec State
nextrow State
nextrow State
results State
nextrow State
nextrow State
results
State
State
test query exec done_test2
sqlexec State
nextrow State
nextrow State
results State COLS(1) ROWS(0)
nextrow State COLS(1) ROWS(0)
nextrow State COLS(1) ROWS(0)
results
State COLS(1)
nextrow State COLS(1)
results
DB-Library error (severity 7):
        Attempt to initiate a new Adaptive Server operation with results
pending
Operating-system error:
        Success
State COLS(1)
State COLS(1)
test query declare @i int
sqlexec State
nextrow State
nextrow State
results State
nextrow State
nextrow State
results
State
State
query: drop proc done_test
query: drop proc done_test2



As you can note is quite different... is seems that there are some ROWS
and PARAMS less using FreeTDS...

Let's take the first one

sybase
  select * from #dummy
  test query select * from #dummy
  sqlexec State
  nextrow State
  nextrow State
  results State COLS(1)
  nextrow State COLS(1) ROWS(1) IDLE
  nextrow State IDLE
  results
  State
  nextrow State
  results
  State
  State

our
  test query select * from #dummy
  sqlexec State
  nextrow State
  nextrow State
  results State COLS(1)
  nextrow State COLS(1) IDLE
  nextrow State IDLE
  results
  State
  nextrow State
  results
  State
  State

It seems that we are not able to read rows after last nextrow. In this
case testing for IDLE reset rows. This happen cause proprietary
libraries seems to read DONE asap, not at next dbnextrow.
Well, this seems very broken but it works for most programs...

freddy77





More information about the FreeTDS mailing list