Proving the safety of SQL queries

Stefan Brass, C. Goldberg
{"title":"Proving the safety of SQL queries","authors":"Stefan Brass, C. Goldberg","doi":"10.1109/QSIC.2005.50","DOIUrl":null,"url":null,"abstract":"Many programs need to access data in a relational database. This is usually done by means of queries written in SQL. Although the language SQL is declarative, certain runtime errors are possible. Since the occurrence of these errors depend on the data, they are not easily found during testing. The question whether a query is safe can be reduced to a consistency check. It is well known that consistency is in general undecidable, and that this applies also to SQL queries. However, in this paper, we propose a consistency check that can handle a surprisingly large subset of SQL (it uses Skolemization with sorted Skolem functions, and a few other tricks). This consistency check is also the basis for generating other semantic warnings. Furthermore, it can be used to generate test data for SQL queries.","PeriodicalId":150211,"journal":{"name":"Fifth International Conference on Quality Software (QSIC'05)","volume":"33 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2005-09-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"17","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Fifth International Conference on Quality Software (QSIC'05)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/QSIC.2005.50","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 17

Abstract

Many programs need to access data in a relational database. This is usually done by means of queries written in SQL. Although the language SQL is declarative, certain runtime errors are possible. Since the occurrence of these errors depend on the data, they are not easily found during testing. The question whether a query is safe can be reduced to a consistency check. It is well known that consistency is in general undecidable, and that this applies also to SQL queries. However, in this paper, we propose a consistency check that can handle a surprisingly large subset of SQL (it uses Skolemization with sorted Skolem functions, and a few other tricks). This consistency check is also the basis for generating other semantic warnings. Furthermore, it can be used to generate test data for SQL queries.
证明SQL查询的安全性
许多程序需要访问关系数据库中的数据。这通常是通过用SQL编写查询来完成的。尽管SQL语言是声明性的,但仍可能出现某些运行时错误。由于这些错误的发生取决于数据,因此在测试期间不容易发现它们。查询是否安全的问题可以简化为一致性检查。众所周知,一致性通常是不可确定的,这也适用于SQL查询。然而,在本文中,我们提出了一种一致性检查,它可以处理惊人的大SQL子集(它使用Skolemization和排序的Skolem函数,以及其他一些技巧)。这种一致性检查也是生成其他语义警告的基础。此外,它还可用于为SQL查询生成测试数据。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信