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

Proposed by Paul J. Lucas
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10727
Merged at revision: 10725
Proposed branch: lp:~zorba-coders/zorba/bug-957580
Merge into: lp:zorba
Diff against target: 121 lines (+26/-8)
6 files modified
ChangeLog (+8/-7)
src/runtime/spec/strings/strings.xml (+1/-0)
src/runtime/strings/pregenerated/strings.h (+1/-0)
src/runtime/strings/strings_impl.cpp (+5/-1)
test/rbkt/ExpQueryResults/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xml.res (+1/-0)
test/rbkt/Queries/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xq (+10/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-957580
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+98227@code.launchpad.net

Commit message

fixed bug #957580 (stream read failure in StringToCodepointsIteartor)

Description of the change

Fixed EOF handling.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
lp:~zorba-coders/zorba/bug-957580 updated
10727. By Matthias Brantner

added test for bug #957580 + ChangeLog fixes

Revision history for this message
Matthias Brantner (matthias-brantner) :
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-957580-2012-03-19T17-15-59.922Z 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
1=== modified file 'ChangeLog'
2--- ChangeLog 2012-03-14 15:28:15 +0000
3+++ ChangeLog 2012-03-19 17:07:21 +0000
4@@ -41,13 +41,14 @@
5 of the annotations map in expressions.
6
7 Bug Fixes/Other Changes:
8- * Fixed bug 923015 (clone() not implemented for full-text expressions)
9- * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context)
10- * Fixed bug 867509 (Can not handle largest xs:unsignedLong values)
11- * Fixed bug 924063 (sentence is incorrectly incremented when token characters end without sentence terminator)
12- * Fixed bug 909126 (bug in cloning of var_expr)
13+ * Fixed bug #923015 (clone() not implemented for full-text expressions)
14+ * Fixed bug #917923 (bug in copying outer var values into the eval dynamic context)
15+ * Fixed bug #867509 (Can not handle largest xs:unsignedLong values)
16+ * Fixed bug #924063 (sentence is incorrectly incremented when token characters end without sentence terminator)
17+ * Fixed bug #909126 (bug in cloning of var_expr)
18 * Fixed bug in destruction of exit_catcher_expr
19 * Fixed bug #867024 (error messages)
20+ * Fixed bug #957580 (stream read failure in StringToCodepointsIteartor)
21 * Fixed bug #911585 (management of variables during eval)
22 * Fixed bug #866423 (fn:empty and fn:exists iterators must reset their input in
23 case of early-out)
24@@ -65,13 +66,13 @@
25 * Fixed bug #917981 (disallow declaring same module twice).
26 * Deprecated StaticContext:getNamespaceURIByPrefix()
27 * Fixed bug #943788 (streamable string is not seekable)
28- * Fixed bug 921624 (slow queries with bogus example.com schema URIs)
29+ * Fixed bug #921624 (slow queries with bogus example.com schema URIs)
30 * Fixed bug #918211 (xqueryx fulltext w3c conformance generation)
31 * Fixed bug #918157 (Add XQFTTS to validation queue)
32 * Fixed bug with unversioned modules with C++ external functions
33 * Fixed bug #912579 (validate-in-place on non-root elements)
34 * Fixed bug #891209 (validation with xsi:type returns untyped)
35- * Fixed bug 952829 (Nondeterministic annotation doesn't seem to be checked)
36+ * Fixed bug #952829 (Nondeterministic annotation doesn't seem to be checked)
37 * Fixed bug #951772 (Comment node crashes serialization)
38 * Fixed bug #945241 (StaticCollectionManager::declaredIndexes() and temporary indexes)
39
40
41=== modified file 'src/runtime/spec/strings/strings.xml'
42--- src/runtime/spec/strings/strings.xml 2012-01-18 13:57:48 +0000
43+++ src/runtime/spec/strings/strings.xml 2012-03-19 17:07:21 +0000
44@@ -59,6 +59,7 @@
45 <zorba:member type="checked_vector&lt;xs_unsignedInt&gt;" name="theResult"
46 brief="the resulting vector"/>
47 <zorba:member type="std::istream*" name="theStream" />
48+ <zorba:member type="store::Item_t" name="theStreamItem" />
49 </zorba:state>
50
51 </zorba:iterator>
52
53=== modified file 'src/runtime/strings/pregenerated/strings.h'
54--- src/runtime/strings/pregenerated/strings.h 2012-01-18 13:57:48 +0000
55+++ src/runtime/strings/pregenerated/strings.h 2012-03-19 17:07:21 +0000
56@@ -83,6 +83,7 @@
57 xs_unsignedInt theIterator; //the current iterator
58 checked_vector<xs_unsignedInt> theResult; //the resulting vector
59 std::istream* theStream; //
60+ store::Item_t theStreamItem; //
61
62 StringToCodepointsIteratorState();
63
64
65=== modified file 'src/runtime/strings/strings_impl.cpp'
66--- src/runtime/strings/strings_impl.cpp 2012-02-29 11:10:30 +0000
67+++ src/runtime/strings/strings_impl.cpp 2012-03-19 17:07:21 +0000
68@@ -126,13 +126,14 @@
69 }
70 else
71 {
72+ state->theStreamItem = item;
73 state->theStream = &item->getStream();
74 }
75 }
76
77 if ( state->theStream )
78 {
79- while ( !state->theStream->eof() )
80+ while ( true )
81 {
82 utf8::encoded_char_type ec;
83 memset( ec, 0, sizeof( ec ) );
84@@ -141,6 +142,8 @@
85
86 if ( utf8::read( *state->theStream, ec ) == utf8::npos )
87 {
88+ if ( state->theStream->eof() )
89+ break;
90 if ( state->theStream->good() ) {
91 //
92 // If read() failed but the stream state is good, it means that an
93@@ -212,6 +215,7 @@
94 PlanIteratorState::reset(planState);
95 theIterator = 0;
96 theResult.clear();
97+ theStreamItem = 0;
98 }
99
100
101
102=== added file 'test/rbkt/ExpQueryResults/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xml.res'
103--- test/rbkt/ExpQueryResults/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xml.res 1970-01-01 00:00:00 +0000
104+++ test/rbkt/ExpQueryResults/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xml.res 2012-03-19 17:07:21 +0000
105@@ -0,0 +1,1 @@
106+60 110 111 100 101 62 109 121 86 97 108 117 101 60 47 110 111 100 101 62
107
108=== added file 'test/rbkt/Queries/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xq'
109--- test/rbkt/Queries/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xq 1970-01-01 00:00:00 +0000
110+++ test/rbkt/Queries/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xq 2012-03-19 17:07:21 +0000
111@@ -0,0 +1,10 @@
112+let $n := <root><node>myValue</node></root>
113+let $v := fn:serialize(
114+ $n/child::node(),
115+ <output:serialization-parameters
116+ xmlns:output="http://www.w3.org/2010/xslt-xquery-serialization">
117+ <output:method value="xml"/>
118+ <output:omit-xml-declaration value="yes"/>
119+ <output:version value="1.0"/>
120+ </output:serialization-parameters>)
121+return fn:string-to-codepoints($v)

Subscribers

People subscribed via source and target branches