fix(vastbase): avoid backslash escape in role grants SQL
This commit is contained in:
parent
10aff74072
commit
8732075dc9
|
|
@ -244,7 +244,7 @@ FROM (
|
|||
)
|
||||
FROM target t
|
||||
CROSS JOIN pg_catalog.pg_namespace n
|
||||
WHERE n.nspname NOT LIKE 'pg\\_%' ESCAPE '\\'
|
||||
WHERE n.nspname NOT LIKE 'pg~_%' ESCAPE '~'
|
||||
AND n.nspname <> 'information_schema'
|
||||
AND (has_schema_privilege(t.rolname, n.oid, 'USAGE') OR has_schema_privilege(t.rolname, n.oid, 'CREATE'))
|
||||
UNION ALL
|
||||
|
|
|
|||
|
|
@ -172,4 +172,6 @@ test("builds PostgreSQL role metadata SQL without directly requiring rolbypassrl
|
|||
assert.doesNotMatch(listSql, /r\.rolbypassrls/);
|
||||
assert.doesNotMatch(grantsSql, /r\.rolbypassrls/);
|
||||
assert.match(grantsSql, /AS rolbypassrls/);
|
||||
assert.match(grantsSql, /n\.nspname NOT LIKE 'pg~_%' ESCAPE '~'/);
|
||||
assert.ok(!grantsSql.includes("ESCAPE '\\'"));
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue