cockroachdb / cockroachdb/cockroach

builtins: ensure that sqlsmith can generate interesting arguments for all builtins

Open
#102,695 0 comments 1 reaction 0 assignees View on GitHub
C-cleanup E-quick-win O-sre T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

As part of the postportem for #101549, Josh and I discussed how we could have better testing coverage for builtins. One idea mentioned was to rely on `sqlsmith` (which can randomly use all builtins, unless explicitly opted-out). However, we need to make sure that `sqlsmith` can generate "interesting" arguments so that builtin invocation wouldn't result in an error and would actually do something meaningful. E.g. exercising `crdb_internal.probe_ranges` via `sqlsmith` would never get "intersting" arguments because the builtin accepts an enum argument that is never persisted to disk, so it's impossible to actually generate that enum randomly.

We should consider writing a unit test that for each builtin would ensure that "interesting" arguments can picked by `sqlsmith` (unless explicitly opted-out). This would encourage engineers to pick argument types that are more likely to be exercised.

Jira issue: CRDB-27600

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.