From adc23d2d872ee2e09770e37a38ef6cfa69ba55aa Mon Sep 17 00:00:00 2001 From: Dmitry Yemanov Date: Sat, 20 Jul 2019 11:49:22 +0300 Subject: [PATCH] Fixed CORE-6104: incorrect erroris thrown when an embedded user does not have SELECT permissions --- src/gpre/c_cxx.cpp | 9 ++++++++- src/gpre/languages/pas.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gpre/c_cxx.cpp b/src/gpre/c_cxx.cpp index a927d9bede..6e879484d8 100644 --- a/src/gpre/c_cxx.cpp +++ b/src/gpre/c_cxx.cpp @@ -1215,9 +1215,16 @@ static void gen_compile( const act* action, int column) PATTERN_expand((USHORT) column, pattern2, &args); + column += INDENT; + begin(column); + args.pat_condition = !(request->req_flags & REQ_exp_hand); args.pat_value1 = request->req_length; - PATTERN_expand((USHORT) (column + INDENT), pattern1, &args); + PATTERN_expand((USHORT) column, pattern1, &args); + + set_sqlcode(action, column); + endp(column); + column -= INDENT; // If blobs are present, zero out all of the blob handles. After this // point, the handles are the user's responsibility diff --git a/src/gpre/languages/pas.cpp b/src/gpre/languages/pas.cpp index 18b389e9a5..30d8ca9762 100644 --- a/src/gpre/languages/pas.cpp +++ b/src/gpre/languages/pas.cpp @@ -998,12 +998,19 @@ static void gen_compile( const act* action, int column) else printa(column, "if %s = nil then", request->req_handle); - align(column + INDENT); + column += INDENT; + begin(column); + + align(column); fprintf(gpreGlob.out_file, "GDS__COMPILE_REQUEST%s (%s, %s, %s, %d, gds__%d);\n", (request->req_flags & REQ_exp_hand) ? "" : "2", status_vector(action), symbol->sym_string, request->req_handle, request->req_length, request->req_ident); + set_sqlcode(action, column); + ends(column); + column -= INDENT; + // If blobs are present, zero out all of the blob handles. After this // point, the handles are the user's responsibility