summaryrefslogtreecommitdiff
path: root/storage/connect/connect.cc
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2015-12-04 22:38:16 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2015-12-04 22:38:16 +0100
commit27f9d2f9291efaca2a96fbda1c68e410abd94767 (patch)
tree2f4f53d612a0cd9f17b94287327cb319437f9d7e /storage/connect/connect.cc
parentdc8a0df0a2c72a974c7e76eb8a3f945e6eed4f15 (diff)
downloadmariadb-git-27f9d2f9291efaca2a96fbda1c68e410abd94767.tar.gz
Commit updating CONNECT from the 10.1 version
Diffstat (limited to 'storage/connect/connect.cc')
-rw-r--r--storage/connect/connect.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index 4e554b16638..56a0fc4fd4f 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -735,17 +735,12 @@ static void SetSwapValue(PVAL valp, char *kp)
/* IndexRead: fetch a record having the index value. */
/***********************************************************************/
RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
- const void *key, int len, bool mrr)
+ const key_range *kr, bool mrr)
{
- char *kp= (char*)key;
int n, x;
- short lg;
- bool rcb;
RCODE rc;
- PVAL valp;
- PCOL colp;
XXBASE *xbp;
- PTDBDOX tdbp;
+ PTDBDOX tdbp;
if (!ptdb)
return RC_FX;
@@ -757,13 +752,13 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
return RC_FX;
} else if (x == 2) {
// Remote index
- if (ptdb->ReadKey(g, op, key, len))
+ if (ptdb->ReadKey(g, op, kr))
return RC_FX;
goto rnd;
} else if (x == 3) {
- if (key)
- ((PTDBASE)ptdb)->SetRecpos(g, *(int*)key);
+ if (kr)
+ ((PTDBASE)ptdb)->SetRecpos(g, *(int*)kr->key);
if (op == OP_SAME)
return RC_NF;
@@ -790,7 +785,14 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
xbp= (XXBASE*)tdbp->To_Kindex;
- if (key) {
+ if (kr) {
+ char *kp= (char*)kr->key;
+ int len= kr->length;
+ short lg;
+ bool rcb;
+ PVAL valp;
+ PCOL colp;
+
for (n= 0; n < tdbp->Knum; n++) {
colp= (PCOL)tdbp->To_Key_Col[n];
@@ -832,10 +834,10 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
kp+= valp->GetClen();
- if (len == kp - (char*)key) {
+ if (len == kp - (char*)kr->key) {
n++;
break;
- } else if (len < kp - (char*)key) {
+ } else if (len < kp - (char*)kr->key) {
strcpy(g->Message, "Key buffer is too small");
return RC_FX;
} // endif len