<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 22 Oct 2009, at 07:25, Hendrik Baecker wrote:</div><br class="Apple-interchange-newline"><br><blockquote type="cite"><div>Am 22.10.09 05:33, schrieb Ton Voon:<br><blockquote type="cite">Quick note. I saw this change below and wondered if this is best done in<br></blockquote><blockquote type="cite">the database. For Opsview, we made this change about 2 years ago for the<br></blockquote><blockquote type="cite">same effect:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">    ALTER TABLE nagios_objects MODIFY name1 varchar(128) COLLATE<br></blockquote><blockquote type="cite">latin1_bin NOT NULL default '';<br></blockquote><blockquote type="cite">    ALTER TABLE nagios_objects MODIFY name2 varchar(128) COLLATE<br></blockquote><blockquote type="cite">latin1_bin default NULL;<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The code then stayed the same. Also it means anything trying to read the<br></blockquote><blockquote type="cite">data doesn't need to remember to specify BINARY either.<br></blockquote><blockquote type="cite"><br></blockquote>Yes it looks nicer and will keep the code cleaner. Also I like the fact<br>to keep the work on the database.<br>One question back: If it uses COLLATE latin1_bin, the default sort thing<br>would be binary which is OK but afaik there are other associations with<br>the charset<br>(<a href="http://dev.mysql.com/doc/refman/5.1/en/charset-collation-charset.html">http://dev.mysql.com/doc/refman/5.1/en/charset-collation-charset.html</a>).<br><br>What will happen on a simplified chinese as default charset mysql if<br>ndoutils would try to set latin1_bin as collate?<br>There are missing MySQL international experiences on my side, but is it<br>a good practice to rule the charset?<br><br>Further comments on this?<br>I would prefer a database way to do this, but I wouldn't like to force<br>the user to use a charset which he doesn't know/like/can't use.<br></div></blockquote><div><br></div>This is a fair point. Would </div><div><br></div><div><div>   ALTER TABLE nagios_objects MODIFY name1 varchar(128) COLLATE<br>utf8_bin NOT NULL default '';<br>   ALTER TABLE nagios_objects MODIFY name2 varchar(128) COLLATE<br>utf8_bin default NULL;</div><div><br></div><div>make more sense then? </div><div><br></div>Can anyone with more mysql knowledge explain?</div><div><br></div><div>Ton</div><div><br></div></body></html>