[freetds] MS query notifications patch

Richard Hughes cyreve at gmail.com
Thu May 15 14:55:04 EDT 2014

Here's a couple of smallish bug fixes over my previous patch.

On 2014-05-14 at 21:19, Frediano Ziglio wrote:
> Let see if this time I'm more quick. I have a test machine. Actually I
> committed to my master branch and launched the test. If there are no
> regression I'll commit. Just a request. Which mail address (your) can
> I use for the commit and which description for the commit do you want.
> The feature is really useful!
> Actually is just:
> "Add support for MS query notifications"
> a bit too few considering the importance can have.

You might like to steal the initial sentence of the 'About Query
Notifications' section from my initial post. I wrote that bit because
I've been using MSSQLServer for years and only just found the feature,
so I guessed that some of the readers of this mailing list would have
no idea what I was talking about.

Use my Reply-To address (richard.freetds at ...) for the commit.

>>>>>> @@ -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.
> My testbox has an msde (free mssql 2000) I can use.
> I just need to code a new test. Oh.. if you have some code to test
> with is more than welcome. I try adding tests for all feature we have.

I'm afraid the code I've been using for basic testing heavily depends
on libraries which are owned by my employer.

Certainly it was my intent to look at writing a few tests within your
framework as my next task before we can consider the patch to be
complete. The code I wrote in SQLGetStmtAttr() has never been
executed, for example.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freetds-mssql-query-notifications-v4.diff
Type: application/octet-stream
Size: 24932 bytes
Desc: not available
URL: <http://lists.ibiblio.org/pipermail/freetds/attachments/20140515/153984f9/attachment-0001.obj>

More information about the FreeTDS mailing list