summaryrefslogtreecommitdiff
path: root/storage/connect/table.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-08-09 18:02:47 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2013-08-09 18:02:47 +0200
commit5d75457fc93d22493d3f9e45162963e1b54f935c (patch)
treeff1f04bd8f08a6a3e7aa5cb86ef7c2aa94ee69fb /storage/connect/table.cpp
parent98f3fd646654f97b2bc10a7a7d63d2a5fb2aaa6f (diff)
downloadmariadb-git-5d75457fc93d22493d3f9e45162963e1b54f935c.tar.gz
- Implement the SERVID special columns. This imply modifying the way
special columns are processed. This will be documented. Also some code cleanup and some changes to prepare the indexing of nullable columns (not achieve yet) modified: storage/connect/colblk.cpp storage/connect/colblk.h storage/connect/connect.cc storage/connect/connect.h storage/connect/ha_connect.cc storage/connect/ha_connect.h storage/connect/macutil.cpp storage/connect/mycat.cc storage/connect/plgdbsem.h storage/connect/reldef.cpp storage/connect/reldef.h storage/connect/table.cpp storage/connect/tabmysql.cpp storage/connect/tabmysql.h storage/connect/tabodbc.h storage/connect/tabtbl.cpp storage/connect/tabutil.h storage/connect/value.h storage/connect/xindex.cpp storage/connect/xindex.h storage/connect/xtable.h
Diffstat (limited to 'storage/connect/table.cpp')
-rw-r--r--storage/connect/table.cpp35
1 files changed, 21 insertions, 14 deletions
diff --git a/storage/connect/table.cpp b/storage/connect/table.cpp
index 3768109809e..8f12a04a71a 100644
--- a/storage/connect/table.cpp
+++ b/storage/connect/table.cpp
@@ -307,15 +307,17 @@ PCOL TDBASE::ColDB(PGLOBAL g, PSZ name, int num)
/*****************************************************************/
if (cp)
colp = cp;
- else
+ else if (!(cdp->Flags & U_SPECIAL))
colp = MakeCol(g, cdp, cprec, i);
+ else if (Mode == MODE_READ)
+ colp = InsertSpcBlk(g, cdp);
if (trace)
htrc("colp=%p\n", colp);
if (name || num)
break;
- else if (colp)
+ else if (colp && !colp->IsSpecial())
cprec = colp;
} // endif Name
@@ -339,30 +341,35 @@ PCOL TDBASE::InsertSpecialColumn(PGLOBAL g, PCOL colp)
/***********************************************************************/
/* Make a special COLBLK to insert in a table. */
/***********************************************************************/
-PCOL TDBASE::InsertSpcBlk(PGLOBAL g, PCOLUMN cp)
+PCOL TDBASE::InsertSpcBlk(PGLOBAL g, PCOLDEF cdp)
{
- char *name = (char*)cp->GetName();
- PCOL colp;
+//char *name = cdp->GetName();
+ char *name = cdp->GetFmt();
+ PCOLUMN cp;
+ PCOL colp;
- if (!strcmp(name, "FILEID")) {
-// !strcmp(name, "SERVID")) {
+ cp= new(g) COLUMN(cdp->GetName());
+ cp->SetTo_Table(To_Table);
+
+ if (!stricmp(name, "FILEID") ||
+ !stricmp(name, "SERVID")) {
if (!To_Def || !(To_Def->GetPseudo() & 2)) {
sprintf(g->Message, MSG(BAD_SPEC_COLUMN));
return NULL;
} // endif Pseudo
-// if (!strcmp(name, "FILEID"))
+ if (!stricmp(name, "FILEID"))
colp = new(g) FIDBLK(cp);
-// else
-// colp = new(g) SIDBLK(cp);
+ else
+ colp = new(g) SIDBLK(cp);
- } else if (!strcmp(name, "TABID")) {
+ } else if (!stricmp(name, "TABID")) {
colp = new(g) TIDBLK(cp);
-//} else if (!strcmp(name, "CONID")) {
+//} else if (!stricmp(name, "CONID")) {
// colp = new(g) CIDBLK(cp);
- } else if (!strcmp(name, "ROWID")) {
+ } else if (!stricmp(name, "ROWID")) {
colp = new(g) RIDBLK(cp, false);
- } else if (!strcmp(name, "ROWNUM")) {
+ } else if (!stricmp(name, "ROWNUM")) {
colp = new(g) RIDBLK(cp, true);
} else {
sprintf(g->Message, MSG(BAD_SPECIAL_COL), name);