Re: tsql connects but prompt incs 1, 2, 3

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Ryp Walters wrote:
> 
> [root@XXX apps]# TDSVER=4.2 ./tsql -H XXX.XXX.XXX.XXX -p 1433 -U XXX
> locale is "en_US.UTF-8"
> locale charset is "UTF-8"
> Password: 
> 1
> 2
> 3
> 4
> 5
> ....
> 
> It pauses and accepts my password.
> 
> I do not get the '1>' prompt.  The prompt has no '>' and does not accept
> any commands.  The prompt increments by one every second.  I've tried
> compiling on three difference boxes with difference versions of redhat,
> but get the same result every time.

You might have found a bug in tsql.  Perhaps someone else can confirm?  

It seems when the options "-H -p" are used with tsql, it doesn't use the
specified port.  Instead it asks the server for a port number (from port
1434).  Here's an example failure using CVS HEAD:

$ TDSDUMP=dump  tsql -H localhost  -p99 -UU -PP || tail dump
locale is "C"
locale charset is "646"
15There was a problem connecting to the server
16net.c:1078:tds7_get_instance_port: timed out on try 9 of 16
net.c:1078:tds7_get_instance_port: timed out on try 10 of 16
net.c:1078:tds7_get_instance_port: timed out on try 11 of 16
net.c:1078:tds7_get_instance_port: timed out on try 12 of 16
net.c:1078:tds7_get_instance_port: timed out on try 13 of 16
net.c:1078:tds7_get_instance_port: timed out on try 14 of 16
net.c:1078:tds7_get_instance_port: timed out on try 15 of 16
net.c:1150:instance port is 0
login.c:434:invalid port number
mem.c:603:tds_free_all_results()

In your case, you're using tds 4.2 and tsql shouldn't even *attempt* to
look for a server instance.  Depending on how you count, that's one or two
bugs.  

Using -S instead of -H, or TDSPORT instead of -p, should both work fine,
however.  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.