summaryrefslogtreecommitdiff
path: root/storage/connect/colblk.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-12-03 22:59:40 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2013-12-03 22:59:40 +0100
commitee2f04450b45515c507e4511c26e48e2b846aa73 (patch)
tree2c1d9bec56e1268c8c41629ae1dd4f1d8253f471 /storage/connect/colblk.cpp
parentd240a0418cf6d59fba711f0677f164d9ee881b7e (diff)
downloadmariadb-git-ee2f04450b45515c507e4511c26e48e2b846aa73.tar.gz
- Add support for unsigned numeric types
added: storage/connect/mysql-test/connect/r/unsigned.result storage/connect/mysql-test/connect/t/unsigned.test modified: storage/connect/colblk.cpp storage/connect/colblk.h storage/connect/connect.cc storage/connect/ha_connect.cc storage/connect/myconn.cpp storage/connect/mysql-test/connect/r/mysql_discovery.result storage/connect/mysql-test/connect/r/xml.result storage/connect/myutil.cpp storage/connect/myutil.h storage/connect/plgdbsem.h storage/connect/tabdos.cpp storage/connect/tabfix.cpp storage/connect/tabmysql.cpp storage/connect/tabutil.cpp storage/connect/valblk.cpp storage/connect/valblk.h storage/connect/value.cpp storage/connect/value.h storage/connect/xobject.cpp storage/connect/xobject.h
Diffstat (limited to 'storage/connect/colblk.cpp')
-rw-r--r--storage/connect/colblk.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/storage/connect/colblk.cpp b/storage/connect/colblk.cpp
index 2953fa29493..6b2921e1737 100644
--- a/storage/connect/colblk.cpp
+++ b/storage/connect/colblk.cpp
@@ -41,6 +41,7 @@ COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i)
Buf_Type = cdp->Buf_Type;
ColUse |= cdp->Flags; // Used by CONNECT
Nullable = !!(cdp->Flags & U_NULLS);
+ Unsigned = !!(cdp->Flags & U_UNSIGNED);
} else {
Name = NULL;
memset(&Format, 0, sizeof(FORMAT));
@@ -48,6 +49,7 @@ COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i)
Long = 0;
Buf_Type = TYPE_ERROR;
Nullable = false;
+ Unsigned = false;
} // endif cdp
To_Tdb = tdbp;
@@ -171,9 +173,12 @@ bool COLBLK::InitValue(PGLOBAL g)
if (Value)
return false; // Already done
+ // Unsigned can be set only for valid value types
+ int prec = (Unsigned) ? 1 : GetPrecision();
+
// Allocate a Value object
if (!(Value = AllocateValue(g, Buf_Type, Format.Length,
- GetPrecision(), GetDomain())))
+ prec, GetDomain())))
return true;
AddStatus(BUF_READY);