Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for rename and set properties TestFakerQueries.java #23950

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import org.intellij.lang.annotations.Language;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

final class TestFakerQueries
extends AbstractTestQueryFramework
{
Expand All @@ -36,6 +38,24 @@ void testShowTables()
assertTableColumnNames("faker.default.test", "id", "name");
}

@Test
kavyabala23 marked this conversation as resolved.
Show resolved Hide resolved
void testRenameTable()
{
assertUpdate("CREATE TABLE faker.default.original_table (id INTEGER, name VARCHAR)");
assertQuery("SHOW TABLES FROM faker.default LIKE 'original_table'", "VALUES 'original_table'");
assertUpdate("ALTER TABLE faker.default.original_table RENAME TO renamed_table");
assertQuery("SHOW TABLES FROM faker.default LIKE 'renamed_table'", "VALUES 'renamed_table'");
}

@Test
void tableComment()
{
assertUpdate("CREATE TABLE faker.default.table_comment (id INTEGER, name VARCHAR)");
assertUpdate("COMMENT ON TABLE faker.default.table_comment IS 'test table comment'");
assertQuery("SELECT comment FROM system.metadata.table_comments WHERE catalog_name = 'faker' AND schema_name = 'default' AND table_name = 'table_comment'" , "VALUES('test table comment')");
assertUpdate("DROP TABLE faker.default.table_comment");
}

@Test
void testSelectFromTable()
{
Expand Down
Loading