Skip to content

Commit defbac0

Browse files
committed
WL14529: Move QA tests to internal UT
1 parent 0872820 commit defbac0

File tree

2 files changed

+1319
-0
lines changed

2 files changed

+1319
-0
lines changed

devapi/tests/bugs-t.cc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,29 @@ TEST_F(Bugs, bug_27727505_multiple_results)
371371
EXPECT_EQ(string("new_f0"), res.getColumn(0).getColumnLabel());
372372
EXPECT_FALSE(res.nextResult());
373373
}
374+
375+
376+
//This test uses undefined table, so an error should occur when getting to
377+
//that result
378+
sess.sql("drop procedure if exists test").execute();
379+
sess.sql("CREATE PROCEDURE test() BEGIN select f0 from newtable; select f1 from newtable "
380+
"where f0 > 100; select f0 as new_f0 from unknowntable where f0 <= 10;"
381+
" END").execute();
382+
383+
{
384+
SqlResult res = sess.sql("call test").execute();
385+
EXPECT_EQ(100, res.count());
386+
EXPECT_EQ(string("f0"), res.getColumn(0).getColumnName());
387+
std::vector<Row> rowAll = res.fetchAll();
388+
EXPECT_EQ(100, rowAll.size());
389+
EXPECT_TRUE(res.nextResult());
390+
EXPECT_EQ(static_cast<unsigned long>(0), res.count());
391+
EXPECT_EQ(string("f1"), res.getColumn(0).getColumnName());
392+
rowAll = res.fetchAll();
393+
EXPECT_EQ(0, rowAll.size());
394+
EXPECT_THROW(res.nextResult(), mysqlx::Error);
395+
EXPECT_THROW(rowAll = res.fetchAll(), mysqlx::Error);
396+
}
374397
}
375398

376399

@@ -860,3 +883,47 @@ TEST_F(Bugs, Bug31686958)
860883

861884

862885
}
886+
887+
TEST_F(Bugs, Bug29788255)
888+
{
889+
SKIP_IF_NO_XPLUGIN;
890+
891+
SKIP_TEST("Untill Bug#29788255 is fixed");
892+
893+
auto &sess = get_sess();
894+
auto sch = sess.createSchema("test", true);
895+
auto coll = sch.createCollection("Bug29788255");
896+
897+
auto res = coll.find("1 overlaps (1,2)").execute();
898+
EXPECT_EQ(1, res.count());
899+
900+
res = coll.find("null overlaps [1]").execute();
901+
EXPECT_EQ(0, res.count());
902+
903+
res = coll.find("null overlaps [1, null]").execute();
904+
EXPECT_EQ(1, res.count());
905+
906+
res = coll.find("$.food overlaps [\"\"]").execute();
907+
EXPECT_EQ(0, res.count());
908+
909+
res = coll.find("$.food overlaps null").execute();
910+
EXPECT_EQ(0, res.count());
911+
912+
res = coll.find("$.food OVERLAPS \"@#$%^\"").execute();
913+
EXPECT_EQ(0, res.count());
914+
915+
res = coll.find("[\"@#$%^\"] OVERLAPS $.list").execute();
916+
EXPECT_EQ(0, res.count());
917+
918+
res = coll.find("(1+6) OVERLAPS [2,3,5]").execute();
919+
EXPECT_EQ(0, res.count());
920+
921+
res = coll.find("cast((1+6) AS JSON) OVERLAPS [2,3,7]").execute();
922+
EXPECT_EQ(0, res.count());
923+
924+
res = coll.find("[(1+6)] OVERLAPS [2,3,7]").execute();
925+
EXPECT_EQ(1, res.count());
926+
927+
res = coll.find("(1+6) in [2,3,7]").execute();
928+
EXPECT_EQ(1, res.count());
929+
}

0 commit comments

Comments
 (0)