Issue Details (XML | Word | Printable)

Key: DERBY-392
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Satheesh Bandaram
Reporter: Satheesh Bandaram
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Disable creating indexes on long varchar for bit data. Long varchar column doesn't allow creating indexes already.

Created: 25/Jun/05 06:18 AM   Updated: 14/Oct/05 08:47 AM
Return to search
Component/s: SQL
Affects Version/s: 10.0.2.2, 10.1.1.0
Fix Version/s: 10.1.2.1, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works Derby392 2005-10-05 10:05 AM Satheesh Bandaram 7 kB
Environment: generic

Resolution Date: 14/Oct/05 08:47 AM


 Description  « Hide
I guess I did not articulate my reasons for suggesting removal of index support for 'long varchar for bit data' completely.
 
    1) Long varchar types are not comparable... If they are not comparable, it should not be possible to use them in GROUP BY, ORDER BY or allow regular B-Tree indexes.
   2) Also, long varchar types tend to be long in size and hence the regular B-Tree mechanism is not a suitable way to index them. Dan also mentioned they become ineffective for keys longer than half a page size.

It should not be possible to create an index on 'long varchar for bit data' datatypes. Derby currently doesn't allow creating indexes on 'long varchar' datatypes and the same should apply for it's bit data equivalent too.

ij> create table longchar ( i int, c long varchar);
0 rows inserted/updated/deleted
ij> create index longIdx on longchar(c);
ERROR X0X67: Columns of type 'LONG VARCHAR' may not be used in CREATE INDEX, ORD
ER BY, GROUP BY, UNION, INTERSECT, EXCEPT or DISTINCT statements because compari
sons are not supported for that type.
ij> create table longcharBitData ( i int, c long varchar for bit data);
0 rows inserted/updated/deleted
ij> create index longIdx on longcharBitData(c);
0 rows inserted/updated/deleted

Derby also seems to allow GROUP BY and/or ORDER BY on LONG VARCHAR FOR BIT DATA types. I believe this is incorrect too.
select c from longcharBitData group by c;
C

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

0 rows selected
ij> select c from longcharBitData group by c order by c;
C

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

0 rows selected

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #295070 Wed Oct 05 18:32:16 UTC 2005 bandaram DERBY-392: Disable creating b-tree indexes on long varchar for bit data. This datatype requires different kind of index and allowing the current behavior causes may issues.

Submitted by Satheesh Bandaram (satheesh@sourcery.org)
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggbuiltin.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/groupBy.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/implicitConversions.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bit.out

Repository Revision Date User Message
ASF #295076 Wed Oct 05 18:44:46 UTC 2005 bandaram DERBY-392: Disable creating b-tree indexes on long varchar for bit data. This datatype requires different kind of index and allowing the current behavior causes many issues.

Porting the fix from TRUNK (10.2) to 10.1 branch.

Submitted by Satheesh Bandaram (satheesh@sourcery.org)
Files Changed
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/aggbuiltin.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/groupBy.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/implicitConversions.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/bit.out
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/TypeId.java

Repository Revision Date User Message
ASF #306964 Thu Oct 06 23:52:27 UTC 2005 kmarsden DERBY-504
SELECT DISTINCT returns duplicates when selecting from subselects
Merged from trunk with
svn merge -r 267238:267239 https://svn.apache.org/repos/asf/db/derby/code/trunk

Contributed by Knut Anders Hatlen

I (Kathey) also ran j9 tests and updated the j9 masters for changes due to DERBY-392
Files Changed
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/distinct.sql
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/groupBy.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/j9_22/groupBy.out
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/groupBy.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/distinct.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/j9_22/distinct.out
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/distinct.out
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/ProjectRestrictNode.java