summaryrefslogtreecommitdiff
path: root/storage/connect/taboccur.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storage/connect/taboccur.cpp')
-rw-r--r--storage/connect/taboccur.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/storage/connect/taboccur.cpp b/storage/connect/taboccur.cpp
index 86f0bd20d47..07e260154e0 100644
--- a/storage/connect/taboccur.cpp
+++ b/storage/connect/taboccur.cpp
@@ -1,7 +1,7 @@
/************ TabOccur CPP Declares Source Code File (.CPP) ************/
/* Name: TABOCCUR.CPP Version 1.1 */
/* */
-/* (C) Copyright to the author Olivier BERTRAND 2013 */
+/* (C) Copyright to the author Olivier BERTRAND 2013 - 2015 */
/* */
/* OCCUR: Table that provides a view of a source table where the */
/* contain of several columns of the source table is placed in only */
@@ -13,7 +13,7 @@
/***********************************************************************/
#include "my_global.h"
#include "table.h" // MySQL table definitions
-#if defined(WIN32)
+#if defined(__WIN__)
#include <stdlib.h>
#include <stdio.h>
#if defined(__BORLANDC__)
@@ -45,11 +45,8 @@
#include "tabcol.h"
#include "taboccur.h"
#include "xtable.h"
-#if defined(MYSQL_SUPPORT)
#include "tabmysql.h"
-#endif // MYSQL_SUPPORT
#include "ha_connect.h"
-#include "mycat.h"
/***********************************************************************/
/* Prepare and count columns in the column list. */
@@ -93,8 +90,7 @@ bool OcrColumns(PGLOBAL g, PQRYRES qrp, const char *col,
} // endif col
// Prepare the column list
- colist = (char*)PlugSubAlloc(g, NULL, strlen(col) + 1);
- strcpy(colist, col);
+ colist = PlugDup(g, col);
m = PrepareColist(colist);
if ((rk = (rank && *rank))) {
@@ -191,8 +187,7 @@ bool OcrSrcCols(PGLOBAL g, PQRYRES qrp, const char *col,
} // endif col
// Prepare the column list
- colist = (char*)PlugSubAlloc(g, NULL, strlen(col) + 1);
- strcpy(colist, col);
+ colist = PlugDup(g, col);
m = PrepareColist(colist);
if ((rk = (rank && *rank)))
@@ -271,7 +266,7 @@ bool OCCURDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
/* GetTable: makes a new TDB of the proper type. */
/***********************************************************************/
-PTDB OCCURDEF::GetTable(PGLOBAL g, MODE m)
+PTDB OCCURDEF::GetTable(PGLOBAL g, MODE)
{
if (Catfunc != FNC_COL)
return new(g) TDBOCCUR(this);
@@ -355,7 +350,7 @@ bool TDBOCCUR::MakeColumnList(PGLOBAL g)
for (colp = Columns; colp; colp = colp->GetNext())
if (colp->GetAmType() == TYPE_AM_PRX)
- if (((PPRXCOL)colp)->Init(g))
+ if (((PPRXCOL)colp)->Init(g, NULL))
return true;
Col = (PCOL*)PlugSubAlloc(g, NULL, Mult * sizeof(PCOL));
@@ -437,7 +432,7 @@ int TDBOCCUR::GetMaxSize(PGLOBAL g)
/* In this sample, ROWID will be the (virtual) row number, */
/* while ROWNUM will be the occurence rank in the multiple column. */
/***********************************************************************/
-int TDBOCCUR::RowNumber(PGLOBAL g, bool b)
+int TDBOCCUR::RowNumber(PGLOBAL, bool b)
{
return (b) ? M : N;
} // end of RowNumber
@@ -572,7 +567,7 @@ void OCCURCOL::ReadColumn(PGLOBAL g)
/* ReadColumn: what this routine does is to access the Mth columns of */
/* list, extract its name and set to it the rank column value. */
/***********************************************************************/
-void RANKCOL::ReadColumn(PGLOBAL g)
+void RANKCOL::ReadColumn(PGLOBAL)
{
PTDBOCCUR tdbp = (PTDBOCCUR)To_Tdb;
PCOL *col = tdbp->Col;