Re: incorrect char() string for bigint column
Posted by: Anthony Linnett
Date: August 07, 2011 10:09PM

thanks for the response!

i am using the mysql c client to return a bigint column from table data.

typically, the client will return a string representation of the bigint column (*ugh*) when queried, meaning my app will need to parse the string to convert to integer.

i am offloading this parsing to the mysql server to return a array of binary characters so i can simply memcpy to use (within reason.)

the hex representation of 130333868145 is 0x1E5881007, thus I expect [0x00,0x1E,0x58,0x81,0x00,0x71] to be retured as per the following

As of MySQL 5.0.15, CHAR() arguments larger than 255 are converted into multiple result bytes. For example, CHAR(256) is equivalent to CHAR(1,0), and CHAR(256*256) is equivalent to CHAR(1,0,0):

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: incorrect char() string for bigint column
995
August 07, 2011 10:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.