summaryrefslogtreecommitdiff
path: root/storage/connect/tabfmt.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-10-09 17:23:37 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2014-10-09 17:23:37 +0200
commit5821b8eb022f23a7384a18b5f580de8b0644d5bb (patch)
treeaffcde99cf6d0386baba439edcdc3da36be218f9 /storage/connect/tabfmt.cpp
parentf80e4ed941ab28f3ee150d98ea6a411e51a8396f (diff)
downloadmariadb-git-5821b8eb022f23a7384a18b5f580de8b0644d5bb.tar.gz
- in CheckCond change strcat to strncat to avoid the case of non zero
terminated string. modified: storage/connect/ha_connect.cc - The Accept and Header Boolean variables were wrongly retrieved using GetIntInfo instead of GetBoolInfo causing some setting to ignored. modified: storage/connect/tabdos.cpp storage/connect/tabdos.h storage/connect/tabfmt.cpp - Fix date truncated because their Value class was not using their field length. modified: storage/connect/ha_connect.cc
Diffstat (limited to 'storage/connect/tabfmt.cpp')
-rw-r--r--storage/connect/tabfmt.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp
index c1119c57065..2efdd0d661b 100644
--- a/storage/connect/tabfmt.cpp
+++ b/storage/connect/tabfmt.cpp
@@ -390,8 +390,8 @@ PQRYRES CSVColumns(PGLOBAL g, char *dp, const char *fn, char sep,
/***********************************************************************/
CSVDEF::CSVDEF(void)
{
- Fmtd = Accept = Header = false;
- Maxerr = 0;
+ Fmtd = Header = false;
+//Maxerr = 0;
Quoted = -1;
Sep = ',';
Qot = '\0';
@@ -428,9 +428,13 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
Qot = '"';
Fmtd = (!Sep || (am && (*am == 'F' || *am == 'f')));
- Header = (GetIntCatInfo("Header", 0) != 0);
+ Header = GetBoolCatInfo("Header", false);
Maxerr = GetIntCatInfo("Maxerr", 0);
- Accept = (GetIntCatInfo("Accept", 0) != 0);
+ Accept = GetBoolCatInfo("Accept", false);
+
+ if (Accept && Maxerr == 0)
+ Maxerr = INT_MAX32; // Accept all bad lines
+
return false;
} // end of DefineAM