Package org.apache.derbyTesting.junit

Examples of org.apache.derbyTesting.junit.IndexStatsUtil.assertTableStats()


        //table. This will cause sysstatistics table to have one row for this
        //new index. Old index will still not have a row for it in
        //sysstatistics table
        s.executeUpdate("INSERT INTO T1 VALUES(1,'a'),(2,'b'),(3,'c'),(4,'d')");
        s.executeUpdate("CREATE INDEX i2 ON t1(c11)");
        stats.assertTableStats(tbl1, 1);
        //Drop the statistics on index I2 and then add it back by calling
        // update statistics
        s.execute("CALL SYSCS_UTIL.SYSCS_DROP_STATISTICS('APP','T1','I2')");
        //Since we dropped the only statistics that existed for table T1, there
        // will no stats found at this point
View Full Code Here


        //Since we dropped the only statistics that existed for table T1, there
        // will no stats found at this point
        stats.assertNoStatsTable(tbl1);
        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1','I2')");
        //The statistics for index I2 has been added back
        stats.assertTableStats(tbl1, 1);
        //Now update the statistics for the old index I1 using the new stored
        //procedure. Doing this should add a row for it in sysstatistics table
        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1','I1')");
        stats.assertTableStats(tbl1, 2);
        //Drop the statistics on index I1 and then add it back by calling
View Full Code Here

        //The statistics for index I2 has been added back
        stats.assertTableStats(tbl1, 1);
        //Now update the statistics for the old index I1 using the new stored
        //procedure. Doing this should add a row for it in sysstatistics table
        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1','I1')");
        stats.assertTableStats(tbl1, 2);
        //Drop the statistics on index I1 and then add it back by calling
        // update statistics
        s.execute("CALL SYSCS_UTIL.SYSCS_DROP_STATISTICS('APP','T1','I1')");
        stats.assertTableStats(tbl1, 1);
        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1','I1')");
View Full Code Here

        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1','I1')");
        stats.assertTableStats(tbl1, 2);
        //Drop the statistics on index I1 and then add it back by calling
        // update statistics
        s.execute("CALL SYSCS_UTIL.SYSCS_DROP_STATISTICS('APP','T1','I1')");
        stats.assertTableStats(tbl1, 1);
        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1','I1')");
        stats.assertTableStats(tbl1, 2);
        //Drop all the statistics on table T1 and then recreate all the
        // statisitcs back again
        s.execute("CALL SYSCS_UTIL.SYSCS_DROP_STATISTICS('APP','T1',null)");
View Full Code Here

        //Drop the statistics on index I1 and then add it back by calling
        // update statistics
        s.execute("CALL SYSCS_UTIL.SYSCS_DROP_STATISTICS('APP','T1','I1')");
        stats.assertTableStats(tbl1, 1);
        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1','I1')");
        stats.assertTableStats(tbl1, 2);
        //Drop all the statistics on table T1 and then recreate all the
        // statisitcs back again
        s.execute("CALL SYSCS_UTIL.SYSCS_DROP_STATISTICS('APP','T1',null)");
        stats.assertNoStatsTable(tbl1);
        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1',null)");
View Full Code Here

        //Drop all the statistics on table T1 and then recreate all the
        // statisitcs back again
        s.execute("CALL SYSCS_UTIL.SYSCS_DROP_STATISTICS('APP','T1',null)");
        stats.assertNoStatsTable(tbl1);
        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1',null)");
        stats.assertTableStats(tbl1, 2);
        //Dropping the index should get rid of it's statistics
        s.executeUpdate("DROP INDEX I1");
        stats.assertTableStats(tbl1, 1);

        //calls to system procedure for update and drop statistics are
View Full Code Here

        stats.assertNoStatsTable(tbl1);
        s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T1',null)");
        stats.assertTableStats(tbl1, 2);
        //Dropping the index should get rid of it's statistics
        s.executeUpdate("DROP INDEX I1");
        stats.assertTableStats(tbl1, 1);

        //calls to system procedure for update and drop statistics are
        // internally converted into ALTER TABLE ... sql but that generated
        // sql format is not available to end user to issue directly. Write a
        // test case for these internal sql syntaxes
View Full Code Here

            "PRIMARY KEY (c11)");
        stats.assertNoStatsTable("TEST_TAB_1");

        //Test - non-unique index
        s.executeUpdate("CREATE INDEX TEST_TAB_1_NUNQ_1 ON TEST_TAB_1(c12)");
        stats.assertTableStats("TEST_TAB_1",1);
        s.executeUpdate("DROP INDEX TEST_TAB_1_NUNQ_1");
        stats.assertNoStatsTable("TEST_TAB_1");
        s.executeUpdate("ALTER TABLE TEST_TAB_1 "+
                "DROP CONSTRAINT TEST_TAB_1_PK_1");
        stats.assertNoStatsTable("TEST_TAB_1");
View Full Code Here

        //Test - unique key constraint on nullable column & non-nullable column
        s.executeUpdate("ALTER TABLE TEST_TAB_1 "+
                "ADD CONSTRAINT TEST_TAB_1_UNQ_2 "+
            "UNIQUE (c12, c13)");
        stats.assertTableStats("TEST_TAB_1",2);
        s.executeUpdate("ALTER TABLE TEST_TAB_1 "+
                "DROP CONSTRAINT TEST_TAB_1_UNQ_2");
        stats.assertNoStatsTable("TEST_TAB_1");
        s.executeUpdate("ALTER TABLE TEST_TAB_1 "+
                "DROP CONSTRAINT TEST_TAB_1_PK_1");
View Full Code Here

        s.executeUpdate("CREATE TABLE TEST_TAB_3 (c31 int not null)");
        s.executeUpdate("INSERT INTO TEST_TAB_3 VALUES(1),(2)");
        s.executeUpdate("ALTER TABLE TEST_TAB_3 "+
                "ADD CONSTRAINT TEST_TAB_3_FK_1 "+
            "FOREIGN KEY(c31) REFERENCES TEST_TAB_1(c11)");
        stats.assertTableStats("TEST_TAB_3",1);
        s.executeUpdate("ALTER TABLE TEST_TAB_3 "+
                "DROP CONSTRAINT TEST_TAB_3_FK_1");
        stats.assertNoStatsTable("TEST_TAB_3");

        //Test - foreign key and primary key constraint
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.