Skip to Content.
Sympa Menu

freetds - Re: [freetds] MS query notifications patch

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Richard Hughes <cyreve AT gmail.com>
  • To: Frediano Ziglio <freddy77 AT gmail.com>
  • Cc: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] MS query notifications patch
  • Date: Wed, 14 May 2014 19:24:10 +0100

On 2014-05-10 at 09:55, Frediano Ziglio wrote:
> 2014-04-23 18:50 GMT+01:00 Richard Hughes <cyreve AT gmail.com>:
>> On 2014-04-18 at 09:39, Frediano Ziglio wrote:
>>> 2014-04-16 19:12 GMT+01:00 Richard Hughes <cyreve AT gmail.com>:
>>>> I needed support for SQL Server 2005's Query Notifications feature, so
>>>> here's a patch against tip.

> Sorry for late reply. I was on holiday and actually I'm without my own
> computer.

This entire thread seems to be plagued with late replies - work got
busy for me :-)

> I like the idea of splitting in query.c the code that handle tds7 from
> other protocol however I would not expose all these definitions
> outside it and instead all function calls should add the head
> parameter.

I had ruled out that option because I didn't think I was allowed to
change the TDS API. If that breakage is allowed then absolutely adding
a new parameter is cleaner.

This version of the patch does, however, undo the splitting-out of
tds7. I find it difficult to manage and review patches (even my own)
which combine cosmetic changes with functional changes. Once we're
happy with the functional stuff then either you or I can do the split
as a separate task.

...
> It make sense but perhaps here would
> be more sensible to add a tds_start_query_head (or similar) function.

Done.

>>>> @@ -228,6 +229,11 @@ prepare_call(struct _hstmt * stmt)
>>>> else
>>>> return SQL_ERROR;
>>>>
>>>> + if (tds_dstr_isempty(&stmt->attr.qn_msgtext) !=
>>>> tds_dstr_isempty(&stmt->attr.qn_options))
>>>> + return SQL_SUCCESS_WITH_INFO;
>>>> + if (!tds_dstr_isempty(&stmt->attr.qn_msgtext) &&
>>>> !IS_TDS72_PLUS(stmt->dbc->tds_socket->conn))
>>>> + return SQL_SUCCESS_WITH_INFO;
>>>> +
>>>
>>> I'm not sure this is the right place. Also I think MS add some error
>>> to the statement. I didn't find from documentation which error should
>>> be reported.
>>
>> Yes - the _WITH_INFO part should have been a clue that I needed to
>> return some info. MS Native Client returns HY000 for the first case
>> and still executes the query, but I don't have a pre-2005 server to
>> find out what should happen in the second case so I just left it as a
>> generic error.
>>
>
> I'll try with a former server.

If it's inconvenient for you, I can get all the installation media for
2000 - I just need to find the time to spin up a virtual machine and
get it running and tested.

Richard.

Attachment: freetds-mssql-query-notifications-v3.diff
Description: Binary data




Archive powered by MHonArc 2.6.24.

Top of Page