Menu

#12 search crashes if collection has ValueIndexer with pattern *

serious
open
Indexers (2)
5
2004-12-02
2004-12-02
No

Hello,

I have found, that search engine crashes on some simple
enough XPath queries if the collection has index
created by ValueIndexer initialized with pattern "*" or
"*@*".

My profile: dbXML-2.0, jdk-1.4.2_04, Linux (SuSe
9.2), i386.

Test document is:

<?xml version="1.0" encoding="UTF-8"?>
<user name="test_user" password="test_password">
<groups>
<group>test_group</group>
</groups>
</user>

Test XPath-query:

/user[groups/group='test_group']

Index:

<index name="IDX_ALL_VALUES"
class="com.dbxml.db.common.indexers.ValueIndexer"
pattern="*" />

I have attached test case, illustrating this crash.

Regards,
Yaroslav Sokolov.

p.s. output of the test case, started on my host:

Test of nonindexed collection
found 1 match(es)
ok

Test of indexed collection
java.lang.NullPointerException
at
com.dbxml.db.core.indexer.IndexPattern.convertSymbolToName(IndexPattern.java:87)
at
com.dbxml.db.core.indexer.IndexPattern.<init>(IndexPattern.java:82)
at
com.dbxml.db.common.indexers.ValueIndexer$1.indexInfo(ValueIndexer.java:337)
at
com.dbxml.db.common.btree.BTree$BTreeNode.query(BTree.java:778)
at com.dbxml.db.common.btree.BTree.query(BTree.java:191)
at
com.dbxml.db.common.indexers.ValueIndexer.queryMatches(ValueIndexer.java:330)
at
com.dbxml.db.common.xpath.XPathQuery.queryIndexes(XPathQuery.java:880)
at
com.dbxml.db.common.xpath.XPathQuery.queryComparison(XPathQuery.java:964)
at
com.dbxml.db.common.xpath.XPathQuery.evalValComparison(XPathQuery.java:457)
at
com.dbxml.db.common.xpath.XPathQuery.evaluate(XPathQuery.java:284)
at
com.dbxml.db.common.xpath.XPathQuery.evaluate(XPathQuery.java:272)
at
com.dbxml.db.common.xpath.XPathQuery.evalAxis(XPathQuery.java:615)
at
com.dbxml.db.common.xpath.XPathQuery.evaluate(XPathQuery.java:329)
at
com.dbxml.db.common.xpath.XPathQuery.evalLocationPath(XPathQuery.java:363)
at
com.dbxml.db.common.xpath.XPathQuery.evaluate(XPathQuery.java:267)
at
com.dbxml.db.common.xpath.XPathQuery.evaluate(XPathQuery.java:272)
at
com.dbxml.db.common.xpath.XPathQuery.execute(XPathQuery.java:202)
at
com.dbxml.db.common.query.QueryResolverBase.query(QueryResolverBase.java:51)
at
com.dbxml.db.core.query.QueryEngine.query(QueryEngine.java:115)
at
com.dbxml.db.core.Collection.queryCollection(Collection.java:875)
at
com.dbxml.db.client.local.CollectionClientImpl.queryCollection(CollectionClientImpl.java:381)
at
com.dbxml.db.client.xmldb.QueryServiceImpl.performQuery(QueryServiceImpl.java:83)
at
com.dbxml.db.client.xmldb.XPathQueryServiceImpl.query(XPathQueryServiceImpl.java:52)
at TestSearch.testFindPatternIndex(TestSearch.java:122)
at TestSearch.main(TestSearch.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
found 0 match(es)
FAIL

Discussion

  • Yaroslav Sokolov

    test case for described bug

     
  • Yaroslav Sokolov

    patch, which fixes this bug (additionaly, it changes name of dbxml.jar to dbxml-2.0-y1.jar)

     

Log in to post a comment.