Skip to Content.
Sympa Menu

freetds - [freetds] 'compute' deprecated (Re: rc3 looks good on OpenVMS)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Craig A. Berry" <craigberry AT mac.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] 'compute' deprecated (Re: rc3 looks good on OpenVMS)
  • Date: Fri, 29 Apr 2016 08:41:43 -0500


> On May 28, 2015, at 5:16 PM, Frediano Ziglio <freddy77 AT gmail.com> wrote:
>
> Il 28/Mag/2015 09:58, "Craig A. Berry" <craigberry AT mac.com> ha scritto:
>> With SQL 2012 this test below fails, but I
>> think it's just because "compute" has been removed in SQL 2012:

> Yes, that test check how compute queries reply so cannot work but is not a
> Freetds issue

I’m reviving this year-old thread because this is still a problem and getting
to be a bigger one, and while it isn’t FreeTDS’s fault, it is FreeTDS’s
problem if its test suite can’t even run to completion on 3 of the 4
currently-supported versions of Microsoft’s server (SQL 2005 went out of
support a week or two ago, so SQL 2008 is the only one that can run the test
suite).

The following tests are the ones affected:

src/ctlib/unittests/t0009
src/dblib/unittests/t0023
src/dblib/unittests/dbmorecmds

I tried (unsuccessfully) to come up with a way to skip the tests when running
on SQL 2012 or greater. The following check tells you what you’ve got, but
only at run time, which is too late. The ‘compute’ keyword will still be
seen at parse time so the script will already fail before this check runs.
Plus it uses Microsoft-specific functions that will probably not parse on
Sybase.

IF CHARINDEX('Microsoft', @@VERSION) <> 0
BEGIN
IF CAST(PARSENAME(CAST(SERVERPROPERTY('PRODUCTVERSION') AS VARCHAR), 4)
AS INT) >= 11
BEGIN
PRINT 'SKIP - SQL 2012 or greater'
END
END

Not sure what to suggest. Anybody have a good way forward?

> SQL text will be read from ../../../src/dblib/unittests/t0023.sql
>> Starting dsa0:[craig.freetds-0^.95rc3.src.dblib.unittests]t0023.exe
>> About to logon
>> About to open
>> creating table
>> 1: create table #dblib0023 (col1 int not null, col2 char(1) not
>> null, col3 datetime not null)
>> insert
>> 1: insert into #dblib0023 values (1, 'A', 'Jan 1 2002
>> 10:00:00AM')
>> 1: insert into #dblib0023 values (2, 'A', 'Jan 2 2002
>> 10:00:00AM')
>> 1: insert into #dblib0023 values (3, 'A', 'Jan 3 2002
>> 10:00:00AM')
>> 1: insert into #dblib0023 values (8, 'B', 'Jan 4 2002
>> 10:00:00AM')
>> 1: insert into #dblib0023 values (9, 'B', 'Jan 5 2002
>> 10:00:00AM')
>> select
>> 1: select col1, col2, col3 from #dblib0023 order by col2 compute
>> sum(col1) by col2 compute max(col3)
>> Msg 156, Level 15, State 1
>> Server 'ABC0012312'
>> , Line 1
>>
>> Incorrect syntax near the keyword 'compute'.
>> exit: no unanticipated messages allowed in unit tests


________________________________________
Craig A. Berry

"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser





Archive powered by MHonArc 2.6.24.

Top of Page