Skip to Content.
Sympa Menu

freetds - Re: [freetds] 0.65 (or whatever) TODO

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] 0.65 (or whatever) TODO
  • Date: Thu, 12 Apr 2007 20:49:45 -0400

ZIGLIO, Frediano, VF-IT wrote:
> Message handling has been a
> > problem in ODBC
> > from the beginning.
>
> 8-| I never though this was a "problem"... currently is not "broken" but
> perhaps "ugly".
> ODBC read as much as it can like proprietary implementations. The
> problem is that code is in ODBC and not in libTDS so dblib is not that
> perfect as ODBC

Sorry, Freddy. I did not mean to offend.

I'm talking about server message handling. Sometimes we lose them and
sometimes they print out in the wrong order. I include two examples
below.

I consider this to be part of result set handling. In a production
environment, server messages can be very important to understanding a log
file. That's why I've spent so much time trying to fix it, even to the
point of writing my own application (bsqlodbc).

Do these queries work correctly for you?

Regards,

--jkl


Example 1: losing messages
--------------------------

$ cat hsg.sql
print 'hello' select 1 as one print 'goodbye'
select 2 as two

$ cat hsg.sql | isql -vb $S $U $P # loses 'goodbye' message
...
SQL> [01000][unixODBC][FreeTDS][SQL Server]hello
[ISQL]INFO: SQLExecute returned SQL_SUCCESS_WITH_INFO
+------------+
| one |
+------------+
| 1 |
+------------+
SQLRowCount returns 1
1 rows fetched
SQL> +------------+
| two |
+------------+
| 2 |
+------------+
SQLRowCount returns 1
1 rows fetched

$ cat hsg.sql | ./bsqlodbc -S $S -U $P -P $P # loses 'goodbye' message
"[FreeTDS][SQL Server]hello"
one
----------
1
two
----------
2

$ cat hsg.sql | ./bsqldb -S $S -U $P -P $P # works
hello
@@rowcount not available
one
-----------
1
1 rows affected
goodbye
two
-----------
2
1 rows affected


Example 2: Reverses messages!
-----------------------------

$ cat hg.sql
print 'hello' print 'goodbye'

$ cat hg.sql | ./bsqldb -S $S -U $P -P $P # OK
hello
@@rowcount not available
goodbye

$ cat hg.sql | ./bsqlodbc -S $S -U $P -P $P # OK
"[FreeTDS][SQL Server]hello"
"[FreeTDS][SQL Server]goodbye"

$ cat hg.sql | isql -vb $S $U $PP $P # print 2nd message first. Why not?

...
SQL> [01000][unixODBC][FreeTDS][SQL Server]goodbye
[01000][unixODBC][FreeTDS][SQL Server]hello
[ISQL]INFO: SQLExecute returned SQL_SUCCESS_WITH_INFO
SQLRowCount returns -1
SQL>




Archive powered by MHonArc 2.6.24.

Top of Page