db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2352) Assertion Failure with order by and group by expression
Date Fri, 19 Oct 2007 21:06:51 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536345
] 

Bryan Pendleton commented on DERBY-2352:
----------------------------------------

Modifying SQLChar.getNewVarchar() will affect SQLChar.substring(),
SQLChar.trim(), and SQLChar.ansiTrim().

I'm not clear on the difference between trim() and ansiTrim(). May have to set
breakpoints to try to figure out which one is called by what SQL. I think that
the difference may involve LTRIM vs TRIM LEADING and RTRIM vs
TRIM TRAILING

I see that in our docs, we state explicitly that TRIM and SUBSTR return
a value of type VARCHAR. For example,
http://db.apache.org/derby/docs/10.3/ref/rreftrimfunc.html
So if we change this we'll need to change some docs.

The docs also talk about how these functions work with CLOB types, which
indicates that any complete patch built on substringReturnsChar.diff would
need to have tests that include CLOB.

So, to turn substringReturnsChar.diff into a complete patch, I need to:
 - figure out exactly what SQL functions cause us to arrive at the
   SQLChar methods 'substring', 'trim', and 'ansiTrim'.
 - write tests which use those SQL functions in both ORDER BY and
   GROUP BY expressions
 - ensure that those tests cover CHAR, VARCHAR, LONG VARCHAR,
   CHAR FOR BIT DATA, VARCHAR FOR BIT DATA, 
   LONG VARCHAR FOR BIT DATA, BLOB, and CLOB data types.


> Assertion Failure with order by and group by expression
> -------------------------------------------------------
>
>                 Key: DERBY-2352
>                 URL: https://issues.apache.org/jira/browse/DERBY-2352
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0, 10.3.1.4
>         Environment: Any
>            Reporter: Yip Ng
>            Assignee: Bryan Pendleton
>         Attachments: substringReturnsChar.diff
>
>
> Assertion failure with order by expression:
> ij> select substr('abc', 1) from t1 order by substr('abc', 1);
> ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLVarchar)
expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.SQLChar): org.apache.derby.shared.common.sanity.AssertFailure'.
> Stacktrace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED col1.getClass() (class
org.apache.derby.iapi.types.SQLVarchar) expected to be the same as col2.getClass() (class
org.apache.derby.iapi.types.SQLChar)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.impl.store.access.sort.MergeSort.checkColumnTypes(MergeSort.java:472)
> 	at org.apache.derby.impl.store.access.sort.MergeInserter.insert(MergeInserter.java:106)
> 	at org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(SortResultSet.java:318)
> 	at org.apache.derby.impl.sql.execute.SortResultSet.openCore(SortResultSet.java:269)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(ProjectRestrictResultSet.java:169)
> 	at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(BasicNoPutResultSetImpl.java:260)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:358)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message