Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
MySQL++ - Programming with the C++ API to MySQL
ODBC - ODBC with the MySQL Connector/ODBC driver
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
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
MyODBC and BLOB 's

MyODBC and BLOB 's

2005-04-19       - By Ian Klassen

 Back
Reply:     1     2  

Hello,

I'm trying to figure out why MyODBC is having trouble extending the size of net
->buff to accomodate a large (greater than 8k) BLOB.

Here's the MFC code I'm using as a test:

db.OpenEx(_T("dsn=test"), CDatabase::noOdbcDialog);

CMySet rs(&db);
rs.Open(CRecordset::snapshot);  
rs.AddNew();
rs.m_id = 1;         // int
rs.m_type = 2;         // int
rs.m_pr1.SetSize(9000);     // CByteArray (initial size is 12000)

// fill in test data into byte array
for (int i = 0; i < 9000; i++)
{
  rs.m_pr1[i] = 1;
}

rs.Update();

The buff size is initally set to 8199 as seen in the ODBC debug log.

| >my_net_init
| | >_mymalloc
| | | enter: Size: 8199
| | | exit: ptr: 0x14d737e0
| | <_mymalloc
| | >vio_fastsend
| | | exit: 0
| | <vio_fastsend
| <my_net_init

However, when it has to grow, I get a memory allocation error.  I can't realloc
the memory pointed to by net->buff without getting an error.

| >add_to_buffer
| | enter: from: ','  length: 1
| | >extend_buffer
| | | enter: current_length: 3  length: 1  buffer_length: 8192
| | | INFO: to: 14d737e3, buff: 14d737e0
| | <extend_buffer
| <add_to_buffer
| copy_rowdata: buffer: '', length: 9001, actual: 1
| >extend_buffer
| | enter: current_length: 4  length: 9001  buffer_length: 8192
| | >my_realloc
| | | my: ptr: 0x14d737e0  size: 16384  my_flags: 16

The address trying to be reallocated (to 16k) is the same address as the one
initially allocated (to 8199) so I don't see why there should be a problem.
Any idea as to what's going on?

Ian

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:    http://lists.mysql.com/myodbc?unsub=mysql@(protected)


Earn $52 per hosting referral at Lunarpages.