Commit 4c77ef36 authored by Sergei Golubchik's avatar Sergei Golubchik

compilation w/o partitioning

parent ae6355f5
...@@ -856,21 +856,6 @@ bool partition_info::has_unique_name(partition_element *element) ...@@ -856,21 +856,6 @@ bool partition_info::has_unique_name(partition_element *element)
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
bool partition_info::vers_init_info(THD * thd)
{
part_type= VERSIONING_PARTITION;
list_of_part_fields= TRUE;
column_list= TRUE;
num_columns= 1;
vers_info= new (thd->mem_root) Vers_part_info;
if (!vers_info)
{
mem_alloc_error(sizeof(Vers_part_info));
return true;
}
return false;
}
void partition_info::vers_set_hist_part(THD *thd) void partition_info::vers_set_hist_part(THD *thd)
{ {
if (vers_info->limit) if (vers_info->limit)
...@@ -2747,6 +2732,22 @@ bool check_partition_dirs(partition_info *part_info) ...@@ -2747,6 +2732,22 @@ bool check_partition_dirs(partition_info *part_info)
#endif /* WITH_PARTITION_STORAGE_ENGINE */ #endif /* WITH_PARTITION_STORAGE_ENGINE */
bool partition_info::vers_init_info(THD * thd)
{
part_type= VERSIONING_PARTITION;
list_of_part_fields= TRUE;
column_list= TRUE;
num_columns= 1;
vers_info= new (thd->mem_root) Vers_part_info;
if (!vers_info)
{
mem_alloc_error(sizeof(Vers_part_info));
return true;
}
return false;
}
bool partition_info::error_if_requires_values() const bool partition_info::error_if_requires_values() const
{ {
switch (part_type) { switch (part_type) {
......
...@@ -1470,6 +1470,16 @@ open_table_get_mdl_lock(THD *thd, Open_table_context *ot_ctx, ...@@ -1470,6 +1470,16 @@ open_table_get_mdl_lock(THD *thd, Open_table_context *ot_ctx,
return FALSE; return FALSE;
} }
/* Set all [named] partitions as used. */
static int set_partitions_as_used(TABLE_LIST *tl, TABLE *t)
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (t->part_info)
return t->file->change_partitions_to_open(tl->partition_names);
#endif
return 0;
}
/** /**
Open a base table. Open a base table.
...@@ -1612,12 +1622,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx) ...@@ -1612,12 +1622,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx)
table= best_table; table= best_table;
table->query_id= thd->query_id; table->query_id= thd->query_id;
DBUG_PRINT("info",("Using locked table")); DBUG_PRINT("info",("Using locked table"));
if (table->part_info) part_names_error= set_partitions_as_used(table_list, table);
{
/* Set all [named] partitions as used. */
part_names_error=
table->file->change_partitions_to_open(table_list->partition_names);
}
goto reset; goto reset;
} }
/* /*
...@@ -1902,12 +1907,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx) ...@@ -1902,12 +1907,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx)
{ {
DBUG_ASSERT(table->file != NULL); DBUG_ASSERT(table->file != NULL);
MYSQL_REBIND_TABLE(table->file); MYSQL_REBIND_TABLE(table->file);
if (table->part_info) part_names_error= set_partitions_as_used(table_list, table);
{
/* Set all [named] partitions as used. */
part_names_error=
table->file->change_partitions_to_open(table_list->partition_names);
}
} }
else else
{ {
...@@ -1921,7 +1921,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx) ...@@ -1921,7 +1921,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx)
HA_OPEN_KEYFILE | HA_TRY_READ_ONLY, HA_OPEN_KEYFILE | HA_TRY_READ_ONLY,
EXTRA_RECORD, EXTRA_RECORD,
thd->open_options, table, FALSE, thd->open_options, table, FALSE,
table_list->partition_names); IF_PARTITIONING(table_list->partition_names,0));
if (error) if (error)
{ {
......
...@@ -9205,7 +9205,7 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db, const LEX_CSTRING *n ...@@ -9205,7 +9205,7 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db, const LEX_CSTRING *n
if (table_list->table->versioned(VERS_TRX_ID) && if (table_list->table->versioned(VERS_TRX_ID) &&
alter_info->requested_algorithm == alter_info->requested_algorithm ==
Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT && Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT &&
!table_list->table->s->partition_info_str) IF_PARTITIONING(!table_list->table->s->partition_info_str, 1))
{ {
// Changle default ALGORITHM to COPY for INNODB // Changle default ALGORITHM to COPY for INNODB
alter_info->requested_algorithm= Alter_info::ALTER_TABLE_ALGORITHM_COPY; alter_info->requested_algorithm= Alter_info::ALTER_TABLE_ALGORITHM_COPY;
......
...@@ -35,12 +35,16 @@ VTMD_table::create(THD *thd) ...@@ -35,12 +35,16 @@ VTMD_table::create(THD *thd)
return true; return true;
Reprepare_observer *reprepare_observer= thd->m_reprepare_observer; Reprepare_observer *reprepare_observer= thd->m_reprepare_observer;
partition_info *work_part_info= thd->work_part_info;
thd->m_reprepare_observer= NULL; thd->m_reprepare_observer= NULL;
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info *work_part_info= thd->work_part_info;
thd->work_part_info= NULL; thd->work_part_info= NULL;
#endif
bool rc= mysql_create_like_table(thd, &table, &src_table, &create_info); bool rc= mysql_create_like_table(thd, &table, &src_table, &create_info);
thd->m_reprepare_observer= reprepare_observer; thd->m_reprepare_observer= reprepare_observer;
#ifdef WITH_PARTITION_STORAGE_ENGINE
thd->work_part_info= work_part_info; thd->work_part_info= work_part_info;
#endif
return rc; return rc;
} }
......
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