Made set_part_info a handler method and not a ha_partition method only
The previous variant where it was a specific ha_partition method only worked for the partition handler. It was unfortunately called also for the NDB handler and in this case it called a random method in the NDB handler with random input. sql/ha_ndbcluster.cc: Moved initialisation of some handler variables to set_part_info method called earlly in the open process sql/ha_ndbcluster.h: Moved initialisation of some handler variables to set_part_info method called earlly in the open process sql/ha_partition.h: Made set_part_info a handler method and not a ha_partition method only sql/handler.h: Made set_part_info a handler method and not a ha_partition method only sql/sql_partition.cc: Made set_part_info a handler method and not a ha_partition method only
This commit is contained in:
parent
705965362d
commit
68e89d69e0
@ -4503,18 +4503,18 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
|
|||||||
if (!res)
|
if (!res)
|
||||||
info(HA_STATUS_VARIABLE | HA_STATUS_CONST);
|
info(HA_STATUS_VARIABLE | HA_STATUS_CONST);
|
||||||
|
|
||||||
if (table->part_info)
|
|
||||||
{
|
|
||||||
m_part_info= table->part_info;
|
|
||||||
if (!(m_part_info->part_type == HASH_PARTITION &&
|
|
||||||
m_part_info->list_of_part_fields &&
|
|
||||||
!is_sub_partitioned(m_part_info)))
|
|
||||||
m_use_partition_function= TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
DBUG_RETURN(res);
|
DBUG_RETURN(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ha_ndbcluster::set_part_info(partition_info *part_info)
|
||||||
|
{
|
||||||
|
m_part_info= part_info;
|
||||||
|
if (!(m_part_info->part_type == HASH_PARTITION &&
|
||||||
|
m_part_info->list_of_part_fields &&
|
||||||
|
!is_sub_partitioned(m_part_info)))
|
||||||
|
m_use_partition_function= TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Close the table
|
Close the table
|
||||||
|
@ -534,6 +534,7 @@ class ha_ndbcluster: public handler
|
|||||||
return (HA_CAN_PARTITION | HA_CAN_UPDATE_PARTITION_KEY |
|
return (HA_CAN_PARTITION | HA_CAN_UPDATE_PARTITION_KEY |
|
||||||
HA_CAN_PARTITION_UNIQUE);
|
HA_CAN_PARTITION_UNIQUE);
|
||||||
}
|
}
|
||||||
|
void set_part_info(partition_info *part_info);
|
||||||
ulong index_flags(uint idx, uint part, bool all_parts) const;
|
ulong index_flags(uint idx, uint part, bool all_parts) const;
|
||||||
uint max_supported_record_length() const;
|
uint max_supported_record_length() const;
|
||||||
uint max_supported_keys() const;
|
uint max_supported_keys() const;
|
||||||
|
@ -122,7 +122,7 @@ private:
|
|||||||
PARTITION_SHARE *share; /* Shared lock info */
|
PARTITION_SHARE *share; /* Shared lock info */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_part_info(partition_info *part_info)
|
virtual void set_part_info(partition_info *part_info)
|
||||||
{
|
{
|
||||||
m_part_info= part_info;
|
m_part_info= part_info;
|
||||||
m_is_sub_partitioned= is_sub_partitioned(part_info);
|
m_is_sub_partitioned= is_sub_partitioned(part_info);
|
||||||
|
@ -1273,6 +1273,7 @@ public:
|
|||||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||||
virtual ulong partition_flags(void) const { return 0;}
|
virtual ulong partition_flags(void) const { return 0;}
|
||||||
virtual int get_default_no_partitions(ulonglong max_rows) { return 1;}
|
virtual int get_default_no_partitions(ulonglong max_rows) { return 1;}
|
||||||
|
virtual void set_part_info(partition_info *part_info) { return; }
|
||||||
#endif
|
#endif
|
||||||
virtual ulong index_flags(uint idx, uint part, bool all_parts) const =0;
|
virtual ulong index_flags(uint idx, uint part, bool all_parts) const =0;
|
||||||
virtual ulong index_ddl_flags(KEY *wanted_index) const
|
virtual ulong index_ddl_flags(KEY *wanted_index) const
|
||||||
|
@ -3128,7 +3128,7 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
|
|||||||
}
|
}
|
||||||
part_info= lex.part_info;
|
part_info= lex.part_info;
|
||||||
table->part_info= part_info;
|
table->part_info= part_info;
|
||||||
((ha_partition*)table->file)->set_part_info(part_info);
|
table->file->set_part_info(part_info);
|
||||||
if (part_info->default_engine_type == DB_TYPE_UNKNOWN)
|
if (part_info->default_engine_type == DB_TYPE_UNKNOWN)
|
||||||
part_info->default_engine_type= default_db_type;
|
part_info->default_engine_type= default_db_type;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user