Skip to Content.
Sympa Menu

freetds - Re: [freetds] sql_cmd in unittests

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] sql_cmd in unittests
  • Date: Thu, 5 Feb 2009 21:22:13 -0500

Frediano Ziglio wrote:
> new sql_cmd stuff produce a leak (we do not close INPUT file so
> we have a leak).

Eh. Program exits, OS reclaims resources. When the unittests are
finished running, there are no files open. I don't consider that to be a
"leak". I don't think main() should call free(3), either. :-)

The idea that one pedantically must close every file reminds me of the
days when Structured Programming insisted that every function had to have
one entry and one exit point (never "if (!foo) return 0"). I tend to
favor the Less Is More school of thought.

> - 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)

My idea was that indeed we could add a getopts option to override the
filename. That would be more useful for some tests than others. It
seemed to me that the query-reader should be able to read any file
including standard input.

> we could add some special comments in sql script and an
> additional argument to sql_cmd to specify a name for a specific
> command.

I thought about it. I didn't find any immediate use, so I left it as-is.
One objective, though, is to be able to compare the unit test's behavior
to that of another utility, so plain-jane SQL has its advantages.

No answer to my automake question yet. :-(

http://lists.gnu.org/archive/html/automake/2009-02/threads.html

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page