<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Krishna,<div class=""><br class=""><div><div class="">Am 21.10.2016 um 09:29 schrieb Upadhay, Krishna - Kolkata <<a href="mailto:kupadhay@wiley.com" class="">kupadhay@wiley.com</a>>:</div><blockquote type="cite" class=""><span style="font-size: 10pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);" class="">We are trying to fetch data from sybase DB through mod lua (in apache 2.4.23) using the freetds(downloaded from</span><br class=""><div class=""><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><span style="font-size: 10pt;" class=""><a href="https://www.opencsw.org/package/freetds/" class="">https://www.opencsw.org/package/freetds/</a>).<br class=""><br class="">OS details is: Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC<br class=""><br class="">The lua module receives a key from the http request and looks up for the corresponding value from a sybase database table.<br class="">The problem is in this database lookup. It's only a plain select query fetching a single value of type varchar.</span></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><span style="font-size: 10pt;" class="">However, some random characters get appended to the retrieved value at the end when we recieve it in the lua module.<br class=""><br class="">We tried to gather a pattern of data for which we encountered the issue. If the character count of the string value that is fetched from DB is exactly 2^n, the data fetched is absolutely fine. Anything greater or less than that is appended with random characters at the end. Following are few examples:<br class=""><br class="">-- 9 character varchar value in DB -> 0021/2015<br class="">-- Data received in lua code -> 0021/2015<span style="color: rgb(255, 0, 0);" class="">h</span><br class=""><br class="">-- 17 character varchar value in DB -> 0021/2015/06/18/7<br class="">-- Data received in lua code -> 0021/2015/06/18/7<span style="color: rgb(255, 0, 0);" class="">\x07\xc1\xd4</span><br class=""><br class="">-- 33 character varchar value in DB -> 0021/2015/06/18/732/10.1002-2Fabc<br class="">-- Data received in lua code -> 0021/2015/06/18/732/10.1002-2Fabc<span style="color: rgb(255, 0, 0);" class="">\x02h</span><br style="color: rgb(255, 0, 0);" class=""><br class="">-- 65 character varchar value in DB -> 0021/2015/06/18/732/10.1002-2Fab0021/2015/06/18/732/10.1002-2Fabc<br class="">-- Data received in lua code -> 0021/2015/06/18/732/10.1002-2Fab0021/2015/06/18/732/10.1002-2FabcY<span style="color: rgb(255, 0, 0);" class="">\x140</span><br class=""><br class="">Please note the following:<br class="">1. The issue do not happen in a RHEL system<br class="">2. The same functionality works fine if we lookup a similar table in MySQL.</span></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><br class=""><span style="font-size: 10pt;" class=""></span></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><span style="font-size: 10pt;" class="">Any comments regarding the cause of this issue would be really helpful.<br class=""></span></div></div></blockquote><div><br class=""></div><div>This doesn’t sound like a packaging issue, are you using the same version on RHEL?</div><div>Maybe the FreeTDS people can help.</div><div><br class=""></div><div><br class=""></div><div>Best regards</div><div><br class=""></div><div>  — Dago</div><br class=""><blockquote type="cite" class=""><div class=""><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div id="Signature" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><div class="BodyFragment"><font size="2" class=""><div class="PlainText">Thanks & Regards,<br class="">Krishna Upadhyay<br class="">Tata Consultancy Services<br class=""></div></font></div></div></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><div class=""><span style="font-family: monospace; " class="">-- </span><br style="font-family: monospace; " class=""><span style="font-family: monospace; " class="">"You don't become great by trying to be great, you become great by wanting to do something,</span><br style="font-family: monospace; " class=""><span style="font-family: monospace; " class="">and then doing it so hard that you become great in the process." - xkcd #896</span></div></div>
</div>
<br class=""></div></body></html>