Commit cc38c511 authored by Olivier Bertrand's avatar Olivier Bertrand

- Commit merged and resolve

added:
  storage/connect/inihandl.h
  storage/connect/rcmsg.h
modified:
  storage/connect/CMakeLists.txt
  storage/connect/connect.h
  storage/connect/ha_connect.cc
  storage/connect/inihandl.c
  storage/connect/maputil.h
  storage/connect/odbconn.cpp
  storage/connect/osutil.c
  storage/connect/osutil.h
  storage/connect/plgdbutl.cpp
  storage/connect/plugutil.c
  storage/connect/rcmsg.c
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabpivot.cpp
  storage/connect/tabsys.cpp
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
  storage/connect/user_connect.cc
  storage/connect/value.cpp
parents c035bde3 54f32928
......@@ -18,7 +18,7 @@ SET(CONNECT_PLUGIN_DYNAMIC "connect")
SET(CONNECT_SOURCES
ha_connect.cc connect.cc user_connect.cc mycat.cc
fmdlex.c osutil.c plugutil.c rcmsg.c
fmdlex.c osutil.c plugutil.c rcmsg.c rcmsg.h
csort.cpp maputil.cpp plgdbutl.cpp
colblk.cpp reldef.cpp tabcol.cpp table.cpp
filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp
......@@ -28,7 +28,7 @@ filamzip.cpp tabtbl.cpp myutil.cpp
tabutil.cpp tabxcl.cpp taboccur.cpp tabpivot.cpp
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
global.h ha_connect.h maputil.h msgid.h mycat.h myutil.h os.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
tabdos.h tabfix.h tabfmt.h tabmul.h tabsys.h tabtbl.h tabvct.h
user_connect.h valblk.h value.h xindex.h xobject.h xtable.h
......@@ -48,7 +48,6 @@ IF(UNIX)
# Bar: -Wfatal-errors removed (does not present in gcc on solaris10)
if(WITH_WARNINGS)
add_definitions(-Wall -Wextra -Wmissing-declarations)
add_definitions(-Wno-non-virtual-dtor)
message(STATUS "CONNECT: GCC: All warnings enabled")
else()
add_definitions(-Wall -Wmissing-declarations)
......@@ -64,13 +63,11 @@ IF(UNIX)
# add_definitions(-Wno-int-to-pointer-cast)
# Bar: -Wno-narrowing commented (does not present in gcc on solaris10)
# add_definitions(-Wno-narrowing)
add_definitions(-Wno-non-virtual-dtor)
# This switch is for pure C only:
# add_definitions(-Wno-implicit-function-declaration)
# These switches are for C++ only
# add_definitions(-Wno-reorder)
# add_definitions(-Wno-delete-non-virtual-dtor)
message(STATUS "CONNECT: GCC: Some warnings disabled")
endif(WITH_WARNINGS)
......
......@@ -44,6 +44,7 @@ RCODE CntDeleteRow(PGLOBAL g, PTDB tdbp, bool all);
bool CntInfo(PGLOBAL g, PTDB tdbp, PXF info);
int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
bool *incl, key_part_map *kmap);
PGLOBAL CntExit(PGLOBAL g);
/***********************************************************************/
/* Definition of classes XCOLCRT, XIXDEF, XKPDEF, DOXDEF, TDBDOX */
......
......@@ -137,6 +137,7 @@
#include "mycat.h"
#include "myutil.h"
#include "preparse.h"
#include "inihandl.h"
#define PLGXINI "plgcnx.ini" /* Configuration settings file */
#define my_strupr(p) my_caseup_str(default_charset_info, (p));
......@@ -3260,8 +3261,8 @@ static char *encode(PGLOBAL g, char *cnm)
Return 0 if ok
*/
bool add_field(String *sql, const char *field_name, const char *type,
int len, int dec, uint tm, const char *rem)
static bool add_field(String *sql, const char *field_name, const char *type,
int len, int dec, uint tm, const char *rem)
{
bool error= false;
......@@ -3318,7 +3319,6 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
bool ok= false, dbf= false;
TABTYPE ttp= TAB_UNDEF;
MEM_ROOT *mem= thd->mem_root;
CHARSET_INFO *cs;
PQRYRES qrp;
PCOLRES crp;
PGLOBAL g= GetPlug(thd, NULL);
......@@ -3572,7 +3572,6 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
rem= NULL;
typ= len= dec= 0;
tm= NOT_NULL_FLAG;
cs= NULL;
for (crp= qrp->Colresp; crp; crp= crp->Next)
switch (crp->Fld) {
......@@ -3845,6 +3844,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
} // endif tabname
default: /* do nothing */;
} // endswitch ttp
if (type == TAB_XML) {
......
......@@ -29,9 +29,8 @@
//#include <sys/types.h>
//#include <memory.h>
#include "my_global.h"
//#include "osutil.h"
#include "global.h"
#include "inihandl.h"
// The types and variables used locally
//typedef int bool;
......@@ -672,7 +671,7 @@ static BOOL PROFILE_DeleteKey(PROFILESECTION* *section,
*
* Delete all keys from a profile tree.
***********************************************************************/
void PROFILE_DeleteAllKeys(LPCSTR section_name)
static void PROFILE_DeleteAllKeys(LPCSTR section_name)
{
PROFILESECTION* *section= &CurProfile->section;
......@@ -1038,6 +1037,7 @@ static BOOL PROFILE_SetString(LPCSTR section_name, LPCSTR key_name,
* Convenience function that turns a string 'xxx, yyy, zzz' into
* the 'xxx\0 yyy, zzz' and returns a pointer to the 'yyy, zzz'.
***********************************************************************/
#if 0
char *PROFILE_GetStringItem(char* start)
{
char *lpchX, *lpch;
......@@ -1065,6 +1065,7 @@ char *PROFILE_GetStringItem(char* start)
return NULL;
} // end of PROFILE_GetStringItem
#endif
/**********************************************************************
* if allow_section_name_copy is TRUE, allow the copying :
......@@ -1132,7 +1133,7 @@ static int PROFILE_GetPrivateProfileString(LPCSTR section, LPCSTR entry,
* GetPrivateProfileStringA (KERNEL32.@)
***********************************************************************/
int GetPrivateProfileString(LPCSTR section, LPCSTR entry, LPCSTR def_val,
LPSTR buffer, uint len, LPCSTR filename)
LPSTR buffer, DWORD len, LPCSTR filename)
{
return PROFILE_GetPrivateProfileString(section, entry, def_val,
buffer, len, filename, TRUE);
......@@ -1308,7 +1309,8 @@ BOOL WritePrivateProfileSection(LPCSTR section,
* Note that when the buffer is big enough then the return value may be any
* value between 1 and len-1 (or len in Win95), including len-2.
*/
DWORD GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename)
static DWORD
GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename)
{
DWORD ret = 0;
......
#ifndef __INIHANDL_H__
#define __INIHANDL_H__
#if defined(UNIX) || defined(UNIV_LINUX)
#ifdef __cplusplus
extern "C" {
#endif
void PROFILE_Close(LPCSTR filename);
int GetPrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpDefault, // default string
LPTSTR lpReturnedString, // destination buffer
DWORD nSize, // size of destination buffer
LPCTSTR lpFileName // initialization file name
);
uint GetPrivateProfileInt(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
INT nDefault, // return value if key name not found
LPCTSTR lpFileName // initialization file name
);
BOOL WritePrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpString, // string to add
LPCTSTR lpFileName // initialization file
);
int GetPrivateProfileSection(
LPCTSTR lpAppName, // section name
LPTSTR lpReturnedString, // return buffer
DWORD nSize, // size of return buffer
LPCTSTR lpFileName // initialization file name
);
BOOL WritePrivateProfileSection(
LPCTSTR lpAppName, // section name
LPCTSTR lpString, // data
LPCTSTR lpFileName // file name
);
#ifdef __cplusplus
}
#endif
#endif /* defined(UNIX) */
#endif /* __INIHANDL_H__ */
......@@ -13,7 +13,6 @@ typedef struct {
HANDLE CreateFileMap(PGLOBAL, LPCSTR, MEMMAP *, MODE, bool);
bool CloseMemMap(void *memory, size_t dwSize);
my_bool CloseFileHandle(HANDLE h);
#ifdef __cplusplus
}
......
......@@ -36,6 +36,7 @@
//#include "kindex.h"
#include "xtable.h"
#include "tabodbc.h"
#include "odbccat.h"
#include "plgcnx.h" // For DB types
#include "resource.h"
#include "valblk.h"
......@@ -47,9 +48,7 @@
/***********************************************************************/
#pragma comment(lib, "odbc32.lib")
extern "C" HINSTANCE s_hModule; // Saved module handle
#else // !WIN32
extern "C" int GetRcString(int id, char *buf, int bufsize);
#endif // !WIN32
#endif // WIN32
/***********************************************************************/
/* Some macro's (should be defined elsewhere to be more accessible) */
......@@ -176,7 +175,7 @@ int TranslateSQLType(int stp, int prec, int& len)
/***********************************************************************/
/* Allocate the structure used to refer to the result set. */
/***********************************************************************/
CATPARM *AllocCatInfo(PGLOBAL g, CATINFO fid, char *tab, PQRYRES qrp)
static CATPARM *AllocCatInfo(PGLOBAL g, CATINFO fid, char *tab, PQRYRES qrp)
{
size_t i, m, n;
CATPARM *cap;
......@@ -203,7 +202,7 @@ CATPARM *AllocCatInfo(PGLOBAL g, CATINFO fid, char *tab, PQRYRES qrp)
/***********************************************************************/
/* Check for nulls and reset them to Null (?) values. */
/***********************************************************************/
void ResetNullValues(CATPARM *cap)
static void ResetNullValues(CATPARM *cap)
{
int i, n, ncol;
PCOLRES crp;
......
......@@ -142,10 +142,12 @@ my_bool CloseFileHandle(HANDLE h)
return (close(h)) ? TRUE : FALSE;
} /* end of CloseFileHandle */
#if 0
void Sleep(DWORD time)
{
//FIXME: TODO
} /* end of Sleep */
#endif
int GetLastError()
{
......@@ -213,6 +215,7 @@ int _isatty(int fileNo)
return isatty(fileNo);
} /* end of _isatty */
#if 0
/* This function is ridiculous and should be revisited */
DWORD FormatMessage(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId,
DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, ...)
......@@ -227,5 +230,6 @@ DWORD FormatMessage(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId,
strncpy(lpBuffer, buff, nSize);
return min(n, nSize);
} /* end of FormatMessage */
#endif
#endif // UNIX
......@@ -32,44 +32,6 @@ char *_fullpath(char *absPath, const char *relPath, size_t maxLength);
BOOL MessageBeep(uint);
unsigned long _filelength(int fd);
void PROFILE_Close(LPCSTR filename);
int GetPrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpDefault, // default string
LPTSTR lpReturnedString, // destination buffer
int nSize, // size of destination buffer
LPCTSTR lpFileName // initialization file name
);
uint GetPrivateProfileInt(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
INT nDefault, // return value if key name not found
LPCTSTR lpFileName // initialization file name
);
BOOL WritePrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpString, // string to add
LPCTSTR lpFileName // initialization file
);
int GetPrivateProfileSection(
LPCTSTR lpAppName, // section name
LPTSTR lpReturnedString, // return buffer
int nSize, // size of return buffer
LPCTSTR lpFileName // initialization file name
);
BOOL WritePrivateProfileSection(
LPCTSTR lpAppName, // section name
LPCTSTR lpString, // data
LPCTSTR lpFileName // file name
);
PSZ strupr(PSZ s);
PSZ strlwr(PSZ s);
......@@ -90,12 +52,14 @@ typedef __int64 FILEPOS;
#define XSTR(x) ((x)?(x):"<null>")
#ifdef __cplusplus
extern "C" {
#endif
my_bool CloseFileHandle(HANDLE h);
#ifdef __cplusplus
}
#endif
#endif /* __OSUTIL_H__ */
......@@ -67,6 +67,7 @@
#include "xtable.h" // header of TBX, TDB and TDBASE classes
#include "tabcol.h" // header of XTAB and COLUMN classes
#include "valblk.h"
#include "rcmsg.h"
/***********************************************************************/
/* Macro or external routine definition */
......@@ -129,7 +130,6 @@ void CloseXMLFile(PGLOBAL, PFBLOCK, bool);
void CloseXML2File(PGLOBAL, PFBLOCK, bool);
#endif // LIBXML2_SUPPORT
extern "C" int GetRcString(int id, char *buf, int bufsize);
/***********************************************************************/
/* Routines for file IO with error reporting to g->Message */
......@@ -519,6 +519,7 @@ bool PlgSetXdbPath(PGLOBAL g, PSZ dbname, PSZ dbpath,
/* Extract from a path name the required component. */
/* This function assumes there is enough space in the buffer. */
/***********************************************************************/
#if 0
char *ExtractFromPath(PGLOBAL g, char *pBuff, char *FileName, OPVAL op)
{
char *drive = NULL, *direc = NULL, *fname = NULL, *ftype = NULL;
......@@ -539,13 +540,14 @@ char *ExtractFromPath(PGLOBAL g, char *pBuff, char *FileName, OPVAL op)
_splitpath(FileName, drive, direc, fname, ftype);
return pBuff;
} // end of PlgExtractFromPath
#endif
/***********************************************************************/
/* Check the occurence and matching of a pattern against a string. */
/* Because this function is only used for catalog name checking, */
/* it must be case insensitive. */
/***********************************************************************/
bool PlugCheckPattern(PGLOBAL g, LPCSTR string, LPCSTR pat)
static bool PlugCheckPattern(PGLOBAL g, LPCSTR string, LPCSTR pat)
{
if (pat && strlen(pat)) {
// This leaves 512 bytes (MAX_STR / 2) for each components
......
......@@ -107,7 +107,7 @@ ACTIVITY defActivity = { /* Describes activity and language */
#endif // XMSG || NEWMSG
#if defined(UNIX) || defined(UNIV_LINUX)
int GetRcString(int id, char *buf, int bufsize);
#include "rcmsg.h"
#endif // UNIX
/**************************************************************************/
......@@ -494,9 +494,10 @@ void *MakePtr(void *memp, OFFSET offset)
/***********************************************************************/
/* This routine makes an offset from a pointer new format. */
/***********************************************************************/
#if 0
OFFSET MakeOff(void *memp, void *ptr)
{
return ((!ptr) ? 0 : (OFFSET)((char *)ptr - (char *)memp));
} /* end of MakeOff */
#endif
/*--------------------- End of PLUGUTIL program -----------------------*/
......@@ -14,6 +14,7 @@
/***********************************************************************/
#include <stdio.h>
#include "resource.h"
#include "rcmsg.h"
char *GetMsgid(int id)
{
......
#ifndef __RCMSG_H__
#define __RCMSG_H__
#ifdef __cplusplus
extern "C" {
#endif
char *GetMsgid(int id);
int GetRcString(int id, char *buf, int bufsize);
#ifdef __cplusplus
}
#endif
#endif /* __RCMSG_H__ */
......@@ -57,6 +57,7 @@
#include "reldef.h"
#include "tabmysql.h"
#include "valblk.h"
#include "tabutil.h"
#if defined(_CONSOLE)
void PrintResult(PGLOBAL, PSEM, PQRYRES);
......@@ -65,9 +66,6 @@ void PrintResult(PGLOBAL, PSEM, PQRYRES);
extern "C" int trace;
extern MYSQL_PLUGIN_IMPORT uint mysqld_port;
// This function is located in tabutil.cpp
void Remove_tshp(PCATLG cat);
/* -------------- Implementation of the MYSQLDEF class --------------- */
/***********************************************************************/
......
......@@ -75,7 +75,6 @@
#include "sql_string.h"
extern "C" char *GetMsgid(int id);
extern "C" int trace;
/***********************************************************************/
......
......@@ -278,16 +278,16 @@ bool TDBPIVOT::MakePivotColumns(PGLOBAL g)
} else if (Xcolp->InitValue(g))
return true;
// Check and initialize the subtable columns
for (PCOL cp = Columns; cp; cp = cp->GetNext())
if (cp->GetAmType() == TYPE_AM_SRC) {
if (((PSRCCOL)cp)->Init(g))
return TRUE;
} else if (cp->GetAmType() == TYPE_AM_FNC)
if (((PFNCCOL)cp)->InitColumn(g))
return TRUE;
// Check and initialize the subtable columns
for (PCOL cp = Columns; cp; cp = cp->GetNext())
if (cp->GetAmType() == TYPE_AM_SRC) {
if (((PSRCCOL)cp)->Init(g))
return TRUE;
} else if (cp->GetAmType() == TYPE_AM_FNC)
if (((PFNCCOL)cp)->InitColumn(g))
return TRUE;
} // endif isview
return false;
......@@ -347,7 +347,7 @@ bool TDBPIVOT::MakeViewColumns(PGLOBAL g)
if (!(Xcolp = tdbp->MakeFieldColumn(g, Picol)))
return true;
// Check and initialize the subtable columns
// Check and initialize the subtable columns
for (cp = Columns; cp; cp = cp->GetNext())
if (cp->GetAmType() == TYPE_AM_SRC) {
if ((colp = tdbp->MakeFieldColumn(g, cp->GetName()))) {
......@@ -357,9 +357,9 @@ bool TDBPIVOT::MakeViewColumns(PGLOBAL g)
} else
return true;
} else if (cp->GetAmType() == TYPE_AM_FNC)
if (((PFNCCOL)cp)->InitColumn(g))
return TRUE;
} else if (cp->GetAmType() == TYPE_AM_FNC)
if (((PFNCCOL)cp)->InitColumn(g))
return TRUE;
} // endif isview
......
......@@ -41,9 +41,7 @@
#include "tabdos.h"
#include "tabsys.h"
#include "tabmul.h"
#if defined(UNIX)
#include "osutil.h"
#endif // UNIX
#include "inihandl.h"
#define CSZ 36 // Column section name length
#define CDZ 256 // Column definition length
......
......@@ -423,7 +423,7 @@ int TDBPRX::GetMaxSize(PGLOBAL g)
{
if (MaxSize < 0) {
if (InitTable(g))
return NULL;
return 0;
MaxSize = Tdbp->GetMaxSize(g);
} // endif MaxSize
......
......@@ -20,6 +20,8 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
const char *name, bool info);
void Remove_tshp(PCATLG cat);
/* -------------------------- PROXY classes -------------------------- */
/***********************************************************************/
......
......@@ -43,6 +43,7 @@
#include "osutil.h"
#include "global.h"
#include "plgdbsem.h"
#include "connect.h"
#include "user_connect.h"
#include "mycat.h"
......@@ -54,11 +55,6 @@ extern int xtrace;
/****************************************************************************/
PCONNECT user_connect::to_users= NULL;
/****************************************************************************/
/* CONNECT functions called externally. */
/****************************************************************************/
PGLOBAL CntExit(PGLOBAL g);
/* -------------------------- class user_connect -------------------------- */
/****************************************************************************/
......
......@@ -93,7 +93,7 @@ PSZ strlwr(PSZ s);
/* met when returning from TestValue for a given operator. */
/* Bit one is EQ, bit 2 is LT, and bit 3 is GT. */
/***********************************************************************/
BYTE OpBmp(PGLOBAL g, OPVAL opc)
static BYTE OpBmp(PGLOBAL g, OPVAL opc)
{
BYTE bt;
......
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