MyODBC and BLOB"s
am 19.04.2005 09:05:23 von Ian KlassenHello,
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=3Dtest"), CDatabase::noOdbcDialog);
CMySet rs(&db);
rs.Open(CRecordset::snapshot);=09
rs.AddNew();
rs.m_id =3D 1; // int
rs.m_type =3D 2; // int
rs.m_pr1.SetSize(9000); // CByteArray (initial size is 12000)
// fill in test data into byte array
for (int i =3D 0; i < 9000; i++)
{
rs.m_pr1[i] =3D 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
| |
However, when it has to grow, I get a memory allocation error. I can't rea=
lloc 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
| | 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 on=
e initially allocated (to 8199) so I don't see why there should be a proble=
m. 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=3Dgcdmo-myodbc@m.gmane.o rg