1 CREATE USER test2@localhost;
 
    3 --source include/not_embedded.inc
 
    6 --source suite/parts/inc/part_exch_tabs.inc
 
   10 CREATE DATABASE testdb;
 
   14 --source suite/parts/inc/part_exch_tabs.inc
 
   19 GRANT CREATE, ALTER, DROP, INSERT, SELECT on 
test.* TO test2@localhost;
 
   20 GRANT CREATE, ALTER, DROP, INSERT, SELECT on testdb.* TO test2@localhost;
 
   22 # 8) Exchanges partition and table and back in 2 sessions with 2 databases. 
   23 --echo connect (test2,localhost,test2,,
test,MASTER_MYPORT,MASTER_MYSOCK);
 
   24 connect (test2,localhost,test2,,
test,$MASTER_MYPORT,$MASTER_MYSOCK);
 
   25 # Privileges on both DB's 
   26 ALTER 
TABLE tp EXCHANGE PARTITION p0 WITH 
TABLE testdb.t_10;
 
   28 SELECT * FROM testdb.t_10;
 
   30 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
 
   32 ALTER 
TABLE tp EXCHANGE PARTITION p0 WITH 
TABLE testdb.t_10;
 
   34 SELECT * FROM testdb.t_10;
 
   36 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
 
   38 ALTER 
TABLE testdb.tp EXCHANGE PARTITION p0 WITH 
TABLE t_10;
 
   42 SELECT * FROM testdb.tp WHERE a BETWEEN 0 AND 10;
 
   44 ALTER 
TABLE testdb.tp EXCHANGE PARTITION p0 WITH 
TABLE t_10;
 
   48 SELECT * FROM testdb.tp WHERE a BETWEEN 0 AND 10;
 
   49 --echo disconnect test2;
 
   52 --echo connection 
default;
 
   54 REVOKE INSERT ON testdb.* FROM test2@localhost;
 
   56 --echo connect (test2,localhost,test2,,
test,MASTER_MYPORT,MASTER_MYSOCK);
 
   57 connect (test2,localhost,test2,,
test,$MASTER_MYPORT,$MASTER_MYSOCK);
 
   58 --error ER_TABLEACCESS_DENIED_ERROR
 
   59 ALTER 
TABLE tp EXCHANGE PARTITION p0 WITH 
TABLE testdb.t_10;
 
   60 --error ER_TABLEACCESS_DENIED_ERROR
 
   61 ALTER 
TABLE testdb.tp EXCHANGE PARTITION p0 WITH 
TABLE t_10;
 
   62 --echo disconnect test2;
 
   65 --echo connection 
default;
 
   67 --source suite/parts/inc/part_exch_drop_tabs.inc
 
   69 DROP USER test2@localhost;