diff options
-rw-r--r-- | storage/connect/ha_connect.cc | 37 | ||||
-rw-r--r-- | storage/connect/odbconn.cpp | 10 | ||||
-rw-r--r-- | storage/connect/tabdos.h | 3 |
3 files changed, 45 insertions, 5 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index e9e53144e76..d56f3ca08e4 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -4864,7 +4864,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, if (!qrp) { my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); return HA_ERR_INTERNAL_ERROR; - } // endif qrp + } // endif !qrp if (fnc != FNC_NO || src || ttp == TAB_PIVOT) { // Catalog like table @@ -4890,7 +4890,18 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, #endif // !NEW_WAY } // endfor crp - } else // Not a catalog table + } else { + // Not a catalog table + if (!qrp->Nblin) { + if (tab) + sprintf(g->Message, "Cannot get columns from %s", tab); + else + strcpy(g->Message, "Fail to retrieve columns"); + + my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); + return HA_ERR_INTERNAL_ERROR; + } // endif !nblin + for (i= 0; !rc && i < qrp->Nblin; i++) { typ= len= prec= dec= 0; tm= NOT_NULL_FLAG; @@ -4993,6 +5004,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, #endif // !NEW_WAY } // endfor i + } // endif fnc + #if defined(NEW_WAY) rc= init_table_share(thd, table_s, create_info, &alter_info); #else // !NEW_WAY @@ -5435,7 +5448,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; @@ -5688,7 +5709,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/odbconn.cpp b/storage/connect/odbconn.cpp index a857a1bc918..d0072987fd0 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -2287,6 +2287,7 @@ int ODBConn::GetCatInfo(CATPARM *cap) } // endfor i +#if 0 if ((crow = i) && (rc == SQL_NO_DATA || rc == SQL_SUCCESS_WITH_INFO)) rc = SQL_SUCCESS; @@ -2303,6 +2304,15 @@ int ODBConn::GetCatInfo(CATPARM *cap) } else ThrowDBX(rc, fnc, hstmt); +#endif // 0 + + if (!rc || rc == SQL_NO_DATA || rc == SQL_SUCCESS_WITH_INFO) { + if ((rc = SQLFetch(hstmt)) != SQL_NO_DATA_FOUND) + qrp->Truncated = true; + + crow = i; + } else + ThrowDBX(rc, fnc, hstmt); irc = (int)crow; } catch(DBX *x) { diff --git a/storage/connect/tabdos.h b/storage/connect/tabdos.h index 4db28f78868..d7a6af5a5ec 100644 --- a/storage/connect/tabdos.h +++ b/storage/connect/tabdos.h @@ -57,7 +57,8 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */ int *GetTo_Pos(void) {return To_Pos;} // 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); |