Serious query error in eXist-DB 2.2?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Serious query error in eXist-DB 2.2?

Gerrit Boers
Hi,

I’m running into a serious query error on exist 2.2. The following simple query returns incorrect results:

   for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs

As there are no dbcGroups with statusCode=active nothing should be returned but this is the result:

<dbcGroup no="486" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0313" advice="" logic="" defaultDbc="true">
   
<dbc code="499" priority="1"/>
</dbcGroup>
<dbcGroup no="487" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0316" advice="" logic="" defaultDbc="true">
   
<dbc code="7899" priority="1"/>
</dbcGroup>
<dbcGroup no="488" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0310" advice="" logic="" defaultDbc="true">
   
<dbc code="04" priority="1"/>
</dbcGroup>

If I change the query to:

  
for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs[@statusCode='active']

It is working as expected and nothing is returned

eXist version:
eXist Version:2.2
eXist Build:20141120
Operating System:Mac OS X 10.11.5 x86_64
Default Encoding:UTF8
Instance ID:exist


On eXist LTS 2.2 the query is working as expected.


Kind regards,

Gerrit Boers







------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Joe Wicentowski
Gerrit,

Just to advance the discussion, do you have an index(es) defined on @statuscode or not?  

Joe

On Wed, Jun 29, 2016 at 4:16 AM, Gerrit Boers <[hidden email]> wrote:
Hi,

I’m running into a serious query error on exist 2.2. The following simple query returns incorrect results:

   for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs

As there are no dbcGroups with statusCode=active nothing should be returned but this is the result:

<dbcGroup no="486" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0313" advice="" logic="" defaultDbc="true">
   
<dbc code="499" priority="1"/>
</dbcGroup>
<dbcGroup no="487" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0316" advice="" logic="" defaultDbc="true">
   
<dbc code="7899" priority="1"/>
</dbcGroup>
<dbcGroup no="488" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0310" advice="" logic="" defaultDbc="true">
   
<dbc code="04" priority="1"/>
</dbcGroup>

If I change the query to:

  
for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs[@statusCode='active']

It is working as expected and nothing is returned

eXist version:
eXist Version:2.2
eXist Build:20141120
Operating System:Mac OS X 10.11.5 x86_64
Default Encoding:UTF8
Instance ID:exist


On eXist LTS 2.2 the query is working as expected.


Kind regards,

Gerrit Boers







------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Gerrit Boers
Hi Joe,

Yes, here’s the index definition:

<collection xmlns="http://exist-db.org/collection-config/1.0">
   
<index>
       
<lucene>
           
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer">
               
<param name="stopwords" type="org.apache.lucene.analysis.util.CharArraySet"/>
           
</analyzer>
           
<text qname="desc"/>
       
</lucene><!-- eXist-db 2.2 -->
       
<range>
           
<create qname="@thesaurusId" type="xs:string"/>
           
<create qname="@thesaurus" type="xs:string"/>
           
<create qname="@type" type="xs:string"/>
           
<create qname="@idLink" type="xs:string"/>
           
<create qname="@id" type="xs:string"/>
           
<create qname="@no" type="xs:string"/>
           
<create qname="@code" type="xs:string"/>
           
<create qname="@agbCode" type="xs:string"/>
           
<create qname="@conceptId" type="xs:string"/>
           
<create qname="@statusCode" type="xs:string"/>
           
<create qname="@effectiveDate" type="xs:string"/>
           
<create qname="@expirationDate" type="xs:string"/>
           
<create qname="@specialismCode" type="xs:string"/>
           
<create qname="@referencedComponentId" type="xs:string"/>
           
<create qname="@refsetId" type="xs:string"/>
       
</range>
   
</index>
</collection>

I just confirmed that it works as expected on eXist LTS 2.2


Kind regards,

Gerrit


On 29 Jun 2016, at 14:47, Joe Wicentowski <[hidden email]> wrote:

Gerrit,

Just to advance the discussion, do you have an index(es) defined on @statuscode or not?  

Joe

