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
=== modified file 'ChangeLog'
--- ChangeLog 2012-03-14 15:28:15 +0000
+++ ChangeLog 2012-03-19 17:07:21 +0000
@@ -41,13 +41,14 @@
41 of the annotations map in expressions.41 of the annotations map in expressions.
4242
43Bug Fixes/Other Changes:43Bug Fixes/Other Changes:
44 * Fixed bug 923015 (clone() not implemented for full-text expressions)44 * Fixed bug #923015 (clone() not implemented for full-text expressions)
45 * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context)45 * Fixed bug #917923 (bug in copying outer var values into the eval dynamic context)
46 * Fixed bug 867509 (Can not handle largest xs:unsignedLong values)46 * Fixed bug #867509 (Can not handle largest xs:unsignedLong values)
47 * Fixed bug 924063 (sentence is incorrectly incremented when token characters end without sentence terminator)47 * Fixed bug #924063 (sentence is incorrectly incremented when token characters end without sentence terminator)
48 * Fixed bug 909126 (bug in cloning of var_expr)48 * Fixed bug #909126 (bug in cloning of var_expr)
49 * Fixed bug in destruction of exit_catcher_expr49 * Fixed bug in destruction of exit_catcher_expr
50 * Fixed bug #867024 (error messages)50 * Fixed bug #867024 (error messages)
51 * Fixed bug #957580 (stream read failure in StringToCodepointsIteartor)
51 * Fixed bug #911585 (management of variables during eval)52 * Fixed bug #911585 (management of variables during eval)
52 * Fixed bug #866423 (fn:empty and fn:exists iterators must reset their input in53 * Fixed bug #866423 (fn:empty and fn:exists iterators must reset their input in
53 case of early-out)54 case of early-out)
@@ -65,13 +66,13 @@
65 * Fixed bug #917981 (disallow declaring same module twice).66 * Fixed bug #917981 (disallow declaring same module twice).
66 * Deprecated StaticContext:getNamespaceURIByPrefix()67 * Deprecated StaticContext:getNamespaceURIByPrefix()
67 * Fixed bug #943788 (streamable string is not seekable)68 * Fixed bug #943788 (streamable string is not seekable)
68 * Fixed bug 921624 (slow queries with bogus example.com schema URIs)69 * Fixed bug #921624 (slow queries with bogus example.com schema URIs)
69 * Fixed bug #918211 (xqueryx fulltext w3c conformance generation)70 * Fixed bug #918211 (xqueryx fulltext w3c conformance generation)
70 * Fixed bug #918157 (Add XQFTTS to validation queue)71 * Fixed bug #918157 (Add XQFTTS to validation queue)
71 * Fixed bug with unversioned modules with C++ external functions72 * Fixed bug with unversioned modules with C++ external functions
72 * Fixed bug #912579 (validate-in-place on non-root elements)73 * Fixed bug #912579 (validate-in-place on non-root elements)
73 * Fixed bug #891209 (validation with xsi:type returns untyped)74 * Fixed bug #891209 (validation with xsi:type returns untyped)
74 * Fixed bug 952829 (Nondeterministic annotation doesn't seem to be checked)75 * Fixed bug #952829 (Nondeterministic annotation doesn't seem to be checked)
75 * Fixed bug #951772 (Comment node crashes serialization)76 * Fixed bug #951772 (Comment node crashes serialization)
76 * Fixed bug #945241 (StaticCollectionManager::declaredIndexes() and temporary indexes)77 * Fixed bug #945241 (StaticCollectionManager::declaredIndexes() and temporary indexes)
7778
7879
=== modified file 'src/runtime/spec/strings/strings.xml'
--- src/runtime/spec/strings/strings.xml 2012-01-18 13:57:48 +0000
+++ src/runtime/spec/strings/strings.xml 2012-03-19 17:07:21 +0000
@@ -59,6 +59,7 @@
59 <zorba:member type="checked_vector&lt;xs_unsignedInt&gt;" name="theResult"59 <zorba:member type="checked_vector&lt;xs_unsignedInt&gt;" name="theResult"
60 brief="the resulting vector"/>60 brief="the resulting vector"/>
61 <zorba:member type="std::istream*" name="theStream" />61 <zorba:member type="std::istream*" name="theStream" />
62 <zorba:member type="store::Item_t" name="theStreamItem" />
62 </zorba:state>63 </zorba:state>
6364
64</zorba:iterator>65</zorba:iterator>
6566
=== modified file 'src/runtime/strings/pregenerated/strings.h'
--- src/runtime/strings/pregenerated/strings.h 2012-01-18 13:57:48 +0000
+++ src/runtime/strings/pregenerated/strings.h 2012-03-19 17:07:21 +0000
@@ -83,6 +83,7 @@
83 xs_unsignedInt theIterator; //the current iterator83 xs_unsignedInt theIterator; //the current iterator
84 checked_vector<xs_unsignedInt> theResult; //the resulting vector84 checked_vector<xs_unsignedInt> theResult; //the resulting vector
85 std::istream* theStream; //85 std::istream* theStream; //
86 store::Item_t theStreamItem; //
8687
87 StringToCodepointsIteratorState();88 StringToCodepointsIteratorState();
8889
8990
=== modified file 'src/runtime/strings/strings_impl.cpp'
--- src/runtime/strings/strings_impl.cpp 2012-02-29 11:10:30 +0000
+++ src/runtime/strings/strings_impl.cpp 2012-03-19 17:07:21 +0000
@@ -126,13 +126,14 @@
126 }126 }
127 else127 else
128 {128 {
129 state->theStreamItem = item;
129 state->theStream = &item->getStream();130 state->theStream = &item->getStream();
130 }131 }
131 }132 }
132133
133 if ( state->theStream )134 if ( state->theStream )
134 {135 {
135 while ( !state->theStream->eof() )136 while ( true )
136 {137 {
137 utf8::encoded_char_type ec;138 utf8::encoded_char_type ec;
138 memset( ec, 0, sizeof( ec ) );139 memset( ec, 0, sizeof( ec ) );
@@ -141,6 +142,8 @@
141142
142 if ( utf8::read( *state->theStream, ec ) == utf8::npos )143 if ( utf8::read( *state->theStream, ec ) == utf8::npos )
143 {144 {
145 if ( state->theStream->eof() )
146 break;
144 if ( state->theStream->good() ) {147 if ( state->theStream->good() ) {
145 //148 //
146 // If read() failed but the stream state is good, it means that an149 // If read() failed but the stream state is good, it means that an
@@ -212,6 +215,7 @@
212 PlanIteratorState::reset(planState);215 PlanIteratorState::reset(planState);
213 theIterator = 0;216 theIterator = 0;
214 theResult.clear();217 theResult.clear();
218 theStreamItem = 0;
215}219}
216220
217221
218222
=== added file 'test/rbkt/ExpQueryResults/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xml.res'
--- test/rbkt/ExpQueryResults/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xml.res 2012-03-19 17:07:21 +0000
@@ -0,0 +1,1 @@
160 110 111 100 101 62 109 121 86 97 108 117 101 60 47 110 111 100 101 62
02
=== added file 'test/rbkt/Queries/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xq'
--- test/rbkt/Queries/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/string/StringToCodepointFunc/StringToCodepointFunc4.xq 2012-03-19 17:07:21 +0000
@@ -0,0 +1,10 @@
1let $n := <root><node>myValue</node></root>
2let $v := fn:serialize(
3 $n/child::node(),
4 <output:serialization-parameters
5 xmlns:output="http://www.w3.org/2010/xslt-xquery-serialization">
6 <output:method value="xml"/>
7 <output:omit-xml-declaration value="yes"/>
8 <output:version value="1.0"/>
9 </output:serialization-parameters>)
10return fn:string-to-codepoints($v)

Subscribers

People subscribed via source and target branches