CC: | "rt-cpan-admin [...] bestpractical.com" <rt-cpan-admin [...] bestpractical.com> |
Subject: | Report of new bug with UNIVARCHAR long string (over than 128 caracters) |
Date: | Thu, 29 Sep 2011 18:46:58 +0200 |
To: | "bug-DBD-Sybase [...] rt.cpan.org" <bug-DBD-Sybase [...] rt.cpan.org> |
From: | <jjoly.ext [...] orange.com> |
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
Show quoted text
> #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;
---
Show quoted text> len = column->maxlength;
630a641,644
Show quoted text> #if defined(CS_UNICHAR_TYPE)
> case CS_UNICHAR_TYPE:
> case CS_UNITEXT_TYPE:
> #endif
3698a3713,3716
Show quoted text> /* 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;
---
Show quoted text> imp_sth->coldata[i].valuelen = slen * 2;
3705a3723
Show quoted text> #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>
Show quoted text________________________________
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.
********************************************************************************
Message body not shown because it is not plain text.