Inspect cluster table account scope

Run this recipe only as the sys account on an isolated instance. A cluster table in mo_catalog has account scope; check the sys and tenant-scoped rows through separate logins. The source regression test changes global privilege-cache state, so use its isolated test environment if the manual scope check is unsuitable.

sys account

CREATE ACCOUNT cookbook_cluster_reader ADMIN_NAME 'admin' IDENTIFIED BY '111';
USE mo_catalog;
CREATE CLUSTER TABLE cookbook_cluster_demo(id INT);
INSERT INTO cookbook_cluster_demo VALUES(1,0),(2,1);
UPDATE cookbook_cluster_demo
SET account_id=(SELECT account_id FROM mo_account
                WHERE account_name='cookbook_cluster_reader')
WHERE account_id=1;
SELECT id,account_id FROM cookbook_cluster_demo ORDER BY id;

tenant account

USE mo_catalog;
SELECT id FROM cookbook_cluster_demo ORDER BY id;

sys cleanup

USE mo_catalog;
DROP TABLE cookbook_cluster_demo;
DROP ACCOUNT cookbook_cluster_reader;

The sys query sees both rows, including their account IDs; the tenant session sees only ID 2, assigned to that account. The temporary account ID 1 in the insert is replaced before the tenant query. Clean up the table and account from sys after closing the tenant session. See the v4.2.4 source test.