Bug 119466 - UPGRADE: Error assigning categories in upgraded db:
UPGRADE: Error assigning categories in upgraded db:
Status: CLOSED RAWHIDE
Product: Red Hat Enterprise CMS
Classification: Retired
Component: other (Show other bugs)
nightly
All Linux
medium Severity medium
: ---
: ---
Assigned To: Vadim Nasardinov
Jon Orris
:
: 122946 (view as bug list)
Depends On:
Blocks: 113496 113597
  Show dependency treegraph
 
Reported: 2004-03-30 14:22 EST by Jon Orris
Modified: 2007-04-18 13:04 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-03-30 16:08:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jon Orris 2004-03-30 14:22:19 EST
@41891/Oracle-se

Clean upgraded oracle database. Does not occur on postgres.

To Reproduce:
Create an item.
Go to 'Assign categories' authoring kit
Click 'Add categories'

Description of problem:
2004-03-30 14:11:31,362 [004-0] ERROR rdbms.RDBMSEngine - select
t6.sort_key as "categorySubtree_parents@link.s0",
       t6.related_category_id as "categorySubtree_parents@link.1",
       t56.object_type as "categorySubtree_parents@link.2",
       t6.category_id as "categorySubtree_parents@link.3",
       t65.object_type as "categorySubtree_parents@link.4",
       t6.default_p as "categorySubtree_parents@link.5",
       t6.relation_type as "categorySubtree_parents@link.6",
       t20.category_id as "categorySubtree_parents.id",
       t65.object_type as "categorySubtree_parents.objec8",
       t65.display_name as "categorySubtree_parents.displ9",
       t65.default_domain_class as "categorySubtree_parents.defa10",
       t2.category_id as "this.categorySubtree.id",
       t2.object_type as "this.categorySubtree.objectT12",
       t2.abstract_p as "this.categorySubtree.isAbstr13",
       t2.default_ancestors as "this.categorySubtree.default14",
       t2.enabled_p as "this.categorySubtree.isEnabled",
       t2.name as "this.categorySubtree.name",
       t2.default_domain_class as "this.categorySubtree.default17",
       t2.description as "this.categorySubtree.descrip18",
       t20.description as "categorySubtree_parents.desc19",
       t20.name as "categorySubtree_parents.name",
       t20.url as "categorySubtree_parents.url",
       t20.enabled_p as "categorySubtree_parents.isEn22",
       t20.abstract_p as "categorySubtree_parents.isAb23",
       t20.default_ancestors as "categorySubtree_parents.defa24"
from (
        select cat_categories.category_id, name, description, enabled_p,
               abstract_p, object_type, default_domain_class,
               default_ancestors
          from acs_objects,
               cat_categories,
               cat_cat_subcat_trans_index trans
         where acs_objects.object_id = cat_categories.category_id
           and trans.category_id = ?
           and trans.subcategory_id = cat_categories.category_id) t2
join cat_category_category_map t6
join acs_objects t56 on t6.related_category_id = t56.object_id
join acs_objects t65 on t6.category_id = t65.object_id on
t2.category_id = t6.related_category_id
join cat_categories t20 on t20.category_id = t65.object_id
where t20.category_id = t6.category_id and t6.category_id =
t20.category_id and t6.relation_type = ?
java.sql.SQLException: ORA-00972: identifier is too long

	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
	at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321)
	at
oracle.jdbc.oci8.OCIDBAccess.parseExecuteDescribe(OCIDBAccess.java:1255)
	at
oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391)
	at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672)
	at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
	at
oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)
	at
com.redhat.persistence.engine.rdbms.RDBMSEngine.execute(RDBMSEngine.java:489)
	at
com.redhat.persistence.engine.rdbms.RDBMSEngine.execute(RDBMSEngine.java:431)
	at
com.redhat.persistence.engine.rdbms.RDBMSEngine.execute(RDBMSEngine.java:265)
	at com.redhat.persistence.Cursor.execute(Cursor.java:131)
	at com.redhat.persistence.Cursor.next(Cursor.java:115)
	at com.arsdigita.persistence.DataQueryImpl.next(DataQueryImpl.java:646)
	at
com.arsdigita.persistence.DataQueryDecorator.next(DataQueryDecorator.java:75)
	at com.arsdigita.domain.DomainQuery.next(DomainQuery.java:94)
	at
