Commit e0cbfe76 authored by unknown's avatar unknown

Merge mysql.com:/home/timka/mysql/src/4.1-virgin

into mysql.com:/home/timka/mysql/src/4.1-bug-7331

parents f1328f13 404fc5ac
...@@ -187,28 +187,33 @@ public: ...@@ -187,28 +187,33 @@ public:
}; };
void update_max_auto_val(const char *data, int size) { void update_max_auto_val(const char *data, int size) {
Uint64 val= 0; union {
Uint8 u8;
Uint16 u16;
Uint32 u32;
} val;
Uint64 v;
switch(size){ switch(size){
case 8: case 64:
val= *(Uint8*)data; memcpy(&v,data,8);
break;
case 16:
val= *(Uint16*)data;
break;
case 24:
val= (0xffffff)&*(Uint32*)data;
break; break;
case 32: case 32:
val= *(Uint32*)data; memcpy(&val.u32,data,4);
v= val.u32;
break; break;
case 64: case 16:
val= *(Uint64*)data; memcpy(&val.u16,data,2);
v= val.u16;
break;
case 8:
memcpy(&val.u8,data,1);
v= val.u8;
break; break;
default: default:
return; return;
}; };
if(val > m_max_auto_val) if(v > m_max_auto_val)
m_max_auto_val= val; m_max_auto_val= v;
}; };
/** /**
* Get attribute descriptor * Get attribute descriptor
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment