Skip to content

Validate physical CockroachDB table config value before using it#9191

Merged
pcman312 merged 3 commits into
masterfrom
cockroachdb-sql
Jun 12, 2020
Merged

Validate physical CockroachDB table config value before using it#9191
pcman312 merged 3 commits into
masterfrom
cockroachdb-sql

Conversation

@pcman312
Copy link
Copy Markdown
Contributor

Adding validation to the CockroachDB physical backend's table config value.

From the CockroachDB docs

  • All values that accept an identifier must:
    • Begin with a Unicode letter or an underscore (_). Subsequent characters can be letters,
    • underscores, digits (0-9), or dollar signs ($).
  • Not equal any SQL keyword unless the keyword is accepted by the element's syntax.

The rules implemented here are a bit more restricted than what is listed on the docs for ease of implementation. Also explicitly rejecting backticks, single quotes, and double quotes to prevent problems when using it in SQL queries.

@pcman312 pcman312 requested a review from a team June 10, 2020 20:19
"YEAR": true,
"ZONE": true,
}
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long list is long :)

Copy link
Copy Markdown

@Valarissa Valarissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pcman312 pcman312 merged commit d11f157 into master Jun 12, 2020
@pcman312 pcman312 deleted the cockroachdb-sql branch June 12, 2020 17:09
catsby added a commit that referenced this pull request Jun 15, 2020
* master: (36 commits)
  Minor transform docs rewording (#9223)
  Validate physical CockroachDB table config value before using it (#9191)
  Validate physical MySQL database and table config values before using them (#9189)
  add disable_iss_validation option to k8s auth docs (#9142)
  fix: configutil redeclared as imported package name (#9211)
  Integrate password policies into RabbitMQ secret engine (#9143)
  Clarify cache setting. (#9204)
  Test pre-1.4 seal migration  (#9085)
  Simple typos (#9119)
  Update contribution guidelines
  changelog++
  Add ssh signing algorithm as a role option.   (#9096)
  replacing "a key usage mode" as it is confusing (#9194)
  changelog++
  fix: invalidate cached clients after a config change in the aws secrets backend (#9186)
  website: remove whitepaper link from subnav (#9190)
  changelog++
  Improving transit batch encrypt and decrypt latencies (#8775)
  changelog++
  AWS: Add iam_groups parameter to role create/update (#8811)
  ...
andaley pushed a commit that referenced this pull request Jul 17, 2020
* Validate table name (and database if specified) prior to using it in SQL
pull Bot pushed a commit to Reality2byte/vault that referenced this pull request Sep 9, 2025
* Update github.com/petermattis/goid to support Go 1.25
* Update to Go 1.25.1

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants