mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-19 20:24:46 +08:00
Make _timescaledb_functions.makeaclitem strict
Function `_timescaledb_functions.makeaclitem` needs to be strict since if it is called with NULL values, it should return NULL.
This commit is contained in:
parent
1d7a7e4e25
commit
483ddcd4de
1
.unreleased/fix_6305
Normal file
1
.unreleased/fix_6305
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fixes: #6305 Make _timescaledb_functions.makeaclitem strict
|
@ -126,7 +126,7 @@ $$ LANGUAGE plpgsql;
|
|||||||
-- This is intended for internal usage and interface might change.
|
-- This is intended for internal usage and interface might change.
|
||||||
CREATE FUNCTION _timescaledb_functions.makeaclitem(regrole, regrole, text, bool)
|
CREATE FUNCTION _timescaledb_functions.makeaclitem(regrole, regrole, text, bool)
|
||||||
RETURNS AclItem AS '@MODULE_PATHNAME@', 'ts_makeaclitem'
|
RETURNS AclItem AS '@MODULE_PATHNAME@', 'ts_makeaclitem'
|
||||||
LANGUAGE C STABLE PARALLEL SAFE;
|
LANGUAGE C STABLE PARALLEL SAFE STRICT;
|
||||||
|
|
||||||
-- Repair relation ACL by removing roles that do not exist in pg_authid.
|
-- Repair relation ACL by removing roles that do not exist in pg_authid.
|
||||||
CREATE PROCEDURE _timescaledb_functions.repair_relation_acls()
|
CREATE PROCEDURE _timescaledb_functions.repair_relation_acls()
|
||||||
|
@ -2,3 +2,17 @@
|
|||||||
-- Please see the included NOTICE for copyright information and
|
-- Please see the included NOTICE for copyright information and
|
||||||
-- LICENSE-APACHE for a copy of the license.
|
-- LICENSE-APACHE for a copy of the license.
|
||||||
\set ECHO errors
|
\set ECHO errors
|
||||||
|
item
|
||||||
|
--------------------
|
||||||
|
wizard=a/wizard
|
||||||
|
wizard=ar/wizard
|
||||||
|
wizard=a*/wizard
|
||||||
|
wizard=a*r*/wizard
|
||||||
|
[NULL]
|
||||||
|
[NULL]
|
||||||
|
[NULL]
|
||||||
|
[NULL]
|
||||||
|
=a*r*/wizard
|
||||||
|
wizard=a*r*/0
|
||||||
|
(10 rows)
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
\set ECHO errors
|
\set ECHO errors
|
||||||
\set VERBOSITY default
|
\set VERBOSITY default
|
||||||
|
\c :TEST_DBNAME :ROLE_SUPERUSER
|
||||||
|
|
||||||
DO $$
|
DO $$
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -11,3 +12,20 @@ BEGIN
|
|||||||
ASSERT( _timescaledb_functions.get_partition_for_key('dev1'::text) = 1129986420 );
|
ASSERT( _timescaledb_functions.get_partition_for_key('dev1'::text) = 1129986420 );
|
||||||
ASSERT( _timescaledb_functions.get_partition_for_key('longlonglonglongpartitionkey'::text) = 1169179734);
|
ASSERT( _timescaledb_functions.get_partition_for_key('longlonglonglongpartitionkey'::text) = 1169179734);
|
||||||
END$$;
|
END$$;
|
||||||
|
|
||||||
|
\pset null '[NULL]'
|
||||||
|
CREATE USER wizard;
|
||||||
|
SELECT * FROM (
|
||||||
|
VALUES
|
||||||
|
(_timescaledb_functions.makeaclitem('wizard', 'wizard', 'insert', false)),
|
||||||
|
(_timescaledb_functions.makeaclitem('wizard', 'wizard', 'insert,select', false)),
|
||||||
|
(_timescaledb_functions.makeaclitem('wizard', 'wizard', 'insert', true)),
|
||||||
|
(_timescaledb_functions.makeaclitem('wizard', 'wizard', 'insert,select', true)),
|
||||||
|
(_timescaledb_functions.makeaclitem(NULL, 'wizard', 'insert,select', true)),
|
||||||
|
(_timescaledb_functions.makeaclitem('wizard', NULL, 'insert,select', true)),
|
||||||
|
(_timescaledb_functions.makeaclitem('wizard', 'wizard', NULL, true)),
|
||||||
|
(_timescaledb_functions.makeaclitem('wizard', 'wizard', 'insert,select', NULL)),
|
||||||
|
(_timescaledb_functions.makeaclitem(0, 'wizard', 'insert,select', true)),
|
||||||
|
(_timescaledb_functions.makeaclitem('wizard', 0, 'insert,select', true))
|
||||||
|
) AS t(item);
|
||||||
|
DROP USER wizard;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user