[freetds] (no subject)

Medi Montaseri medi at resonate.com
Tue Jun 26 14:56:11 EDT 2007


I recently had a need to run N number of SQL requests in a batch mode
where I found bsqldb(1) the most suitable tool. The problem however was
that I also wanted to be able to throttle by inserting sleep between
each request (or GO) including sleeping (or waiting) indefintely waiting
for developer to single-step thru. 
 
I modified bsqldb.c and provided a -w option (w for waitfor) such that
-w 0   // default value, meaning don't throttle, blast away
-w n  // where n is > 0 and it means sleep for n seconds
-w -n  // where n is < 0 and it means sleep for ever
 
In the course of changing bsqldb.c I noticed that the current design is
reopen-ing stdin, stderr and stdout to support -o -e -i.
My question for this audience is:
 
1 - I'd like to contribute this change to the community,  are you guys
interested in this feature ? If yes, then
2- Since the case of -w -1 requires receiving input from stdin, it
creates a conflict between -i which has been reopend as stdin. 
2.1 - I can either change the entire code and not use reopen but simply
use a different descriptor for -i, -o, -e processing. Or
2.2 - I can temporarly reopen stdout and stdin while interacting with
user and put it back to -o -i 
 
Please let me know and  if it is a go...who should I coordinate this
patch or checkin with ?
 
Cheers
Medi


More information about the FreeTDS mailing list