Skip to content

Commit

Permalink
Fixed CORE-4870 - SET COUNT ON: issuing UPDATE on view which was crea…
Browse files Browse the repository at this point in the history
…ted WITH CHECK OPTION produces wrong number of affected rows (doubled ?).
  • Loading branch information
asfernandes committed Aug 25, 2015
1 parent b543944 commit 35397f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dsql/StmtNodes.cpp
Expand Up @@ -6177,7 +6177,7 @@ const StmtNode* ModifyNode::modify(thread_db* tdbb, jrd_req* request, WhichTrigg

if (relation == request->req_top_view_modify)
{
if (whichTrig == ALL_TRIGS || whichTrig == POST_TRIG)
if (!subMod && (whichTrig == ALL_TRIGS || whichTrig == POST_TRIG))
{
request->req_records_updated++;
request->req_records_affected.bumpModified(true);
Expand Down Expand Up @@ -6625,6 +6625,7 @@ string StoreNode::internalPrint(NodePrinter& printer) const
NODE_PRINT(printer, dsqlRse);
NODE_PRINT(printer, statement);
NODE_PRINT(printer, statement2);
NODE_PRINT(printer, subStore);
//// FIXME-PRINT: NODE_PRINT(printer, validations);
NODE_PRINT(printer, relationSource);

Expand Down Expand Up @@ -7013,7 +7014,7 @@ const StmtNode* StoreNode::store(thread_db* tdbb, jrd_req* request, WhichTrigger

if (relation == request->req_top_view_store)
{
if (whichTrig == ALL_TRIGS || whichTrig == POST_TRIG)
if (!subStore && (whichTrig == ALL_TRIGS || whichTrig == POST_TRIG))
{
request->req_records_inserted++;
request->req_records_affected.bumpModified(true);
Expand Down
6 changes: 6 additions & 0 deletions src/jrd/JrdStatement.cpp
Expand Up @@ -244,6 +244,12 @@ JrdStatement* JrdStatement::makeStatement(thread_db* tdbb, CompilerScratch* csb,
ExprNode::doPass2(tdbb, csb, fieldInfo.validationExpr.getAddress());
}

/*** Print nodes for debugging purposes.
NodePrinter printer;
csb->csb_node->print(printer);
printf("\n%s\n\n\n", printer.getText().c_str());
***/

if (csb->csb_impure > MAX_REQUEST_SIZE)
IBERROR(226); // msg 226 request size limit exceeded

Expand Down

0 comments on commit 35397f8

Please sign in to comment.