You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kathey Marsden (JIRA)" <ji...@apache.org> on 2007/07/19 23:17:06 UTC

[jira] Created: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation
--------------------------------------------------------------------------------------------------------------------------------

                 Key: DERBY-2962
                 URL: https://issues.apache.org/jira/browse/DERBY-2962
             Project: Derby
          Issue Type: Task
    Affects Versions: 10.4.0.0
            Reporter: Kathey Marsden


Many of the tests use system table queries which fail when run against a database with TERRITORY_BASED collation with exceptions like:
Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
and can be seen when running lang/FullCollationTests.java

It would be good to change the tests to use casts so that the queries succeed and the tests can complete.



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


[jira] Closed: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden closed DERBY-2962.
---------------------------------


> Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2962
>                 URL: https://issues.apache.org/jira/browse/DERBY-2962
>             Project: Derby
>          Issue Type: Task
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.0.0
>
>
> Many of the tests use system table queries which fail when run against a database with TERRITORY_BASED collation with exceptions like:
> Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
> and can be seen when running lang/FullCollationTests.java
> It would be good to change the tests to use casts so that the queries succeed and the tests can complete.

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


[jira] Updated: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-2962:
----------------------------------

    Fix Version/s: 10.4.0.0

> Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2962
>                 URL: https://issues.apache.org/jira/browse/DERBY-2962
>             Project: Derby
>          Issue Type: Task
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.0.0
>
>
> Many of the tests use system table queries which fail when run against a database with TERRITORY_BASED collation with exceptions like:
> Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
> and can be seen when running lang/FullCollationTests.java
> It would be good to change the tests to use casts so that the queries succeed and the tests can complete.

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


Re: [jira] Commented: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by Bryan Pendleton <bp...@amberpoint.com>.
>> Why does the extra space affect the number of rows in the result? Isn't
>> that space just whitespace and discarded by the SQL parser?
> 
> I don't know. I've attached the failing output in case you want to have 
> a look.

Ah, now I understand.

The test is fetching statements from the *statement cache*, and the extra
space in the statement causes it to appear in the statement cache twice,
once with the extra space and once without.

    ij> select SQL_TEXT from syscs_diag.statement_cache where CAST(SQL_TEXT  AS LONG VARCHAR) LIKE 
'%932432%';
    SQL_TEXT 

 
--------------------------------------------------------------------------------------------------------------------------------
    select SQL_TEXT from syscs_diag.statement_cache where CAST(SQL_TEXT  AS LONG VARCHAR) LIKE 
'%932432%'
    select SQL_TEXT from syscs_diag.statement_cache where CAST(SQL_TEXT AS LONG VARCHAR) LIKE 
'%932432%'

So the actual statement is semantically identical, but since the statement
cache is tracking the literal statement text, whitespace is significant.

It all makes sense now, thanks for being patient with me John while
it sunk in ... :)

thanks,

bryan


Re: [jira] Commented: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by John Embretsen <Jo...@Sun.COM>.
Bryan Pendleton wrote:
>  > ij> select SQL_TEXT from syscs_diag.statement_cache where 
> CAST(SQL_TEXT  AS LONG VARCHAR) LIKE '%932432%';
> ...
>  > Kathey, was it intentional to include an extra space in the above 
> mentioned statement (between "TEXT" and "AS")?
>  > I think if the second space is removed, the result will contain one 
> row instead of two, and we won't see this diff any longer...
> 
> 
> Why does the extra space affect the number of rows in the result? Isn't
> that space just whitespace and discarded by the SQL parser?

I don't know. I've attached the failing output in case you want to have a look.


-- 
John

Re: [jira] Commented: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by Bryan Pendleton <bp...@amberpoint.com>.
 > ij> select SQL_TEXT from syscs_diag.statement_cache where CAST(SQL_TEXT  AS LONG VARCHAR) LIKE '%932432%';
...
 > Kathey, was it intentional to include an extra space in the above mentioned statement (between "TEXT" and "AS")?
 > I think if the second space is removed, the result will contain one row instead of two, and we won't see this diff any longer...


Why does the extra space affect the number of rows in the result? Isn't
that space just whitespace and discarded by the SQL parser?

thanks,

bryan


[jira] Commented: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by "John H. Embretsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517271 ] 

John H. Embretsen commented on DERBY-2962:
------------------------------------------

I observed that the change to miscerrors.sql in revision 558801 are causing test failures in junit suites in some environments, see for example
http://dbtg.thresher.com/derby/test/Daily/jvm1.5/testing/Limited/testSummary-561847.html