On Wed, Jun 29, 2016 at 4:16 AM, Gerrit Boers <[hidden email]> wrote:
Hi,

I’m running into a serious query error on exist 2.2. The following simple query returns incorrect results:

   for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs

As there are no dbcGroups with statusCode=active nothing should be returned but this is the result:

<dbcGroup no="486" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0313" advice="" logic="" defaultDbc="true">
   
<dbc code="499" priority="1"/>
</dbcGroup>
<dbcGroup no="487" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0316" advice="" logic="" defaultDbc="true">
   
<dbc code="7899" priority="1"/>
</dbcGroup>
<dbcGroup no="488" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0310" advice="" logic="" defaultDbc="true">
   
<dbc code="04" priority="1"/>
</dbcGroup>

If I change the query to:

  
for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs[@statusCode='active']

It is working as expected and nothing is returned

eXist version:
eXist Version:2.2
eXist Build:20141120
Operating System:Mac OS X 10.11.5 x86_64
Default Encoding:UTF8
Instance ID:exist


On eXist LTS 2.2 the query is working as expected.


Kind regards,

Gerrit Boers







------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open




------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Alexander Henket-2
Hi Gerrit,

This phenomenon matches my experience with range indexes and manual db actions. I could find not other solution than to deactivate all range indexes. Range indexes appear to be really sensitive in some way or another. I got false positive matches, false negative matches and duplicate matches.

Love to hear what this issue you raised leads to.

Alexander Henket


Op 29 jun. 2016, om 14:55 heeft [hidden email] het volgende geschreven:

Hi Joe,

Yes, here’s the index definition:

<collection xmlns="http://exist-db.org/collection-config/1.0">
   
<index>
       
<lucene>
           
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer">
               
<param name="stopwords" type="org.apache.lucene.analysis.util.CharArraySet"/>
           
</analyzer>
           
<text qname="desc"/>
       
</lucene><!-- eXist-db 2.2 -->
       
<range>
           
<create qname="@thesaurusId" type="xs:string"/>
           
<create qname="@thesaurus" type="xs:string"/>
           
<create qname="@type" type="xs:string"/>
           
<create qname="@idLink" type="xs:string"/>
           
<create qname="@id" type="xs:string"/>
           
<create qname="@no" type="xs:string"/>
           
<create qname="@code" type="xs:string"/>
           
<create qname="@agbCode" type="xs:string"/>
           
<create qname="@conceptId" type="xs:string"/>
           
<create qname="@statusCode" type="xs:string"/>
           
<create qname="@effectiveDate" type="xs:string"/>
           
<create qname="@expirationDate" type="xs:string"/>
           
<create qname="@specialismCode" type="xs:string"/>
           
<create qname="@referencedComponentId" type="xs:string"/>
           
<create qname="@refsetId" type="xs:string"/>
       
</range>
   
</index>
</collection>

I just confirmed that it works as expected on eXist LTS 2.2


Kind regards,

Gerrit


On 29 Jun 2016, at 14:47, Joe Wicentowski <[hidden email]> wrote:

Gerrit,

Just to advance the discussion, do you have an index(es) defined on @statuscode or not?  

Joe

On Wed, Jun 29, 2016 at 4:16 AM, Gerrit Boers <[hidden email]> wrote:
Hi,

I’m running into a serious query error on exist 2.2. The following simple query returns incorrect results:

   for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs

As there are no dbcGroups with statusCode=active nothing should be returned but this is the result:

<dbcGroup no="486" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0313" advice="" logic="" defaultDbc="true">
   
<dbc code="499" priority="1"/>
</dbcGroup>
<dbcGroup no="487" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0316" advice="" logic="" defaultDbc="true">
   
<dbc code="7899" priority="1"/>
</dbcGroup>
<dbcGroup no="488" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0310" advice="" logic="" defaultDbc="true">
   
<dbc code="04" priority="1"/>
</dbcGroup>

If I change the query to:

  
for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs[@statusCode='active']

It is working as expected and nothing is returned

