Warning: TextIndexNG 1.07 corrups your objects if you have casefolding on
Hi ya, this is a very strange bug that I my collegue found, I hunted down that TextIndexNG is the cause for it. Short description: When TextIndexNG is used and case folding is on, TextIndexNG seems to corrupt the object - ie. putting the case folded content to the object that it indexed! Below is my story. Situation: Site with propertyObjects, propertyFolders and ZCatalog that has TextIndexNG fields. Some propertyObjects / folders have a field called content, which is uText of type and is indexed into TextIndexNG. If in TextIndexNG we have case folding turned on, then after we save changes to propertyObject/Folder ( and object indexes itself automaticly to Catalog ) the content in content-field loses it's case. And if we turn off the case folding, then casing stays. In TextIndexNG it does not matter, wether the id for index is content or something else - as long as content-attribute is indexed. I didn't look into TextIndexNG code, but I assume that somewhere there is a bug that takes the object attribute instead of just the value of it, and thisway also screws up the object. This was really evil bug, since it was hard to get - and when we saw it - then it had allready corrupted a lot of files that had content. -huima
I have never seen this problem since casefolding is on by default(!) and there is no code that modifies the original object. Please provide a reasonable description how to reproduce this problem with a standard Zope installation. -aj --On Montag, 6. Januar 2003 04:59 +0200 Heimo Laukkanen <huima@fountainpark.org> wrote:
Hi ya,
this is a very strange bug that I my collegue found, I hunted down that TextIndexNG is the cause for it.
Short description: When TextIndexNG is used and case folding is on, TextIndexNG seems to corrupt the object - ie. putting the case folded content to the object that it indexed!
Below is my story.
Situation:
Site with propertyObjects, propertyFolders and ZCatalog that has TextIndexNG fields. Some propertyObjects / folders have a field called content, which is uText of type and is indexed into TextIndexNG.
If in TextIndexNG we have case folding turned on, then after we save changes to propertyObject/Folder ( and object indexes itself automaticly to Catalog ) the content in content-field loses it's case. And if we turn off the case folding, then casing stays. In TextIndexNG it does not matter, wether the id for index is content or something else - as long as content-attribute is indexed.
I didn't look into TextIndexNG code, but I assume that somewhere there is a bug that takes the object attribute instead of just the value of it, and thisway also screws up the object. This was really evil bug, since it was hard to get - and when we saw it - then it had allready corrupted a lot of files that had content.
-huima
--------------------------------------------------------------------- - Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - - "Life is too short to (re)write parsers" - ---------------------------------------------------------------------
Andreas Jung wrote:
I have never seen this problem since casefolding is on by default(!) and there is no code that modifies the original object. Please provide a reasonable description how to reproduce this problem with a standard Zope installation.
Ok. Here is how to do it. I have a Zope 2.6. Create new folder for test textindextest with public interface ( index_html ) Go to index_html, add to properties content uText field. Add content: Test Content' Create ZCatalag there - with name Catalog, add TextIndexNG index with name content, indexing content attribute. Find objects to catalog with name index_html Go back to index_html and check properties: Test Content is changed to test content -huima
Ok, I can reproduce this bug. This seems to be a problem when you are using uText as property type. The bug does not occur with normal string property and does not occur with standard unicode attributes. I am trying to investigate the reason later today...should not be too hard to fix that. -aj --On Montag, 6. Januar 2003 06:58 +0200 Heimo Laukkanen <huima@fountainpark.org> wrote:
Andreas Jung wrote:
I have never seen this problem since casefolding is on by default(!) and there is no code that modifies the original object. Please provide a reasonable description how to reproduce this problem with a standard Zope installation.
Ok. Here is how to do it.
I have a Zope 2.6.
Create new folder for test textindextest with public interface ( index_html )
Go to index_html, add to properties content uText field. Add content: Test Content'
Create ZCatalag there - with name Catalog, add TextIndexNG index with name content, indexing content attribute.
Find objects to catalog with name index_html
Go back to index_html and check properties: Test Content is changed to test content
-huima
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
--------------------------------------------------------------------- - Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - - "Life is too short to (re)write parsers" - ---------------------------------------------------------------------
participants (2)
-
Andreas Jung -
Heimo Laukkanen