summaryrefslogtreecommitdiff
path: root/storage/connect/tabfmt.cpp
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-04-21 20:45:38 +0200
committerSergei Golubchik <sergii@pisem.net>2014-04-21 20:45:38 +0200
commit046ae9f5c668056288f4c314310a87fbcb3221d5 (patch)
treece58d06c31a735054ce2c8446d5e0c9da5bd97e5 /storage/connect/tabfmt.cpp
parent7216afbc78f7a4b4d517e04364fcc23255d4dfeb (diff)
parent6075c8246771dd14bd52a511ee665b8995e3f33f (diff)
downloadmariadb-git-046ae9f5c668056288f4c314310a87fbcb3221d5.tar.gz
10.0-connect merge
Diffstat (limited to 'storage/connect/tabfmt.cpp')
-rw-r--r--storage/connect/tabfmt.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp
index 7155c93a363..b15d5c201c9 100644
--- a/storage/connect/tabfmt.cpp
+++ b/storage/connect/tabfmt.cpp
@@ -118,7 +118,7 @@ PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q,
} // endif fn
imax = hmax = nerr = 0;
- mxr = max(0, mxr);
+ mxr = MY_MAX(0, mxr);
for (i = 0; i < MAXCOL; i++) {
colname[i] = NULL;
@@ -190,7 +190,7 @@ PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q,
imax = hmax = i;
for (i = 0; i < hmax; i++)
- length[0] = max(length[0], strlen(colname[i]));
+ length[0] = MY_MAX(length[0], strlen(colname[i]));
} // endif hdr
@@ -228,11 +228,11 @@ PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q,
} // endif i
if (n) {
- len[i] = max(len[i], n);
+ len[i] = MY_MAX(len[i], n);
type = (digit || (dec && n == 1)) ? TYPE_STRING
: (dec) ? TYPE_DOUBLE : TYPE_INT;
- typ[i] = min(type, typ[i]);
- prc[i] = max((typ[i] == TYPE_DOUBLE) ? (dec - 1) : 0, prc[i]);
+ typ[i] = MY_MIN(type, typ[i]);
+ prc[i] = MY_MAX((typ[i] == TYPE_DOUBLE) ? (dec - 1) : 0, prc[i]);
} // endif n
i++;
@@ -308,14 +308,14 @@ PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q,
goto skip;
if (n) {
- len[i] = max(len[i], n);
+ len[i] = MY_MAX(len[i], n);
type = (digit || n == 0 || (dec && n == 1)) ? TYPE_STRING
: (dec) ? TYPE_DOUBLE : TYPE_INT;
- typ[i] = min(type, typ[i]);
- prc[i] = max((typ[i] == TYPE_DOUBLE) ? (dec - 1) : 0, prc[i]);
+ typ[i] = MY_MIN(type, typ[i]);
+ prc[i] = MY_MAX((typ[i] == TYPE_DOUBLE) ? (dec - 1) : 0, prc[i]);
} // endif n
- imax = max(imax, i+1);
+ imax = MY_MAX(imax, i+1);
skip: ; // Skip erroneous line
} // endfor num_read
@@ -415,10 +415,10 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
if (DOSDEF::DefineAM(g, "CSV", poff))
return true;
- Cat->GetCharCatInfo("Separator", ",", buf, sizeof(buf));
+ GetCharCatInfo("Separator", ",", buf, sizeof(buf));
Sep = (strlen(buf) == 2 && buf[0] == '\\' && buf[1] == 't') ? '\t' : *buf;
- Quoted = Cat->GetIntCatInfo("Quoted", -1);
- Cat->GetCharCatInfo("Qchar", "", buf, sizeof(buf));
+ Quoted = GetIntCatInfo("Quoted", -1);
+ GetCharCatInfo("Qchar", "", buf, sizeof(buf));
Qot = *buf;
if (Qot && Quoted < 0)
@@ -427,9 +427,9 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
Qot = '"';
Fmtd = (!Sep || (am && (*am == 'F' || *am == 'f')));
- Header = (Cat->GetIntCatInfo("Header", 0) != 0);
- Maxerr = Cat->GetIntCatInfo("Maxerr", 0);
- Accept = (Cat->GetIntCatInfo("Accept", 0) != 0);
+ Header = (GetIntCatInfo("Header", 0) != 0);
+ Maxerr = GetIntCatInfo("Maxerr", 0);
+ Accept = (GetIntCatInfo("Accept", 0) != 0);
return false;
} // end of DefineAM
@@ -599,7 +599,7 @@ int TDBCSV::EstimatedLength(PGLOBAL g)
for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next)
if (!colp->IsSpecial()) // Not a pseudo column
- Fields = max(Fields, (int)colp->Fldnum);
+ Fields = MY_MAX(Fields, (int)colp->Fldnum);
if (Columns)
Fields++; // Fldnum was 0 based
@@ -642,7 +642,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
if (Mode != MODE_UPDATE && Mode != MODE_INSERT) {
for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next)
if (!colp->IsSpecial()) // Not a pseudo column
- Fields = max(Fields, (int)colp->Fldnum);
+ Fields = MY_MAX(Fields, (int)colp->Fldnum);
if (Columns)
Fields++; // Fldnum was 0 based
@@ -1102,7 +1102,7 @@ bool TDBFMT::OpenDB(PGLOBAL g)
for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next)
if (!colp->IsSpecial()) // Not a pseudo column
- Fields = max(Fields, (int)colp->Fldnum);
+ Fields = MY_MAX(Fields, (int)colp->Fldnum);
if (Columns)
Fields++; // Fldnum was 0 based