[freetds] tsql bug fixes that got lost between 0.64 and 0.65

Christos Zoulas christos at zoulas.com
Thu Aug 24 13:28:52 EDT 2006


On Aug 24, 12:47pm, entropy at freetds.org (entropy at freetds.org) wrote:
-- Subject: Re: [freetds] tsql bug fixes that got lost between 0.64 and 0.65

| Christos Zoulas wrote:
| > 1. You cannot use readline when stdin is not a tty. You need to use the
| >    home-brewed version. If you don't believe me, try passing a script
| >    to tsql via stdin that has lines that begin with tab. Yes, you guessed
| >    it right, readline will helpfully give directory listings.
| 
| I'm pretty sure I already fixed that in rev 1.88 of tsql.c.  What 
| revision do you have?

Well, you did indeed fix it with:

> #ifdef HAVE_READLINE
>       rl_inhibit_completion = 1;
> #endif

Have you tried strace'ing/truss'ing tsql when it reads an input file?
Using readline(3), it issues a read(2) per character, not counting the large
number of failed ioctl(2)'s in the beginning. We have the code in tsql to
do the readline, why not just use it when we are not connected to the tty?
This way, in the future, when readline(3) decides to do something else bogus
with the input stream we are not going to be affected.

christos



More information about the FreeTDS mailing list