mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-28 10:30:40 +00:00
fix(compute_ctl): Dollar escaping helper fixes (#11263)
## Problem In the previous PR #11045, one edge-case wasn't covered, when an ident contains only one `$`, we were picking `$$` as a 'wrapper'. Yet, when this `$` is at the beginning or at the end of the ident, then we end up with `$$$` in a row which breaks the escaping. ## Summary of changes Start from `x` tag instead of a blank string. Slack: https://neondb.slack.com/archives/C08HV951W2W/p1742076675079769?thread_ts=1742004205.461159&cid=C08HV951W2W
This commit is contained in:
@@ -16,6 +16,9 @@ TEST_ROLE_NAMES = [
|
||||
{"name": "role \";with ';injections $$ $x$ $ %I !/\\&#@"},
|
||||
{"name": '"role in double quotes"'},
|
||||
{"name": "'role in single quotes'"},
|
||||
{"name": "role$"},
|
||||
{"name": "role$$"},
|
||||
{"name": "role$x$"},
|
||||
]
|
||||
|
||||
TEST_DB_NAMES = [
|
||||
@@ -59,6 +62,18 @@ TEST_DB_NAMES = [
|
||||
"name": "'db in single quotes'",
|
||||
"owner": "'role in single quotes'",
|
||||
},
|
||||
{
|
||||
"name": "db name$",
|
||||
"owner": "role$",
|
||||
},
|
||||
{
|
||||
"name": "db name$$",
|
||||
"owner": "role$$",
|
||||
},
|
||||
{
|
||||
"name": "db name$x$",
|
||||
"owner": "role$x$",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user