Skip to main content

SPECULATIVE_FAILURES_PER_TOKEN

Constant SPECULATIVE_FAILURES_PER_TOKEN 

Source
const SPECULATIVE_FAILURES_PER_TOKEN: usize = 100;
Expand description

Per-token cap on Parser::maybe_parse failures. Bounded by token count so deeply nested but valid SQL (e.g. parallel-workload generated queries with thousands of nested casts) has room to speculate, while still cutting off exponential backtracking on pathological input (the DoS case is 2^N failures on ~200 tokens; this cap is linear).