华东师范大学学报(自然科学版) ›› 2021, Vol. 2021 ›› Issue (5): 74-83.doi: 10.3969/j.issn.1000-5641.2021.05.007

• 系统关键技术 • 上一篇    下一篇

面向OLAP数据库查询处理功能的模糊测试工具

项兆坤1, 陈婷1, 苏仟2, 张蓉1,*()   

  1. 1. 华东师范大学 数据科学与工程学院, 上海 200062
    2. 国家工业信息安全发展研究中心, 北京 100040
  • 收稿日期:2021-08-04 出版日期:2021-09-25 发布日期:2021-09-28
  • 通讯作者: 张蓉 E-mail:rzhang@dase.ecnu.edu.cn
  • 基金资助:
    国家自然科学基金(62072179); 2020年关键软件适配验证中心项目

A fuzzer for query processing functionality of OLAP databases

Zhaokun XIANG1, Ting CHEN1, Qian SU2, Rong ZHANG1,*()   

  1. 1. School of Data Science and Engineering, East China Normal University, Shanghai 200062, China
    2. China Industrial Control Systems Cyber Emergency Response Team, Beijing 100040, China
  • Received:2021-08-04 Online:2021-09-25 Published:2021-09-28
  • Contact: Rong ZHANG E-mail:rzhang@dase.ecnu.edu.cn

摘要:

查询处理是现代关系型数据库管理系统(DBMS)中最重要的功能之一, 主要包括查询优化和查询执行. 然而查询处理的复杂性导致了测试的高成本, 阻碍了开发过程中的快速迭代, 并可能在生产环境中导致严重错误. 为了更好地服务于DBMS查询处理功能的评测, 采用模糊测试的方法生成基于主键约束的随机数据和完全有效的复杂分析型查询; 构建约束优化, 对查询中算子的精确基数进行高效计算, 从而获得查询的正确结果; 最后实现了完整的工具. 通过对TiDB的不同版本进行了小规模的测试, 结果表明可以有效地检测出TiDB不同版本的一些Bug.

关键词: 分析型数据库, 查询处理, 查询执行, 查询优化器, 模糊测试

Abstract:

Query processing, including optimization and execution, is one of the most critical functionalities of modern relational database management systems (DBMS). The complexity of query processing functionalities, however, leads to high testing costs. It hinders rapid iterations during the development process and can lead to severe errors when deployed in production environments. In this paper, we propose a tool to better serve the testing and evaluation of DBMS query processing functionalities; the tool uses a fuzzing approach to generate random data that is highly associated with primary keys and generates valid complex analytical queries. The tool constructs constrained optimization problems to efficiently compute the exact cardinalities of operators in queries and furnish the results. We launched small-scale testing of our method on different versions of TiDB and demonstrated that the tool can effectively detect bugs in different versions of TiDB.

Key words: OLAP database, query processing, query execution, exact cardinality, fuzzing

中图分类号: