Skip to content

Commit 790219f

Browse files
author
Bogdan Degtyariov
committed
Fixed the test case Crud.row_locking
1 parent d5737ba commit 790219f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

devapi/tests/crud-t.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,7 @@ TEST_F(Crud, row_locking)
21712171

21722172
auto lock_check = sess.getSchema("information_schema")
21732173
.getTable("innodb_trx")
2174-
.select("trx_rows_locked")
2174+
.select("count(trx_rows_locked)")
21752175
.where("trx_mysql_thread_id=connection_id()");
21762176

21772177

@@ -2182,7 +2182,7 @@ TEST_F(Crud, row_locking)
21822182
/* Wait to for the row locking status to populate */
21832183
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
21842184
/* No rows here */
2185-
EXPECT_TRUE(lock_check.execute().fetchOne().isNull());
2185+
EXPECT_TRUE((int)lock_check.execute().fetchOne()[0] == 0);
21862186

21872187
sch.createCollection(coll_name);
21882188
Collection coll = sch.getCollection(coll_name);
@@ -2197,14 +2197,16 @@ TEST_F(Crud, row_locking)
21972197
for (DbDoc d; (d = dres.fetchOne());)
21982198
cout << d["num"] << endl;
21992199

2200+
/* Wait to for the row locking status to populate */
2201+
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
22002202
/* Some number of rows has to be locked */
22012203
EXPECT_TRUE((int)lock_check.execute().fetchOne()[0] > 0);
22022204
sess.commit();
22032205

22042206
/* Wait to for the row locking status to populate */
22052207
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
22062208
/* No rows here */
2207-
EXPECT_TRUE(lock_check.execute().fetchOne().isNull());
2209+
EXPECT_TRUE((int)lock_check.execute().fetchOne()[0] == 0);
22082210

22092211
sess.dropSchema(db_name);
22102212
}

0 commit comments

Comments
 (0)