PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > ODBC 3.51.22 problem - please
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
ODBC 3.51.22 problem - please

Réponse
 
LinkBack Outils de la discussion
Vieux 13/12/2007, 01h11   #1
Ed Reed
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut ODBC 3.51.22 problem - please

I've found a glaring problem with the latest ODBC connector. Data types have been changed and data is no longer being read correctly.

I'm running MySQL 5.1.16 on Netware. My apps are VB6 and VBA using ADO. The following query produces different data types depending on the version of the ODBC driver.

SELECT ConCat(21000,'-','a')

In 3.51.19 it is a VarChar and in 3.51.22 it's a VarBinary. Concat is supposed to return a string. In C a byte array may be fine but in VB a string should be a VarChar.

Is this a bug or is there a server or OBDC setting that can be changed to make sure that it always returns a VarChar

Thanks for the

  Réponse avec citation
Vieux 13/12/2007, 20h47   #2
Jim Winstead
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ODBC 3.51.22 problem - please

On Wed, Dec 12, 2007 at 05:11:43PM -0800, Ed Reed wrote:
> I've found a glaring problem with the latest ODBC connector. Data
> types have been changed and data is no longer being read correctly.


That's not quite correct -- data types are now actually being read
correctly. They were wrong before, even if it was what you expected.

> I'm running MySQL 5.1.16 on Netware. My apps are VB6 and VBA using
> ADO. The following query produces different data types depending on
> the version of the ODBC driver.
>
> SELECT ConCat(21000,'-','a')
>
> In 3.51.19 it is a VarChar and in 3.51.22 it's a VarBinary. Concat is
> supposed to return a string. In C a byte array may be fine but in VB a
> string should be a VarChar.
>
> Is this a bug or is there a server or OBDC setting that can be changed
> to make sure that it always returns a VarChar


CONCAT() derives its return types from its arguments. The key part from
the CONCAT() documentation is:

If all arguments are non-binary strings, the result is a non-binary
string. If the arguments include any binary strings, the result is a
binary string. A numeric argument is converted to its equivalent binary
string form; if you want to avoid that, you can use an explicit type
cast, as in this example:

SELECT CONCAT(CAST(int_col AS CHAR), char_col);

That earlier releases of the driver would return a non-binary string in
your case was a bug.

That a numeric argument is converted to a binary string is an
unfortunate server "feature". I hope it will get fixed in a future
server release, but I'm not sure when that will be, and it will almost
certainly not be in the 5.1 series.

Jim
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h59.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10024 seconds with 10 queries