Re: MS query notifications patch
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAHt6W4eANCnBmkCAxfpTTSw1yKmo2LDgt=XqDRHUcWTKXtW0Vg@mail.gmail.com> |
2014-05-15 19:55 GMT+01:00 Richard Hughes <[email protected]>: > 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@...) for the commit. > Pushed! (well twice due to a mistake) >>>>>>> @@ -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. > > Richard. Just some code snippet are enough Frediano