You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2017/04/27 03:43:41 UTC

kylin git commit: KYLIN-2569 Fix long query issue, avoid ODBC log writing out of buffer

Repository: kylin
Updated Branches:
  refs/heads/master 85b4b2c7c -> 043dd5cd5


KYLIN-2569 Fix long query issue, avoid ODBC log writing out of buffer

Signed-off-by: lidongsjtu <li...@apache.org>


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

Branch: refs/heads/master
Commit: 043dd5cd551735c5f9d8036a987eab579c4ee7b3
Parents: 85b4b2c
Author: Yifan Zhang <ev...@gmail.com>
Authored: Thu Apr 27 11:17:35 2017 +0800
Committer: lidongsjtu <li...@apache.org>
Committed: Thu Apr 27 11:43:19 2017 +0800

----------------------------------------------------------------------
 odbc/Driver/KO_DIAG.CPP  | 11 ++++++++++-
 odbc/Driver/KO_FETCH.CPP |  2 ++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/043dd5cd/odbc/Driver/KO_DIAG.CPP
----------------------------------------------------------------------
diff --git a/odbc/Driver/KO_DIAG.CPP b/odbc/Driver/KO_DIAG.CPP
index e296335..ac313e7 100644
--- a/odbc/Driver/KO_DIAG.CPP
+++ b/odbc/Driver/KO_DIAG.CPP
@@ -1126,8 +1126,17 @@ void _ODBCLogMsg ( LogLevel level, const char* pMsgArgs, ... )
         {
             // convert to full msg including parsed params
             va_start ( args, pMsgArgs );
-            vsprintf ( s, pMsgArgs, args );
+            vsnprintf ( s, 4095, pMsgArgs, args );
             va_end ( args );
+            // Omit out of buffer message
+            if ( strlen ( s ) >= 4095 )
+            {
+                s[4092] = '.';
+                s[4093] = '.';
+                s[4094] = '.';
+                s[4095] = 0;
+            }
+
         }
 
         else

http://git-wip-us.apache.org/repos/asf/kylin/blob/043dd5cd/odbc/Driver/KO_FETCH.CPP
----------------------------------------------------------------------
diff --git a/odbc/Driver/KO_FETCH.CPP b/odbc/Driver/KO_FETCH.CPP
index 07780cf..a7ef57a 100644
--- a/odbc/Driver/KO_FETCH.CPP
+++ b/odbc/Driver/KO_FETCH.CPP
@@ -146,6 +146,8 @@ RETCODE _SQLColAttribute_basic ( SQLHSTMT pStmt,
         return SQL_ERROR;
     }
 
+    __ODBCLOG ( _ODBCLogMsg ( LogLevel_DEBUG, "SQLColAttribute_basic called, ColNum: %d, FldID: %d", pColNum, pFldID ) );
+
     // get value from descriptor as per field type
     switch ( pFldID )
     {