@@ -1291,6 +1291,37 @@ func TestUserSpaceDoltTables(t *testing.T) {
12911291 {"generated_exception" , "f" },
12921292 },
12931293 },
1294+ {
1295+ Query : `SELECT * FROM public.dolt_ignore` ,
1296+ Expected : []sql.Row {
1297+ {"generated_*" , "t" },
1298+ {"generated_exception" , "f" },
1299+ },
1300+ },
1301+ {
1302+ Query : `SELECT dolt_ignore.pattern FROM public.dolt_ignore` ,
1303+ Expected : []sql.Row {
1304+ {"generated_*" },
1305+ {"generated_exception" },
1306+ },
1307+ },
1308+ {
1309+ Query : `SELECT name FROM other.dolt_ignore` ,
1310+ ExpectedErr : "database schema not found" ,
1311+ },
1312+ {
1313+ Query : `SELECT * FROM dolt_diff_summary('main', 'WORKING')` ,
1314+ Expected : []sql.Row {
1315+ {"" , "public.dolt_ignore" , "added" , 1 , 1 },
1316+ },
1317+ },
1318+ {
1319+ Query : `SELECT diff_type, from_pattern, to_pattern FROM dolt_diff('main', 'WORKING', 'dolt_ignore')` ,
1320+ Expected : []sql.Row {
1321+ {"added" , nil , "generated_*" },
1322+ {"added" , nil , "generated_exception" },
1323+ },
1324+ },
12941325 {
12951326 Query : "CREATE TABLE foo (pk int);" ,
12961327 Expected : []sql.Row {},
@@ -1310,13 +1341,104 @@ func TestUserSpaceDoltTables(t *testing.T) {
13101341 {
13111342 Query : "SELECT * FROM dolt_status;" ,
13121343 Expected : []sql.Row {
1313- {"dolt_ignore" , 1 , "new table" },
1344+ {"public.dolt_ignore" , 1 , "new table" },
1345+ {"public.foo" , 1 , "new table" },
1346+ {"public.generated_exception" , 1 , "new table" },
1347+ {"public.generated_foo" , 0 , "new table" },
1348+ },
1349+ },
1350+ {
1351+ Query : `CREATE SCHEMA newschema` ,
1352+ Expected : []sql.Row {},
1353+ },
1354+ {
1355+ Query : "INSERT INTO newschema.dolt_ignore VALUES ('test_*', true)" ,
1356+ Expected : []sql.Row {},
1357+ },
1358+ {
1359+ Query : "SET search_path = 'newschema'" ,
1360+ Expected : []sql.Row {},
1361+ },
1362+ {
1363+ Query : `SELECT * FROM dolt_ignore` ,
1364+ Expected : []sql.Row {
1365+ {"test_*" , "t" },
1366+ },
1367+ },
1368+ {
1369+ // Should ignore generated_expected table in newschema but not in public
1370+ Query : "INSERT INTO dolt_ignore VALUES ('generated_exception', true)" ,
1371+ Expected : []sql.Row {},
1372+ },
1373+ {
1374+ Query : `SELECT * FROM dolt_ignore` ,
1375+ Expected : []sql.Row {
1376+ {"generated_exception" , "t" },
1377+ {"test_*" , "t" },
1378+ },
1379+ },
1380+ {
1381+ Query : `SELECT * FROM newschema.dolt_ignore` ,
1382+ Expected : []sql.Row {
1383+ {"generated_exception" , "t" },
1384+ {"test_*" , "t" },
1385+ },
1386+ },
1387+ {
1388+ Query : `SELECT * FROM public.dolt_ignore` ,
1389+ Expected : []sql.Row {
1390+ {"generated_*" , "t" },
1391+ {"generated_exception" , "f" },
1392+ },
1393+ },
1394+ {
1395+ Query : `SELECT * FROM dolt_diff_summary('main', 'WORKING', 'dolt_ignore')` ,
1396+ Expected : []sql.Row {
1397+ {"" , "newschema.dolt_ignore" , "added" , 1 , 1 },
1398+ },
1399+ },
1400+ {
1401+ Query : `SELECT pattern FROM public.dolt_ignore` ,
1402+ Expected : []sql.Row {
1403+ {"generated_*" },
1404+ {"generated_exception" },
1405+ },
1406+ },
1407+ {
1408+ Query : "CREATE TABLE foo (pk int);" ,
1409+ Expected : []sql.Row {},
1410+ },
1411+ {
1412+ Query : "CREATE TABLE test_foo (pk int);" ,
1413+ Expected : []sql.Row {},
1414+ },
1415+ {
1416+ Query : "CREATE TABLE generated_foo (pk int);" ,
1417+ Expected : []sql.Row {},
1418+ },
1419+ {
1420+ Query : "CREATE TABLE generated_exception (pk int);" ,
1421+ Expected : []sql.Row {},
1422+ },
1423+ {
1424+ Query : "SELECT dolt_add('-A');" ,
1425+ Expected : []sql.Row {{"{0}" }},
1426+ },
1427+ {
1428+ Query : "SELECT * FROM dolt_status ORDER BY table_name;" ,
1429+ Expected : []sql.Row {
1430+ {"newschema" , 1 , "new schema" },
1431+ {"newschema.dolt_ignore" , 1 , "new table" },
1432+ {"newschema.foo" , 1 , "new table" },
1433+ {"newschema.generated_exception" , 0 , "new table" },
1434+ {"newschema.generated_foo" , 1 , "new table" },
1435+ {"newschema.test_foo" , 0 , "new table" },
1436+ {"public.dolt_ignore" , 1 , "new table" },
13141437 {"public.foo" , 1 , "new table" },
13151438 {"public.generated_exception" , 1 , "new table" },
13161439 {"public.generated_foo" , 0 , "new table" },
13171440 },
13181441 },
1319- // TODO: Test tables in different schemas
13201442 },
13211443 },
13221444 {
0 commit comments