/*s*/DROP tmptbl1 IF EXISTS;
/*s*/DROP tmptbl2 IF EXISTS;
/*s*/DROP user altuser1;
/*s*/DROP user altuser2;

CREATE USER altuser1 PASSWORD password;;
CREATE USER altuser2 PASSWORD password;;
SET AUTOCOMMIT false;
/*u0*/CREATE TEMP TABLE tmptbl1 (i int);
/*u0*/CREATE TEMP TABLE tmptbl2 (i int);
/*u1*/INSERT INTO tmptbl1 VALUES(1);
/*u1*/INSERT INTO tmptbl1 VALUES(2);
/*c2*/SELECT * FROM tmptbl1;
COMMIT;
-- Purposefully not committing these inserts
/*u1*/INSERT INTO tmptbl2 VALUES(1);
/*u1*/INSERT INTO tmptbl2 VALUES(2);
/*c0*/SELECT * FROM tmptbl1;
/*c2*/SELECT * FROM tmptbl2;
/*u0*/GRANT ALL ON tmptbl1 TO altuser1;
/*u0*/GRANT ALL ON tmptbl2 TO altuser1;

CONNECT USER altuser1 PASSWORD password;
/*c0*/SELECT * FROM tmptbl1;
/*c0*/SELECT * FROM tmptbl2;

CONNECT USER altuser2 PASSWORD password;
/*e*/SELECT * FROM tmptbl1;
/*e*/SELECT * FROM tmptbl2;

CONNECT USER SA password '';
SHUTDOWN IMMEDIATELY;
