[GitHub] trafodion pull request #1671: [TRAFODION-3710] odb don't report error messag...

2018-07-31 Thread SuJinpei
GitHub user SuJinpei opened a pull request:

https://github.com/apache/trafodion/pull/1671

[TRAFODION-3710] odb don't report error message.

**root cause:** SQLGetDiagRec expected an error message buffer length 
parameter which type is signed short, but odb defined a macro LINE_CHUNK as 
51200 and this macro will be pass to SQLGetDiagRec as error message buffer 
length parameter,  51200 is a negative value for signed short, so no error 
message returned.
**solution:** define a new macro ERR_MSG_LEN with a small value for 
SQLGetDiagRec function.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/SuJinpei/incubator-trafodion traf-3710

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/trafodion/pull/1671.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1671


commit ad4d844be6bf85ad264beb8b1f9070df1cfde102
Author: SuJinpei <873118042@...>
Date:   2018-07-31T08:00:34Z

TRAFODION-3710




---


[GitHub] trafodion pull request #1671: [TRAFODION-3710] odb don't report error messag...

2018-07-31 Thread xiaozhongwang
Github user xiaozhongwang commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1671#discussion_r206444234
  
--- Diff: core/conn/odb/src/odb.c ---
@@ -40,6 +40,7 @@ char *odbauth = "Trafodion Dev 
";
 #define MAX_ARGS11  /* Max arguments for interactive mode */
 #define ARG_LENGTH  128 /* Max argument length in interactive mode 
*/
 #define LINE_CHUNK  51200   /* size of memory chunks allocated to 
store lines */
+#define ERR_MSG_LEN 512 /* size of error message buffer */
--- End diff --

The value of short is [32768, 32767], why do you define it so small?
I am worried that this value is too small and will cause a buffer overflow.


---


[GitHub] trafodion pull request #1671: [TRAFODION-3710] odb don't report error messag...

2018-07-31 Thread SuJinpei
Github user SuJinpei commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1671#discussion_r206455613
  
--- Diff: core/conn/odb/src/odb.c ---
@@ -40,6 +40,7 @@ char *odbauth = "Trafodion Dev 
";
 #define MAX_ARGS11  /* Max arguments for interactive mode */
 #define ARG_LENGTH  128 /* Max argument length in interactive mode 
*/
 #define LINE_CHUNK  51200   /* size of memory chunks allocated to 
store lines */
+#define ERR_MSG_LEN 512 /* size of error message buffer */
--- End diff --

This value came from the driver implementer @Weixin-Xu 's advise. By the 
way, the small buffer length won't cause the buffer overflow issue, because the 
driver will protect this by truncating the error message.


---


[GitHub] trafodion pull request #1671: [TRAFODION-3710] odb don't report error messag...

2018-07-31 Thread xiaozhongwang
Github user xiaozhongwang commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1671#discussion_r206460404
  
--- Diff: core/conn/odb/src/odb.c ---
@@ -40,6 +40,7 @@ char *odbauth = "Trafodion Dev 
";
 #define MAX_ARGS11  /* Max arguments for interactive mode */
 #define ARG_LENGTH  128 /* Max argument length in interactive mode 
*/
 #define LINE_CHUNK  51200   /* size of memory chunks allocated to 
store lines */
+#define ERR_MSG_LEN 512 /* size of error message buffer */
--- End diff --

+1 if you have think about this.


---


[GitHub] trafodion pull request #1671: [TRAFODION-3710] odb don't report error messag...

2018-08-02 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/trafodion/pull/1671


---