Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2225 06/06/27 22:19:27 tomas@stripped +8 -0
partition functions to pass create_info, not only max_rows
sql/sql_table.cc
1.351 06/06/27 22:19:18 tomas@stripped +5 -5
partition functions to pass create_info, not only max_rows
sql/sql_partition.h
1.10 06/06/27 22:19:18 tomas@stripped +1 -1
partition functions to pass create_info, not only max_rows
sql/sql_partition.cc
1.79 06/06/27 22:19:18 tomas@stripped +1 -2
partition functions to pass create_info, not only max_rows
sql/partition_info.h
1.14 06/06/27 22:19:18 tomas@stripped +4 -4
partition functions to pass create_info, not only max_rows
sql/partition_info.cc
1.20 06/06/27 22:19:18 tomas@stripped +14 -13
partition functions to pass create_info, not only max_rows
sql/handler.h
1.221 06/06/27 22:19:17 tomas@stripped +1 -1
partition functions to pass create_info, not only max_rows
sql/ha_ndbcluster.h
1.145 06/06/27 22:19:17 tomas@stripped +1 -1
partition functions to pass create_info, not only max_rows
sql/ha_ndbcluster.cc
1.340 06/06/27 22:19:17 tomas@stripped +18 -10
partition functions to pass create_info, not only max_rows
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tomas
# Host: poseidon.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-new-ndb
--- 1.220/sql/handler.h 2006-06-27 14:31:26 +02:00
+++ 1.221/sql/handler.h 2006-06-27 22:19:17 +02:00
@@ -1335,7 +1335,7 @@
virtual const char *table_type() const =0;
virtual const char **bas_ext() const =0;
- virtual int get_default_no_partitions(TABLE_SHARE *) { return 1;}
+ virtual int get_default_no_partitions(HA_CREATE_INFO *info) { return 1;}
virtual void set_auto_partitions(partition_info *part_info) { return; }
virtual bool get_no_parts(const char *name,
uint *no_parts)
--- 1.350/sql/sql_table.cc 2006-06-22 01:25:50 +02:00
+++ 1.351/sql/sql_table.cc 2006-06-27 22:19:18 +02:00
@@ -3185,8 +3185,7 @@
}
DBUG_PRINT("info", ("db_type = %d",
ha_legacy_type(part_info->default_engine_type)));
- if (part_info->check_partition_info(thd, &engine_type, file,
- create_info->max_rows))
+ if (part_info->check_partition_info(thd, &engine_type, file, create_info))
goto err;
part_info->default_engine_type= engine_type;
@@ -3224,7 +3223,8 @@
*/
if (part_info->use_default_no_partitions &&
part_info->no_parts &&
- (int)part_info->no_parts != file->get_default_no_partitions(0ULL))
+ (int)part_info->no_parts !=
+ file->get_default_no_partitions(create_info))
{
uint i;
List_iterator<partition_element> part_it(part_info->partitions);
@@ -3237,10 +3237,10 @@
part_info->use_default_no_subpartitions &&
part_info->no_subparts &&
(int)part_info->no_subparts !=
- file->get_default_no_partitions(0ULL))
+ file->get_default_no_partitions(create_info))
{
DBUG_ASSERT(thd->lex->sql_command != SQLCOM_CREATE_TABLE);
- part_info->no_subparts= file->get_default_no_partitions(0ULL);
+ part_info->no_subparts= file->get_default_no_partitions(create_info);
}
}
else if (create_info->db_type != engine_type)
--- 1.339/sql/ha_ndbcluster.cc 2006-06-27 14:31:26 +02:00
+++ 1.340/sql/ha_ndbcluster.cc 2006-06-27 22:19:17 +02:00
@@ -9590,12 +9590,8 @@
/*
Create a table in NDB Cluster
*/
-static uint get_no_fragments(TABLE_SHARE *table_share)
+static uint get_no_fragments(ulonglong max_rows)
{
- ha_rows max_rows= table_share->max_rows;
- ha_rows min_rows= table_share->min_rows;
- if (max_rows < min_rows)
- max_rows= min_rows;
#if MYSQL_VERSION_ID >= 50000
uint acc_row_size= 25 + /*safety margin*/ 2;
#else
@@ -9632,10 +9628,22 @@
return (reported_frags < no_fragments);
}
-int ha_ndbcluster::get_default_no_partitions(TABLE_SHARE *table_share)
+int ha_ndbcluster::get_default_no_partitions(HA_CREATE_INFO *info)
{
+ ha_rows max_rows, min_rows;
+ if (info)
+ {
+ max_rows= info->max_rows;
+ min_rows= info->min_rows;
+ }
+ else
+ {
+ max_rows= table_share->max_rows;
+ min_rows= table_share->min_rows;
+ }
uint reported_frags;
- uint no_fragments= get_no_fragments(table_share);
+ uint no_fragments=
+ get_no_fragments(max_rows >= min_rows ? max_rows : min_rows);
uint no_nodes= g_ndb_cluster_connection->no_db_nodes();
if (adjusted_frag_count(no_fragments, no_nodes, reported_frags))
{
@@ -9884,14 +9892,14 @@
tab->setDefaultNoPartitionsFlag(part_info->use_default_no_partitions);
tab->setLinearFlag(part_info->linear_hash_ind);
{
- ha_rows max_rows= form->s->max_rows;
- ha_rows min_rows= form->s->min_rows;
+ ha_rows max_rows= table_share->max_rows;
+ ha_rows min_rows= table_share->min_rows;
if (max_rows < min_rows)
max_rows= min_rows;
if (max_rows != (ha_rows)0) /* default setting, don't set fragmentation */
{
tab->setMaxRows(max_rows);
- tab->setMaxRows(min_rows);
+ tab->setMinRows(min_rows);
}
}
tab->setTablespaceNames(ts_names, fd_index*sizeof(char*));
--- 1.144/sql/ha_ndbcluster.h 2006-06-27 14:31:26 +02:00
+++ 1.145/sql/ha_ndbcluster.h 2006-06-27 22:19:17 +02:00
@@ -651,7 +651,7 @@
int create(const char *name, TABLE *form, HA_CREATE_INFO *info);
int create_handler_files(const char *file, const char *old_name,
int action_flag, HA_CREATE_INFO *info);
- int get_default_no_partitions(TABLE_SHARE *);
+ int get_default_no_partitions(HA_CREATE_INFO *info);
bool get_no_parts(const char *name, uint *no_parts);
void set_auto_partitions(partition_info *part_info);
--- 1.78/sql/sql_partition.cc 2006-06-14 15:22:23 +02:00
+++ 1.79/sql/sql_partition.cc 2006-06-27 22:19:18 +02:00
@@ -3834,14 +3834,13 @@
if (alter_info->flags == ALTER_TABLE_REORG)
{
uint new_part_no, curr_part_no;
- ulonglong max_rows= table->s->max_rows;
if (tab_part_info->part_type != HASH_PARTITION ||
tab_part_info->use_default_no_partitions)
{
my_error(ER_REORG_NO_PARAM_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
- new_part_no= table->file->get_default_no_partitions(max_rows);
+ new_part_no= table->file->get_default_no_partitions(create_info);
curr_part_no= tab_part_info->no_parts;
if (new_part_no == curr_part_no)
{
--- 1.19/sql/partition_info.cc 2006-06-15 01:40:00 +02:00
+++ 1.20/sql/partition_info.cc 2006-06-27 22:19:18 +02:00
@@ -153,7 +153,7 @@
SYNOPSIS
set_up_default_partitions()
file A reference to a handler of the table
- max_rows Maximum number of rows stored in the table
+ info Create info
start_no Starting partition number
RETURN VALUE
@@ -169,7 +169,8 @@
The external routine needing this code is check_partition_info
*/
-bool partition_info::set_up_default_partitions(handler *file, ulonglong max_rows,
+bool partition_info::set_up_default_partitions(handler *file,
+ HA_CREATE_INFO *info,
uint start_no)
{
uint i;
@@ -188,7 +189,7 @@
goto end;
}
if (no_parts == 0)
- no_parts= file->get_default_no_partitions(max_rows);
+ no_parts= file->get_default_no_partitions(info);
if (unlikely(no_parts > MAX_PARTITIONS))
{
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
@@ -228,7 +229,7 @@
SYNOPSIS
set_up_default_subpartitions()
file A reference to a handler of the table
- max_rows Maximum number of rows stored in the table
+ info Create info
RETURN VALUE
TRUE Error, attempted default values not possible
@@ -244,7 +245,7 @@
*/
bool partition_info::set_up_default_subpartitions(handler *file,
- ulonglong max_rows)
+ HA_CREATE_INFO *info)
{
uint i, j;
char *default_name, *name_ptr;
@@ -254,7 +255,7 @@
DBUG_ENTER("partition_info::set_up_default_subpartitions");
if (no_subparts == 0)
- no_subparts= file->get_default_no_partitions(max_rows);
+ no_subparts= file->get_default_no_partitions(info);
if (unlikely((no_parts * no_subparts) > MAX_PARTITIONS))
{
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
@@ -296,7 +297,7 @@
SYNOPSIS
set_up_defaults_for_partitioning()
file A reference to a handler of the table
- max_rows Maximum number of rows stored in the table
+ info Create info
start_no Starting partition number
RETURN VALUE
@@ -309,7 +310,7 @@
*/
bool partition_info::set_up_defaults_for_partitioning(handler *file,
- ulonglong max_rows,
+ HA_CREATE_INFO *info,
uint start_no)
{
DBUG_ENTER("partition_info::set_up_defaults_for_partitioning");
@@ -318,10 +319,10 @@
{
default_partitions_setup= TRUE;
if (use_default_partitions)
- DBUG_RETURN(set_up_default_partitions(file, max_rows, start_no));
+ DBUG_RETURN(set_up_default_partitions(file, info, start_no));
if (is_sub_partitioned() &&
use_default_subpartitions)
- DBUG_RETURN(set_up_default_subpartitions(file, max_rows));
+ DBUG_RETURN(set_up_default_subpartitions(file, info));
}
DBUG_RETURN(FALSE);
}
@@ -692,7 +693,7 @@
SYNOPSIS
check_partition_info()
file A reference to a handler of the table
- max_rows Maximum number of rows stored in the table
+ info Create info
engine_type Return value for used engine in partitions
RETURN VALUE
@@ -708,7 +709,7 @@
*/
bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
- handler *file, ulonglong max_rows)
+ handler *file, HA_CREATE_INFO *info)
{
handlerton **engine_array= NULL;
uint part_count= 0;
@@ -743,7 +744,7 @@
my_error(ER_SUBPARTITION_ERROR, MYF(0));
goto end;
}
- if (unlikely(set_up_defaults_for_partitioning(file, max_rows, (uint)0)))
+ if (unlikely(set_up_defaults_for_partitioning(file, info, (uint)0)))
goto end;
tot_partitions= get_tot_partitions();
if (unlikely(tot_partitions > MAX_PARTITIONS))
--- 1.13/sql/partition_info.h 2006-06-15 01:40:01 +02:00
+++ 1.14/sql/partition_info.h 2006-06-27 22:19:18 +02:00
@@ -243,21 +243,21 @@
return no_parts * (is_sub_partitioned() ? no_subparts : 1);
}
- bool set_up_defaults_for_partitioning(handler *file, ulonglong max_rows,
+ bool set_up_defaults_for_partitioning(handler *file, HA_CREATE_INFO *info,
uint start_no);
char *has_unique_names();
static bool check_engine_mix(handlerton **engine_array, uint no_parts);
bool check_range_constants();
bool check_list_constants();
bool check_partition_info(THD *thd, handlerton **eng_type,
- handler *file, ulonglong max_rows);
+ handler *file, HA_CREATE_INFO *info);
void print_no_partition_found(TABLE *table);
private:
static int list_part_cmp(const void* a, const void* b);
static int list_part_cmp_unsigned(const void* a, const void* b);
- bool set_up_default_partitions(handler *file, ulonglong max_rows,
+ bool set_up_default_partitions(handler *file, HA_CREATE_INFO *info,
uint start_no);
- bool set_up_default_subpartitions(handler *file, ulonglong max_rows);
+ bool set_up_default_subpartitions(handler *file, HA_CREATE_INFO *info);
char *create_default_partition_names(uint part_no, uint no_parts,
uint start_no);
char *create_subpartition_name(uint subpart_no, const char *part_name);
--- 1.9/sql/sql_partition.h 2006-06-14 14:41:06 +02:00
+++ 1.10/sql/sql_partition.h 2006-06-27 22:19:18 +02:00
@@ -65,7 +65,7 @@
partition_info *part_info, uint32 *part_id);
void prune_partition_set(const TABLE *table, part_id_range *part_spec);
bool check_partition_info(partition_info *part_info,handlerton **eng_type,
- TABLE *table, handler *file, ulonglong max_rows);
+ TABLE *table, handler *file, HA_CREATE_INFO *info);
bool fix_partition_func(THD *thd, TABLE *table, bool create_table_ind);
char *generate_partition_syntax(partition_info *part_info,
uint *buf_length, bool use_sql_alloc,
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2225) | tomas | 27 Jun |