Special character issue connecting Mod lua to Sybase DB using Freetds

Dagobert Michelsen dam at opencsw.org
Fri Oct 21 10:17:54 CEST 2016


Hi Krishna,

Am 21.10.2016 um 09:29 schrieb Upadhay, Krishna - Kolkata <kupadhay at wiley.com>:
> We are trying to fetch data from sybase DB through mod lua (in apache 2.4.23) using the freetds(downloaded from
> https://www.opencsw.org/package/freetds/ <https://www.opencsw.org/package/freetds/>).
> 
> OS details is: Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC
> 
> The lua module receives a key from the http request and looks up for the corresponding value from a sybase database table.
> The problem is in this database lookup. It's only a plain select query fetching a single value of type varchar.
> However, some random characters get appended to the retrieved value at the end when we recieve it in the lua module.
> 
> 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:
> 
> -- 9 character varchar value in DB -> 0021/2015
> -- Data received in lua code -> 0021/2015h
> 
> -- 17 character varchar value in DB -> 0021/2015/06/18/7
> -- Data received in lua code -> 0021/2015/06/18/7\x07\xc1\xd4
> 
> -- 33 character varchar value in DB -> 0021/2015/06/18/732/10.1002-2Fabc
> -- Data received in lua code -> 0021/2015/06/18/732/10.1002-2Fabc\x02h
> 
> -- 65 character varchar value in DB -> 0021/2015/06/18/732/10.1002-2Fab0021/2015/06/18/732/10.1002-2Fabc
> -- Data received in lua code -> 0021/2015/06/18/732/10.1002-2Fab0021/2015/06/18/732/10.1002-2FabcY\x140
> 
> Please note the following:
> 1. The issue do not happen in a RHEL system
> 2. The same functionality works fine if we lookup a similar table in MySQL.
> 
> Any comments regarding the cause of this issue would be really helpful.

This doesn’t sound like a packaging issue, are you using the same version on RHEL?
Maybe the FreeTDS people can help.


Best regards

  — Dago

> 
> Thanks & Regards,
> Krishna Upadhyay
> Tata Consultancy Services

--
"You don't become great by trying to be great, you become great by wanting to do something,
and then doing it so hard that you become great in the process." - xkcd #896

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencsw.org/pipermail/users/attachments/20161021/b91855d2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.opencsw.org/pipermail/users/attachments/20161021/b91855d2/attachment.asc>


More information about the users mailing list