Special character issue connecting Mod lua to Sybase DB using Freetds

Upadhay, Krishna - Kolkata kupadhay at wiley.com
Fri Oct 21 11:18:24 CEST 2016


Thanks for your prompt response Dago. I will reach out to freetds with this question.

By the way we are using the same version in RHEL as well.


Thanks & Regards,
Krishna Upadhyay
Tata Consultancy Services
________________________________
From: users <users-bounces+kupadhay=wiley.com at lists.opencsw.org> on behalf of Dagobert Michelsen <dam at opencsw.org>
Sent: 21 October 2016 13:47
To: Questions and discussions
Subject: Re: Special character issue connecting Mod lua to Sybase DB using Freetds

Hi Krishna,

Am 21.10.2016 um 09:29 schrieb Upadhay, Krishna - Kolkata <kupadhay at wiley.com<mailto: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/).

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/042c97cf/attachment-0001.html>


More information about the users mailing list