[
https://issues.apache.org/jira/browse/DERBY-2670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mike Matrigali updated DERBY-2670:
----------------------------------
This problem is very sensitive to the data that exists in the table. Removing
a row that should not be affected by the query
changes the results.
I don't know if this is the problem, but it looks like the
WorkHorseForCollatorDatatypes class may cache values in it.. Derby
may reuse a single DataValueDescriptor for multiple values. This is why code
like readExternal goes out of it's way to
reset fields in the datastructure when reading in a new value.
I think this has to somehow get accomplished for the various uses of
WorkHorseForCollatorDatatypes in:
CollatorSQLChar.java CollatorSQLLongvarchar.java
CollatorSQLClob.java CollatorSQLVarchar.java
This problem is showing up particularly for like as we create an array of
collationElementsForString and cache it so if we
a like again we don't rebuild it.
> %a% and %aa% match too many rows in database with collation=TERRITORY_BASED
> and territory=no_NO
> -----------------------------------------------------------------------------------------------
>
> Key: DERBY-2670
> URL: https://issues.apache.org/jira/browse/DERBY-2670
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.3.0.0
> Reporter: Knut Anders Hatlen
> Assigned To: Mike Matrigali
> Attachments: coll.java, collrepro.sql
>
>
> On a database with territory=no_NO and collation=TERRITORY_BASED, I get these
> results from a query which uses the LIKE predicate:
> ij> select * from t where x like '%a%';
> X
> --------------------
> Waagan
> Wåhan
> Wanvik
> Wågan
> ekstrabetaling
> ekstraarbeid
> a
> a
> -a
> a
> B
> C
> 12 rows selected
> The last two rows ('B' and 'C') should not have been included in the result,
> since they do not match the pattern '%a%'.
> Similar wrong results are seen with '%aa%':
> ij> select * from t where x like '%aa%';
> X
> --------------------
> Waagan
> ekstraarbeid
> B
> 3 rows selected
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.