1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

A fix for bit type.

pack_length_in_rec() func has been introduced.


sql/field.h:
  A fix for bit type. 
  As from now the pack_length_in_rec() function is used for MyISAM 
  record length calculation instead of the pack_length().
  For bit field it doesn't count uneven bits.
sql/ha_myisam.cc:
  A fix for bit type. 
  As from now the pack_length_in_rec() function is used for MyISAM 
  record length calculation instead of the pack_length().
  For bit field it doesn't count uneven bits.
This commit is contained in:
unknown
2005-01-14 18:24:32 +04:00
parent 60ff25cac8
commit 8c3a1fde1d
2 changed files with 3 additions and 1 deletions

View File

@@ -123,6 +123,7 @@ public:
}
virtual bool eq_def(Field *field);
virtual uint32 pack_length() const { return (uint32) field_length; }
virtual uint32 pack_length_in_rec() const { return pack_length(); }
virtual void reset(void) { bzero(ptr,pack_length()); }
virtual void reset_fields() {}
virtual void set_default()
@@ -1237,6 +1238,7 @@ public:
{ get_key_image(buff, length, itRAW); }
uint32 pack_length() const
{ return (uint32) field_length + (bit_len > 0); }
uint32 pack_length_in_rec() const { return field_length; }
void sql_type(String &str) const;
field_cast_enum field_cast_type() { return FIELD_CAST_BIT; }
char *pack(char *to, const char *from, uint max_length=~(uint) 0);

View File

@@ -1467,7 +1467,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
fieldpos <= minpos)
{
/* skip null fields */
if (!(temp_length= (*field)->pack_length()))
if (!(temp_length= (*field)->pack_length_in_rec()))
continue; /* Skip null-fields */
if (! found || fieldpos < minpos ||
(fieldpos == minpos && temp_length < length))