Commit ee7e3e71 authored by unknown's avatar unknown

merge

parent 8707870d
......@@ -351,11 +351,12 @@ void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2)
void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit)
{
uchar use_byte= use_bit ? 0xff : 0;
uchar *to= map->bitmap + from_byte;
uchar *end= map->bitmap + map->bitmap_size;
uchar *to= (uchar *)map->bitmap + from_byte;
uchar *end= (uchar *)map->bitmap + (map->n_bits+7)/8;
while (to < end)
*to++= use_byte;
*map->last_word_ptr|= map->last_word_mask; /*Set last bits again*/
}
......
......@@ -67,8 +67,25 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE * table);
MODULE create/delete handler object
****************************************************************************/
static handlerton partition_hton = {
"partition",
0, /* slot */
0, /* savepoint size */
NULL /*ndbcluster_close_connection*/,
NULL, /* savepoint_set */
NULL, /* savepoint_rollback */
NULL, /* savepoint_release */
NULL /*ndbcluster_commit*/,
NULL /*ndbcluster_rollback*/,
NULL, /* prepare */
NULL, /* recover */
NULL, /* commit_by_xid */
NULL, /* rollback_by_xid */
HTON_NO_FLAGS
};
ha_partition::ha_partition(TABLE *table)
:handler(table), m_part_info(NULL), m_create_handler(FALSE),
:handler(&partition_hton, table), m_part_info(NULL), m_create_handler(FALSE),
m_is_sub_partitioned(0)
{
DBUG_ENTER("ha_partition::ha_partition(table)");
......@@ -86,7 +103,7 @@ ha_partition::ha_partition(TABLE *table)
ha_partition::ha_partition(partition_info *part_info)
:handler(NULL), m_part_info(part_info), m_create_handler(TRUE),
:handler(&partition_hton, NULL), m_part_info(part_info), m_create_handler(TRUE),
m_is_sub_partitioned(is_sub_partitioned(m_part_info))
{
......
......@@ -55,7 +55,7 @@ template <uint default_width> class Bitmap
void intersect_extended(ulonglong map2buff)
{
intersect(map2buff);
if (map.bitmap_size > sizeof(ulonglong))
if (map.n_bits > sizeof(ulonglong) * 8)
bitmap_set_above(&map, sizeof(ulonglong),
test(map2buff & (LL(1) << (sizeof(ulonglong) * 8 - 1))));
}
......
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