eXist version:
eXist Version:2.2
eXist Build:20141120
Operating System:Mac OS X 10.11.5 x86_64
Default Encoding:UTF8
Instance ID:exist


On eXist LTS 2.2 the query is working as expected.


Kind regards,

Gerrit Boers







------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Wolfgang Meier-2
Hi,

I remember I committed a few fixes to range indexes on attributes a while ago. Could you retest on a develop build? Would be good to know if the issues persists.

Wolfgang



2016-06-30 9:48 GMT+02:00 Alexander Henket <[hidden email]>:
Hi Gerrit,

This phenomenon matches my experience with range indexes and manual db actions. I could find not other solution than to deactivate all range indexes. Range indexes appear to be really sensitive in some way or another. I got false positive matches, false negative matches and duplicate matches.

Love to hear what this issue you raised leads to.

Alexander Henket


Op 29 jun. 2016, om 14:55 heeft [hidden email] het volgende geschreven:

Hi Joe,

Yes, here’s the index definition:

<collection xmlns="http://exist-db.org/collection-config/1.0">
   
<index>
       
<lucene>
           
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer">
               
<param name="stopwords" type="org.apache.lucene.analysis.util.CharArraySet"/>
           
</analyzer>
           
<text qname="desc"/>
       
</lucene><!-- eXist-db 2.2 -->
       
<range>
           
<create qname="@thesaurusId" type="xs:string"/>
           
<create qname="@thesaurus" type="xs:string"/>
           
<create qname="@type" type="xs:string"/>
           
<create qname="@idLink" type="xs:string"/>
           
<create qname="@id" type="xs:string"/>
           
<create qname="@no" type="xs:string"/>
           
<create qname="@code" type="xs:string"/>
           
<create qname="@agbCode" type="xs:string"/>
           
<create qname="@conceptId" type="xs:string"/>
           
<create qname="@statusCode" type="xs:string"/>
           
<create qname="@effectiveDate" type="xs:string"/>
           
<create qname="@expirationDate" type="xs:string"/>
           
<create qname="@specialismCode" type="xs:string"/>
           
<create qname="@referencedComponentId" type="xs:string"/>
           
<create qname="@refsetId" type="xs:string"/>
       
</range>
   
</index>
</collection>

I just confirmed that it works as expected on eXist LTS 2.2


Kind regards,

Gerrit


On 29 Jun 2016, at 14:47, Joe Wicentowski <[hidden email]> wrote:

Gerrit,

Just to advance the discussion, do you have an index(es) defined on @statuscode or not?  

Joe

On Wed, Jun 29, 2016 at 4:16 AM, Gerrit Boers <[hidden email]> wrote:
Hi,

I’m running into a serious query error on exist 2.2. The following simple query returns incorrect results:

   for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs

As there are no dbcGroups with statusCode=active nothing should be returned but this is the result:

<dbcGroup no="486" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0313" advice="" logic="" defaultDbc="true">
   
<dbc code="499" priority="1"/>
</dbcGroup>
<dbcGroup no="487" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0316" advice="" logic="" defaultDbc="true">
   
<dbc code="7899" priority="1"/>
</dbcGroup>
<dbcGroup no="488" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0310" advice="" logic="" defaultDbc="true">
   
<dbc code="04" priority="1"/>
</dbcGroup>

If I change the query to:

  
for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs[@statusCode='active']

It is working as expected and nothing is returned

eXist version:
eXist Version:2.2
eXist Build:20141120
Operating System:Mac OS X 10.11.5 x86_64
Default Encoding:UTF8
Instance ID:exist


On eXist LTS 2.2 the query is working as expected.


Kind regards,

Gerrit Boers







------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Alexander Henket-2
Hi Wolfgang,

I had eXist-db 3.0RC1 installed but after some initial testing I went back to 2.2. It is very hard to reproduce the index issues I found I must add, which is why I did not post too much here about it.

I'd love to see an 3.0RC2 to test with. I'm not much of a "build-from-source" person. Any word on that maybe?

Regards

Alexander Henket


Op 30 jun. 2016, om 09:55 heeft Wolfgang Meier <[hidden email]> het volgende geschreven:

