Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: varchar field > 65K

From: Warren Young <mysqlpp(at)etr-usa.com>
Date: Fri Oct 12 2007 - 02:22:59 EDT


John Gehring wrote:
> I am adding records to my MySQL database that contains a column of type
> 'mediumtext' (call it ColA). The amount of data is roughly 75K bytes. If I
> use the SELECT ... INTO OUTFILE ... statement to get the data, I
> successfully get all the data of the record. However, if I use a select
> statement within an embedded application (using mysql++), the data from ColA
> is truncated at 65K bytes.

Things to check:

  • What character set are you using? Unicode character representations may do surprising things when processed by naive code. See chapter 6 in the user manual.
  • "65K" bothers me. Are you using SI suffixes here -- 65,000 bytes -- or do you mean that it's actually getting over the special 64K boundary?
  • Are you sure you don't need a BLOB column here? Or, at least treating it with the precautions due a BLOB column? See examples/load_jpeg.cpp and examples/cgi_jpeg.cpp.

> I see quite a bit of documentation for the mysql
> embedded library related to binding data for result sets. But I don't see
> anyplace in the mysql++ code that uses that functionality (like
> mysql_stmt_bind_result()).

Yes, but there's no requirement to use those APIs. MySQL++ takes the traditional approach: it uses text representations of data, in plain old SQL forms. You must use BLOBs to get bit-for-bit accuracy, and even then, it goes across the wire in escaped text form.

> Am I missing something, or does the mysql++
> library have a limit on how large a field of data can be returned from a
> select statement?

MySQL++ imposes no limits above what the underlying C API does. That's not to say that you can't abuse the library to make it truncate data, just that there are proper ways to get the data without truncation.

-- 
MySQL++ Mailing List
For list archives: 
http://lists.mysql.com/plusplus
To unsubscribe:    
http://lists.mysql.com/plusplus?unsub=lists@pantek.com
Received on Fri Oct 12 02:23:24 2007

This archive was generated by hypermail 2.1.8 : Fri Jul 04 2008 - 00:21:30 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library