<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/wine-window-equivalence-translation-m3l4npk65" -->

---
title: WINE: Window Equivalence Translation | daily.dev
description: WINE is a new testing tool from NUS's TEST Lab that finds correctness bugs in SQL window functions. It rewrites window function queries into semantically...
canonical: https://daily.dev/posts/wine-window-equivalence-translation-m3l4npk65
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: WINE: Window Equivalence Translation | daily.dev
og:description: WINE is a new testing tool from NUS's TEST Lab that finds correctness bugs in SQL window functions. It rewrites window function queries into semantically...
og:url: https://daily.dev/posts/wine-window-equivalence-translation-m3l4npk65
og:image: https://api.daily.dev/og/posts/M3l4NPK65.png
og:image:alt: WINE: Window Equivalence Translation
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# WINE: Window Equivalence Translation

**[DoltHub Blog](https://daily.dev/sources/dolthub-blog)** · 6 min read · 0 upvotes · 0 comments

## Summary

WINE is a new testing tool from NUS's TEST Lab that finds correctness bugs in SQL window functions. It rewrites window function queries into semantically equivalent non-window queries using subqueries, then compares execution results as a test oracle. WINE found 164 bugs total across four tested databases, 87 of them in Dolt, which has already fixed 89 of the 100 GitHub issues filed. Coding agents helped implement and scale the testing, though Yibo Dong manually verified every bug before filing. The approach is compared to SQLancer, the methodology that Argus built upon.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dolthub.com/blog/2026-10-26-wine>

## Questions this post answers

### How does WINE test SQL window functions for correctness bugs?

WINE rewrites window function queries into semantically equivalent queries without window functions, typically using correlated subqueries to replicate the window context, then runs both versions against the same database and compares results. A documented DuckDB example rewrites a SUM DISTINCT window with PARTITION BY into a correlated subquery filtering by matching region. Discrepancies between the two outputs flag a correctness bug.

_Anyone validating window function behavior across databases can track testing research like this via daily.dev._

### How many bugs has WINE found in the Dolt database so far?

WINE found 164 total bugs across four tested databases, with 87 of those in Dolt, making up over half of all bugs found. Of the 100 corresponding GitHub issues filed against Dolt, 89 have already been fixed. Dolt underwent more testing rounds than other databases because its team responded quickly to bug reports, not because it has more bugs.

_Teams picking a database for correctness guarantees can follow bug-hunting results like this on daily.dev._

### What is a 'megabug' in the context of bug reporting for open source projects?

A megabug is a single GitHub issue containing links to many individual bug reproductions, rather than filing a separate issue for each one. Dolt piloted this approach after researcher Suyang Zhong filed a megabug with 23 subissues, letting the Dolt team triage the linked repros at their own pace instead of handling a flood of individual issues.

_Maintainers managing researcher-driven bug floods can see how others structure triage on daily.dev._

## Similar posts on daily.dev

- [Working with Researchers: TEST Lab at National University of Singapore](https://daily.dev/posts/working-with-researchers-test-lab-at-national-university-of-singapore-ok8zixxao) · DoltHub Blog · 0 upvotes · 0 comments
- [Running Ito, a Runtime Analysis Code Review Tool, on Doltgres](https://daily.dev/posts/running-ito-a-runtime-analysis-code-review-tool-on-doltgres-qipdo1lu1) · DoltHub Blog · 0 upvotes · 0 comments
- [Expert in SQL Server Windows Function\( 5 min\)](https://daily.dev/posts/expert-in-sql-server-windows-function-5-min--9vrbtx6uj) · Medium · 0 upvotes · 0 comments
- [Introducing YeSQL: Practical PostgreSQL, One Concept at a Time](https://daily.dev/posts/introducing-yesql-practical-postgresql-one-concept-at-a-time-0hjavfxxa) · Planet PostgreSQL · 0 upvotes · 0 comments
- [How we used Quint to find over 10 bugs in SQLite while hardening Turso](https://daily.dev/posts/how-we-used-quint-to-find-over-10-bugs-in-sqlite-while-hardening-turso-o1aufeqp3) · Lobsters · 2 upvotes · 0 comments

---

Tags: [#sql](https://daily.dev/tags/sql), [#dolt](https://daily.dev/tags/dolt)

[View this post on daily.dev](https://daily.dev/posts/wine-window-equivalence-translation-m3l4npk65)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"WINE: Window Equivalence Translation","url":"https://daily.dev/posts/wine-window-equivalence-translation-m3l4npk65","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/wine-window-equivalence-translation-m3l4npk65"},"datePublished":"2026-10-27T05:11:06.953Z","dateModified":"2026-10-27T05:11:39.083Z","description":"WINE is a new testing tool from NUS's TEST Lab that finds correctness bugs in SQL window functions. It rewrites window function queries into semantically...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/136c8d9e03de332551331ec3518e8e99?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/136c8d9e03de332551331ec3518e8e99?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"DoltHub Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DoltHub Blog","logo":"https://media.daily.dev/image/upload/s--LXDlvjS4--/f_auto,q_auto/v1780213587/logos/dolthub-blog?_a=BAMAMiWQ0","url":"https://daily.dev/sources/dolthub-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/wine-window-equivalence-translation-m3l4npk65","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"sql,dolt","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DoltHub Blog","item":"https://daily.dev/sources/dolthub-blog"},{"@type":"ListItem","position":3,"name":"WINE: Window Equivalence Translation"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/wine-window-equivalence-translation-m3l4npk65#faq","mainEntity":[{"@type":"Question","name":"How does WINE test SQL window functions for correctness bugs?","acceptedAnswer":{"@type":"Answer","text":"WINE rewrites window function queries into semantically equivalent queries without window functions, typically using correlated subqueries to replicate the window context, then runs both versions against the same database and compares results. A documented DuckDB example rewrites a SUM DISTINCT window with PARTITION BY into a correlated subquery filtering by matching region. Discrepancies between the two outputs flag a correctness bug. Anyone validating window function behavior across databases can track testing research like this via daily.dev."}},{"@type":"Question","name":"How many bugs has WINE found in the Dolt database so far?","acceptedAnswer":{"@type":"Answer","text":"WINE found 164 total bugs across four tested databases, with 87 of those in Dolt, making up over half of all bugs found. Of the 100 corresponding GitHub issues filed against Dolt, 89 have already been fixed. Dolt underwent more testing rounds than other databases because its team responded quickly to bug reports, not because it has more bugs. Teams picking a database for correctness guarantees can follow bug-hunting results like this on daily.dev."}},{"@type":"Question","name":"What is a 'megabug' in the context of bug reporting for open source projects?","acceptedAnswer":{"@type":"Answer","text":"A megabug is a single GitHub issue containing links to many individual bug reproductions, rather than filing a separate issue for each one. Dolt piloted this approach after researcher Suyang Zhong filed a megabug with 23 subissues, letting the Dolt team triage the linked repros at their own pace instead of handling a flood of individual issues. Maintainers managing researcher-driven bug floods can see how others structure triage on daily.dev."}}]}
```

