jumpwire-db-gateway
jumpwire-db-gateway copied to clipboard
Treat derived tables as wildcards
When using a derived table name, it isn't possible to determine the tables being accessed just from the query. For example,
SELECT * FROM (SELECT name FROM users) AS t;
will use dynamic table names based on the value of name in the users table. Since we don't know the values ahead of time, we should be cautious and treat this as potentially accessing all labeled data.
Implementation note: when parsing queries like this, :derived will be set as the table name instead of a string.