Overview of the Issue
When executing a query that joins a table with a derived table containing a UNION that spans multiple keyspaces (or shards), the query planner fails with the error:
VT13001: [BUG] could not find the column '...' on the UNION
Reproduction Steps
This can be reproduced with the following query running against the planner test vschema.
-- Where `user` is in a sharded keyspace and `unsharded` is in an unsharded keyspace.
SELECT u.id
FROM user AS u
JOIN (
SELECT id AS pid FROM user WHERE id = 1
UNION
SELECT id AS pid FROM unsharded WHERE id = 1
) AS i ON u.id = i.pid
Binary Version
This affects v22, v23 and main.
Operating System and Environment details
Log Fragments
Overview of the Issue
When executing a query that joins a table with a derived table containing a UNION that spans multiple keyspaces (or shards), the query planner fails with the error:
Reproduction Steps
This can be reproduced with the following query running against the planner test vschema.
Binary Version
This affects v22, v23 and
main.Operating System and Environment details
Log Fragments