summaryrefslogtreecommitdiff
path: root/storage/connect/xindex.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-04-30 11:05:11 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2014-04-30 11:05:11 +0200
commit006dfe52822ee3550a42a9338ad29aca012945f4 (patch)
treeeaab8b64101c8c34eba979d46530c2f71960f0aa /storage/connect/xindex.cpp
parente7c7256d1d67125921d9f688a382aef873f5b9ce (diff)
parentf3af6da9765a4541d63de91e8a848d3c3116e957 (diff)
downloadmariadb-git-006dfe52822ee3550a42a9338ad29aca012945f4.tar.gz
- Commit merged files (HUGE to use instead of storing MySQL result sets)
modified: storage/connect/myconn.cpp storage/connect/myconn.h storage/connect/tabmysql.cpp storage/connect/tabmysql.h storage/connect/xindex.cpp storage/connect/xindex.h
Diffstat (limited to 'storage/connect/xindex.cpp')
-rwxr-xr-xstorage/connect/xindex.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp
index 2a7a10528fb..50d19ac67fc 100755
--- a/storage/connect/xindex.cpp
+++ b/storage/connect/xindex.cpp
@@ -282,25 +282,25 @@ int XINDEX::Qcompare(int *i1, int *i2)
return k;
} // end of Qcompare
-/***********************************************************************/
-/* AddColumns: here we try to determine whether it is worthwhile to */
-/* add to the keys the values of the columns selected for this table. */
-/* Sure enough, it is done while records are read and permit to avoid */
-/* reading the table while doing the join (Dynamic index only) */
-/***********************************************************************/
-bool XINDEX::AddColumns(void)
- {
- if (!Dynamic)
- return false; // Not applying to static index
- else if (IsMul())
- return false; // Not done yet for multiple index
- else if (Tbxp->GetAmType() == TYPE_AM_VCT && ((PTDBVCT)Tbxp)->IsSplit())
- return false; // This would require to read additional files
- else
- return true;
-
- } // end of AddColumns
-
+/***********************************************************************/
+/* AddColumns: here we try to determine whether it is worthwhile to */
+/* add to the keys the values of the columns selected for this table. */
+/* Sure enough, it is done while records are read and permit to avoid */
+/* reading the table while doing the join (Dynamic index only) */
+/***********************************************************************/
+bool XINDEX::AddColumns(void)
+ {
+ if (!Dynamic)
+ return false; // Not applying to static index
+ else if (IsMul())
+ return false; // Not done yet for multiple index
+ else if (Tbxp->GetAmType() == TYPE_AM_VCT && ((PTDBVCT)Tbxp)->IsSplit())
+ return false; // This would require to read additional files
+ else
+ return true;
+
+ } // end of AddColumns
+
/***********************************************************************/
/* Make: Make and index on key column(s). */
/***********************************************************************/
@@ -378,48 +378,48 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp)
To_LastCol = prev;
- if (AddColumns()) {
- PCOL kolp = To_Cols[0]; // Temporary while imposing Nk = 1
-
- i = 0;
-
- // Allocate the accompanying
- for (colp = Tbxp->GetColumns(); colp; colp = colp->GetNext()) {
- // Count how many columns to add
-// for (k = 0; k < Nk; k++)
-// if (colp == To_Cols[k])
-// break;
-
-// if (k == nk)
- if (colp != kolp)
- i++;
-
- } // endfor colp
-
- if (i && i < 10) // Should be a parameter
- for (colp = Tbxp->GetColumns(); colp; colp = colp->GetNext()) {
-// for (k = 0; k < Nk; k++)
-// if (colp == To_Cols[k])
-// break;
-
-// if (k < nk)
- if (colp == kolp)
- continue; // This is a key column
-
- kcp = new(g) KXYCOL(this);
-
- if (kcp->Init(g, colp, n, true, NULL))
- return true;
-
- if (trace)
- htrc("Adding colp=%p Buf_Type=%d size=%d\n",
- colp, colp->GetResultType(), n);
-
- prev->Next = kcp;
- prev = kcp;
- } // endfor colp
-
- } // endif AddColumns
+ if (AddColumns()) {
+ PCOL kolp = To_Cols[0]; // Temporary while imposing Nk = 1
+
+ i = 0;
+
+ // Allocate the accompanying
+ for (colp = Tbxp->GetColumns(); colp; colp = colp->GetNext()) {
+ // Count how many columns to add
+// for (k = 0; k < Nk; k++)
+// if (colp == To_Cols[k])
+// break;
+
+// if (k == nk)
+ if (colp != kolp)
+ i++;
+
+ } // endfor colp
+
+ if (i && i < 10) // Should be a parameter
+ for (colp = Tbxp->GetColumns(); colp; colp = colp->GetNext()) {
+// for (k = 0; k < Nk; k++)
+// if (colp == To_Cols[k])
+// break;
+
+// if (k < nk)
+ if (colp == kolp)
+ continue; // This is a key column
+
+ kcp = new(g) KXYCOL(this);
+
+ if (kcp->Init(g, colp, n, true, NULL))
+ return true;
+
+ if (trace)
+ htrc("Adding colp=%p Buf_Type=%d size=%d\n",
+ colp, colp->GetResultType(), n);
+
+ prev->Next = kcp;
+ prev = kcp;
+ } // endfor colp
+
+ } // endif AddColumns
#if 0
/*********************************************************************/