<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/both-ways-bug-me-ixnffblrq" -->

---
title: Both Ways Bug Me | daily.dev
description: A production SQL query contained leftover debugging flags disguised as tautological boolean conditions, such as (1 = 0 OR (1 = 1 AND ...)), which let someone...
canonical: https://daily.dev/posts/both-ways-bug-me-ixnffblrq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Both Ways Bug Me | daily.dev
og:description: A production SQL query contained leftover debugging flags disguised as tautological boolean conditions, such as (1 = 0 OR (1 = 1 AND ...)), which let someone...
og:url: https://daily.dev/posts/both-ways-bug-me-ixnffblrq
og:image: https://api.daily.dev/og/posts/iXNFFBLrq.png
og:image:alt: Both Ways Bug Me
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.

# Both Ways Bug Me

**[The Daily WTF](https://daily.dev/sources/thedailywtf)** · 2 min read · 5 upvotes · 0 comments

## Summary

A production SQL query contained leftover debugging flags disguised as tautological boolean conditions, such as (1 = 0 OR (1 = 1 AND ...)), which let someone toggle whether the query returns all rows or filtered rows. The pattern likely originated as an analyst's ad hoc query that got frozen into a stored procedure, with the undocumented flags never touched since release, highlighting a broader observability gap in the codebase.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://thedailywtf.com/articles/both-ways-bug-me>

## Similar posts on daily.dev

- [SQL Has Rules You Don’t Notice Until Your Query Is Wrong](https://daily.dev/posts/sql-has-rules-you-don-t-notice-until-your-query-is-wrong-ue7ucmkyu) · Medium · 0 upvotes · 0 comments
- [Qaudruple Negative](https://daily.dev/posts/qaudruple-negative-gvjx6zpq7) · The Daily WTF · 3 upvotes · 0 comments
- [T-SQL Mistakes: Careless and Careful Write Six Queries](https://daily.dev/posts/t-sql-mistakes-careless-and-careful-write-six-queries-yclc27gxr) · SQL Authority · 0 upvotes · 0 comments
- [SQL Golf: 5 SQL Tricks You Should \(Probably\) Never Use](https://daily.dev/posts/sql-golf-5-sql-tricks-you-should-probably-never-use-tu7j39kzd) · MotherDuck · 10 upvotes · 0 comments
- [I Know a Query’s Gonna Be Bad When… \#TSQL2sday](https://daily.dev/posts/i-know-a-query-s-gonna-be-bad-when-tsql2sday-ngvz4dujq) · Brent Ozar · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/both-ways-bug-me-ixnffblrq)

```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":"Both Ways Bug Me","url":"https://daily.dev/posts/both-ways-bug-me-ixnffblrq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/both-ways-bug-me-ixnffblrq"},"datePublished":"2026-08-25T11:18:06.063Z","dateModified":"2026-09-13T19:21:13.768Z","description":"A production SQL query contained leftover debugging flags disguised as tautological boolean conditions, such as (1 = 0 OR (1 = 1 AND ...)), which let someone...","image":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","thumbnailUrl":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","isAccessibleForFree":true,"articleSection":"The Daily WTF","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":"The Daily WTF","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/d21a6aa61a7244d893a3b3284df8e2ef","url":"https://daily.dev/sources/thedailywtf"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/both-ways-bug-me-ixnffblrq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"sql","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"The Daily WTF","item":"https://daily.dev/sources/thedailywtf"},{"@type":"ListItem","position":3,"name":"Both Ways Bug Me"}]}
```

