errors casting to xs:dateTimeStamp
Bug #1158975 reported by
Till Westmann
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
Critical
|
Till Westmann |
Bug Description
I think that I've found 2 problems casting to xs:dateTimeStamp:
1) This query
let $dt := xs:dateTime(
let $dts := $dt cast as xs:dateTimeStamp
return
$dts instance of xs:dateTimeStamp
return false
2) This query
xs:dateTime(
causes a segfault.
Related branches
lp:~zorba-coders/zorba/bug1158975-sxDateTimeStamp
- Till Westmann: Pending requested
-
Diff: 12 lines (+1/-1)1 file modifiedsrc/store/naive/simple_item_factory.cpp (+1/-1)
lp:~zorba-coders/zorba/bug1158975
- Cezar Andrei: Approve
- Till Westmann: Approve
-
Diff: 135 lines (+33/-6)11 files modifiedsrc/runtime/durations_dates_times/DurationsDatesTimesImpl.cpp (+4/-0)
src/store/naive/simple_item_factory.cpp (+1/-1)
src/types/casting.cpp (+8/-3)
src/zorbaserialization/serialize_zorba_types.cpp (+8/-0)
test/fots/CMakeLists.txt (+0/-2)
test/rbkt/ExpQueryResults/zorba/durationdatetime/DateTimeStamp/adjust_dateTimeStamp_to_timezone.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/durationdatetime/DateTimeStamp/cast_as_dateTimeStamp1.xml.res (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/DateTimeStamp/adjust_dateTimeStamp_to_timezone.xq (+4/-0)
test/rbkt/Queries/zorba/durationdatetime/DateTimeStamp/cast_as_dateTimeStamp1.xq (+4/-0)
test/rbkt/Queries/zorba/durationdatetime/DateTimeStamp/cast_as_dateTimeStamp2.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/DateTimeStamp/cast_as_dateTimeStamp2.xq (+1/-0)
lp:~zorba-coders/zorba/bug1158975-fix-error-value
- Till Westmann: Approve
- Matthias Brantner: Approve
-
Diff: 10 lines (+1/-1)1 file modifiedsrc/types/casting.cpp (+1/-1)
Changed in zorba: | |
assignee: | nobody → Cezar Andrei (cezar-andrei) |
importance: | Undecided → Critical |
Changed in zorba: | |
assignee: | Markos Zaharioudakis (markos-za) → Cezar Andrei (cezar-andrei) |
tags: | added: dates |
tags: | added: segfault |
Changed in zorba: | |
milestone: | none → 2.9 |
Changed in zorba: | |
status: | New → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The second query is a bug in the optimizer, see stack below. I'm assigning this to Markos while I'm still working on the first query.
==6659== Memcheck, a memory error detector build/bin/ zorba -f -q e.xq store:: Item::isError( ) const (item.h:177) execute( zorba:: CompilerCB* , zorba::expr*, zorba:: store:: ItemHandle< zorba:: store:: Item>&) (fold_rules. cpp:483) FoldConst: :apply( zorba:: RewriterContext &, zorba::expr*, bool&) (fold_rules. cpp:408) RuleMajorDriver ::rewrite( zorba:: RewriterContext &) (rule_driver. cpp:63) DefaultOptimize r::rewrite( zorba:: RewriterContext &) (default_ optimizer. cpp:95) XQueryCompiler: :optimize( zorba:: expr*) (compiler_ api.cpp: 375) XQueryCompiler: :compile( zorba:: rchandle< zorba:: parsenode> const&, bool, unsigned long&, zorba:: audit:: ScopedRecord& ) (compiler_ api.cpp: 275) XQueryCompiler: :compile( std::istream& , zorba:: rstring< zorba:: rstring_ classes: :rep<zorba: :atomic_ int, std::char_ traits< char>, std::allocator< char> > > const&, unsigned long&) (compiler_ api.cpp: 241) XQueryImpl: :doCompile( std::istream& , Zorba_CompilerHints const&, bool, unsigned long&) (xqueryimpl. cpp:611) XQueryImpl: :compile( std::istream& , zorba:: SmartPtr< zorba:: StaticContext> const&, Zorba_CompilerHints const&) (xqueryimpl. cpp:540) te(zorba: :Zorba* , ZorbaCMDProperties const&, zorba:: SmartPtr< zorba:: StaticContext> &, std::string const&, std::istream&, std::ostream&, TimingInfo&) (zorbacmd.cpp:770)
==6659== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==6659== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==6659== Command: ./zorba/
==6659==
==6659== Invalid read of size 8
==6659== at 0x56F2FA4: zorba::
==6659== by 0x56F1368: zorba::
==6659== by 0x56F0FEB: zorba::
==6659== by 0x56DB24D: zorba::
==6659== by 0x56DC85E: zorba::
==6659== by 0x57190E9: zorba::
==6659== by 0x5718D2B: zorba::
==6659== by 0x5718BAB: zorba::
==6659== by 0x549A4E2: zorba::
==6659== by 0x549A054: zorba::
==6659== by 0x415341: compileAndExecu
==6659== by 0x416CFD: main (zorbacmd.cpp:1201)
==6659== Address 0x10 is not stack'd, malloc'd or (recently) free'd
==6659==