Skip to content

Commit

Permalink
RenameTable TestFakerQueries.java
Browse files Browse the repository at this point in the history
  • Loading branch information
kavyabala23 authored Oct 31, 2024
1 parent ddf77a5 commit a83fca4
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,18 @@ void testShowTables()
assertQuery("SHOW SCHEMAS FROM faker", "VALUES 'default', 'information_schema'");
assertUpdate("CREATE TABLE faker.default.test (id INTEGER, name VARCHAR)");
assertTableColumnNames("faker.default.test", "id", "name");
assertUpdate("DROP TABLE faker.default.test");
}

@Test
void testRenameTable()
{
assertUpdate("CREATE TABLE faker.default.original_table (id INTEGER, name VARCHAR)");
assertQuery("SHOW TABLES FROM faker.default", "VALUES 'original_table'");
assertUpdate("ALTER TABLE faker.default.original_table RENAME TO renamed_table");
@Language("SQL")
String testQuery = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'faker' AND table_name = 'renamed_table'";
assertQuery(testQuery, "VALUES 'renamed_table'");
assertUpdate("DROP TABLE faker.default.renamed_table");
assertQuery("SHOW TABLES FROM faker.default", "VALUES 'renamed_table'");
}


@Test
void testSelectFromTable()
{
Expand Down Expand Up @@ -206,7 +204,7 @@ void testSelectLimit()
assertQuery(testQuery, "VALUES (1000)");
assertUpdate("DROP TABLE faker.default.single_column");
}

@Test
void testSelectDefaultTableLimit()
{
Expand Down

0 comments on commit a83fca4

Please sign in to comment.