Hi,

I remember I committed a few fixes to range indexes on attributes a while ago. Could you retest on a develop build? Would be good to know if the issues persists.

Wolfgang



2016-06-30 9:48 GMT+02:00 Alexander Henket <[hidden email]>:
Hi Gerrit,

This phenomenon matches my experience with range indexes and manual db actions. I could find not other solution than to deactivate all range indexes. Range indexes appear to be really sensitive in some way or another. I got false positive matches, false negative matches and duplicate matches.

Love to hear what this issue you raised leads to.

Alexander Henket


Op 29 jun. 2016, om 14:55 heeft [hidden email] het volgende geschreven:

Hi Joe,

Yes, here’s the index definition:

<collection xmlns="http://exist-db.org/collection-config/1.0">
   
<index>
       
<lucene>
           
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer">
               
<param name="stopwords" type="org.apache.lucene.analysis.util.CharArraySet"/>
           
</analyzer>
           
<text qname="desc"/>
       
</lucene><!-- eXist-db 2.2 -->
       
<range>
           
<create qname="@thesaurusId" type="xs:string"/>
           
<create qname="@thesaurus" type="xs:string"/>
           
<create qname="@type" type="xs:string"/>
           
<create qname="@idLink" type="xs:string"/>
           
<create qname="@id" type="xs:string"/>
           
<create qname="@no" type="xs:string"/>
           
<create qname="@code" type="xs:string"/>
           
<create qname="@agbCode" type="xs:string"/>
           
<create qname="@conceptId" type="xs:string"/>
           
<create qname="@statusCode" type="xs:string"/>
           
<create qname="@effectiveDate" type="xs:string"/>
           
<create qname="@expirationDate" type="xs:string"/>
           
<create qname="@specialismCode" type="xs:string"/>
           
<create qname="@referencedComponentId" type="xs:string"/>
           
<create qname="@refsetId" type="xs:string"/>
       
</range>
   
</index>
</collection>

I just confirmed that it works as expected on eXist LTS 2.2


Kind regards,

Gerrit


On 29 Jun 2016, at 14:47, Joe Wicentowski <[hidden email]> wrote:

Gerrit,

Just to advance the discussion, do you have an index(es) defined on @statuscode or not?  

Joe

On Wed, Jun 29, 2016 at 4:16 AM, Gerrit Boers <[hidden email]> wrote:
Hi,

I’m running into a serious query error on exist 2.2. The following simple query returns incorrect results:

   for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs

As there are no dbcGroups with statusCode=active nothing should be returned but this is the result:

<dbcGroup no="486" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0313" advice="" logic="" defaultDbc="true">
   
<dbc code="499" priority="1"/>
</dbcGroup>
<dbcGroup no="487" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0316" advice="" logic="" defaultDbc="true">
   
<dbc code="7899" priority="1"/>
</dbcGroup>
<dbcGroup no="488" effectiveDate="2000-01-01" expirationDate="2016-03-31" editDate="2016-03-18" editCode="GEWIJZIGD" validationDate="2015-05-01" validationEndDate="" validated="true" statusCode="retired" agbCode="0310" advice="" logic="" defaultDbc="true">
   
<dbc code="04" priority="1"/>
</dbcGroup>

If I change the query to:

  
for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active']
  
return
  
$activeDBCs[@statusCode='active']

It is working as expected and nothing is returned

eXist version:
eXist Version:2.2
eXist Build:20141120
Operating System:Mac OS X 10.11.5 x86_64
Default Encoding:UTF8
Instance ID:exist


On eXist LTS 2.2 the query is working as expected.


Kind regards,

Gerrit Boers







------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open




------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Wolfgang Meier-2
Hi Alexander,

I'd love to see an 3.0RC2 to test with. I'm not much of a "build-from-source" person. Any word on that maybe?

Me too ;-) Just waiting for some fixes to come in. In the meantime you could test a nightly build from http://static.adamretter.org.uk/exist-nightly/. They should be quite stable.

