diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2014-04-25 19:14:33 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2014-04-25 19:14:33 +0200 |
commit | 24369d217578bfc8140d0617169b6ad527e61e78 (patch) | |
tree | 86eb2f14ed6faf1764fe4aa585bf9aedda6a8fec | |
parent | e9bb12acdb003f3335a547aeec0c3121b282e5b8 (diff) | |
download | mariadb-git-24369d217578bfc8140d0617169b6ad527e61e78.tar.gz |
- 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
-rw-r--r-- | storage/connect/ha_connect.cc | 20 | ||||
-rw-r--r-- | storage/connect/tabdos.h | 3 |
2 files changed, 20 insertions, 3 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 23c4a326c2c..7ba5682c01f 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -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; diff --git a/storage/connect/tabdos.h b/storage/connect/tabdos.h index 5ea7847d2c9..d6cbc8f8d92 100644 --- a/storage/connect/tabdos.h +++ b/storage/connect/tabdos.h @@ -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); |