cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

sql: add randomized test for plan-gist logic

Open yuzefovich opened this issue 1 year ago • 4 comments

This commit adds a randomized test for plan-gist logic. It utilizes sqlsmith to generate random stmts, then runs EXPLAIN (GIST) for it to retrieve the gist followed by decoding that gist, and ensures that no internal errors occur. All generated stmts are also executed with a short timeout to allow for DB state to evolve. Additionally, all gists are accumulated and decoded against an empty DB.

The test is placed in the ccl package to exercise features gated behind CCL license.

The test quickly discovered bug fixed in 1315dda2d60f6064ff112c4d169cfdb8a1ce224c (when the corresponding fix is reverted) but haven't found anything new for plan-gist logic (but did hit a few issues elsewhere which are currently ignored in the test).

Fixes: #117634.

Release note: None

yuzefovich avatar Apr 22 '24 23:04 yuzefovich

This change is Reviewable

cockroach-teamcity avatar Apr 22 '24 23:04 cockroach-teamcity

Actually, hold off on reviewing this - it seems like this test is uncovering some issues (not directly related to plan gist though).

yuzefovich avatar Apr 23 '24 01:04 yuzefovich

It's RFAL.

yuzefovich avatar Apr 23 '24 22:04 yuzefovich

Friendly ping @mgartner

yuzefovich avatar May 09 '24 21:05 yuzefovich

Thanks for the review!

bors r+

yuzefovich avatar May 20 '24 22:05 yuzefovich

Build failed (retrying...):

craig[bot] avatar May 20 '24 22:05 craig[bot]

Build failed (retrying...):

craig[bot] avatar May 20 '24 22:05 craig[bot]

bors r-

rickystewart avatar May 20 '24 22:05 rickystewart

Canceled.

craig[bot] avatar May 20 '24 22:05 craig[bot]

Looks like you need to dev gen bazel, please check the CI results before bors'ing.

rickystewart avatar May 20 '24 22:05 rickystewart

Indeed, my bad.

yuzefovich avatar May 20 '24 22:05 yuzefovich

bors r+

yuzefovich avatar May 20 '24 23:05 yuzefovich