469,623 Members | 1,438 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

MyODBC recognize all BLOB fields as FIELD_TYPE_BLOB?

qhe
Dear All:

I'm using MyODBC 3.51.06 and MySQL 4.0.18.

My table has a mediumblob field, but I can't update/insert data larger than
64K. The test application is created by VC6 appwizard, here is the test
code:

m_pSet->GetODBCFieldInfo(2, fieldinfo);
n = fieldinfo.m_nPrecision;

No matter field is blob, mediumblob or longblob, the m_nPrecision is always
65535. I traced into the myodbc source, in this piece of code (utility.c):
////////////////////////////////////////////////////////////////////////////
int unireg_to_sql_datatype(STMT FAR *stmt, MYSQL_FIELD *field, char *buff,
ulong *transfer_length, ulong *precision,
ulong *display_size)
{
char *pos;
if (stmt->dbc->flag & (FLAG_FIELD_LENGTH | FLAG_SAFE))
*transfer_length= *precision= *display_size= max(field->length,
field->max_length);
else
*transfer_length= *precision= *display_size= field->max_length;

switch(field->type) {

...

case FIELD_TYPE_BLOB:
if (buff)
strmov(buff,(field->flags & BINARY_FLAG) ? "blob" : "text");
if (stmt->dbc->flag & (FLAG_FIELD_LENGTH | FLAG_SAFE))
*transfer_length= *precision= *display_size= 65535;

////////////////////////////////////////////////////////////////////////////
the field->type is FIELD_TYPE_BLOB for blob,mediumblob and longblob.
This leads to an buffer length error, I can't feed longer data into the
field, and sometimes there gives memory alloction error.

Is this a MyODBC bug?

TIA

qhe
Jul 19 '05 #1
0 1364

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by David McKay | last post: by
3 posts views Thread by hamvil79 | last post: by
reply views Thread by HABJAN ®iga | last post: by
7 posts views Thread by johnm | last post: by
reply views Thread by LuisH | last post: by
2 posts views Thread by pmz | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.