Summary: | ASTERISK-09853: 10075 fix in 1.4.7.1 breaks MS SQL 2000 | ||
Reporter: | Stuart Henderson (stuarth) | Labels: | |
Date Opened: | 2007-07-10 17:00:58 | Date Closed: | 2007-07-11 13:18:51 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Resources/res_config_odbc |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) 10175.patch.txt ( 1) 10175.patch2.txt | |
Description: | MSSQL 2000 needs ESCAPE next to LIKE. This fails: SELECT * FROM foo WHERE bar LIKE 'weasels' ORDER BY baz ESCAPE '\' This works: SELECT * FROM foo WHERE bar LIKE 'weasels' ESCAPE '\' ORDER BY baz (It also appears that the ESCAPE only applies to the immediately preceding 'LIKE' clause). | ||
Comments: | By: Russell Bryant (russell) 2007-07-10 18:06:30 1.4.7.1 shouldn't have made this any different versus 1.4.7. All I did was make the ESCAPE only get added if LIKE was being used. So, I guess you're saying the original patch was broken, too. I'll have to look at this in more detail tomorrow. By: Russell Bryant (russell) 2007-07-10 18:29:07 Can you please test the attached patch? By: Stuart Henderson (stuarth) 2007-07-10 19:46:32 >So, I guess you're saying the original patch was broken, too. Yes, sorry I should have checked that. Same for 1.4.7. s/newparm/newparam/ and apply it to the instance lower down too, and it fixes MSSQL 2000. Sorry, I am no DBA, and don't know how well positioning directly after the LIKE clause works on other software. http://spacehopper.org/10175.diff.txt if you can use it (I didn't attach it directly as I don't want to sign the disclaimer at the moment), if not it'll only take a moment to redo :) By: Russell Bryant (russell) 2007-07-10 21:28:48 Yikes. I didn't try to compile the patch before posting it? I guess you can tell it was at the end of the day. :) I can fix that part, no big deal. By: Vadim Berezniker (kryptolus) 2007-07-11 10:03:02 This doesn't only affect MSSQL 2000, it also breaks MSSQL 2005. Can you post an updated patch? By: Vadim Berezniker (kryptolus) 2007-07-11 10:06:33 Actually I just checked and this affects mysql too. I guess that will get this bug fixed quick ;) By: Russell Bryant (russell) 2007-07-11 10:31:34 Updated patch posted. Please verify that this patch is functional. I don't want to make a 3rd release with this broken ... By: Michael L. Young (elguero) 2007-07-11 11:26:55 I can confirm that this patch works with MySQL again. By: Digium Subversion (svnbot) 2007-07-11 13:16:36 Repository: asterisk Revision: 74656 ------------------------------------------------------------------------ r74656 | russell | 2007-07-11 13:16:35 -0500 (Wed, 11 Jul 2007) | 4 lines Make sure that the ESCAPE immediately follows the condition that uses LIKE. This fixes realtime extensions with ODBC. (closes issue ASTERISK-9853, reported by stuarth, patch by me) ------------------------------------------------------------------------ By: Digium Subversion (svnbot) 2007-07-11 13:18:05 Repository: asterisk Revision: 74657 ------------------------------------------------------------------------ r74657 | russell | 2007-07-11 13:18:04 -0500 (Wed, 11 Jul 2007) | 12 lines Merged revisions 74656 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r74656 | russell | 2007-07-11 13:33:23 -0500 (Wed, 11 Jul 2007) | 4 lines Make sure that the ESCAPE immediately follows the condition that uses LIKE. This fixes realtime extensions with ODBC. (closes issue ASTERISK-9853, reported by stuarth, patch by me) ........ ------------------------------------------------------------------------ By: Digium Subversion (svnbot) 2007-07-11 13:18:51 Repository: asterisk Revision: 74658 ------------------------------------------------------------------------ r74658 | russell | 2007-07-11 13:18:50 -0500 (Wed, 11 Jul 2007) | 20 lines Merged revisions 74657 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r74657 | russell | 2007-07-11 13:34:51 -0500 (Wed, 11 Jul 2007) | 12 lines Merged revisions 74656 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r74656 | russell | 2007-07-11 13:33:23 -0500 (Wed, 11 Jul 2007) | 4 lines Make sure that the ESCAPE immediately follows the condition that uses LIKE. This fixes realtime extensions with ODBC. (closes issue ASTERISK-9853, reported by stuarth, patch by me) ........ ................ ------------------------------------------------------------------------ |