home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / rename.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  778 b   |  27 lines  |  [TEXT/ttxt]

  1. #
  2. # Test of rename table
  3. #
  4.  
  5. drop table if exists t0,t1,t2,t3,t4;
  6. create table t0 SELECT 1,"table 1";
  7. create table t2 SELECT 2,"table 2";
  8. create table t3 SELECT 3,"table 3";
  9. rename table t0 to t1;
  10. rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
  11. select * from t1;
  12. rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
  13. rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
  14. select * from t1;
  15. # The following should give errors
  16. !$1050 rename table t1 to t2;
  17. !$1050 rename table t1 to t1;
  18. !$1050 rename table t3 to t4, t2 to t3, t1 to t2, t4 to t2;
  19. show tables like "t_";
  20. !$1050 rename table t3 to t1, t2 to t3, t1 to t2, t4 to t1;
  21. !$1017 rename table t3 to t4, t5 to t3, t1 to t2, t4 to t1;
  22.  
  23. select * from t1;
  24. select * from t2;
  25. select * from t3;
  26. drop table if exists t1,t2,t3,t4;
  27.