summaryrefslogtreecommitdiff
path: root/storage/connect/mycat.cc
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-04-12 18:30:15 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2013-04-12 18:30:15 +0200
commit8cf33505f13b604b3d03f3e1fb22c2ecf984be10 (patch)
tree4255cea6d732b778481374e1117345954b25d5fb /storage/connect/mycat.cc
parent1357bffbf39cdeb1746ce276ad3a556ec0356c35 (diff)
downloadmariadb-git-8cf33505f13b604b3d03f3e1fb22c2ecf984be10.tar.gz
- Extend the TBL type to support sub-tables of any engines. Not CONNECT
sub-tables are accessed via the MySQL API like the MYSQL CONNECT tables. modified: mysql-test/suite/connect/r/tbl.result mysql-test/suite/connect/t/tbl.test storage/connect/catalog.h storage/connect/ha_connect.cc storage/connect/mycat.cc storage/connect/mycat.h storage/connect/tabmysql.h storage/connect/tabtbl.cpp
Diffstat (limited to 'storage/connect/mycat.cc')
-rw-r--r--storage/connect/mycat.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc
index eb7098e8189..4db70efe27f 100644
--- a/storage/connect/mycat.cc
+++ b/storage/connect/mycat.cc
@@ -581,19 +581,17 @@ bool MYCAT::GetIndexInfo(PGLOBAL g, PTABDEF defp)
/* found, make and add the descriptor and return a pointer to it. */
/***********************************************************************/
PRELDEF MYCAT::GetTableDesc(PGLOBAL g, LPCSTR name,
- LPCSTR am, PRELDEF *prp)
+ LPCSTR type, PRELDEF *prp)
{
- LPCSTR type;
-
if (xtrace)
- printf("GetTableDesc: name=%s am=%s\n", name, SVP(am));
+ printf("GetTableDesc: name=%s am=%s\n", name, SVP(type));
// Firstly check whether this table descriptor is in memory
if (To_Desc)
return To_Desc;
- // Here get the type of this table
- if (!(type= Hc->GetStringOption("Type")))
+ // If not specified get the type of this table
+ if (!type && !(type= Hc->GetStringOption("Type")))
type= "DOS";
return MakeTableDesc(g, name, type);
@@ -658,7 +656,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am)
/***********************************************************************/
/* Initialize a Table Description Block construction. */
/***********************************************************************/
-PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode)
+PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type)
{
PRELDEF tdp;
PTDB tdbp= NULL;
@@ -668,7 +666,7 @@ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode)
printf("GetTableDB: name=%s\n", name);
// Look for the description of the requested table
- tdp= GetTableDesc(g, name, NULL);
+ tdp= GetTableDesc(g, name, type);
if (tdp) {
if (xtrace)