summaryrefslogtreecommitdiff
path: root/storage/connect/connect.cc
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-04-19 18:02:01 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2014-04-19 18:02:01 +0200
commit95b7d92da34a4d16bccdd5e853ede55131e63a49 (patch)
tree8da7197892548c04e5cc76efe4e3f8ba80050c51 /storage/connect/connect.cc
parent50953a0e9de6ae36a62fc195f3fc97d6d319493e (diff)
parent187e41697b7e4c43fcfe8e5c01f7cc7ad289f995 (diff)
downloadmariadb-git-95b7d92da34a4d16bccdd5e853ede55131e63a49.tar.gz
- Commit merge files (implementing "remote" indexes)
modified: storage/connect/connect.cc storage/connect/ha_connect.cc storage/connect/ha_connect.h storage/connect/mycat.cc storage/connect/plgdbsem.h storage/connect/reldef.h storage/connect/tabdos.h storage/connect/tabmysql.cpp storage/connect/tabmysql.h storage/connect/tabodbc.cpp storage/connect/tabodbc.h storage/connect/xindex.cpp storage/connect/xtable.h
Diffstat (limited to 'storage/connect/connect.cc')
-rw-r--r--storage/connect/connect.cc31
1 files changed, 24 insertions, 7 deletions
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index cf11a22d32b..1433a5c6ce4 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -587,7 +587,8 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp)
tbxp= (TDBDOX*)tdbp;
tbxp->SetKindex(NULL);
tbxp->To_Key_Col= NULL;
- rc= tbxp->ResetTableOpt(g, false, ((PTDBASE)tdbp)->GetDef()->Indexable());
+ rc= tbxp->ResetTableOpt(g, true,
+ ((PTDBASE)tdbp)->GetDef()->Indexable() == 1);
err:
if (trace > 1)
@@ -709,7 +710,7 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
const void *key, int len, bool mrr)
{
char *kp= (char*)key;
- int n;
+ int n, x;
short lg;
bool rcb;
RCODE rc;
@@ -720,9 +721,18 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
if (!ptdb)
return RC_FX;
- if (!((PTDBASE)ptdb)->GetDef()->Indexable()) {
+ else
+ x= ((PTDBASE)ptdb)->GetDef()->Indexable();
+
+ if (!x) {
sprintf(g->Message, "CntIndexRead: Table %s is not indexable", ptdb->GetName());
return RC_FX;
+ } else if (x == 2) {
+ // Remote index
+ if (ptdb->ReadKey(g, op, key, len))
+ return RC_FX;
+
+ goto rnd;
} else
tdbp= (PTDBDOX)ptdb;
@@ -782,8 +792,9 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
xbp->SetOp(op);
xbp->SetNth(0);
- if ((rc= (RCODE)tdbp->ReadDB(g)) == RC_OK)
- rc= EvalColumns(g, tdbp, mrr);
+ rnd:
+ if ((rc= (RCODE)ptdb->ReadDB(g)) == RC_OK)
+ rc= EvalColumns(g, ptdb, mrr);
return rc;
} // end of CntIndexRead
@@ -795,7 +806,7 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
bool *incl, key_part_map *kmap)
{
const uchar *p, *kp;
- int i, n, k[2];
+ int i, n, x, k[2];
short lg;
bool b, rcb;
PVAL valp;
@@ -805,10 +816,16 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
if (!ptdb)
return -1;
- else if (!((PTDBASE)ptdb)->GetDef()->Indexable()) {
+
+ x= ((PTDBASE)ptdb)->GetDef()->Indexable();
+
+ if (!x) {
sprintf(g->Message, "CntIndexRange: Table %s is not indexable", ptdb->GetName());
DBUG_PRINT("Range", ("%s", g->Message));
return -1;
+ } else if (x == 2) {
+ // Remote index
+ return 2;
} else
tdbp= (PTDBDOX)ptdb;