paperbot · PL 论文追踪

RSS

A Formal Framework for Typing and Cast Semantics in SQL Engines

TOPLAS ACM Transactions on Programming Languages and Systems2026
Wenjia Ye, Matías Toro, Claudio Gutierrez, Bruno C. D. S. Oliveira, Éric Tanter

尚未生成 AI 速览(可能缺少 API key 或等待下次运行补跑)。

原文摘要(Abstract)

Practical SQL engines differ in subtle ways in their handling of typing constraints and implicit type casts. These issues, usually not considered in formal accounts of SQL, directly affect the portability of queries between engines. To address this problem, we present a formal typing semantics for SQL, named TRAF , that explicitly captures both static and dynamic type behavior. The system TRAF is expressed in terms of abstract operators that provide the necessary leeway to systematically model the type and cast behavior of different SQL engines (PostgreSQL, MS SQL Server, MySQL, SQLite, and Oracle). We show that this formalism provides formal guarantees for the handling of types. We identify practical conditions under which engine instantiations satisfy type safety and type soundness. In this regard, TRAF can serve as an explicit and testable account of typing in existing engines, potentially guide their evolution, and provide a formal basis to study type-aware query optimizations and design provably-correct query translators. We also test the adequacy of the formalism by implementing TRAF in Python for these five engines and testing it with synthetic queries, SQLancer++- generated queries, and adapted Spider and Calcite benchmark queries.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot3949,
  title = {A Formal Framework for Typing and Cast Semantics in SQL Engines},
  author = {Wenjia Ye and Matías Toro and Claudio Gutierrez and Bruno C. D. S. Oliveira and Éric Tanter},
  booktitle = {TOPLAS},
  year = {2026},
  doi = {10.1145/3834861}
}