From b1ae8341655e7af388fc203392151890478ae086 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Mon, 31 Mar 2014 01:20:35 +0200 Subject: - Fix using ~ in file name on Linux modified: storage/connect/osutil.c storage/connect/plugutil.c - Fix using fmt uninitialized in Tabcolumns modified: storage/connect/tabutil.cpp - Suppress gcc warning modified: storage/connect/ha_connect.cc --- storage/connect/plugutil.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'storage/connect/plugutil.c') diff --git a/storage/connect/plugutil.c b/storage/connect/plugutil.c index 489b0555a79..cc06a3da96a 100644 --- a/storage/connect/plugutil.c +++ b/storage/connect/plugutil.c @@ -255,7 +255,20 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath) strcpy(pBuff, FileName); // FileName includes absolute path return pBuff; } // endif - + +#if !defined(WIN32) + if (*FileName == '~') { + if (_fullpath(pBuff, FileName, _MAX_PATH)) { + if (trace > 1) + htrc("pbuff='%s'\n", pBuff); + + return pBuff; + } else + return FileName; // Error, return unchanged name + + } // endif FileName +#endif // !WIN32 + if (strcmp(prefix, ".") && !PlugIsAbsolutePath(defpath)) { char tmp[_MAX_PATH]; -- cgit v1.2.1 From b43e82dce63c07abe8de740b3bf18a33600ccac0 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 5 Apr 2014 19:26:32 +0200 Subject: - Make memory allocation of VALBLK's more flexible (can be allocated normally when too big to be suballocated) to handle big results. modified: storage/connect/valblk.cpp storage/connect/valblk.h - Add system variable connect_work_size giving the size of the CONNECT work area used for memory allocation. modified: storage/connect/ha_connect.cc storage/connect/plugutil.c storage/connect/user_connect.cc --- storage/connect/plugutil.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'storage/connect/plugutil.c') diff --git a/storage/connect/plugutil.c b/storage/connect/plugutil.c index cc06a3da96a..201aa5a4371 100644 --- a/storage/connect/plugutil.c +++ b/storage/connect/plugutil.c @@ -115,11 +115,6 @@ void htrc(char const *fmt, ...) va_list ap; va_start (ap, fmt); -//if (trace == 0 || (trace == 1 && !debug) || !fmt) { -// printf("In %s wrong trace=%d debug=%p fmt=%p\n", -// __FILE__, trace, debug, fmt); -// trace = 0; -// } // endif trace //if (trace == 1) // vfprintf(debug, fmt, ap); @@ -490,10 +485,9 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size) size = ((size + 7) / 8) * 8; /* Round up size to multiple of 8 */ pph = (PPOOLHEADER)memp; -#if defined(DEBUG2) || defined(DEBUG3) - htrc("SubAlloc in %p size=%d used=%d free=%d\n", - memp, size, pph->To_Free, pph->FreeBlk); -#endif + if (trace > 2) + htrc("SubAlloc in %p size=%d used=%d free=%d\n", + memp, size, pph->To_Free, pph->FreeBlk); if ((uint)size > pph->FreeBlk) { /* Not enough memory left in pool */ char *pname = "Work"; @@ -502,9 +496,8 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size) "Not enough memory in %s area for request of %u (used=%d free=%d)", pname, (uint) size, pph->To_Free, pph->FreeBlk); -#if defined(DEBUG2) || defined(DEBUG3) - htrc("%s\n", g->Message); -#endif + if (trace) + htrc("PlugSubAlloc: %s\n", g->Message); longjmp(g->jumper[g->jump_level], 1); } /* endif size OS32 code */ @@ -515,10 +508,11 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size) memp = MakePtr(memp, pph->To_Free); /* Points to suballocated block */ pph->To_Free += size; /* New offset of pool free block */ pph->FreeBlk -= size; /* New size of pool free block */ -#if defined(DEBUG2) || defined(DEBUG3) - htrc("Done memp=%p used=%d free=%d\n", - memp, pph->To_Free, pph->FreeBlk); -#endif + + if (trace > 2) + htrc("Done memp=%p used=%d free=%d\n", + memp, pph->To_Free, pph->FreeBlk); + return (memp); } /* end of PlugSubAlloc */ -- cgit v1.2.1