You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
11 KiB

  1. DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
  2. drop view if exists v1;
  3. drop database if exists client_test_db;
  4. mtr.global_suppressions OK
  5. mtr.test_suppressions OK
  6. mysql.columns_priv OK
  7. mysql.db OK
  8. mysql.event OK
  9. mysql.func OK
  10. mysql.general_log
  11. note : The storage engine for the table doesn't support analyze
  12. mysql.help_category OK
  13. mysql.help_keyword OK
  14. mysql.help_relation OK
  15. mysql.help_topic OK
  16. mysql.host OK
  17. mysql.ndb_binlog_index OK
  18. mysql.plugin OK
  19. mysql.proc OK
  20. mysql.procs_priv OK
  21. mysql.proxies_priv OK
  22. mysql.servers OK
  23. mysql.slow_log
  24. note : The storage engine for the table doesn't support analyze
  25. mysql.tables_priv OK
  26. mysql.time_zone OK
  27. mysql.time_zone_leap_second OK
  28. mysql.time_zone_name OK
  29. mysql.time_zone_transition OK
  30. mysql.time_zone_transition_type OK
  31. mysql.user OK
  32. mtr.global_suppressions Table is already up to date
  33. mtr.test_suppressions Table is already up to date
  34. mysql.columns_priv OK
  35. mysql.db OK
  36. mysql.event OK
  37. mysql.func OK
  38. mysql.general_log
  39. note : The storage engine for the table doesn't support optimize
  40. mysql.help_category OK
  41. mysql.help_keyword OK
  42. mysql.help_relation OK
  43. mysql.help_topic OK
  44. mysql.host OK
  45. mysql.ndb_binlog_index OK
  46. mysql.plugin OK
  47. mysql.proc OK
  48. mysql.procs_priv OK
  49. mysql.proxies_priv OK
  50. mysql.servers OK
  51. mysql.slow_log
  52. note : The storage engine for the table doesn't support optimize
  53. mysql.tables_priv OK
  54. mysql.time_zone OK
  55. mysql.time_zone_leap_second OK
  56. mysql.time_zone_name OK
  57. mysql.time_zone_transition OK
  58. mysql.time_zone_transition_type OK
  59. mysql.user OK
  60. mysql.columns_priv OK
  61. mysql.db OK
  62. mysql.event OK
  63. mysql.func OK
  64. mysql.general_log
  65. note : The storage engine for the table doesn't support analyze
  66. mysql.help_category OK
  67. mysql.help_keyword OK
  68. mysql.help_relation OK
  69. mysql.help_topic OK
  70. mysql.host OK
  71. mysql.ndb_binlog_index OK
  72. mysql.plugin OK
  73. mysql.proc OK
  74. mysql.procs_priv OK
  75. mysql.proxies_priv OK
  76. mysql.servers OK
  77. mysql.slow_log
  78. note : The storage engine for the table doesn't support analyze
  79. mysql.tables_priv OK
  80. mysql.time_zone OK
  81. mysql.time_zone_leap_second OK
  82. mysql.time_zone_name OK
  83. mysql.time_zone_transition OK
  84. mysql.time_zone_transition_type OK
  85. mysql.user OK
  86. mysql.columns_priv Table is already up to date
  87. mysql.db Table is already up to date
  88. mysql.event Table is already up to date
  89. mysql.func Table is already up to date
  90. mysql.general_log
  91. note : The storage engine for the table doesn't support optimize
  92. mysql.help_category Table is already up to date
  93. mysql.help_keyword Table is already up to date
  94. mysql.help_relation Table is already up to date
  95. mysql.help_topic Table is already up to date
  96. mysql.host Table is already up to date
  97. mysql.ndb_binlog_index Table is already up to date
  98. mysql.plugin Table is already up to date
  99. mysql.proc Table is already up to date
  100. mysql.procs_priv Table is already up to date
  101. mysql.proxies_priv Table is already up to date
  102. mysql.servers Table is already up to date
  103. mysql.slow_log
  104. note : The storage engine for the table doesn't support optimize
  105. mysql.tables_priv Table is already up to date
  106. mysql.time_zone Table is already up to date
  107. mysql.time_zone_leap_second Table is already up to date
  108. mysql.time_zone_name Table is already up to date
  109. mysql.time_zone_transition Table is already up to date
  110. mysql.time_zone_transition_type Table is already up to date
  111. mysql.user Table is already up to date
  112. create table t1 (a int);
  113. create view v1 as select * from t1;
  114. test.t1 OK
  115. test.t1 Table is already up to date
  116. test.t1 OK
  117. test.t1 Table is already up to date
  118. drop view v1;
  119. drop table t1;
  120. create table `t``1`(a int);
  121. create table `t 1`(a int);
  122. test.t 1 OK
  123. test.t`1 OK
  124. drop table `t``1`, `t 1`;
  125. create database d_bug25347;
  126. use d_bug25347;
  127. create table t_bug25347 (a int);
  128. create view v_bug25347 as select * from t_bug25347;
  129. insert into t_bug25347 values (1),(2),(3);
  130. flush tables;
  131. removing and creating
  132. d_bug25347.t_bug25347
  133. Error : Incorrect file format 't_bug25347'
  134. error : Corrupt
  135. insert into t_bug25347 values (4),(5),(6);
  136. ERROR HY000: Incorrect file format 't_bug25347'
  137. d_bug25347.t_bug25347
  138. warning : Number of rows changed from 0 to 3
  139. status : OK
  140. insert into t_bug25347 values (7),(8),(9);
  141. select * from t_bug25347;
  142. a
  143. 1
  144. 2
  145. 3
  146. 7
  147. 8
  148. 9
  149. select * from v_bug25347;
  150. a
  151. 1
  152. 2
  153. 3
  154. 7
  155. 8
  156. 9
  157. drop view v_bug25347;
  158. drop table t_bug25347;
  159. drop database d_bug25347;
  160. use test;
  161. create view v1 as select * from information_schema.routines;
  162. check table v1, information_schema.routines;
  163. Table Op Msg_type Msg_text
  164. test.v1 check status OK
  165. information_schema.routines check note The storage engine for the table doesn't support check
  166. drop view v1;
  167. CREATE TABLE t1(a INT);
  168. CREATE TABLE t2(a INT);
  169. test.t1
  170. Error : Incorrect information in file: './test/t1.frm'
  171. error : Corrupt
  172. test.t2 OK
  173. DROP TABLE t1, t2;
  174. End of 5.0 tests
  175. create table t1(a int);
  176. create view v1 as select * from t1;
  177. show tables;
  178. Tables_in_test
  179. t1
  180. v1
  181. show tables;
  182. Tables_in_test
  183. t1
  184. #mysql50#v-1
  185. v1
  186. test.t1 OK
  187. show tables;
  188. Tables_in_test
  189. t1
  190. v1
  191. v-1
  192. drop view v1, `v-1`;
  193. drop table t1;
  194. SET NAMES utf8;
  195. CREATE TABLE `#mysql50#@` (a INT);
  196. SHOW TABLES;
  197. Tables_in_test
  198. #mysql50#@
  199. SET NAMES DEFAULT;
  200. mysqlcheck --fix-table-names --databases test
  201. SET NAMES utf8;
  202. SHOW TABLES;
  203. Tables_in_test
  204. @
  205. DROP TABLE `@`;
  206. CREATE TABLE `я` (a INT);
  207. SET NAMES DEFAULT;
  208. mysqlcheck --default-character-set="latin1" --databases test
  209. test.?
  210. Error : Table doesn't exist
  211. status : Operation failed
  212. mysqlcheck --default-character-set="utf8" --databases test
  213. test.я OK
  214. SET NAMES utf8;
  215. DROP TABLE `я`;
  216. SET NAMES DEFAULT;
  217. CREATE DATABASE `#mysql50#a@b`;
  218. USE `#mysql50#a@b`;
  219. CREATE TABLE `#mysql50#c@d` (a INT);
  220. CREATE TABLE t1 (a INT);
  221. SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
  222. WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
  223. TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
  224. def #mysql50#a@b tr1 INSERT def #mysql50#a@b #mysql50#c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
  225. def #mysql50#a@b tr2 INSERT def #mysql50#a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
  226. mysqlcheck --fix-db-names --fix-table-names --all-databases
  227. USE `a@b`;
  228. SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
  229. WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name;
  230. TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
  231. def a@b tr1 INSERT def a@b c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
  232. def a@b tr2 INSERT def a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
  233. INSERT INTO `c@d` VALUES (2), (1);
  234. SELECT * FROM `c@d`;
  235. a
  236. 20
  237. 10
  238. INSERT INTO t1 VALUES (3), (5);
  239. SELECT * FROM t1;
  240. a
  241. 300
  242. 500
  243. DROP DATABASE `a@b`;
  244. USE test;
  245. #
  246. # Bug #31821: --all-in-1 and --fix-table-names don't work together
  247. #
  248. drop table if exists `#mysql50#t1-1`;
  249. create table `#mysql50#t1-1` (a int);
  250. show tables like 't1-1';
  251. Tables_in_test (t1-1)
  252. t1-1
  253. drop table `t1-1`;
  254. create table `#mysql50#t1-1` (a int);
  255. show tables like 't1-1';
  256. Tables_in_test (t1-1)
  257. t1-1
  258. drop table `t1-1`;
  259. End of 5.1 tests
  260. #
  261. # Bug #35269: mysqlcheck behaves different depending on order of parameters
  262. #