public final class SyntaxDegrader extends Object
SyntaxDegrader.Kind.TRUNCATE — drop the trailing 10-40% of the tokens at a token boundary.SyntaxDegrader.Kind.DROP_PAREN — remove one random ( or ).SyntaxDegrader.Kind.INSERT_KEYWORD — insert FOOBAR before a random clause keyword.These samples are meant for the pp2 (tolerant) engine; pp is expected to reject them.
| Modifier and Type | Class and Description |
|---|---|
static class |
SyntaxDegrader.Kind |
static class |
SyntaxDegrader.Sample
A derived sample.
|
| Modifier and Type | Method and Description |
|---|---|
static SyntaxDegrader.Sample |
degrade(String sql,
EDbVendor vendor,
long seed,
int index)
Degrade
sql with the index-th kind (rotating) and a seed derived from seed and
index, verifying that the result no longer parses; up to five re-seeded attempts rotate through
the kinds, and a sample that still parses after that is returned flagged SyntaxDegrader.Sample.stillParses. |
static SyntaxDegrader.Sample |
degrade(String sql,
EDbVendor vendor,
long seed,
SyntaxDegrader.Kind kind) |
public static SyntaxDegrader.Sample degrade(String sql, EDbVendor vendor, long seed, int index)
sql with the index-th kind (rotating) and a seed derived from seed and
index, verifying that the result no longer parses; up to five re-seeded attempts rotate through
the kinds, and a sample that still parses after that is returned flagged SyntaxDegrader.Sample.stillParses.public static SyntaxDegrader.Sample degrade(String sql, EDbVendor vendor, long seed, SyntaxDegrader.Kind kind)