Commit 87b75b77 authored by Sergei Golubchik's avatar Sergei Golubchik

10.0-connect

parents 722dc78d cfa872f6
...@@ -23,15 +23,15 @@ array.cpp blkfil.cpp colblk.cpp csort.cpp ...@@ -23,15 +23,15 @@ array.cpp blkfil.cpp colblk.cpp csort.cpp
filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp filamzip.cpp filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp filamzip.cpp
filter.cpp maputil.cpp myutil.cpp plgdbutl.cpp reldef.cpp tabcol.cpp filter.cpp maputil.cpp myutil.cpp plgdbutl.cpp reldef.cpp tabcol.cpp
tabdos.cpp tabfix.cpp tabfmt.cpp table.cpp tabmul.cpp taboccur.cpp tabdos.cpp tabfix.cpp tabfmt.cpp table.cpp tabmul.cpp taboccur.cpp
tabpivot.cpp tabsys.cpp tabtbl.cpp tabutil.cpp tabvct.cpp tabxcl.cpp tabpivot.cpp tabsys.cpp tabtbl.cpp tabutil.cpp tabvct.cpp tabvir.cpp
valblk.cpp value.cpp xindex.cpp xobject.cpp tabxcl.cpp valblk.cpp value.cpp xindex.cpp xobject.cpp
array.h blkfil.h block.h catalog.h checklvl.h colblk.h connect.h csort.h array.h blkfil.h block.h catalog.h checklvl.h colblk.h connect.h csort.h
engmsg.h filamap.h filamdbf.h filamfix.h filamtxt.h filamvct.h filamzip.h engmsg.h filamap.h filamdbf.h filamfix.h filamtxt.h filamvct.h filamzip.h
filter.h global.h ha_connect.h inihandl.h maputil.h msgid.h mycat.h myutil.h filter.h global.h ha_connect.h inihandl.h maputil.h msgid.h mycat.h myutil.h
os.h osutil.h plgcnx.h plgdbsem.h preparse.h reldef.h resource.h tabcol.h os.h osutil.h plgcnx.h plgdbsem.h preparse.h reldef.h resource.h tabcol.h
tabdos.h tabfix.h tabfmt.h tabmul.h taboccur.h tabpivot.h tabsys.h tabdos.h tabfix.h tabfmt.h tabmul.h taboccur.h tabpivot.h tabsys.h
tabtbl.h tabutil.h tabvct.h tabxcl.h user_connect.h valblk.h value.h tabtbl.h tabutil.h tabvct.h tabvir.h tabxcl.h user_connect.h valblk.h value.h
xindex.h xobject.h xtable.h) xindex.h xobject.h xtable.h)
# #
......
...@@ -51,11 +51,6 @@ ...@@ -51,11 +51,6 @@
#define ASSERT(B) #define ASSERT(B)
#endif #endif
/***********************************************************************/
/* Static variables. */
/***********************************************************************/
extern "C" int trace;
/***********************************************************************/ /***********************************************************************/
/* DB static external variables. */ /* DB static external variables. */
/***********************************************************************/ /***********************************************************************/
......
...@@ -39,11 +39,6 @@ ...@@ -39,11 +39,6 @@
#include "array.h" // ARRAY classes dcls #include "array.h" // ARRAY classes dcls
#include "blkfil.h" // Block Filter classes dcls #include "blkfil.h" // Block Filter classes dcls
/***********************************************************************/
/* Static variables. */
/***********************************************************************/
extern "C" int trace;
/* ------------------------ Class BLOCKFILTER ------------------------ */ /* ------------------------ Class BLOCKFILTER ------------------------ */
/***********************************************************************/ /***********************************************************************/
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include "xindex.h" #include "xindex.h"
#include "xtable.h" #include "xtable.h"
extern "C" int trace;
/***********************************************************************/ /***********************************************************************/
/* COLBLK protected constructor. */ /* COLBLK protected constructor. */
/***********************************************************************/ /***********************************************************************/
......
...@@ -48,11 +48,6 @@ ...@@ -48,11 +48,6 @@
#define my_strlwr(p) my_casedn_str(default_charset_info, (p)); #define my_strlwr(p) my_casedn_str(default_charset_info, (p));
#define my_stricmp(a, b) my_strcasecmp(default_charset_info, (a), (b)) #define my_stricmp(a, b) my_strcasecmp(default_charset_info, (a), (b))
/***********************************************************************/
/* DB static variables. */
/***********************************************************************/
extern "C" int trace;
/***********************************************************************/ /***********************************************************************/
/* Routines called internally by semantic routines. */ /* Routines called internally by semantic routines. */
/***********************************************************************/ /***********************************************************************/
...@@ -281,16 +276,13 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, ...@@ -281,16 +276,13 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
if (trace) if (trace)
printf("Allocating column %s\n", p); printf("Allocating column %s\n", p);
// if (*p == '*') { g->Message[0] = 0; // To check whether ColDB made an error message
// // This is a special column colp= tdbp->ColDB(g, p, 0);
// cp= new(g) COLUMN(p + 1);
// cp->SetTo_Table(tdbp->GetTable()); if (!colp && !(mode == MODE_INSERT && tdbp->IsSpecial(p))) {
// colp= ((PTDBASE)tdbp)->InsertSpcBlk(g, cp); if (g->Message[0] == 0)
// } else sprintf(g->Message, MSG(COL_ISNOT_TABLE), p, tdbp->GetName());
colp= tdbp->ColDB(g, p, 0);
if (!colp) {
sprintf(g->Message, "Column %s not found in %s", p, tdbp->GetName());
goto err; goto err;
} // endif colp } // endif colp
...@@ -421,14 +413,14 @@ RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool mrr) ...@@ -421,14 +413,14 @@ RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool mrr)
for (colp= tdbp->GetColumns(); rc == RC_OK && colp; for (colp= tdbp->GetColumns(); rc == RC_OK && colp;
colp= colp->GetNext()) { colp= colp->GetNext()) {
colp->Reset(); colp->Reset();
// Virtual columns are computed by MariaDB // Virtual columns are computed by MariaDB
if (!colp->GetColUse(U_VIRTUAL) && (!mrr || colp->GetKcol())) if (!colp->GetColUse(U_VIRTUAL) && (!mrr || colp->GetKcol()))
if (colp->Eval(g)) if (colp->Eval(g))
rc= RC_FX; rc= RC_FX;
} // endfor colp } // endfor colp
err: err:
g->jump_level--; g->jump_level--;
...@@ -659,8 +651,10 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted) ...@@ -659,8 +651,10 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
if (!ptdb) if (!ptdb)
return -1; return -1;
else if (!((PTDBASE)ptdb)->GetDef()->Indexable()) { else if (!((PTDBASE)ptdb)->GetDef()->Indexable()) {
sprintf(g->Message, "CntIndexInit: Table %s is not indexable", ptdb->GetName()); sprintf(g->Message, MSG(TABLE_NO_INDEX), ptdb->GetName());
return 0; return 0;
} else if (((PTDBASE)ptdb)->GetDef()->Indexable() == 3) {
return 1;
} else } else
tdbp= (PTDBDOX)ptdb; tdbp= (PTDBDOX)ptdb;
...@@ -730,13 +724,21 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, ...@@ -730,13 +724,21 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
x= ((PTDBASE)ptdb)->GetDef()->Indexable(); x= ((PTDBASE)ptdb)->GetDef()->Indexable();
if (!x) { if (!x) {
sprintf(g->Message, "CntIndexRead: Table %s is not indexable", ptdb->GetName()); sprintf(g->Message, MSG(TABLE_NO_INDEX), ptdb->GetName());
return RC_FX; return RC_FX;
} else if (x == 2) { } else if (x == 2) {
// Remote index // Remote index
if (ptdb->ReadKey(g, op, key, len)) if (ptdb->ReadKey(g, op, key, len))
return RC_FX; return RC_FX;
goto rnd;
} else if (x == 3) {
if (key)
((PTDBASE)ptdb)->SetRecpos(g, *(int*)key);
if (op == OP_SAME)
return RC_NF;
goto rnd; goto rnd;
} else } else
tdbp= (PTDBDOX)ptdb; tdbp= (PTDBDOX)ptdb;
...@@ -836,12 +838,21 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, ...@@ -836,12 +838,21 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
x= ((PTDBASE)ptdb)->GetDef()->Indexable(); x= ((PTDBASE)ptdb)->GetDef()->Indexable();
if (!x) { if (!x) {
sprintf(g->Message, "CntIndexRange: Table %s is not indexable", ptdb->GetName()); sprintf(g->Message, MSG(TABLE_NO_INDEX), ptdb->GetName());
DBUG_PRINT("Range", ("%s", g->Message)); DBUG_PRINT("Range", ("%s", g->Message));
return -1; return -1;
} else if (x == 2) { } else if (x == 2) {
// Remote index // Remote index
return 2; return 2;
} else if (x == 3) {
// Virtual index
for (i= 0; i < 2; i++)
if (key[i])
k[i] = *(int*)key[i] + (incl[i] ? 0 : 1 - 2 * i);
else
k[i] = (i) ? ptdb->Cardinality(g) : 1;
return k[1] - k[0] + 1;
} else } else
tdbp= (PTDBDOX)ptdb; tdbp= (PTDBDOX)ptdb;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
case IDS_TABLES: p = "Table Headers"; break;
case IDS_TAB_01: p = "Table_Cat"; break;
case IDS_TAB_02: p = "Table_Schema"; break;
case IDS_TAB_03: p = "Table_Name"; break;
case IDS_TAB_04: p = "Table_Type"; break;
case IDS_TAB_05: p = "Remark"; break;
case IDS_COLUMNS: p = "Column Headers"; break;
case IDS_COL_01: p = "Table_Cat"; break;
case IDS_COL_02: p = "Table_Schema"; break;
case IDS_COL_03: p = "Table_Name"; break;
case IDS_COL_04: p = "Column_Name"; break;
case IDS_COL_05: p = "Data_Type"; break;
case IDS_COL_06: p = "Type_Name"; break;
case IDS_COL_07: p = "Column_Size"; break;
case IDS_COL_08: p = "Buffer_Length"; break;
case IDS_COL_09: p = "Decimal_Digits"; break;
case IDS_COL_10: p = "Radix"; break;
case IDS_COL_11: p = "Nullable"; break;
case IDS_COL_12: p = "Remarks"; break;
case IDS_PKEY: p = "Key Headers"; break;
case IDS_PKY_01: p = "Table_Catalog"; break;
case IDS_PKY_02: p = "Table_Schema"; break;
case IDS_PKY_03: p = "Table_Name"; break;
case IDS_PKY_04: p = "Column_Name"; break;
case IDS_PKY_05: p = "Key_Seq"; break;
case IDS_PKY_06: p = "Pk_Name"; break;
case IDS_STAT: p = "Stat Headers"; break;
case IDS_STA_01: p = "Table_Catalog"; break;
case IDS_STA_02: p = "Table_Schema"; break;
case IDS_STA_03: p = "Table_Name"; break;
case IDS_STA_04: p = "Non_Unique"; break;
case IDS_STA_05: p = "Index_Qualifier"; break;
case IDS_STA_06: p = "Index_Name"; break;
case IDS_STA_07: p = "Type"; break;
case IDS_STA_08: p = "Seq_in_Index"; break;
case IDS_STA_09: p = "Column_Name"; break;
case IDS_STA_10: p = "Collation"; break;
case IDS_STA_11: p = "Cardinality"; break;
case IDS_STA_12: p = "Pages"; break;
case IDS_STA_13: p = "Filter_Condition"; break;
case IDS_DRIVER: p = "Driver Headers"; break;
case IDS_DRV_01: p = "Description"; break;
case IDS_DRV_02: p = "Attributes"; break;
case IDS_DSRC: p = "DataSrc Headers"; break;
case IDS_DSC_01: p = "Name"; break;
case IDS_DSC_02: p = "Description"; break;
...@@ -46,8 +46,6 @@ ...@@ -46,8 +46,6 @@
#include "filamap.h" #include "filamap.h"
#include "tabdos.h" #include "tabdos.h"
extern "C" int trace;
/* --------------------------- Class MAPFAM -------------------------- */ /* --------------------------- Class MAPFAM -------------------------- */
/***********************************************************************/ /***********************************************************************/
...@@ -360,7 +358,12 @@ int MAPFAM::ReadBuffer(PGLOBAL g) ...@@ -360,7 +358,12 @@ int MAPFAM::ReadBuffer(PGLOBAL g)
while (*Mempos++ != '\n') ; // What about Unix ??? while (*Mempos++ != '\n') ; // What about Unix ???
// Set caller line buffer // Set caller line buffer
len = (Mempos - Fpos) - Ending; len = (Mempos - Fpos) - 1;
// Don't rely on ENDING setting
if (len > 0 && *(Mempos - 2) == '\r')
len--; // Line ends by CRLF
memcpy(Tdbp->GetLine(), Fpos, len); memcpy(Tdbp->GetLine(), Fpos, len);
Tdbp->GetLine()[len] = '\0'; Tdbp->GetLine()[len] = '\0';
return RC_OK; return RC_OK;
......
...@@ -63,8 +63,6 @@ ...@@ -63,8 +63,6 @@
#define DBFTYPE 3 /* value of bits 0 and 1 if .dbf */ #define DBFTYPE 3 /* value of bits 0 and 1 if .dbf */
#define EOH 0x0D /* end-of-header marker in .dbf file */ #define EOH 0x0D /* end-of-header marker in .dbf file */
extern "C" int trace; // The general trace value
/****************************************************************************/ /****************************************************************************/
/* First 32 bytes of a .dbf file. */ /* First 32 bytes of a .dbf file. */
/* Note: some reserved fields are used here to store info (Fields) */ /* Note: some reserved fields are used here to store info (Fields) */
...@@ -286,7 +284,8 @@ PQRYRES DBFColumns(PGLOBAL g, char *dp, const char *fn, bool info) ...@@ -286,7 +284,8 @@ PQRYRES DBFColumns(PGLOBAL g, char *dp, const char *fn, bool info)
break; break;
default: default:
if (!info) { if (!info) {
sprintf(g->Message, MSG(BAD_DBF_TYPE), thisfield.Type); sprintf(g->Message, MSG(BAD_DBF_TYPE), thisfield.Type
, thisfield.Name);
goto err; goto err;
} // endif info } // endif info
...@@ -587,7 +586,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) ...@@ -587,7 +586,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g)
case 'D': // Date case 'D': // Date
break; break;
default: // Should never happen default: // Should never happen
sprintf(g->Message, "Unsupported DBF type %c for column %s", sprintf(g->Message, MSG(BAD_DBF_TYPE),
c, cdp->GetName()); c, cdp->GetName());
return true; return true;
} // endswitch c } // endswitch c
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#define INVALID_SET_FILE_POINTER 0xFFFFFFFF #define INVALID_SET_FILE_POINTER 0xFFFFFFFF
#endif #endif
extern "C" int trace;
extern int num_read, num_there, num_eq[2]; // Statistics extern int num_read, num_there, num_eq[2]; // Statistics
/* --------------------------- Class FIXFAM -------------------------- */ /* --------------------------- Class FIXFAM -------------------------- */
...@@ -131,18 +130,49 @@ bool FIXFAM::AllocateBuffer(PGLOBAL g) ...@@ -131,18 +130,49 @@ bool FIXFAM::AllocateBuffer(PGLOBAL g)
/*******************************************************************/ /*******************************************************************/
/* For Insert the buffer must be prepared. */ /* For Insert the buffer must be prepared. */
/*******************************************************************/ /*******************************************************************/
memset(To_Buf, ' ', Buflen); if (Tdbp->GetFtype() == RECFM_BIN) {
// The buffer must be prepared depending on column types
int n = 0;
PDOSDEF defp = (PDOSDEF)Tdbp->GetDef();
PCOLDEF cdp;
if (/*Tdbp->GetFtype() < 2 &&*/ !Padded) // Prepare the first line of the buffer
// If not binary, the file is physically a text file. memset(To_Buf, 0, Buflen);
// We do it also for binary table because the lrecl can have been
for (cdp = defp->GetCols(); cdp; cdp = cdp->GetNext()) {
if (IsTypeNum(cdp->GetType()))
memset(To_Buf + cdp->GetOffset(), ' ', cdp->GetClen());
n = MY_MAX(n, cdp->GetPoff() + cdp->GetClen());
} // endfor cdp
// We do this for binary table because the lrecl can have been
// specified with additional space to include line ending. // specified with additional space to include line ending.
for (int len = Lrecl; len <= Buflen; len += Lrecl) { if (n < Lrecl && Ending) {
#if defined(WIN32) To_Buf[Lrecl - 1] = '\n';
To_Buf[len - 2] = '\r';
#endif // WIN32 if (n < Lrecl - 1 && Ending == 2)
To_Buf[len - 1] = '\n'; To_Buf[Lrecl - 2] = '\r';
} // endfor len
} // endif n
// Now repeat this for the whole buffer
for (int len = Lrecl; len <= Buflen - Lrecl; len += Lrecl)
memcpy(To_Buf + len, To_Buf, Lrecl);
} else {
memset(To_Buf, ' ', Buflen);
if (!Padded)
// The file is physically a text file.
for (int len = Lrecl; len <= Buflen; len += Lrecl) {
if (Ending == 2)
To_Buf[len - 2] = '\r';
To_Buf[len - 1] = '\n';
} // endfor len
} // endif Ftype
Rbuf = Nrec; // To be used by WriteDB Rbuf = Nrec; // To be used by WriteDB
} // endif Insert } // endif Insert
...@@ -205,7 +235,7 @@ int FIXFAM::WriteModifiedBlock(PGLOBAL g) ...@@ -205,7 +235,7 @@ int FIXFAM::WriteModifiedBlock(PGLOBAL g)
// NOTE: Next line was added to avoid a very strange fread bug. // NOTE: Next line was added to avoid a very strange fread bug.
// When the fseek is not executed (even the file has the good // When the fseek is not executed (even the file has the good
// pointer position) the next read can happen anywhere in the file. // pointer position) the next read can happen anywhere in the file.
OldBlk = CurBlk; // This will force fseek to be executed OldBlk = -2; // This will force fseek to be executed
Modif = 0; Modif = 0;
return rc; return rc;
} // end of WriteModifiedBlock } // end of WriteModifiedBlock
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
#endif #endif
extern int num_read, num_there, num_eq[2]; // Statistics extern int num_read, num_there, num_eq[2]; // Statistics
extern "C" int trace;
/***********************************************************************/ /***********************************************************************/
/* Routine called externally by TXTFAM SortedRows functions. */ /* Routine called externally by TXTFAM SortedRows functions. */
...@@ -538,7 +537,8 @@ bool DOSFAM::OpenTableFile(PGLOBAL g) ...@@ -538,7 +537,8 @@ bool DOSFAM::OpenTableFile(PGLOBAL g)
PDBUSER dbuserp = PlgGetUser(g); PDBUSER dbuserp = PlgGetUser(g);
// This is required when using Unix files under Windows and vice versa // This is required when using Unix files under Windows and vice versa
Bin = (Blocked || Ending != CRLF); //Bin = (Blocked || Ending != CRLF);
Bin = true; // To avoid ftell problems
switch (mode) { switch (mode) {
case MODE_READ: case MODE_READ:
...@@ -684,6 +684,7 @@ bool DOSFAM::RecordPos(PGLOBAL g) ...@@ -684,6 +684,7 @@ bool DOSFAM::RecordPos(PGLOBAL g)
{ {
if ((Fpos = ftell(Stream)) < 0) { if ((Fpos = ftell(Stream)) < 0) {
sprintf(g->Message, MSG(FTELL_ERROR), 0, strerror(errno)); sprintf(g->Message, MSG(FTELL_ERROR), 0, strerror(errno));
// strcat(g->Message, " (possible wrong ENDING option value)");
return true; return true;
} // endif Fpos } // endif Fpos
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
extern int num_read, num_there; // Statistics extern int num_read, num_there; // Statistics
static int num_write; static int num_write;
extern "C" int trace;
#if defined(UNIX) #if defined(UNIX)
// Add dummy strerror (NGC) // Add dummy strerror (NGC)
...@@ -388,15 +387,20 @@ bool VCTFAM::MakeEmptyFile(PGLOBAL g, char *fn) ...@@ -388,15 +387,20 @@ bool VCTFAM::MakeEmptyFile(PGLOBAL g, char *fn)
n = (Header == 1 || Header == 3) ? sizeof(VECHEADER) : 0; n = (Header == 1 || Header == 3) ? sizeof(VECHEADER) : 0;
if (lseek(h, n + MaxBlk * Nrec * Lrecl - 1, SEEK_SET) == -1) { if (lseek(h, n + MaxBlk * Nrec * Lrecl - 1, SEEK_SET) < 0)
sprintf(g->Message, MSG(MAKE_EMPTY_FILE), To_File, strerror(errno)); goto err;
close(h);
return true; // This actually fills the empty file
} // endif h if (write(h, &c, 1) < 0)
goto err;
write(h, &c, 1); // This actually fills the empty file
close(h); close(h);
return false; return false;
err:
sprintf(g->Message, MSG(MAKE_EMPTY_FILE), To_File, strerror(errno));
close(h);
return true;
} // end of MakeEmptyFile } // end of MakeEmptyFile
/***********************************************************************/ /***********************************************************************/
...@@ -3393,15 +3397,20 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, char *fn) ...@@ -3393,15 +3397,20 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, char *fn)
htrc("MEF: pos=%lld n=%d maxblk=%d blksize=%d\n", htrc("MEF: pos=%lld n=%d maxblk=%d blksize=%d\n",
pos, n, MaxBlk, Blksize); pos, n, MaxBlk, Blksize);
if (lseek64(h, pos, SEEK_SET) < 0) { if (lseek64(h, pos, SEEK_SET) < 0)
sprintf(g->Message, MSG(MAKE_EMPTY_FILE), To_File, strerror(errno)); goto err;
close(h);
return true;
} // endif h
write(h, &c, 1); // This actually fills the empty file // This actually fills the empty file
if (write(h, &c, 1) < 0)
goto err;
close(h); close(h);
return false; return false;
err:
sprintf(g->Message, MSG(MAKE_EMPTY_FILE), To_File, strerror(errno));
close(h);
return true;
#endif // !WIN32 #endif // !WIN32
} // end of MakeEmptyFile } // end of MakeEmptyFile
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
/* DB static variables. */ /* DB static variables. */
/***********************************************************************/ /***********************************************************************/
extern int num_read, num_there, num_eq[]; // Statistics extern int num_read, num_there, num_eq[]; // Statistics
extern "C" int trace;
/* ------------------------------------------------------------------- */ /* ------------------------------------------------------------------- */
......
This diff is collapsed.
...@@ -39,11 +39,6 @@ ...@@ -39,11 +39,6 @@
//#include "select.h" //#include "select.h"
#include "xindex.h" #include "xindex.h"
/***********************************************************************/
/* Static variables. */
/***********************************************************************/
extern "C" int trace;
/***********************************************************************/ /***********************************************************************/
/* Utility routines. */ /* Utility routines. */
/***********************************************************************/ /***********************************************************************/
...@@ -106,7 +101,7 @@ PFIL MakeFilter(PGLOBAL g, PFIL fp1, OPVAL vop, PFIL fp2) ...@@ -106,7 +101,7 @@ PFIL MakeFilter(PGLOBAL g, PFIL fp1, OPVAL vop, PFIL fp2)
PFIL filp = new(g) FILTER(g, vop); PFIL filp = new(g) FILTER(g, vop);
filp->Arg(0) = fp1; filp->Arg(0) = fp1;
filp->Arg(1) = fp2; filp->Arg(1) = (fp2) ? fp2 : pXVOID;
if (filp->Convert(g, false)) if (filp->Convert(g, false))
return NULL; return NULL;
......
This diff is collapsed.
This diff is collapsed.
case IDS_TABLES: p = "Table Enttes"; break;
case IDS_TAB_01: p = "Catalogue"; break;
case IDS_TAB_02: p = "Schma"; break;
case IDS_TAB_03: p = "Nom"; break;
case IDS_TAB_04: p = "Type"; break;
case IDS_TAB_05: p = "Remarque"; break;
case IDS_COLUMNS: p = "Colonne Enttes"; break;
case IDS_COL_01: p = "Cat_Table"; break;
case IDS_COL_02: p = "Schem_Table"; break;
case IDS_COL_03: p = "Nom_Table"; break;
case IDS_COL_04: p = "Nom_Colonne"; break;
case IDS_COL_05: p = "Type_Donnes"; break;
case IDS_COL_06: p = "Nom_Type"; break;
case IDS_COL_07: p = "Prcision"; break;
case IDS_COL_08: p = "Longueur"; break;
case IDS_COL_09: p = "Echelle"; break;
case IDS_COL_10: p = "Base"; break;
case IDS_COL_11: p = "Nullifiable"; break;
case IDS_COL_12: p = "Remarques"; break;
case IDS_PKEY: p = "Cl Enttes"; break;
case IDS_PKY_01: p = "Cat_Table"; break;
case IDS_PKY_02: p = "Schem_Table"; break;
case IDS_PKY_03: p = "Nom_Table"; break;
case IDS_PKY_04: p = "Nom_Colonne"; break;
case IDS_PKY_05: p = "Numro_Cl"; break;
case IDS_PKY_06: p = "Nom_Cl"; break;
case IDS_STAT: p = "Stat Enttes"; break;
case IDS_STA_01: p = "Table_Catalog"; break;
case IDS_STA_02: p = "Table_Schema"; break;
case IDS_STA_03: p = "Table_Name"; break;
case IDS_STA_04: p = "Non_Unique"; break;
case IDS_STA_05: p = "Index_Qualifier"; break;
case IDS_STA_06: p = "Index_Name"; break;
case IDS_STA_07: p = "Type"; break;
case IDS_STA_08: p = "Seq_in_Index"; break;
case IDS_STA_09: p = "Column_Name"; break;
case IDS_STA_10: p = "Collation"; break;
case IDS_STA_11: p = "Cardinality"; break;
case IDS_STA_12: p = "Pages"; break;
case IDS_STA_13: p = "Filter_Condition"; break;
case IDS_DRIVER: p = "Driver Enttes"; break;
case IDS_DRV_01: p = "Description"; break;
case IDS_DRV_02: p = "Attributs"; break;
case IDS_DSRC: p = "DataSrc Enttes"; break;
case IDS_DSC_01: p = "Nom"; break;
case IDS_DSC_02: p = "Description"; break;
This diff is collapsed.
...@@ -24,11 +24,13 @@ ...@@ -24,11 +24,13 @@
#endif #endif
#if defined(XMSG) #if defined(XMSG)
//#error Option XMSG is not yet fully implemented
// Definition used to read messages from message file. // Definition used to read messages from message file.
#include "msgid.h" #include "msgid.h"
#define MSG(I) PlugReadMessage(NULL, MSG_##I, #I) #define MSG(I) PlugReadMessage(NULL, MSG_##I, #I)
#define STEP(I) PlugReadMessage(g, MSG_##I, #I) #define STEP(I) PlugReadMessage(g, MSG_##I, #I)
#elif defined(NEWMSG) #elif defined(NEWMSG)
//#error Option NEWMSG is not yet fully implemented
// Definition used to get messages from resource. // Definition used to get messages from resource.
#include "msgid.h" #include "msgid.h"
#define MSG(I) PlugGetMessage(NULL, MSG_##I) #define MSG(I) PlugGetMessage(NULL, MSG_##I)
...@@ -46,6 +48,11 @@ ...@@ -46,6 +48,11 @@
#define CRLF 1 #define CRLF 1
#endif // !WIN32 #endif // !WIN32
/***********************************************************************/
/* Define access to the thread based trace value. */
/***********************************************************************/
#define trace GetTraceValue()
/***********************************************************************/ /***********************************************************************/
/* Miscellaneous Constants */ /* Miscellaneous Constants */
/***********************************************************************/ /***********************************************************************/
...@@ -255,6 +262,7 @@ DllExport void *PlugSubAlloc(PGLOBAL, void *, size_t); ...@@ -255,6 +262,7 @@ DllExport void *PlugSubAlloc(PGLOBAL, void *, size_t);
DllExport char *PlugDup(PGLOBAL g, const char *str); DllExport char *PlugDup(PGLOBAL g, const char *str);
DllExport void *MakePtr(void *, OFFSET); DllExport void *MakePtr(void *, OFFSET);
DllExport void htrc(char const *fmt, ...); DllExport void htrc(char const *fmt, ...);
DllExport int GetTraceValue(void);
#if defined(__cplusplus) #if defined(__cplusplus)
} // extern "C" } // extern "C"
......
This diff is collapsed.
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#pragma interface /* gcc class implementation */ #pragma interface /* gcc class implementation */
#endif #endif
static char *strz(PGLOBAL g, LEX_STRING &ls);
/****************************************************************************/ /****************************************************************************/
/* Structures used to pass info between CONNECT and ha_connect. */ /* Structures used to pass info between CONNECT and ha_connect. */
/****************************************************************************/ /****************************************************************************/
...@@ -177,13 +179,16 @@ class ha_connect: public handler ...@@ -177,13 +179,16 @@ class ha_connect: public handler
protected: protected:
char *PlugSubAllocStr(PGLOBAL g, void *memp, const char *str, size_t length) char *PlugSubAllocStr(PGLOBAL g, void *memp, const char *str, size_t length)
{ {
char *ptr; char *ptr= (char*)PlgDBSubAlloc(g, memp, length + 1);
if (!(ptr= (char*) PlugSubAlloc(g, memp, length + 1)))
return NULL; if (ptr) {
memcpy(ptr, str, length); memcpy(ptr, str, length);
ptr[length]= '\0'; ptr[length]= '\0';
} // endif ptr
return ptr; return ptr;
} } // end of PlugSubAllocStr
public: public:
ha_connect(handlerton *hton, TABLE_SHARE *table_arg); ha_connect(handlerton *hton, TABLE_SHARE *table_arg);
~ha_connect(); ~ha_connect();
...@@ -210,6 +215,7 @@ class ha_connect: public handler ...@@ -210,6 +215,7 @@ class ha_connect: public handler
void *GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf); void *GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf);
PXOS GetIndexOptionStruct(KEY *kp); PXOS GetIndexOptionStruct(KEY *kp);
PIXDEF GetIndexInfo(TABLE_SHARE *s= NULL); PIXDEF GetIndexInfo(TABLE_SHARE *s= NULL);
bool CheckVirtualIndex(TABLE_SHARE *s);
const char *GetDBName(const char *name); const char *GetDBName(const char *name);
const char *GetTableName(void); const char *GetTableName(void);
char *GetPartName(void); char *GetPartName(void);
...@@ -235,6 +241,8 @@ class ha_connect: public handler ...@@ -235,6 +241,8 @@ class ha_connect: public handler
uint key_len= 0); uint key_len= 0);
bool MakeKeyWhere(PGLOBAL g, char *qry, OPVAL op, char *q, bool MakeKeyWhere(PGLOBAL g, char *qry, OPVAL op, char *q,
const void *key, int klen); const void *key, int klen);
inline char *Strz(LEX_STRING &ls);
/** @brief /** @brief
The name that will be used for display purposes. The name that will be used for display purposes.
......
...@@ -180,7 +180,6 @@ class XML2ATTR : public XMLATTRIBUTE { ...@@ -180,7 +180,6 @@ class XML2ATTR : public XMLATTRIBUTE {
extern "C" { extern "C" {
extern char version[]; extern char version[];
extern int trace;
} // "C" } // "C"
#if defined(MEMORY_TRACE) #if defined(MEMORY_TRACE)
......
This diff is collapsed.
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
#if defined(PIVOT_SUPPORT) #if defined(PIVOT_SUPPORT)
#include "tabpivot.h" #include "tabpivot.h"
#endif // PIVOT_SUPPORT #endif // PIVOT_SUPPORT
#include "tabvir.h"
#include "ha_connect.h" #include "ha_connect.h"
#include "mycat.h" #include "mycat.h"
...@@ -98,8 +99,6 @@ ...@@ -98,8 +99,6 @@
extern "C" HINSTANCE s_hModule; // Saved module handle extern "C" HINSTANCE s_hModule; // Saved module handle
#endif // !WIN32 #endif // !WIN32
extern "C" int trace;
PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info);
/***********************************************************************/ /***********************************************************************/
...@@ -139,6 +138,7 @@ TABTYPE GetTypeID(const char *type) ...@@ -139,6 +138,7 @@ TABTYPE GetTypeID(const char *type)
#ifdef PIVOT_SUPPORT #ifdef PIVOT_SUPPORT
: (!stricmp(type, "PIVOT")) ? TAB_PIVOT : (!stricmp(type, "PIVOT")) ? TAB_PIVOT
#endif #endif
: (!stricmp(type, "VIR")) ? TAB_VIR
: (!stricmp(type, "OEM")) ? TAB_OEM : TAB_NIY; : (!stricmp(type, "OEM")) ? TAB_OEM : TAB_NIY;
} // end of GetTypeID } // end of GetTypeID
...@@ -182,6 +182,7 @@ bool IsExactType(TABTYPE type) ...@@ -182,6 +182,7 @@ bool IsExactType(TABTYPE type)
case TAB_DBF: case TAB_DBF:
// case TAB_XML: depends on Multiple || Xpand || Coltype // case TAB_XML: depends on Multiple || Xpand || Coltype
case TAB_VEC: case TAB_VEC:
case TAB_VIR:
exact= true; exact= true;
break; break;
default: default:
...@@ -280,6 +281,9 @@ int GetIndexType(TABTYPE type) ...@@ -280,6 +281,9 @@ int GetIndexType(TABTYPE type)
// case TAB_ODBC: // case TAB_ODBC:
xtyp= 2; xtyp= 2;
break; break;
case TAB_VIR:
xtyp= 3;
break;
case TAB_ODBC: case TAB_ODBC:
default: default:
xtyp= 0; xtyp= 0;
...@@ -533,6 +537,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) ...@@ -533,6 +537,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am)
#if defined(PIVOT_SUPPORT) #if defined(PIVOT_SUPPORT)
case TAB_PIVOT: tdp= new(g) PIVOTDEF; break; case TAB_PIVOT: tdp= new(g) PIVOTDEF; break;
#endif // PIVOT_SUPPORT #endif // PIVOT_SUPPORT
case TAB_VIR: tdp= new(g) VIRDEF; break;
default: default:
sprintf(g->Message, MSG(BAD_TABLE_TYPE), am, name); sprintf(g->Message, MSG(BAD_TABLE_TYPE), am, name);
} // endswitch } // endswitch
......
This diff is collapsed.
This diff is collapsed.
...@@ -95,7 +95,7 @@ class DBX : public BLOCK { ...@@ -95,7 +95,7 @@ class DBX : public BLOCK {
const char *GetErrorMessage(int i); const char *GetErrorMessage(int i);
protected: protected:
void BuildErrorMessage(ODBConn* pdb, HSTMT hstmt = SQL_NULL_HSTMT); bool BuildErrorMessage(ODBConn* pdb, HSTMT hstmt = SQL_NULL_HSTMT);
// Attributes // Attributes
RETCODE m_RC; RETCODE m_RC;
...@@ -124,6 +124,7 @@ class ODBConn : public BLOCK { ...@@ -124,6 +124,7 @@ class ODBConn : public BLOCK {
forceOdbcDialog = 0x0010}; // Always display ODBC connect dialog forceOdbcDialog = 0x0010}; // Always display ODBC connect dialog
int Open(PSZ ConnectString, DWORD Options = 0); int Open(PSZ ConnectString, DWORD Options = 0);
bool Rewind(char *sql, ODBCCOL *tocols);
void Close(void); void Close(void);
// Attributes // Attributes
...@@ -190,4 +191,5 @@ class ODBConn : public BLOCK { ...@@ -190,4 +191,5 @@ class ODBConn : public BLOCK {
PSZ m_Connect; PSZ m_Connect;
bool m_Updatable; bool m_Updatable;
bool m_Transact; bool m_Transact;
bool m_Scrollable;
}; // end of ODBConn class definition }; // end of ODBConn class definition
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment