【BUG】批量导出测试用例异常
禅道开源版11.5
异常日志如下:
11:23:19 ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'a_tc_devops_zentao.TABLE_TESTRUN' doesn't exist<p>The sql is: SELECT t1.* FROM `zt_testresult` AS t1 LEFT JOIN TABLE_TESTRUN AS t2 ON t1.run=t2.id wHeRe t1.`case` IN ('300230','300229','300228') oRdEr bY `id` desc </p> in lib/base/dao/dao.class.php on line 1394, last called by lib/base/dao/dao.class.php on line 708 through function sqlError. in framework/base/router.class.php on line 2215 when visiting /index.php?m=testcase&f=export&productID=30011&orderBy=id_desc&taskID=0&browseType=all
经查看源代码,发现module/testcase.control.php 的第1109行,
->leftJoin('TABLE_TESTRUN')->alias('t2')->on('t1.run=t2.id')
多了单引号,应该为
->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.run=t2.id')