# This file documents operations that are unsupported when running a SQL tenant
# server.
# LogicTest: 3node-tenant

query I
SELECT crdb_internal.node_id()
----
NULL

statement ok
CREATE TABLE kv (k STRING PRIMARY KEY, v STRING)

statement ok
INSERT INTO kv VALUES ('foo', 'bar')

# This isn't actually using DistSQL since it fails during planning (node liveness
# and friends are missing). The work to do here for Phase 2 is to not even try
# DistSQL on tenant SQL servers.
query I
SET distsql = on; SELECT count(*) FROM kv
----
1

# This works, but jobs itself will need work as it relies on node liveness and
# having a NodeID.
query I
SELECT job_id FROM [ SHOW JOBS ] WHERE job_id = 0
----

# Temp tables work, but the TemporaryObjectCleaner needs some work as it
# relies on the status server.
statement ok
SET experimental_enable_temp_tables = true

statement ok
CREATE TEMP TABLE users (id UUID, city STRING, CONSTRAINT "primary" PRIMARY KEY (id ASC, city ASC))

# Cannot read store or node status

statement error operation is unsupported within a virtual cluster
SELECT * FROM crdb_internal.kv_store_status

statement error operation is unsupported within a virtual cluster
SELECT * FROM crdb_internal.kv_node_status
