You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(storage): allow digits in SQL table names and return errors instead of panicking
escapeForTableName's allow-list omitted digits, so a network, channel or
namespace containing one — "channel1" being about as common as it gets — was
rejected. Worse, the failure arrived as a panic: the only caller was the
Must* formatter, and nothing on the path from store construction recovers, so
a routine configuration value crashed the node.
Allow digits in the table name parameters and validate the composed
identifier instead of the fragment, so a leading digit is accepted behind a
prefix and rejected only when there is none. Return errors along the whole
chain rather than panicking, and drop the Must* calls from it.
Report every invalid short-code override rather than only the first. The
prefix and the params are shared by all seventeen names, so a problem there is
validated once up front and reported once; overrides apply to a single key
each, so those are collected and joined — otherwise an operator with two bad
entries under token.storage.tableNames fixes one, restarts, and hits the next.
Add FuzzGetTableNamesNoPanic, covering both properties (never panics; either
errors or emits a legal SQL identifier) and wired into nightly-fuzz.yml. The
table prefix is deliberately not fuzzed: every accepted prefix is memoised
forever in the package-level formatter cache, which has no eviction, so
fuzzing it would grow the worker heap for the whole four-hour nightly run.
The prefix edge cases are table-driven tests instead.
Fixes#2034
Signed-off-by: AkramBitar <akram@il.ibm.com>
0 commit comments