Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
Subject: mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Subject: Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
Subject: MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Subject: Re: Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
varchar field > 65K

varchar field > 65K

2007-10-12       - By Warren Young

 Back
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=mysql@(protected)