summaryrefslogtreecommitdiff
path: root/storage/connect/reldef.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2015-05-15 11:56:29 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2015-05-15 11:56:29 +0200
commitb9c910909c3e04ceab8d0d514ba6213015787c5a (patch)
treefb8ee71de177393751c22f07efb5ccdb9ebdfa04 /storage/connect/reldef.cpp
parente6b60ee5af76a574a9c87733143e608a2bc648bb (diff)
downloadmariadb-git-b9c910909c3e04ceab8d0d514ba6213015787c5a.tar.gz
Fix a bug in BIN buffer initialisation (in FIXFAM::AllocateBuffer)
modified: storage/connect/filamfix.cpp Second version of BIN table new field format (1st one was buggy) modified: storage/connect/tabfix.cpp modified: storage/connect/tabfix.h Make bin.test not to fail in big-endian machines modified: storage/connect/mysql-test/connect/r/bin.result modified: storage/connect/mysql-test/connect/t/bin.test Fix a bug causing wrong default offset to be generated when virtual or special columns were placed beetween standard columns. Also calculate the good offset for BIN columns with new field format. modified: storage/connect/reldef.cpp
Diffstat (limited to 'storage/connect/reldef.cpp')
-rw-r--r--storage/connect/reldef.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp
index d0483b5075d..e3cea256227 100644
--- a/storage/connect/reldef.cpp
+++ b/storage/connect/reldef.cpp
@@ -322,7 +322,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g)
if ((nof= cdp->Define(g, NULL, pcf, poff)) < 0)
return -1; // Error, probably unhandled type
- else if (nof)
+ else
loff= cdp->GetOffset();
switch (tc) {
@@ -334,15 +334,23 @@ int TABDEF::GetColCatInfo(PGLOBAL g)
// Field width is the internal representation width
// that can also depend on the column format
switch (cdp->Fmt ? *cdp->Fmt : 'X') {
+ case 'X': nof= cdp->Clen;
case 'C': break;
case 'R':
case 'F':
- case 'L':
+// case 'L':
case 'I': nof= 4; break;
case 'D': nof= 8; break;
case 'S': nof= 2; break;
case 'T': nof= 1; break;
- default: nof= cdp->Clen;
+ default: /* New format */
+ for (nof= 0, i= 0; cdp->Fmt[i]; i++)
+ if (isdigit(cdp->Fmt[i]))
+ nof= (nof * 10 + (cdp->Fmt[i] - 48));
+
+ if (!nof)
+ nof= cdp->Clen;
+
} // endswitch Fmt
default:
@@ -745,7 +753,8 @@ int COLDEF::Define(PGLOBAL g, void *, PCOLINFO cfp, int poff)
if (cfp->Datefmt)
Decode = (PSZ)PlugDup(g, cfp->Datefmt);
- } // endif special
+ } else
+ Offset = poff;
if (cfp->Fieldfmt)
Fmt = (PSZ)PlugDup(g, cfp->Fieldfmt);