Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit ccfa941

Browse files
schedutronapavlo
authored andcommitted
Make test more atomic
1 parent bf259f7 commit ccfa941

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/sql/insert_sql_test.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,15 +576,13 @@ TEST_F(InsertSQLTests, NonExistentTable) {
576576
int rows_changed;
577577
std::unique_ptr<optimizer::AbstractOptimizer> optimizer(
578578
new optimizer::Optimizer());
579-
579+
// Insert an int into a non-existent table.
580+
std::string query("INSERT INTO NonExistentTable VALUES(3);");
581+
txn = txn_manager.BeginTransaction();
580582
rows_changed = 0;
581583
EXPECT_THROW({
582584
try {
583-
// Insert an int into a non-existent table.
584-
std::string query("INSERT INTO NonExistentTable VALUES(3);");
585-
txn = txn_manager.BeginTransaction();
586-
auto plan =
587-
TestingSQLUtil::GeneratePlanWithOptimizer(optimizer, query, txn);
585+
TestingSQLUtil::GeneratePlanWithOptimizer(optimizer, query, txn);
588586
} catch (peloton::Exception &ex) {
589587
EXPECT_EQ(ExceptionType::CATALOG, ex.GetType());
590588
EXPECT_STREQ("Table nonexistenttable is not found", ex.what());

0 commit comments

Comments
 (0)