<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Hendrik,<div><br></div><div>Quick note. I saw this change below and wondered if this is best done in the database. For Opsview, we made this change about 2 years ago for the same effect:</div><div><br></div><div><div>    ALTER TABLE nagios_objects MODIFY name1 varchar(128) COLLATE latin1_bin NOT NULL default '';</div><div>    ALTER TABLE nagios_objects MODIFY name2 varchar(128) COLLATE latin1_bin default NULL;</div><div><br></div><div>The code then stayed the same. Also it means anything trying to read the data doesn't need to remember to specify BINARY either.</div><div><br></div><div>I agree it is bad to consider them as the same object. </div><div><br></div><div>I thought I had blogged about it, but maybe it was a permanent draft ...</div><div><br></div><div>Ton</div><div><br></div><div><br><div>Begin forwarded message:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>From: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Hendrik Baecker <<a href="mailto:hendrikb@users.sourceforge.net">hendrikb@users.sourceforge.net</a>></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>Date: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">21 October 2009 20:18:39 BST</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>To: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:nagios-checkins@lists.sourceforge.net">nagios-checkins@lists.sourceforge.net</a></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>Subject: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><b>[Nagios-checkins] ndoutils/src dbhandlers.c,1.13,1.14</b></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> </div><div>Update of /cvsroot/nagios/ndoutils/src<br>In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv411/src<br><br>Modified Files:<br><span class="Apple-tab-span" style="white-space:pre">      </span>dbhandlers.c <br>Log Message:<br>Fix case insensitive behavior in ndo2db<br><br>NDO2DB now handles renamed objects like Nagios itself. Renaming is deleting<br>the old and creating a new object.<br><br>Why change this and possibly loose historical data based on the same database<br>object id? <br>Think about the following:<br>Nagios knows a "localhost" and a "LOCALHOST" two different objects.<br>NDOUtils (without this patch) would handle both objects as the same <br>including all references like services, state changes and so on.<br><br>NDOUtils would mix two different objects together - this can't be right.<br><br><br><br>Index: dbhandlers.c<br>===================================================================<br>RCS file: /cvsroot/nagios/ndoutils/src/dbhandlers.c,v<br>retrieving revision 1.13<br>retrieving revision 1.14<br>diff -C2 -d -r1.13 -r1.14<br>*** dbhandlers.c<span class="Apple-tab-span" style="white-space:pre">      </span>6 Oct 2009 06:34:52 -0000<span class="Apple-tab-span" style="white-space:pre">   </span>1.13<br>--- dbhandlers.c<span class="Apple-tab-span" style="white-space:pre">      </span>21 Oct 2009 19:18:37 -0000<span class="Apple-tab-span" style="white-space:pre">  </span>1.14<br>***************<br>*** 82,86 ****<br>  <span class="Apple-tab-span" style="white-space:pre">      </span>else{<br>  <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>es[0]=ndo2db_db_escape_string(idi,name1);<br>! <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>if(asprintf(&buf1,"name1='%s'",es[0])==-1)<br>  <span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>buf1=NULL;<br>  <span class="Apple-tab-span" style="white-space:pre"> </span>        }<br>--- 82,86 ----<br>  <span class="Apple-tab-span" style="white-space:pre">       </span>else{<br>  <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>es[0]=ndo2db_db_escape_string(idi,name1);<br>! <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>if(asprintf(&buf1,"BINARY name1='%s'",es[0])==-1)<br>  <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>buf1=NULL;<br>  <span class="Apple-tab-span" style="white-space:pre"> </span>        }<br>***************<br>*** 93,97 ****<br>  <span class="Apple-tab-span" style="white-space:pre">      </span>else{<br>  <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>es[1]=ndo2db_db_escape_string(idi,name2);<br>! <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>if(asprintf(&buf2,"name2='%s'",es[1])==-1)<br>  <span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>buf2=NULL;<br>  <span class="Apple-tab-span" style="white-space:pre"> </span>        }<br>--- 93,97 ----<br>  <span class="Apple-tab-span" style="white-space:pre">       </span>else{<br>  <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>es[1]=ndo2db_db_escape_string(idi,name2);<br>! <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>if(asprintf(&buf2,"BINARY name2='%s'",es[1])==-1)<br>  <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>buf2=NULL;<br>  <span class="Apple-tab-span" style="white-space:pre"> </span>        }<br><br><br>------------------------------------------------------------------------------<br>Come build with us! The BlackBerry(R) Developer Conference in SF, CA<br>is the only developer event you need to attend this year. Jumpstart your<br>developing skills, take BlackBerry mobile applications to market and stay <br>ahead of the curve. Join us from November 9 - 12, 2009. Register now!<br><a href="http://p.sf.net/sfu/devconference">http://p.sf.net/sfu/devconference</a><br>_______________________________________________<br>Nagios-checkins mailing list<br><a href="mailto:Nagios-checkins@lists.sourceforge.net">Nagios-checkins@lists.sourceforge.net</a><br>https://lists.sourceforge.net/lists/listinfo/nagios-checkins<br></div></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="font-size: 12px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-GB" style="font-size: 12pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); ">Ton Voon</span><span lang="EN-GB" style="font-size: 14pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); "><br></span><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); ">Product Architect</span><span lang="EN-GB" style="font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Times New Roman', serif; "></span><br class="Apple-interchange-newline"><span></span><span><img height="33" width="100" src="cid:image001.gif@01C923BC.C9EBFE00"></span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-GB" style="font-size: 9pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); "><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">Opsera Limited | Unit 69 Suttons Business Park<br>Reading | Berkshire | RG6 1AZ | UK<b><br><br>Phone:   </b>+44 (0) 845 057 7887<br><b>Mobile</b></span><b><span lang="EN-GB" style="font-size: 9pt; font-family: 'Times New Roman', serif; color: rgb(74, 11, 113); ">:   </span></b><span lang="EN-GB" style="font-size: 9pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); ">+44 (0) 7931 365796<br><b>Skype</b>:   tonvoon     <b>Email:</b>   <u><a href="mailto:ton.voon@opsera.com" style="color: blue; text-decoration: underline; ">ton.voon@opsera.com</a></u></span><b><span style="font-size: 10pt; font-family: Arial, sans-serif; "><br></span></b><span lang="EN-GB" style="font-size: 9pt; font-family: Arial, sans-serif; color: rgb(74, 11, 113); "><a href="http://www.opsera.com/" target="_blank" title="http://www.opsera.com" style="color: blue; text-decoration: underline; "><span style="color: rgb(74, 11, 113); ">www.opsera.com</span></a><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 6pt; font-family: Arial, sans-serif; color: gray; ">This e-mail is confidential, intended only for the named recipient(s) above and may contain information that is privileged and confidential. If you receive this message in error, or are not the named recipient(s), please notify the sender at the phone number above, do not copy this message, do not disclose its contents to anyone, and delete this e-mail message from your computer. Although Opsera routinely screens for viruses, addressees should scan this e-mail and any attachments for viruses. Opsera makes no representation or warranty as to the absence of viruses in this e-mail or any attachments. Opsera Limited is registered in the UK under Company Number 5396532. Our registered office is Gorse View, Horsell Rise, Woking, Surrey, GU21 4RB.</span></div></span> </div></span></div></div></div></span></span></span></div><br></div></body></html>