summaryrefslogtreecommitdiff
path: root/storage/connect/plugutil.cpp
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2018-05-07 17:20:39 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2018-05-07 17:20:39 +0300
commite1ffb66449efa44e99d51c2a01c51d1623342d62 (patch)
tree7ce4e13ba915e8a6a0d50cc1adf7beacc8514a36 /storage/connect/plugutil.cpp
parent648cf7176cc95f697abd8b94e860c74768680298 (diff)
parent42fac3241368ad72f8cfef2b8521269e6c173558 (diff)
downloadmariadb-git-e1ffb66449efa44e99d51c2a01c51d1623342d62.tar.gz
Merge tag 'mariadb-10.0.35' into 10.0-galera
Diffstat (limited to 'storage/connect/plugutil.cpp')
-rw-r--r--storage/connect/plugutil.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/storage/connect/plugutil.cpp b/storage/connect/plugutil.cpp
index e9ba1682e69..887527e38ab 100644
--- a/storage/connect/plugutil.cpp
+++ b/storage/connect/plugutil.cpp
@@ -136,7 +136,7 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize)
{
PGLOBAL g;
- if (trace > 1)
+ if (trace(2))
htrc("PlugInit: Language='%s'\n",
((!Language) ? "Null" : (char*)Language));
@@ -162,7 +162,7 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize)
/*******************************************************************/
if (worksize && AllocSarea(g, worksize)) {
char errmsg[MAX_STR];
- sprintf(errmsg, MSG(WORK_AREA), g->Message);
+ snprintf(errmsg, sizeof(errmsg) - 1, MSG(WORK_AREA), g->Message);
strcpy(g->Message, errmsg);
} // endif Sarea
@@ -205,7 +205,7 @@ LPSTR PlugRemoveType(LPSTR pBuff, LPCSTR FileName)
_splitpath(FileName, drive, direc, fname, ftype);
- if (trace > 1) {
+ if (trace(2)) {
htrc("after _splitpath: FileName=%s\n", FileName);
htrc("drive=%s dir=%s fname=%s ext=%s\n",
SVP(drive), direc, fname, ftype);
@@ -213,7 +213,7 @@ LPSTR PlugRemoveType(LPSTR pBuff, LPCSTR FileName)
_makepath(pBuff, drive, direc, fname, "");
- if (trace > 1)
+ if (trace(2))
htrc("buff='%s'\n", pBuff);
return pBuff;
@@ -246,7 +246,7 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath)
char *drive = NULL, *defdrv = NULL;
#endif
- if (trace > 1)
+ if (trace(2))
htrc("prefix=%s fn=%s path=%s\n", prefix, FileName, defpath);
if (!strncmp(FileName, "//", 2) || !strncmp(FileName, "\\\\", 2)) {
@@ -263,7 +263,7 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath)
#if !defined(__WIN__)
if (*FileName == '~') {
if (_fullpath(pBuff, FileName, _MAX_PATH)) {
- if (trace > 1)
+ if (trace(2))
htrc("pbuff='%s'\n", pBuff);
return pBuff;
@@ -298,7 +298,7 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath)
_splitpath(tmpdir, defdrv, defdir, NULL, NULL);
- if (trace > 1) {
+ if (trace(2)) {
htrc("after _splitpath: FileName=%s\n", FileName);
#if defined(__WIN__)
htrc("drive=%s dir=%s fname=%s ext=%s\n", drive, direc, fname, ftype);
@@ -325,11 +325,11 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath)
_makepath(newname, drive, direc, fname, ftype);
- if (trace > 1)
+ if (trace(2))
htrc("newname='%s'\n", newname);
if (_fullpath(pBuff, newname, _MAX_PATH)) {
- if (trace > 1)
+ if (trace(2))
htrc("pbuff='%s'\n", pBuff);
return pBuff;
@@ -470,7 +470,7 @@ bool AllocSarea(PGLOBAL g, uint size)
#if defined(DEVELOPMENT)
if (true) {
#else
- if (trace) {
+ if (trace(8)) {
#endif
if (g->Sarea)
htrc("Work area of %u allocated at %p\n", size, g->Sarea);
@@ -498,7 +498,7 @@ void FreeSarea(PGLOBAL g)
#if defined(DEVELOPMENT)
if (true)
#else
- if (trace)
+ if (trace(8))
#endif
htrc("Freeing Sarea at %p size = %d\n", g->Sarea, g->Sarea_Size);
@@ -545,7 +545,7 @@ 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 (trace > 3)
+ if (trace(16))
htrc("SubAlloc in %p size=%d used=%d free=%d\n",
memp, size, pph->To_Free, pph->FreeBlk);
@@ -556,10 +556,10 @@ 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 (trace)
+ if (trace(1))
htrc("PlugSubAlloc: %s\n", g->Message);
- throw 1234;
+ throw 1234;
} /* endif size OS32 code */
/*********************************************************************/
@@ -569,7 +569,7 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
pph->To_Free += (OFFSET)size; /* New offset of pool free block */
pph->FreeBlk -= (uint)size; /* New size of pool free block */
- if (trace > 3)
+ if (trace(16))
htrc("Done memp=%p used=%d free=%d\n",
memp, pph->To_Free, pph->FreeBlk);