Merge lp:~zorba-coders/zorba/bug-914655 into lp:zorba

Proposed by David Graf
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 10752
Merged at revision: 10763
Proposed branch: lp:~zorba-coders/zorba/bug-914655
Merge into: lp:zorba
Diff against target: 63 lines (+32/-0)
4 files modified
src/runtime/eval/eval.cpp (+14/-0)
src/runtime/eval/eval.h (+2/-0)
test/rbkt/ExpQueryResults/zorba/eval/eval_reset.xml.res (+1/-0)
test/rbkt/Queries/zorba/eval/eval_reset.xq (+15/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-914655
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Matthias Brantner Approve
David Graf (community) Approve
Review via email: mp+101922@code.launchpad.net

Commit message

Fix for bug #914655.

Description of the change

Fix for bug #914655.

To post a comment you must log in.
Revision history for this message
David Graf (davidagraf) wrote :

Fix for bug #914655.

Revision history for this message
David Graf (davidagraf) :
review: Approve
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Looks good to me. Could the problem be reproduced without debugger? If so, we should add a test for it.

Also adding Markos as a reviewer.

review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-914655-2012-04-14T06-16-05.653Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 2 Approve, 2 Pending.

Revision history for this message
David Graf (davidagraf) wrote :

> Looks good to me. Could the problem be reproduced without debugger? If so, we
> should add a test for it.

Good point. I found a test to add.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-914655-2012-04-15T16-56-58.153Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 2 Approve, 2 Pending.

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-914655-2012-04-16T08-11-01.617Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/runtime/eval/eval.cpp'
--- src/runtime/eval/eval.cpp 2012-04-09 23:08:06 +0000
+++ src/runtime/eval/eval.cpp 2012-04-14 07:02:20 +0000
@@ -62,6 +62,20 @@
62{62{
63}63}
6464
65/****************************************************************************//**
66
67********************************************************************************/
68void
69EvalIteratorState::reset(PlanState& aPlanState)
70{
71 PlanIteratorState::reset(aPlanState);
72 // When an exception is thrown during an EvalIterator::nextImpl invocation
73 // or when the EvalIterator doesn't return all resulting items of an other reason,
74 // the PlanWrapper is not properly destroyed. Therefore, we destroy it in the reset
75 // to prevent troubles the next time the EvalIterator is used.
76 thePlanWrapper = 0;
77}
78
6579
66/****************************************************************************//**80/****************************************************************************//**
6781
6882
=== modified file 'src/runtime/eval/eval.h'
--- src/runtime/eval/eval.h 2012-03-30 19:03:09 +0000
+++ src/runtime/eval/eval.h 2012-04-14 07:02:20 +0000
@@ -37,6 +37,8 @@
37 EvalIteratorState();37 EvalIteratorState();
3838
39 ~EvalIteratorState();39 ~EvalIteratorState();
40
41 void reset(PlanState&);
40};42};
4143
4244
4345
=== added file 'test/rbkt/ExpQueryResults/zorba/eval/eval_reset.xml.res'
--- test/rbkt/ExpQueryResults/zorba/eval/eval_reset.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/eval/eval_reset.xml.res 2012-04-14 07:02:20 +0000
@@ -0,0 +1,1 @@
1not empty not empty not empty
02
=== added file 'test/rbkt/Queries/zorba/eval/eval_reset.xq'
--- test/rbkt/Queries/zorba/eval/eval_reset.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/eval/eval_reset.xq 2012-04-14 07:02:20 +0000
@@ -0,0 +1,15 @@
1(:
2 : Checks if the underlying EvalIterator is reset properly in case if not every
3 : resulting item of the EvalIterator in the iteration before was consumed.
4 : Simulated by doing an empty check on resulting items of the eval function.
5 :)
6
7import module namespace reflection = "http://www.zorba-xquery.com/modules/reflection";
8
9for $x in (1,2,3)
10let $code := "($x, 1, 2, 3)"
11return
12 if (not(empty(reflection:eval($code)))) then
13 "not empty"
14 else
15 "empty"

Subscribers

People subscribed via source and target branches