接口测试 [求助] AssertJ-DB 断言神器在遇到表名和关键字冲突的时候报错

孙高飞 · 2016年05月24日 · 最后由 孙高飞 回复于 2016年05月30日 · 1868 次阅读

问题描述

AssertJ-DB 中使用 Changes 的时候,如果数据库中的表跟 mysql 的关键字冲突了,例如表名为 group。 那么调用 changes.setStartPointNow 的时候就会报错。报错信息如下:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'group' at line 1

尝试过的方法

  • 定义 Table 的时候使用 如下方式 java Table group_Table = new Table(source, "`group`"); 报错:
Incorrect table name ''
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 2 条回复 时间 点赞

加个 schema 前缀不行么,比如 Table group_Table = new Table(source, "mydatabase.group");

#1 楼 @wuyouz 也不行~ 他默认加了 schema name 了。

ABEE ycwdaaaa (孙高飞) 在 TesterHome 的发帖整理 中提及了此贴 01月12日 13:47
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册