hezean / sustc

Template for project 2 of SUSTech Principles of Database Systems (CS307 / CS213), 23 fall semester.
http://172.18.34.154
MIT License
22 stars 10 forks source link

返回空数组 #90

Closed yihanlii closed 10 months ago

yihanlii commented 10 months ago

Related module

Benchmark

What happened

在benchmark测试含有返回数组的方法时,应该有返回值的测试样例全部返回了空数组,但我在数据库和bootrun对同样测试样例进行测试,都能得到正确结果。之后我又进行了测试,发现benchmark测试时数据库查询得到的返回值里调用.next的值为false,也就是没有查询结果,但正常情况下应该有查询结果 1703576257484 1703576346235(1) 1703576306495(1) image image List<String> temp=new ArrayList<>(); String sql2= "select c.videoBV, count(videoBV) as cnt\n" + "from (\n" + " select a.videoBV\n" + " from user_view_video a\n" + " inner join (select usermid,videobv from user_view_video where videoBV= ?) b\n" + " on a.usermid=b.userMid and a.videobv!=b.videobv) c\n" + "group by c.videobv\n" + "order by cnt desc,c.videoBV\n" + "limit 5;"; try (Connection conn = dataSource.getConnection(); PreparedStatement stmt2 = conn.prepareStatement(sql2); ) { stmt2.setString(1,bv); ResultSet rs2 = stmt2.executeQuery(); while (rs2.next()){ temp.add(rs2.getString("videoBV")); } } catch (SQLException e) { throw new RuntimeException(e); } return temp; 注:上面只是rec video 的代码(不含判断corner case)其他方法的代码和这个类似

What you expected to happen

No response

How to reproduce

No response

Anything else

No response

sses7757 commented 10 months ago

@yihanlii This bug may be caused by asynchronous operations. You can discuss this problem in Discussion #83.