diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2014-10-12 12:05:05 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2014-10-12 12:05:05 +0200 |
commit | 50fc9b3b1936662f657dedd124244d373ee8b2be (patch) | |
tree | 0bb920f36d6bd194db6b430fb90c4b39f3f9e283 /storage/connect/plgdbutl.cpp | |
parent | 7531f22a68ba8e0e25ae95366fdfe094daa68565 (diff) | |
download | mariadb-git-50fc9b3b1936662f657dedd124244d373ee8b2be.tar.gz |
- Fix null handling for date columns (see MDEV-6744)
modified:
storage/connect/ha_connect.cc
storage/connect/plgdbutl.cpp
storage/connect/value.cpp
storage/connect/value.h
Diffstat (limited to 'storage/connect/plgdbutl.cpp')
-rw-r--r-- | storage/connect/plgdbutl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index c5b66e8f5e6..755aeb21105 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -730,6 +730,7 @@ int ExtractDate(char *dts, PDTP pdp, int defy, int val[6]) char *fmt, c, d, e, W[8][12]; int i, k, m, numval; int n, y = 30; + bool b = true; // true for null dates if (pdp) fmt = pdp->InFmt; @@ -763,7 +764,8 @@ int ExtractDate(char *dts, PDTP pdp, int defy, int val[6]) m = pdp->Num; for (i = 0; i < m; i++) { - n = *(int*)W[i]; + if ((n = *(int*)W[i])) + b = false; switch (k = pdp->Index[i]) { case 0: @@ -822,7 +824,7 @@ int ExtractDate(char *dts, PDTP pdp, int defy, int val[6]) htrc("numval=%d val=(%d,%d,%d,%d,%d,%d)\n", numval, val[0], val[1], val[2], val[3], val[4], val[5]); - return numval; + return (b) ? 0 : numval; } // end of ExtractDate /***********************************************************************/ |