Spatial Database Management Systems (SDBMSs) aim to store, manipulate, and retrieve spatial data. SDBMSs are employed in various modern applications, such as geographic information systems, computer-aided design tools, and location-based services. However, the presence of logic bugs in SDBMSs can lead to incorrect results, substantially undermining the reliability of these applications. Detecting logic bugs in SDBMSs is challenging due to the lack of ground truth for identifying incorrect results. In this paper, we propose an automated geometry-aware generator to generate high-quality SQL statements for SDBMSs and a novel concept named Affine Equivalent Inputs (AEI) to validate the results of SDBMSs. We implemented them as a tool named Spatter (Spatial DBMSs Tester) for finding logic bugs in four popular SDBMSs: PostGIS, DuckDB Spatial, MySQL, and SQL Server. Our testing campaign detected 34 previously unknown and unique bugs in these SDBMS, of which 30 have been confirmed, and 18 have been already fixed. Our testing efforts have been well appreciated by the developers. Experimental results demonstrate that the geometry-aware generator significantly outperforms a naive random-shape generator in detecting unique bugs, and AEI can identify 14 logic bugs in SDBMSs that were overlooked by previous methodologies.
翻译:空间数据库管理系统旨在存储、操作和检索空间数据,广泛应用于地理信息系统、计算机辅助设计工具和基于位置的服务等现代应用。然而,空间数据库管理系统中存在的逻辑错误可能导致结果错误,严重损害这些应用的可靠性。由于缺乏识别错误结果的基准真值,检测空间数据库管理系统中的逻辑错误具有挑战性。本文提出了一种自动化几何感知生成器,用于为空间数据库管理系统生成高质量的SQL语句,并提出名为仿射等价输入的新概念来验证空间数据库管理系统的结果。我们将其实现在名为Spatter的工具中,用于在四种主流空间数据库管理系统(PostGIS、DuckDB Spatial、MySQL和SQL Server)中检测逻辑错误。测试活动在这些系统中发现了34个先前未知的独特错误,其中30个已获确认,18个已被修复。开发团队对我们的测试工作给予了高度评价。实验结果表明,几何感知生成器在检测独特错误方面显著优于简单的随机形状生成器,且仿射等价输入能够发现先前方法遗漏的14个逻辑错误。