miscerrors(org.apache.derbyTesting.functionTests.tests.lang.LangScripts)junit.framework.ComparisonFailure: Output at line 69 expected:<...where CAST(SQL_TEXT [AS LONG VARCHAR) LIKE '%932432%' ]                    ...> but was:<...where CAST(SQL_TEXT [ AS LONG VARCHAR) LIKE '%932432%']                    ...>

I think, from reading logs from nightly regression tests and my own tests, that the order of the two output rows from the statement

ij> select SQL_TEXT from syscs_diag.statement_cache where CAST(SQL_TEXT  AS LONG VARCHAR) LIKE '%932432%';

varies between JVM versions (e.g. Sun JVM 1.6 has correct order according to the master file, while JVM versions 1.4 and 1.5 have the opposite order), hence causing the failure.

Kathey, was it intentional to include an extra space in the above mentioned statement (between "TEXT" and "AS")?
I think if the second space is removed, the result will contain one row instead of two, and we won't see this diff any longer...


> Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2962
>                 URL: https://issues.apache.org/jira/browse/DERBY-2962
>             Project: Derby
>          Issue Type: Task
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>
> Many of the tests use system table queries which fail when run against a database with TERRITORY_BASED collation with exceptions like:
> Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
> and can be seen when running lang/FullCollationTests.java
> It would be good to change the tests to use casts so that the queries succeed and the tests can complete.

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


[jira] Commented: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517288 ] 

Kathey Marsden commented on DERBY-2962:
---------------------------------------

I posted a patch a while back and would most appreciate if you could try 
it and I will check it in.
http://www.nabble.com/lang.LangScripts-failure-tf4135897.html#a11810906

The test does not fail in my environment so I cannot test it.

Kathey




> Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2962
>                 URL: https://issues.apache.org/jira/browse/DERBY-2962
>             Project: Derby
>          Issue Type: Task
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>
> Many of the tests use system table queries which fail when run against a database with TERRITORY_BASED collation with exceptions like:
> Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
> and can be seen when running lang/FullCollationTests.java
> It would be good to change the tests to use casts so that the queries succeed and the tests can complete.

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


[jira] Resolved: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden resolved DERBY-2962.
-----------------------------------

    Resolution: Fixed

I changed the tests that run with Suites.All (FullCollationTests) but not derbyall since we are not setup to test that except by checking out all the *app.property files. 



> Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2962
>                 URL: https://issues.apache.org/jira/browse/DERBY-2962
>             Project: Derby
>          Issue Type: Task
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>
> Many of the tests use system table queries which fail when run against a database with TERRITORY_BASED collation with exceptions like:
> Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
> and can be seen when running lang/FullCollationTests.java
> It would be good to change the tests to use casts so that the queries succeed and the tests can complete.

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


[jira] Assigned: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden reassigned DERBY-2962:
-------------------------------------

    Assignee: Kathey Marsden

> Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2962
>                 URL: https://issues.apache.org/jira/browse/DERBY-2962
>             Project: Derby
>          Issue Type: Task
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>
> Many of the tests use system table queries which fail when run against a database with TERRITORY_BASED collation with exceptions like:
> Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
> and can be seen when running lang/FullCollationTests.java
> It would be good to change the tests to use casts so that the queries succeed and the tests can complete.

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


[jira] Updated: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-2962:
----------------------------------

    Component/s: Test

> Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2962
>                 URL: https://issues.apache.org/jira/browse/DERBY-2962
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>             Fix For: 10.4.0.0
>
>
> Many of the tests use system table queries which fail when run against a database with TERRITORY_BASED collation with exceptions like:
> Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
> and can be seen when running lang/FullCollationTests.java
> It would be good to change the tests to use casts so that the queries succeed and the tests can complete.

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


[jira] Commented: (DERBY-2962) Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation

Posted by "John H. Embretsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517310 ] 

John H. Embretsen commented on DERBY-2962:
------------------------------------------

I have tested the patch and have verified that the test succeeds with the patch, and fails without it. Feel free to commit :)

> Change functional tests to use casts for System table queries to avoid conversion errors when run with TERRITORY_BASED collation
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2962
>                 URL: https://issues.apache.org/jira/browse/DERBY-2962
>             Project: Derby
>          Issue Type: Task
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>
> Many of the tests use system table queries which fail when run against a database with TERRITORY_BASED collation with exceptions like:
> Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'VARCHAR' and 'CHAR' are not supported.
> and can be seen when running lang/FullCollationTests.java
> It would be good to change the tests to use casts so that the queries succeed and the tests can complete.

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