Skip to Content.
Sympa Menu

freetds - [freetds] sql_cmd in unittests

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] sql_cmd in unittests
  • Date: Thu, 5 Feb 2009 10:02:56 +0100

Hi,
looking at http://freetds.sourceforge.net/up/out83/test/ reveal
that new sql_cmd stuff produce a leak (we do not close INPUT file so
we have a leak). Well... not that hard, just add a call to close file
and is fixed. However before changing all unittests I would change a
bit even sql_cmd:
- sql_cmd is always called with INPUT as second argument, so I would
remove this argument (also because sql_cmd refer to sql_file but for
user supplied files is not valid)
- perhaps is better to automatically close file on feof

I think also it would be interesting to have additional options in sql
commands and in sql_cmd. For instance instead of processing next sql
command we could add some special comments in sql script and an
additional argument to sql_cmd to specify a name for a specific
command. Another addition would be to automatically execute and
process next command (like "go -ec" in script where -e is execute and
-c is continue....)

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page