summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-03-28 19:19:17 +0200
committerSergei Golubchik <serg@mariadb.org>2018-03-30 09:45:01 +0200
commit4c77ef36c69b2919f8d788c4de9e1f2da07410d7 (patch)
tree1af09b10fe25c7b58ff81ebefc45745bd04fa43e
parentae6355f56ea1496a2de2ea271f95c89e47705ef0 (diff)
downloadmariadb-git-4c77ef36c69b2919f8d788c4de9e1f2da07410d7.tar.gz
compilation w/o partitioning
-rw-r--r--sql/partition_info.cc31
-rw-r--r--sql/sql_base.cc26
-rw-r--r--sql/sql_table.cc4
-rw-r--r--sql/vtmd.cc6
4 files changed, 36 insertions, 31 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index da34a4dbf0f..dacb8e32353 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -856,21 +856,6 @@ bool partition_info::has_unique_name(partition_element *element)
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)
{
if (vers_info->limit)
@@ -2747,6 +2732,22 @@ bool check_partition_dirs(partition_info *part_info)
#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
{
switch (part_type) {
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index bb61b8a6459..2cfac847b6f 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1470,6 +1470,16 @@ open_table_get_mdl_lock(THD *thd, Open_table_context *ot_ctx,
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.
@@ -1612,12 +1622,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx)
table= best_table;
table->query_id= thd->query_id;
DBUG_PRINT("info",("Using locked table"));
- if (table->part_info)
- {
- /* Set all [named] partitions as used. */
- part_names_error=
- table->file->change_partitions_to_open(table_list->partition_names);
- }
+ part_names_error= set_partitions_as_used(table_list, table);
goto reset;
}
/*
@@ -1902,12 +1907,7 @@ retry_share:
{
DBUG_ASSERT(table->file != NULL);
MYSQL_REBIND_TABLE(table->file);
- if (table->part_info)
- {
- /* Set all [named] partitions as used. */
- part_names_error=
- table->file->change_partitions_to_open(table_list->partition_names);
- }
+ part_names_error= set_partitions_as_used(table_list, table);
}
else
{
@@ -1921,7 +1921,7 @@ retry_share:
HA_OPEN_KEYFILE | HA_TRY_READ_ONLY,
EXTRA_RECORD,
thd->open_options, table, FALSE,
- table_list->partition_names);
+ IF_PARTITIONING(table_list->partition_names,0));
if (error)
{
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index fae15e11322..0e33a8457b0 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -9204,8 +9204,8 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db, const LEX_CSTRING *n
if (table_list->table->versioned(VERS_TRX_ID) &&
alter_info->requested_algorithm ==
- Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT &&
- !table_list->table->s->partition_info_str)
+ Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT &&
+ IF_PARTITIONING(!table_list->table->s->partition_info_str, 1))
{
// Changle default ALGORITHM to COPY for INNODB
alter_info->requested_algorithm= Alter_info::ALTER_TABLE_ALGORITHM_COPY;
diff --git a/sql/vtmd.cc b/sql/vtmd.cc
index 4ee43d61111..b63d7bf3650 100644
--- a/sql/vtmd.cc
+++ b/sql/vtmd.cc
@@ -35,12 +35,16 @@ VTMD_table::create(THD *thd)
return true;
Reprepare_observer *reprepare_observer= thd->m_reprepare_observer;
- partition_info *work_part_info= thd->work_part_info;
thd->m_reprepare_observer= NULL;
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ partition_info *work_part_info= thd->work_part_info;
thd->work_part_info= NULL;
+#endif
bool rc= mysql_create_like_table(thd, &table, &src_table, &create_info);
thd->m_reprepare_observer= reprepare_observer;
+#ifdef WITH_PARTITION_STORAGE_ENGINE
thd->work_part_info= work_part_info;
+#endif
return rc;
}