diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2014-04-19 11:11:30 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2014-04-19 11:11:30 +0200 |
commit | 812520315318e358d2d9daf9ca709578af1efe40 (patch) | |
tree | d5dff4f4c06aa4554707a6ad717dc73a576313d0 /storage/connect/plugutil.c | |
parent | cc7a08c9410335237e6c19f84d9c5d08938b8e8a (diff) | |
parent | b43e82dce63c07abe8de740b3bf18a33600ccac0 (diff) | |
download | mariadb-git-812520315318e358d2d9daf9ca709578af1efe40.tar.gz |
- Commit merged files
modified:
storage/connect/CMakeLists.txt
storage/connect/connect.h
storage/connect/global.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/myconn.cpp
storage/connect/myconn.h
storage/connect/mysql-test/connect/r/pivot.result
storage/connect/mysql-test/connect/suite.pm
storage/connect/mysql-test/connect/t/pivot.test
storage/connect/myutil.cpp
storage/connect/osutil.c
storage/connect/plgdbsem.h
storage/connect/plugutil.c
storage/connect/tabmysql.cpp
storage/connect/tabpivot.cpp
storage/connect/tabutil.cpp
storage/connect/user_connect.cc
storage/connect/valblk.cpp
storage/connect/valblk.h
storage/connect/value.cpp
storage/connect/value.h
storage/connect/xindex.cpp
storage/connect/xindex.h
Diffstat (limited to 'storage/connect/plugutil.c')
-rw-r--r-- | storage/connect/plugutil.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/storage/connect/plugutil.c b/storage/connect/plugutil.c index 627861c1c36..c3b77544983 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); @@ -256,7 +251,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]; @@ -478,10 +486,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"; @@ -490,9 +497,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 */ @@ -503,10 +509,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 */ |