com.arsdigita.cms.ui.authoring.CategoryWidget.generateWidget(CategoryWidget.java:90)
Comment 1 Jon Orris 2004-03-30 14:38:20 EST
Query & Bind info:
2004-03-30 14:35:48,653 [004-0] INFO  rdbms.RDBMSEngine - Executing
query(filter(filter(left(left(this = sql
{com.arsdigita.categorization.categorySubtree},
filter(categorySubtree_parents@link =
all(com.arsdigita.categorization.com_arsdigita_categorization_Category:parents::com_arsdigita_categorization_Category:related::Link),
exists(filter(target = this.categorySubtree.parents@link,
categorySubtree_parents@link == target)))),
filter(categorySubtree_parents =
all(com.arsdigita.categorization.Category), exists(filter(target =
this.categorySubtree.parents, categorySubtree_parents == target)))),
categorySubtree_parents@link.parents == categorySubtree_parents),
categorySubtree_parents@link.relationType == "child"),
categorySubtree_parents@link.s0 =
categorySubtree_parents@link.sortKey, categorySubtree_parents@link.1 =
categorySubtree_parents@link.related.id,
categorySubtree_parents@link.2 =
categorySubtree_parents@link.related.objectType,
categorySubtree_parents@link.3 =
categorySubtree_parents@link.parents.id,
categorySubtree_parents@link.4 =
categorySubtree_parents@link.parents.objectType,
categorySubtree_parents@link.5 =
categorySubtree_parents@link.isDefault, categorySubtree_parents@link.6
= categorySubtree_parents@link.relationType,
categorySubtree_parents.id = categorySubtree_parents.id,
categorySubtree_parents.objec8 = categorySubtree_parents.objectType,
categorySubtree_parents.displ9 = categorySubtree_parents.displayName,
categorySubtree_parents.defa10 =
categorySubtree_parents.defaultDomainClass, this.categorySubtree.id =
this.categorySubtree.id, this.categorySubtree.objectT12 =
this.categorySubtree.objectType, this.categorySubtree.isAbstr13 =
this.categorySubtree.isAbstract, this.categorySubtree.default14 =
this.categorySubtree.defaultAncestors, this.categorySubtree.isEnabled
= this.categorySubtree.isEnabled, this.categorySubtree.name =
this.categorySubtree.name, this.categorySubtree.default17 =
this.categorySubtree.defaultDomainClass,
this.categorySubtree.descrip18 = this.categorySubtree.description,
categorySubtree_parents.desc19 = categorySubtree_parents.description,
categorySubtree_parents.name = categorySubtree_parents.name,
categorySubtree_parents.url = categorySubtree_parents.url,
categorySubtree_parents.isEn22 = categorySubtree_parents.isEnabled,
categorySubtree_parents.isAb23 = categorySubtree_parents.isAbstract,
categorySubtree_parents.defa24 = categorySubtree_parents.defaultAncestors)

2004-03-30 14:35:48,752 [004-0] INFO  rdbms.RDBMSEngine - [142, child]
2004-03-30 14:35:48,753 [004-0] INFO  rdbms.RDBMSEngine - [NUMERIC,
VARCHAR]
2004-03-30 14:35:48,753 [004-0] INFO  rdbms.RDBMSEngine - {}
Comment 2 Vadim Nasardinov 2004-03-30 15:49:09 EST
I'm 99% certain this should be fixed in change 41903, although I
haven't tested it on Oracle against your specific test case.

The offending identifier in the above query is
"categorySubtree_parents@link.s0", which is 31 characters long without
the quotes.

There was a logic error in the following chunk of code in
Signature#getColumn(Path):

         int used = 0;
         for (int i = pathIndex; i > 0; i /= 10) { used++; }

This is supposed to efficiently compute
String.valueOf(pathIndex).length().  As written, this computes 0 for
0.  The correct answer is 1, because it takes one character to
represent the string "0".

I special-cased the case of 0 and ran a quick test of the corrected
implementation like so:

|$ cat Main.java 
|public class Main {
|
|    public static void main(String[] args) {
|        for (int ii=0; ii<args.length; ii++) {
|            System.out.println(args[ii] + ": " +
|                               intLength(Integer.parseInt(args[ii])));
|        }
|    }
|
|    private static int intLength(int num) {
|        if ( num < 0 ) { throw new IllegalArgumentException(String.valueOf(num)); }
|
|        if ( num == 0 ) {
|            return 1;
|        }
|
|        int used = 0;
|        for (int ii = num; ii > 0; ii /= 10) { used++; }
|
|        return used;
|    }
|}
|
|$ java -cp . Main 0 1 2 3 4 5 6 7 8 9 10 11 20 21 90 91 99 100 101 110 111
|0: 1
|1: 1
|2: 1
|3: 1
|4: 1
|5: 1
|6: 1
|7: 1
|8: 1
|9: 1
|10: 2
|11: 2
|20: 2
|21: 2
|90: 2
|91: 2
|99: 2
|100: 3
|101: 3
|110: 3
|111: 3
Comment 3 Vadim Nasardinov 2004-03-30 15:49:27 EST
marking QA_READY
Comment 4 Jon Orris 2004-03-30 16:08:48 EST
Fixed @41907
Comment 5 Daniel Berrange 2004-05-11 10:15:29 EDT
*** Bug 122946 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.