[prev in list] [next in list] [prev in thread] [next in thread]
List: mysql-internals
Subject: Re: incorrect C API data type constants
From: Paul DuBois <paul () mysql ! com>
Date: 2007-04-27 16:04:08
Message-ID: p06240824c257cf250618 () [192 ! 168 ! 0 ! 35]
[Download RAW message or body]
At 7:25 PM +0200 4/26/07, Sergei Golubchik wrote:
>Hi!
>
>On Apr 09, Alan Nilsson wrote:
>> I have noticed that when using the C API that in certain instances
>> the field 'type' constant is not correct.
>>
>> When a value is returned from a 'TEXT' type field it is reported as a
>> 'BLOB' type. I realize that a TEXT is an extension of a BLOB, but,
>> since they are different types according to the schema, why are they
>> not different when returned via the API? Actually there are no TEXT
>> type constants in the API.
>
>It's for historical reasons.
>
>> This is particularly important for middle ware that knows nothing
>> about the schema, it must rely on what the type is according to the API.
>
>You can distinguish BLOB from TEXT by looking at the charset field.
>'binary' charset means BLOB, anything else - TEXT.
Reference:
http://dev.mysql.com/doc/refman/5.0/en/c-api-datatypes.html
(see last paragraph)
For prepared statements, see here:
http://dev.mysql.com/doc/refman/5.0/en/c-api-prepared-statement-datatypes.html
(last paragraph)
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=mysql-internals@progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic