mpeppler/DBD-Sybase

Report of new bug with UNIVARCHAR long string (over than 128 caracters) [rt.cpan.org #71339]

Closed this issue · 0 comments

Migrated from rt.cpan.org#71339 (status was 'open')

Requestors:

Attachments:

From jjoly.ext@orange.com on 2011-09-29 16:47:15
:

Hello,

    I am currently a developper in Orange France, and I found a bug in the DBD::Sybase.
    The module was describe as the sample of Sybase, but I also had an issue using their samples with a very big string (more than 25 caracters UNIVARCHAR).
    I solve this issue by changing the reservation of buffer used to fetch the data comming from the database. It was previously the same a specified in the datafmt: eg UNIVARCHAR(255) => size = 255.
    Or UNIVARCHAR is UTF-16. and the maximum string could now goes to 510 octet's long.
    I have modify the sample of Sybase, and validate it with them. They include these new modification in the Sybase 15.7 delivered yesterday.
    I have applied the same modification on the module DBD::Sybase. Please read the joind tarball. It's included the "utf8.t", "dbdimp.c" and "Sybase.h". All importants modifications are in "dbdimp.c" in red:

82a83,92
> #if defined(CS_VERSION_155)
> #if !defined BLK_VERSION_155
> #define BLK_VERSION_155       BLK_VERSION_150
> #endif
> #endif
> #if defined(CS_VERSION_157)
> #if !defined BLK_VERSION_157
> #define BLK_VERSION_157       BLK_VERSION_155
> #endif
> #endif
625c635
<               len = column->maxlength;
---
>         len = column->maxlength;
630a641,644
> #if defined(CS_UNICHAR_TYPE)
>       case CS_UNICHAR_TYPE:
>       case CS_UNITEXT_TYPE:
> #endif
3698a3713,3716
>                               /* For these types send data "as is" */
>                               ptr = imp_sth->coldata[i].ptr;
>                               imp_sth->coldata[i].valuelen = slen;
>                               break;
3701d3718
< #endif
3704c3721
<                               imp_sth->coldata[i].valuelen = slen;
---
>                               imp_sth->coldata[i].valuelen = slen * 2;
3705a3723
> #endif
    If you have some questions, I will be pleased to answer

Regards

[cid:453350916@29092011-14EF]
Julien JOLY Pour ORANGE
FT/OLNC/DPS/MSE/IDE/SSO







Téléphone: +33 (0)1 57 36 10 71
Adresse: 21, rue Jasmin
                  75016 Paris
Email:  jjoly.ext@orange.com <mailto:jjoly.ext@orange.com>
________________________________
P Cette obscure clarté qui tombe des étoiles,
Enfin, avec le flux nous fit voir trente voiles,
L'onde s'enfle dessous et, d'un commun effort,
Les Mores et la mer montent jusques au port.

Corneille Le Cid (1636)
________________________________


********************************************************************************
IMPORTANT.Les informations contenues dans ce message electronique y compris les fichiers attaches sont strictement confidentielles
et peuvent etre protegees par la loi.
Ce message electronique est destine exclusivement au(x) destinataire(s) mentionne(s) ci-dessus.
Si vous avez recu ce message par erreur ou s il ne vous est pas destine, veuillez immediatement le signaler  a l expediteur et effacer ce message 
et tous les fichiers eventuellement attaches.
Toute lecture, exploitation ou transmission des informations contenues dans ce message est interdite.
Tout message electronique est susceptible d alteration.
A ce titre, le Groupe France Telecom decline toute responsabilite notamment s il a ete altere, deforme ou falsifie.
De meme, il appartient au destinataire de s assurer de l absence de tout virus.

IMPORTANT.This e-mail message and any attachments are strictly confidential and may be protected by law. This message is
intended only for the named recipient(s) above.
If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this e-mail message.
Any unauthorized view, usage or disclosure ofthis message is prohibited.
Since e-mail messages may not be reliable, France Telecom Group shall not be liable for any message if modified, changed or falsified.
Additionally the recipient should ensure they are actually virus free.
********************************************************************************



From mpeppler@peppler.org on 2011-10-02 15:07:59
:

Should be fixed in 1.14, uploaded to CPAN a few minutes ago.

From jjoly.ext@orange.com on 2011-10-03 10:06:04
:


Hello,

    I am sorry, but i have test the modification and it does not work. The librarie Sybase generate and error 132 again.
  I have seen that the modification regarding the CS_UNICHAR_TYPE were partially comment (eg line 641 to 644). Bug it is the most important lines. I their are commented, the error appears.I have made a test with your code, it does not work. I made it again, with the line 641 to 644 uncomment, and it is work.

Regards




 Julien JOLY Pour ORANGE
FT/OLNC/DPS/MSE/IDE/SSO






Téléphone: +33 (0)1 57 36 10 71
Adresse: 21, rue Jasmin
                  75016 Paris
Email:  jjoly.ext@orange.com
________________________________

P Cette obscure clarté qui tombe des étoiles,
Enfin, avec le flux nous fit voir trente voiles,
L'onde s'enfle dessous et, d'un commun effort,
Les Mores et la mer montent jusques au port.

Corneille Le Cid (1636)

-----Message d'origine-----
De : Michael Peppler via RT [mailto:bug-DBD-Sybase@rt.cpan.org]
Envoyé : dimanche 2 octobre 2011 17:08
� : JOLY Julien Ext OLNC/DPS
Objet : [rt.cpan.org #71339] Resolved: Report of new bug with UNIVARCHAR long string (over than 128 caracters)

<URL: https://rt.cpan.org/Ticket/Display.html?id=71339 >

According to our records, your request has been resolved. If you have any further questions or concerns, please respond to this message.

********************************************************************************
IMPORTANT.Les informations contenues dans ce message electronique y compris les fichiers attaches sont strictement confidentielles
et peuvent etre protegees par la loi.
Ce message electronique est destine exclusivement au(x) destinataire(s) mentionne(s) ci-dessus.
Si vous avez recu ce message par erreur ou s il ne vous est pas destine, veuillez immediatement le signaler  a l expediteur et effacer ce message 
et tous les fichiers eventuellement attaches.
Toute lecture, exploitation ou transmission des informations contenues dans ce message est interdite.
Tout message electronique est susceptible d alteration.
A ce titre, le Groupe France Telecom decline toute responsabilite notamment s il a ete altere, deforme ou falsifie.
De meme, il appartient au destinataire de s assurer de l absence de tout virus.

IMPORTANT.This e-mail message and any attachments are strictly confidential and may be protected by law. This message is
intended only for the named recipient(s) above.
If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this e-mail message.
Any unauthorized view, usage or disclosure ofthis message is prohibited.
Since e-mail messages may not be reliable, France Telecom Group shall not be liable for any message if modified, changed or falsified.
Additionally the recipient should ensure they are actually virus free.
********************************************************************************



From mpeppler@peppler.org on 2011-10-03 17:33:51
:

On Mon Oct 03 06:06:04 2011, jjoly.ext@orange.com wrote:
> 
> Hello,
> 
>     I am sorry, but i have test the modification and it does not work.
>    The librarie Sybase generate and error 132 again.
>   I have seen that the modification regarding the CS_UNICHAR_TYPE were
>    partially comment (eg line 641 to 644). Bug it is the most
>    important lines. I their are commented, the error appears.I have
>    made a test with your code, it does not work. I made it again, with
>    the line 641 to 644 uncomment, and it is work.

Which platform (OS) are you on, which versions of OpenClient, and which
version of ASE please?

I tested my version with OpenClient 15.7 and 15.5, against 15.5 and 15.7
servers, and at least the utf8.t test script worked fine.

If possible could you send me the actual error message you get, as well
as version info, etc?

Thanks.

Michael

PS - you can send this directly to me, and in French if you prefer
(j'habite en Suisse...)


From jjoly.ext@orange.com on 2011-10-04 07:11:25
:

Sorry

    I made a test through OCS 12.5.4, 15.5.1 and 15.7.0 with ASE 12.5.1.
    The instance of the server is with charset "utf8". But i used UNIVARCHAR type.
    My error message is this one:
DBD::Sybase::st fetchrow_array failed: OpenClient message: LAYER = (1) ORIGIN = (4) SEVERITY = (1) NUMBER = (132)
Server ss2_nopfa236, database
Message String: ct_fetch(): user api layer: internal common library error: The bind of result set item 17 resulted in truncation.

    I saw that you comment my test in "utf8.t". That explain my remark. I the sentence in the UNIVARCHAR field is shorter rathen than the size of the field, this issue does not appear. You have to specified a very long sentence. I used a Hindy string (recopy of 3 hindy caracters) to form a 255 UNIVARCHAR sentence (to fullfill the field). I fetch it through PERL and the issue appear.

    As I saw now, i have write an issue in the test:

$dbh->do("create table #utf8test (uv univarchar(255), ut unitext)");

my $ascii = 'Some text';
my $utf8 = "पट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट�टपट";

    Sorry about that last point

    Regards







 Julien JOLY Pour ORANGE
FT/OLNC/DPS/MSE/IDE/SSO






Téléphone: +33 (0)1 57 36 10 71
Adresse: 21, rue Jasmin
                  75016 Paris
Email:  jjoly.ext@orange.com
________________________________

P Cette obscure clarté qui tombe des étoiles,
Enfin, avec le flux nous fit voir trente voiles,
L'onde s'enfle dessous et, d'un commun effort,
Les Mores et la mer montent jusques au port.

Corneille Le Cid (1636)

-----Message d'origine-----
De : Michael Peppler via RT [mailto:bug-DBD-Sybase@rt.cpan.org]
Envoyé : lundi 3 octobre 2011 19:34
� : JOLY Julien Ext OLNC/DPS
Objet : [rt.cpan.org #71339] Report of new bug with UNIVARCHAR long string (over than 128 caracters)

<URL: https://rt.cpan.org/Ticket/Display.html?id=71339 >

On Mon Oct 03 06:06:04 2011, jjoly.ext@orange.com wrote:
>
> Hello,
>
>     I am sorry, but i have test the modification and it does not work.
>    The librarie Sybase generate and error 132 again.
>   I have seen that the modification regarding the CS_UNICHAR_TYPE were
>    partially comment (eg line 641 to 644). Bug it is the most
>    important lines. I their are commented, the error appears.I have
>    made a test with your code, it does not work. I made it again, with
>    the line 641 to 644 uncomment, and it is work.

Which platform (OS) are you on, which versions of OpenClient, and which version of ASE please?

I tested my version with OpenClient 15.7 and 15.5, against 15.5 and 15.7 servers, and at least the utf8.t test script worked fine.

If possible could you send me the actual error message you get, as well as version info, etc?

Thanks.

Michael

PS - you can send this directly to me, and in French if you prefer (j'habite en Suisse...)


********************************************************************************
IMPORTANT.Les informations contenues dans ce message electronique y compris les fichiers attaches sont strictement confidentielles
et peuvent etre protegees par la loi.
Ce message electronique est destine exclusivement au(x) destinataire(s) mentionne(s) ci-dessus.
Si vous avez recu ce message par erreur ou s il ne vous est pas destine, veuillez immediatement le signaler  a l expediteur et effacer ce message 
et tous les fichiers eventuellement attaches.
Toute lecture, exploitation ou transmission des informations contenues dans ce message est interdite.
Tout message electronique est susceptible d alteration.
A ce titre, le Groupe France Telecom decline toute responsabilite notamment s il a ete altere, deforme ou falsifie.
De meme, il appartient au destinataire de s assurer de l absence de tout virus.

IMPORTANT.This e-mail message and any attachments are strictly confidential and may be protected by law. This message is
intended only for the named recipient(s) above.
If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this e-mail message.
Any unauthorized view, usage or disclosure ofthis message is prohibited.
Since e-mail messages may not be reliable, France Telecom Group shall not be liable for any message if modified, changed or falsified.
Additionally the recipient should ensure they are actually virus free.
********************************************************************************