minor, fix empty values of SQLPrepare in odbc driver

Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ea06950a
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ea06950a
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ea06950a

Branch: refs/heads/master
Commit: ea06950ae7078ad5c20d334cb14b075868f763b1
Parents: 0ab915d
Author: lidongsjtu <[email protected]>
Authored: Sat Jun 17 10:04:57 2017 +0800
Committer: Hongbin Ma <[email protected]>
Committed: Mon Jun 19 13:19:29 2017 +0800

----------------------------------------------------------------------
 odbc/Common/REST.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/ea06950a/odbc/Common/REST.cpp
----------------------------------------------------------------------
diff --git a/odbc/Common/REST.cpp b/odbc/Common/REST.cpp
index 8f0c7bb..94e4344 100644
--- a/odbc/Common/REST.cpp
+++ b/odbc/Common/REST.cpp
@@ -133,8 +133,15 @@ void overwrite ( SQLResponse* res )
             case ODBCTypes::ODBC_Type_Time :
             case ODBCTypes::ODBC_Type_Timestamp :
                 length = ScanForLength ( res -> results, i );
-                meta -> displaySize = length;
-                meta -> precision = length;
+                               if (length > meta -> displaySize) 
+                               {
+                                       meta -> displaySize = length;
+                               }
+
+                               if (length > meta -> precision)
+                               {
+                                       meta -> precision = length;
+                               }
                 break;
 
             default :

Reply via email to