Wolfgang

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Gerrit Boers
Hi Wolfgang,

It seems I was to quick in my judgement that 2.2LTS was working fine. The same thing is happening on 2.2. LTS but I found something that might give a clue:

This returns incorrect results:
   for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode=('active','review','pending')]
  
return
  
$activeDBCs

But formulated like this it works correctly:
   for $concept in collection(concat($get:strDhdData,'/thesaurus'))//concept[@thesaurusId='187']
  
let $activeDBCs := $concept/dbcGroup[@statusCode='active' or @statusCode='review' or @statusCode='pending']
  
return
  
$activeDBCs


Next week my vacation starts so I have the time to test this against the nightly build.

Kind regards,

Gerrit



On 30 Jun 2016, at 10:56, Wolfgang Meier <[hidden email]> wrote:

Hi Alexander,

I'd love to see an 3.0RC2 to test with. I'm not much of a "build-from-source" person. Any word on that maybe?

Me too ;-) Just waiting for some fixes to come in. In the meantime you could test a nightly build from http://static.adamretter.org.uk/exist-nightly/. They should be quite stable.

Wolfgang


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Gerrit Boers
In reply to this post by Wolfgang Meier-2
Hi Wolfgang,

I just tested the 3.0 rc2 dev 4-8-2016 nightly build and now the query returns the correct results. There’s also a significant performance improvement :-)

kind regards,

Gerrit



On 30 Jun 2016, at 10:56, Wolfgang Meier <[hidden email]> wrote:

Hi Alexander,

I'd love to see an 3.0RC2 to test with. I'm not much of a "build-from-source" person. Any word on that maybe?

Me too ;-) Just waiting for some fixes to come in. In the meantime you could test a nightly build from http://static.adamretter.org.uk/exist-nightly/. They should be quite stable.

Wolfgang


------------------------------------------------------------------------------

_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Gerrit Boers
In reply to this post by Wolfgang Meier-2
Hi Wolfgang,

Alas, I ran into some more errors:

This query incorrectly returns a retired object:
let $thesaurus := collection(concat($get:strDhdData,'/thesaurus'))/thesaurus
for $object in $thesaurus//dbcGroup[@statusCode='active'][@expirationDate castable as xs:date][xs:date(@expirationDate) le current-date()]
return
$object

this variant correctly returns an empty sequence:
for $object in $thesaurus//dbcGroup[@statusCode='active' and @expirationDate castable as xs:date and xs:date(@expirationDate) le current-date()]

but the strange thing is that this variation also returns the correct result:
for $object in collection(concat($get:strDhdData,'/thesaurus'))//dbcGroup[@statusCode='active'][@expirationDate castable as xs:date][xs:date(@expirationDate) le current-date()]

an exact replacement of the variable like this:
for $object in collection(concat($get:strDhdData,'/thesaurus'))/thesaurus//dbcGroup[@statusCode='active'][@expirationDate castable as xs:date][xs:date(@expirationDate) le current-date()]

again returns an incorrect result!

kind regards,

Gerrit

On 30 Jun 2016, at 10:56, Wolfgang Meier <[hidden email]> wrote:

Hi Alexander,

I'd love to see an 3.0RC2 to test with. I'm not much of a "build-from-source" person. Any word on that maybe?

Me too ;-) Just waiting for some fixes to come in. In the meantime you could test a nightly build from http://static.adamretter.org.uk/exist-nightly/. They should be quite stable.

Wolfgang


------------------------------------------------------------------------------

_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Joe Wicentowski
Hi Gerrit,

This seems quite similar to my report from a few days ago, http://exist-open.markmail.org/thread/rcbwmor2erzz2hl4.  The common aspects seem to be:

1. we're both using the new range index
2. we're both using predicates to filter out unwanted nodes 
3. the predicates are letting nodes through that should be filtered out

I think our task is to provide a reproducible test.  My dataset is huge and I'm working on a conference presentation now, so I probably can't get a test together until next week.  How about yours?

Joe

