Commit 24369d21 authored by Olivier Bertrand's avatar Olivier Bertrand

- Check in Indexable, create and check_if_supported_inplace_alter for not indexable

  tables when they are Multiple or Compressed.
modified:
  storage/connect/ha_connect.cc
  storage/connect/tabdos.h
parent e9bb12ac
......@@ -4973,7 +4973,15 @@ int ha_connect::create(const char *name, TABLE *table_arg,
// Get the index definitions
if (xdp= GetIndexInfo()) {
if (GetIndexType(type) == 1) {
if (options->multiple) {
strcpy(g->Message, "Multiple tables are not indexable");
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
rc= HA_ERR_UNSUPPORTED;
} else if (options->compressed) {
strcpy(g->Message, "Compressed tables are not indexable");
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
rc= HA_ERR_UNSUPPORTED;
} else if (GetIndexType(type) == 1) {
PDBUSER dup= PlgGetUser(g);
PCATLG cat= (dup) ? dup->Catalog : NULL;
......@@ -5226,7 +5234,15 @@ ha_connect::check_if_supported_inplace_alter(TABLE *altered_table,
if (ha_alter_info->handler_flags & index_operations ||
!SameString(altered_table, "optname") ||
!SameBool(altered_table, "sepindex")) {
if (GetIndexType(type) == 1) {
if (newopt->multiple) {
strcpy(g->Message, "Multiple tables are not indexable");
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
DBUG_RETURN(HA_ALTER_ERROR);
} else if (newopt->compressed) {
strcpy(g->Message, "Compressed tables are not indexable");
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
DBUG_RETURN(HA_ALTER_ERROR);
} else if (GetIndexType(type) == 1) {
g->Xchk= new(g) XCHK;
PCHK xcp= (PCHK)g->Xchk;
......
......@@ -49,7 +49,8 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */
int GetEnding(void) {return Ending;}
// Methods
virtual int Indexable(void) {return (Compressed != 1) ? 1 : 0;}
virtual int Indexable(void)
{return (!Multiple && Compressed != 1) ? 1 : 0;}
virtual bool DeleteIndexFile(PGLOBAL g, PIXDEF pxdf);
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
virtual PTDB GetTable(PGLOBAL g, MODE mode);
......
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