org.hsqldb.test
Class TestSubselect

java.lang.Object
  extended byTestCase
      extended byorg.hsqldb.test.TestSubselect

public class TestSubselect
extends TestCase

Test cases for HSQL subselects.

Author:
David Moles Apr 30, 2002
See Also:
Serialized Form

Field Summary
static java.lang.String datasetPath
           
 
Constructor Summary
TestSubselect(java.lang.String s)
          Constructs a new SubselectTest.
 
Method Summary
static void main(java.lang.String[] args)
           
 void testAliasScope()
          Inner select reusing alias names from outer select, but using them for different tables
 void testAndedSubselects()
          Tests two subselects, anded.
 void testHiddenCollision()
          Inner select with two tables having columns with the same name, one of which is referred to in the subselect, the other of which is not used in the query (both FRUITS and TREES have NAME column, but we're only selecting FRUITS.NAME and we're not referring to TREES.NAME at all).
 void testHiddenCollisionWithAliases()
          As above, with table aliases.
 void testNestedSubselects()
          Test nested subselects.
 void testNotIn()
          Inner select with "not in" in outer select where clause.
 void testNotInSameTableAndColumn()
          Inner select with "not in" in outer select where clause and same table in inner select where clause.
 void testSameTable()
          Inner select involving same table
 void testSameTableWithAliases()
          As above with aliases.
 void testSameTableWithJoin()
          Inner select involving same table as one of two joined tables in outer select
 void testSimpleJoin()
          This test is basically a sanity check of the data set.
 void testWhereClausesColliding()
          Inner select with where clause in outer select having column with same name as where clause in inner select
 void testWhereClausesCollidingWithAliases()
          As above, with table aliases.
 void testWhereSelectColliding()
          Inner select with where clause in outer select having column with same name as select clause in inner select
 void testWhereSelectCollidingWithAliases()
          As above, with aliases.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datasetPath

public static final java.lang.String datasetPath
See Also:
Constant Field Values
Constructor Detail

TestSubselect

public TestSubselect(java.lang.String s)
Constructs a new SubselectTest.

Method Detail

testSimpleJoin

public void testSimpleJoin()
                    throws java.sql.SQLException
This test is basically a sanity check of the data set.

Throws:
java.sql.SQLException

testWhereClausesColliding

public void testWhereClausesColliding()
                               throws java.sql.SQLException
Inner select with where clause in outer select having column with same name as where clause in inner select

Throws:
java.sql.SQLException

testWhereClausesCollidingWithAliases

public void testWhereClausesCollidingWithAliases()
                                          throws java.sql.SQLException
As above, with table aliases.

Throws:
java.sql.SQLException

testHiddenCollision

public void testHiddenCollision()
                         throws java.sql.SQLException
Inner select with two tables having columns with the same name, one of which is referred to in the subselect, the other of which is not used in the query (both FRUITS and TREES have NAME column, but we're only selecting FRUITS.NAME and we're not referring to TREES.NAME at all).

Throws:
java.sql.SQLException

testHiddenCollisionWithAliases

public void testHiddenCollisionWithAliases()
                                    throws java.sql.SQLException
As above, with table aliases.

Throws:
java.sql.SQLException

testWhereSelectColliding

public void testWhereSelectColliding()
                              throws java.sql.SQLException
Inner select with where clause in outer select having column with same name as select clause in inner select

Throws:
java.sql.SQLException

testWhereSelectCollidingWithAliases

public void testWhereSelectCollidingWithAliases()
                                         throws java.sql.SQLException
As above, with aliases.

Throws:
java.sql.SQLException

testSameTable

public void testSameTable()
                   throws java.sql.SQLException
Inner select involving same table

Throws:
java.sql.SQLException

testSameTableWithAliases

public void testSameTableWithAliases()
                              throws java.sql.SQLException
As above with aliases.

Throws:
java.sql.SQLException

testSameTableWithJoin

public void testSameTableWithJoin()
                           throws java.sql.SQLException
Inner select involving same table as one of two joined tables in outer select

Throws:
java.sql.SQLException

testAndedSubselects

public void testAndedSubselects()
                         throws java.sql.SQLException
Tests two subselects, anded.

Throws:
java.sql.SQLException

testNestedSubselects

public void testNestedSubselects()
                          throws java.sql.SQLException
Test nested subselects.

Throws:
java.sql.SQLException

testNotIn

public void testNotIn()
               throws java.sql.SQLException
Inner select with "not in" in outer select where clause.

Throws:
java.sql.SQLException

testNotInSameTableAndColumn

public void testNotInSameTableAndColumn()
                                 throws java.sql.SQLException
Inner select with "not in" in outer select where clause and same table in inner select where clause.

Throws:
java.sql.SQLException

testAliasScope

public void testAliasScope()
                    throws java.sql.SQLException
Inner select reusing alias names from outer select, but using them for different tables

Throws:
java.sql.SQLException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2001 - 2002 HSQL Development Group. All Rights Reserved.