On Thu, Aug 4, 2016 at 11:49 AM, <[hidden email]> wrote:
Hi Wolfgang,

Alas, I ran into some more errors:

This query incorrectly returns a retired object:
let $thesaurus := collection(concat($get:strDhdData,'/thesaurus'))/thesaurus
for $object in $thesaurus//dbcGroup[@statusCode='active'][@expirationDate castable as xs:date][xs:date(@expirationDate) le current-date()]
return
$object

this variant correctly returns an empty sequence:
for $object in $thesaurus//dbcGroup[@statusCode='active' and @expirationDate castable as xs:date and xs:date(@expirationDate) le current-date()]

but the strange thing is that this variation also returns the correct result:
for $object in collection(concat($get:strDhdData,'/thesaurus'))//dbcGroup[@statusCode='active'][@expirationDate castable as xs:date][xs:date(@expirationDate) le current-date()]

an exact replacement of the variable like this:
for $object in collection(concat($get:strDhdData,'/thesaurus'))/thesaurus//dbcGroup[@statusCode='active'][@expirationDate castable as xs:date][xs:date(@expirationDate) le current-date()]

again returns an incorrect result!

kind regards,

Gerrit

On 30 Jun 2016, at 10:56, Wolfgang Meier <[hidden email]> wrote:

Hi Alexander,

I'd love to see an 3.0RC2 to test with. I'm not much of a "build-from-source" person. Any word on that maybe?

Me too ;-) Just waiting for some fixes to come in. In the meantime you could test a nightly build from http://static.adamretter.org.uk/exist-nightly/. They should be quite stable.

Wolfgang



------------------------------------------------------------------------------

_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Serious query error in eXist-DB 2.2?

Gerrit Boers
Hi Joe,

Glad to see I’m not the only one running into this issue.

My dataset is about 70MB so that could be used I think.

kind regards,

Gerrit


On 04 Aug 2016, at 18:02, Joe Wicentowski <[hidden email]> wrote:

Hi Gerrit,

This seems quite similar to my report from a few days ago, http://exist-open.markmail.org/thread/rcbwmor2erzz2hl4.  The common aspects seem to be:

1. we're both using the new range index
2. we're both using predicates to filter out unwanted nodes 
3. the predicates are letting nodes through that should be filtered out

I think our task is to provide a reproducible test.  My dataset is huge and I'm working on a conference presentation now, so I probably can't get a test together until next week.  How about yours?

Joe

On Thu, Aug 4, 2016 at 11:49 AM, <[hidden email]> wrote:
Hi Wolfgang,

Alas, I ran into some more errors:

This query incorrectly returns a retired object:
let $thesaurus := collection(concat($get:strDhdData,'/thesaurus'))/thesaurus
for $object in $thesaurus//dbcGroup[@statusCode='active'][@expirationDate castable as xs:date][xs:date(@expirationDate) le current-date()]
return
$object

this variant correctly returns an empty sequence:
for $object in $thesaurus//dbcGroup[@statusCode='active' and @expirationDate castable as xs:date and xs:date(@expirationDate) le current-date()]

but the strange thing is that this variation also returns the correct result:
for $object in collection(concat($get:strDhdData,'/thesaurus'))//dbcGroup[@statusCode='active'][@expirationDate castable as xs:date][xs:date(@expirationDate) le current-date()]

an exact replacement of the variable like this:
for $object in collection(concat($get:strDhdData,'/thesaurus'))/thesaurus//dbcGroup[@statusCode='active'][@expirationDate castable as xs:date][xs:date(@expirationDate) le current-date()]

again returns an incorrect result!

kind regards,

Gerrit

On 30 Jun 2016, at 10:56, Wolfgang Meier <[hidden email]> wrote:

Hi Alexander,

I'd love to see an 3.0RC2 to test with. I'm not much of a "build-from-source" person. Any word on that maybe?

Me too ;-) Just waiting for some fixes to come in. In the meantime you could test a nightly build from http://static.adamretter.org.uk/exist-nightly/. They should be quite stable.

Wolfgang




------------------------------------------------------------------------------

_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open