Skip to content

tests: Introduce SQLancer++ and SQLancer DQP#34881

Merged
def- merged 2 commits intoMaterializeInc:mainfrom
def-:pr-sqlancer++
Mar 9, 2026
Merged

tests: Introduce SQLancer++ and SQLancer DQP#34881
def- merged 2 commits intoMaterializeInc:mainfrom
def-:pr-sqlancer++

Conversation

@def-
Copy link
Copy Markdown
Contributor

@def- def- commented Feb 1, 2026

This is based on Gabor's PR #34892. I'll rebase with only the second commit after it's been merged.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@def- def- force-pushed the pr-sqlancer++ branch 30 times, most recently from a1969c9 to b13ece6 Compare February 3, 2026 09:36
@def- def- force-pushed the pr-sqlancer++ branch 4 times, most recently from 47b8ebf to 6bcb6a4 Compare February 12, 2026 13:32
@def- def- force-pushed the pr-sqlancer++ branch 2 times, most recently from c2b116d to e45e4be Compare February 19, 2026 21:40
@def- def- force-pushed the pr-sqlancer++ branch 10 times, most recently from bb22dbc to 0d97ac4 Compare March 8, 2026 12:00
ggevay added a commit that referenced this pull request Mar 8, 2026
)

Fixes MaterializeInc/database-issues#10067.
(And unblocks #34881)

The problem was that we were simply always statically allowing
subqueries in the `ExprContext` in `sql_impl`. This meant that we
allowed subqueries there even if an outer context (such as the `SET`
part of an `UPDATE`) didn't allow it. This PR fixes this by passing in
the outer context, and inheriting whether that allows subqueries.

(Unfortunately, the error msg didn't come out nice, see the issue that
is linked from the slt.)

Edit: The second commit tweaks how we handle errors in
`generate_column_casts`. The issue was that that function relied on the
buggy behavior of `sql_impl` that allowed subqueries without regard to
the outer context, so that it can catch subqueries specifically by
`lower_uncorrelated`. So, I've now had to explicitly make the outer
context allow subqueries, so that `lower_uncorrelated` can keep catching
it.
@ggevay
Copy link
Copy Markdown
Contributor

ggevay commented Mar 8, 2026

#34892 has been merged now.

@def-
Copy link
Copy Markdown
Contributor Author

def- commented Mar 8, 2026

New status: Blocked on https://github.com/MaterializeInc/database-issues/issues/11219 after rebase :D

I'll probably to bisect that later.

@def- def- force-pushed the pr-sqlancer++ branch 2 times, most recently from 9983d6c to 8418bf3 Compare March 9, 2026 12:37
@def- def- enabled auto-merge (squash) March 9, 2026 13:11
@def- def- changed the title tests: Introduce SQLancer++ tests: Introduce SQLancer++ and SQLancer DQP Mar 9, 2026
@def- def- merged commit 4b2f70f into MaterializeInc:main Mar 9, 2026
132 checks passed
@def- def- deleted the pr-sqlancer++ branch March 9, 2026 13:27
antiguru pushed a commit to antiguru/materialize that referenced this pull request Mar 26, 2026
…erializeInc#34892)

Fixes MaterializeInc/database-issues#10067.
(And unblocks MaterializeInc#34881)

The problem was that we were simply always statically allowing
subqueries in the `ExprContext` in `sql_impl`. This meant that we
allowed subqueries there even if an outer context (such as the `SET`
part of an `UPDATE`) didn't allow it. This PR fixes this by passing in
the outer context, and inheriting whether that allows subqueries.

(Unfortunately, the error msg didn't come out nice, see the issue that
is linked from the slt.)

Edit: The second commit tweaks how we handle errors in
`generate_column_casts`. The issue was that that function relied on the
buggy behavior of `sql_impl` that allowed subqueries without regard to
the outer context, so that it can catch subqueries specifically by
`lower_uncorrelated`. So, I've now had to explicitly make the outer
context allow subqueries, so that `lower_uncorrelated` can keep catching
it.
antiguru pushed a commit to antiguru/materialize that referenced this pull request Mar 26, 2026
This is based on Gabor's PR
MaterializeInc#34892. I'll rebase
with only the second commit after it's been merged.
### Checklist

- [ ] This PR has adequate test coverage / QA involvement has been duly
considered. ([trigger-ci for additional test/nightly
runs](https://trigger-ci.dev.materialize.com/))
- [ ] This PR has an associated up-to-date [design
doc](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/README.md),
is a design doc
([template](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/00000000_template.md)),
or is sufficiently small to not require a design.
  <!-- Reference the design in the description. -->
- [ ] If this PR evolves [an existing `$T ⇔ Proto$T`
mapping](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/command-and-response-binary-encoding.md)
(possibly in a backwards-incompatible way), then it is tagged with a
`T-proto` label.
- [ ] If this PR will require changes to cloud orchestration or tests,
there is a companion cloud PR to account for those changes that is
tagged with the release-blocker label
([example](MaterializeInc/cloud#5021)).
<!-- Ask in #team-cloud on Slack if you need help preparing the cloud
PR. -->
- [ ] If this PR includes major [user-facing behavior
changes](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/guide-changes.md#what-changes-require-a-release-note),
I have pinged the relevant PM to schedule a changelog post.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants