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 / show_check.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  2.4 KB  |  90 lines  |  [TEXT/ttxt]

  1. #
  2. # Test of some show commands
  3. #
  4. drop table if exists t1,t2;
  5. create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
  6. insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
  7. create table t2 type=isam select * from t1;
  8. optimize table t1;
  9. check table t1,t2;
  10. repair table t1,t2;
  11. check table t2,t1;
  12. lock tables t1 write;
  13. check table t2,t1;
  14. show columns from t1;
  15. show full columns from t1;
  16. show index from t1;
  17. drop table t1,t2;
  18.  
  19. create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
  20. insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
  21. check table t1 type=fast;
  22. check table t1 type=fast;
  23. check table t1 type=changed;
  24. insert into t1 values (5,5,5);
  25. check table t1 type=changed;
  26. check table t1 type=medium;
  27. check table t1 type=extended;
  28. show index from t1;
  29. !$1062 insert into t1 values (5,5,5);
  30. optimize table t1;
  31. optimize table t1;
  32. drop table t1;
  33.  
  34. #show variables;
  35. show variables like "wait_timeout%";
  36. show variables like "WAIT_timeout%";
  37. show variables like "this_doesn't_exists%";
  38. show table status from test like "this_doesn't_exists%";
  39. show databases;
  40. show databases like "test%";
  41.  
  42. #
  43. # Check of show index
  44. #
  45. create table t1 (f1 int not null, f2 int not null, f3 int not null, f4 int not null, primary key(f1,f2,f3,f4));
  46. insert into t1 values (1,1,1,0),(1,1,2,0),(1,1,3,0),(1,2,1,0),(1,2,2,0),(1,2,3,0),(1,3,1,0),(1,3,2,0),(1,3,3,0),(1,1,1,1),(1,1,2,1),(1,1,3,1),(1,2,1,1),(1,2,2,1),(1,2,3,1),(1,3,1,1),(1,3,2,1),(1,3,3,1);
  47. analyze table t1;
  48. show index from t1;
  49. repair table t1;
  50. show index from t1;
  51. drop table t1;
  52.  
  53. #
  54. # Test of SHOW CREATE
  55. #
  56.  
  57. create temporary table t1 (a int not null);
  58. show create table t1;
  59. alter table t1 rename t2;
  60. show create table t2;
  61. drop table t2;
  62.  
  63. create table t1 (
  64.   test_set set( 'val1', 'val2', 'val3' ) not null default '',
  65.   name char(20) default 'O''Brien'
  66.   ) comment = 'it\'s a table' ;
  67. show create table t1 ;
  68. drop table t1;
  69.  
  70. create table t1 (a int not null, unique aa (a));
  71. show create table t1;
  72. drop table t1;
  73. create table t1 (a int not null, primary key (a));
  74. show create table t1;
  75. drop table t1;
  76.  
  77. create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), h float(3,2), i float(3,0));
  78. show columns from t1;
  79. drop table t1;
  80.  
  81. # Check auto conversions of types
  82.  
  83. create table t1 (c decimal, d double, f float, r real);
  84. show columns from t1;
  85. drop table t1;
  86.  
  87. create table t1 (c decimal(3,3), d double(3,3), f float(3,3));
  88. show columns from t1;
  89. drop table t1;
  90.