dolt icon indicating copy to clipboard operation
dolt copied to clipboard

Dolt system functions ignore database qualifier.

Open nicktobey opened this issue 1 year ago • 0 comments

This is best illustrated with an example:

CREATE DATABASE d1;
USE d1;
CALL dolt_checkout('-b', 'new');
CREATE DATABASE d2;
USE d2;
CALL dolt_checkout('-b', 'newer');
SELECT active_branch(); -- returns "newer"
USE d1;
SELECT active_branch(); -- returns "new"
SELECT d1.active_branch(); -- returns "new"
SELECT d2.active_branch(); -- returns "new"
SELECT does_not_exist.active_branch(); -- returns "new"

I'm not sure what the correct behavior should be when accessing system tables from another database, but the fact that the qualifier is parsed and then silently ignored feels wrong.

nicktobey avatar Oct 23 '23 22:10 nicktobey