summaryrefslogtreecommitdiff
path: root/storage/connect
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-06-15 17:01:58 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2014-06-15 17:01:58 +0200
commit70160c22f0e622c59030ec7568026b94fe63409f (patch)
tree29d0c2a7e343a63aec6802fc8abfc05fa5c461a4 /storage/connect
parentc1973c80d40a8a56b6c08e71422d37ccc87cb8f0 (diff)
downloadmariadb-git-70160c22f0e622c59030ec7568026b94fe63409f.tar.gz
- Fix calculating the number of fields of CSV and FMT tables. Could be wrong
on UPDATE and INSERT if the table had special columns. modified: storage/connect/tabfmt.cpp
Diffstat (limited to 'storage/connect')
-rw-r--r--storage/connect/tabfmt.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp
index 7665395167d..acba9075959 100644
--- a/storage/connect/tabfmt.cpp
+++ b/storage/connect/tabfmt.cpp
@@ -649,7 +649,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
} else
for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext())
- if (!cdp->IsVirtual())
+ if (!cdp->IsSpecial() && !cdp->IsVirtual())
Fields++;
Offset = (int*)PlugSubAlloc(g, NULL, sizeof(int) * Fields);
@@ -686,7 +686,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
} else // MODE_UPDATE
for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext())
- if (!cdp->IsVirtual()) {
+ if (!cdp->IsSpecial() && !cdp->IsVirtual()) {
i = cdp->GetOffset() - 1;
len = cdp->GetLength();
Field[i] = (PSZ)PlugSubAlloc(g, NULL, len + 1);
@@ -1118,7 +1118,8 @@ bool TDBFMT::OpenDB(PGLOBAL g)
// Get the column formats
for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext())
- if (!cdp->IsVirtual() && (i = cdp->GetOffset() - 1) < Fields) {
+ if (!cdp->IsSpecial() && !cdp->IsVirtual()
+ && (i = cdp->GetOffset() - 1) < Fields) {
if (!(pfm = cdp->GetFmt())) {
sprintf(g->Message, MSG(NO_FLD_FORMAT), i + 1, Name);
return true;