Commit 18455ec3 authored by Sergei Golubchik's avatar Sergei Golubchik

fix compilation wih -DPLUGIN_PARTITION=NO

parent 4e6dab94
...@@ -2744,23 +2744,6 @@ bool partition_info::fix_column_value_functions(THD *thd, ...@@ -2744,23 +2744,6 @@ bool partition_info::fix_column_value_functions(THD *thd,
} }
bool partition_info::error_if_requires_values() const
{
switch (part_type) {
case NOT_A_PARTITION:
case HASH_PARTITION:
break;
case RANGE_PARTITION:
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "RANGE", "LESS THAN");
return true;
case LIST_PARTITION:
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "LIST", "IN");
return true;
}
return false;
}
/** /**
Fix partition data from parser. Fix partition data from parser.
...@@ -3211,3 +3194,19 @@ bool check_partition_dirs(partition_info *part_info) ...@@ -3211,3 +3194,19 @@ bool check_partition_dirs(partition_info *part_info)
} }
#endif /* WITH_PARTITION_STORAGE_ENGINE */ #endif /* WITH_PARTITION_STORAGE_ENGINE */
bool partition_info::error_if_requires_values() const
{
switch (part_type) {
case NOT_A_PARTITION:
case HASH_PARTITION:
break;
case RANGE_PARTITION:
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "RANGE", "LESS THAN");
return true;
case LIST_PARTITION:
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "LIST", "IN");
return true;
}
return false;
}
...@@ -1754,11 +1754,13 @@ bool ha_connect::CheckVirtualIndex(TABLE_SHARE *s) ...@@ -1754,11 +1754,13 @@ bool ha_connect::CheckVirtualIndex(TABLE_SHARE *s)
bool ha_connect::IsPartitioned(void) bool ha_connect::IsPartitioned(void)
{ {
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (tshp) if (tshp)
return tshp->partition_info_str_len > 0; return tshp->partition_info_str_len > 0;
else if (table && table->part_info) else if (table && table->part_info)
return true; return true;
else else
#endif
return false; return false;
} // end of IsPartitioned } // end of IsPartitioned
...@@ -6165,8 +6167,10 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6165,8 +6167,10 @@ int ha_connect::create(const char *name, TABLE *table_arg,
TABLE *st= table; // Probably unuseful TABLE *st= table; // Probably unuseful
THD *thd= ha_thd(); THD *thd= ha_thd();
LEX_STRING cnc = table_arg->s->connect_string; LEX_STRING cnc = table_arg->s->connect_string;
#if defined(WITH_PARTITION_STORAGE_ENGINE) #ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info *part_info= table_arg->part_info; partition_info *part_info= table_arg->part_info;
#else
#define part_info 0
#endif // WITH_PARTITION_STORAGE_ENGINE #endif // WITH_PARTITION_STORAGE_ENGINE
xp= GetUser(thd, xp); xp= GetUser(thd, xp);
PGLOBAL g= xp->g; PGLOBAL g= xp->g;
...@@ -6268,9 +6272,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6268,9 +6272,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
// fall through // fall through
case TAB_MYSQL: case TAB_MYSQL:
#if defined(WITH_PARTITION_STORAGE_ENGINE)
if (!part_info) if (!part_info)
#endif // WITH_PARTITION_STORAGE_ENGINE
{const char *src= options->srcdef; {const char *src= options->srcdef;
PCSZ host, db, tab= options->tabname; PCSZ host, db, tab= options->tabname;
int port; int port;
...@@ -6534,7 +6536,6 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6534,7 +6536,6 @@ int ha_connect::create(const char *name, TABLE *table_arg,
} else } else
lwt[i]= tolower(options->type[i]); lwt[i]= tolower(options->type[i]);
#if defined(WITH_PARTITION_STORAGE_ENGINE)
if (part_info) { if (part_info) {
char *p; char *p;
...@@ -6544,7 +6545,6 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6544,7 +6545,6 @@ int ha_connect::create(const char *name, TABLE *table_arg,
strcat(strcat(strcpy(buf, p), "."), lwt); strcat(strcat(strcpy(buf, p), "."), lwt);
*p= 0; *p= 0;
} else { } else {
#endif // WITH_PARTITION_STORAGE_ENGINE
strcat(strcat(strcpy(buf, GetTableName()), "."), lwt); strcat(strcat(strcpy(buf, GetTableName()), "."), lwt);
sprintf(g->Message, "No file name. Table will use %s", buf); sprintf(g->Message, "No file name. Table will use %s", buf);
...@@ -6552,9 +6552,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6552,9 +6552,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message); push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
strcat(strcat(strcpy(dbpath, "./"), table->s->db.str), "/"); strcat(strcat(strcpy(dbpath, "./"), table->s->db.str), "/");
#if defined(WITH_PARTITION_STORAGE_ENGINE)
} // endif part_info } // endif part_info
#endif // WITH_PARTITION_STORAGE_ENGINE
PlugSetPath(fn, buf, dbpath); PlugSetPath(fn, buf, dbpath);
...@@ -6619,11 +6617,9 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6619,11 +6617,9 @@ int ha_connect::create(const char *name, TABLE *table_arg,
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0,
"Unexpected command in create, please contact CONNECT team"); "Unexpected command in create, please contact CONNECT team");
#if defined(WITH_PARTITION_STORAGE_ENGINE)
if (part_info && !inward) if (part_info && !inward)
strncpy(partname, decode(g, strrchr(name, '#') + 1), sizeof(partname) - 1); strncpy(partname, decode(g, strrchr(name, '#') + 1), sizeof(partname) - 1);
// strcpy(partname, part_info->curr_part_elem->partition_name); // strcpy(partname, part_info->curr_part_elem->partition_name);
#endif // WITH_PARTITION_STORAGE_ENGINE
if (g->Alchecked == 0 && if (g->Alchecked == 0 &&
(!IsFileType(type) || FileExists(options->filename, false))) { (!IsFileType(type) || FileExists(options->filename, false))) {
...@@ -6659,12 +6655,10 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6659,12 +6655,10 @@ int ha_connect::create(const char *name, TABLE *table_arg,
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
rc = HA_ERR_INTERNAL_ERROR; rc = HA_ERR_INTERNAL_ERROR;
} else if (cat) { } else if (cat) {
#if defined(WITH_PARTITION_STORAGE_ENGINE)
if (part_info) if (part_info)
strncpy(partname, strncpy(partname,
decode(g, strrchr(name, (inward ? slash : '#')) + 1), decode(g, strrchr(name, (inward ? slash : '#')) + 1),
sizeof(partname) - 1); sizeof(partname) - 1);
#endif // WITH_PARTITION_STORAGE_ENGINE
if ((rc= optimize(table->in_use, NULL))) { if ((rc= optimize(table->in_use, NULL))) {
htrc("Create rc=%d %s\n", rc, g->Message); htrc("Create rc=%d %s\n", rc, g->Message);
......
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