2006-12-31 02:29:11 +01:00
|
|
|
/* Copyright (C) 2006 MySQL AB
|
2006-02-16 17:38:33 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2006-12-27 02:23:51 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2006-02-16 17:38:33 +01:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2006-12-31 02:29:11 +01:00
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
2006-02-16 17:38:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An enum and a struct to handle partitioning and subpartitioning.
|
|
|
|
*/
|
|
|
|
enum partition_type {
|
|
|
|
NOT_A_PARTITION= 0,
|
|
|
|
RANGE_PARTITION,
|
|
|
|
HASH_PARTITION,
|
|
|
|
LIST_PARTITION
|
|
|
|
};
|
|
|
|
|
|
|
|
enum partition_state {
|
|
|
|
PART_NORMAL= 0,
|
|
|
|
PART_IS_DROPPED= 1,
|
|
|
|
PART_TO_BE_DROPPED= 2,
|
|
|
|
PART_TO_BE_ADDED= 3,
|
|
|
|
PART_TO_BE_REORGED= 4,
|
|
|
|
PART_REORGED_DROPPED= 5,
|
|
|
|
PART_CHANGED= 6,
|
|
|
|
PART_IS_CHANGED= 7,
|
|
|
|
PART_IS_ADDED= 8
|
|
|
|
};
|
|
|
|
|
2006-06-05 20:55:22 +02:00
|
|
|
/*
|
|
|
|
This struct is used to contain the value of an element
|
|
|
|
in the VALUES IN struct. It needs to keep knowledge of
|
|
|
|
whether it is a signed/unsigned value and whether it is
|
|
|
|
NULL or not.
|
|
|
|
*/
|
|
|
|
|
2006-04-18 04:51:34 +02:00
|
|
|
typedef struct p_elem_val
|
|
|
|
{
|
|
|
|
longlong value;
|
|
|
|
bool null_value;
|
|
|
|
bool unsigned_flag;
|
|
|
|
} part_elem_value;
|
|
|
|
|
WL 2826: Error handling of ALTER TABLE for partitioning
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
Fixed mysqlish method intro's
Fixed warning statements
5.1.7 was released still with partition states in clear text
Fixed io_size bug
Fixed bug in open that TRUNCATED before reading :)
file_entry => file_entry_buf
Don't open DDL log until first write call to DDL log
handler_type => handler_name
no => num
sql/ha_partition.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
sql/mysql_priv.h:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/mysqld.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/partition_element.h:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/partition_info.h:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/share/errmsg.txt:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/sql_base.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/sql_partition.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
Fixed mysqlish method intro's
Fixed warning statements
sql/sql_table.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
Fixed mysqlish method intro's
Fixed warning statements
Fixed io_size bug
Fixed bug in open that TRUNCATED before reading :)
file_entry => file_entry_buf
Don't open DDL log until first write call to DDL log
handler_type => handler_name
no => num
sql/table.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
Fixed mysqlish method intro's
Fixed warning statements
5.1.7 was released still with partition states in clear text
Fixed io_size bug
Fixed bug in open that TRUNCATED before reading :)
file_entry => file_entry_buf
Don't open DDL log until first write call to DDL log
handler_type => handler_name
no => num
2006-03-25 00:19:13 +01:00
|
|
|
struct st_ddl_log_memory_entry;
|
2006-03-22 06:17:22 +01:00
|
|
|
|
2006-02-16 17:38:33 +01:00
|
|
|
class partition_element :public Sql_alloc {
|
|
|
|
public:
|
|
|
|
List<partition_element> subpartitions;
|
2006-04-18 04:51:34 +02:00
|
|
|
List<part_elem_value> list_val_list;
|
2006-08-24 00:12:42 +02:00
|
|
|
ha_rows part_max_rows;
|
|
|
|
ha_rows part_min_rows;
|
2006-04-18 04:51:34 +02:00
|
|
|
longlong range_value;
|
2006-02-16 17:38:33 +01:00
|
|
|
char *partition_name;
|
|
|
|
char *tablespace_name;
|
WL 2826: Error handling of ALTER TABLE for partitioning
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
Fixed mysqlish method intro's
Fixed warning statements
5.1.7 was released still with partition states in clear text
Fixed io_size bug
Fixed bug in open that TRUNCATED before reading :)
file_entry => file_entry_buf
Don't open DDL log until first write call to DDL log
handler_type => handler_name
no => num
sql/ha_partition.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
sql/mysql_priv.h:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/mysqld.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/partition_element.h:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/partition_info.h:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/share/errmsg.txt:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/sql_base.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
sql/sql_partition.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
Fixed mysqlish method intro's
Fixed warning statements
sql/sql_table.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
Fixed mysqlish method intro's
Fixed warning statements
Fixed io_size bug
Fixed bug in open that TRUNCATED before reading :)
file_entry => file_entry_buf
Don't open DDL log until first write call to DDL log
handler_type => handler_name
no => num
sql/table.cc:
Loads of review comments fixed
inactivate => deactivate
table log => ddl log
Commented on Error Inject Module added
Put various #defines into enums
Fixed abort_and_upgrade_lock, removed unnecessary parameter
Fixed mysqlish method intro's
Fixed warning statements
5.1.7 was released still with partition states in clear text
Fixed io_size bug
Fixed bug in open that TRUNCATED before reading :)
file_entry => file_entry_buf
Don't open DDL log until first write call to DDL log
handler_type => handler_name
no => num
2006-03-25 00:19:13 +01:00
|
|
|
struct st_ddl_log_memory_entry *log_entry;
|
2006-02-16 17:38:33 +01:00
|
|
|
char* part_comment;
|
|
|
|
char* data_file_name;
|
|
|
|
char* index_file_name;
|
|
|
|
handlerton *engine_type;
|
|
|
|
enum partition_state part_state;
|
|
|
|
uint16 nodegroup_id;
|
2006-03-07 12:25:08 +01:00
|
|
|
bool has_null_value;
|
2006-06-05 20:55:22 +02:00
|
|
|
bool signed_flag;/* Indicate whether this partition uses signed constants */
|
|
|
|
bool max_value; /* Indicate whether this partition uses MAXVALUE */
|
2006-02-28 22:07:14 +01:00
|
|
|
|
2006-02-16 17:38:33 +01:00
|
|
|
partition_element()
|
2006-04-18 04:51:34 +02:00
|
|
|
: part_max_rows(0), part_min_rows(0), range_value(0),
|
2006-06-14 15:12:07 +02:00
|
|
|
partition_name(NULL), tablespace_name(NULL),
|
|
|
|
log_entry(NULL), part_comment(NULL),
|
2006-02-16 17:38:33 +01:00
|
|
|
data_file_name(NULL), index_file_name(NULL),
|
2006-04-18 04:51:34 +02:00
|
|
|
engine_type(NULL), part_state(PART_NORMAL),
|
|
|
|
nodegroup_id(UNDEF_NODEGROUP), has_null_value(FALSE),
|
|
|
|
signed_flag(FALSE), max_value(FALSE)
|
2006-02-16 17:38:33 +01:00
|
|
|
{
|
|
|
|
}
|
2006-04-21 14:43:07 +02:00
|
|
|
partition_element(partition_element *part_elem)
|
2006-06-04 00:37:31 +02:00
|
|
|
: part_max_rows(part_elem->part_max_rows),
|
|
|
|
part_min_rows(part_elem->part_min_rows),
|
2007-04-13 19:23:02 +02:00
|
|
|
range_value(0), partition_name(NULL),
|
2006-06-04 00:37:31 +02:00
|
|
|
tablespace_name(part_elem->tablespace_name),
|
2007-04-13 19:23:02 +02:00
|
|
|
part_comment(part_elem->part_comment),
|
2006-06-04 00:37:31 +02:00
|
|
|
data_file_name(part_elem->data_file_name),
|
|
|
|
index_file_name(part_elem->index_file_name),
|
|
|
|
engine_type(part_elem->engine_type),
|
|
|
|
part_state(part_elem->part_state),
|
|
|
|
nodegroup_id(part_elem->nodegroup_id),
|
|
|
|
has_null_value(FALSE)
|
2006-04-21 14:43:07 +02:00
|
|
|
{
|
|
|
|
}
|
2006-02-16 17:38:33 +01:00
|
|
|
~partition_element() {}
|
|
|
|
};
|