ndb_autodiscover.result
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:9k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
  2. flush status;
  3. create table t1(
  4. id int not null primary key,
  5. name char(20)
  6. ) engine=ndb;
  7. insert into t1 values(1, "Autodiscover");
  8. flush tables;
  9. select * from t1;
  10. id name
  11. 1 Autodiscover
  12. show status like 'handler_discover%';
  13. Variable_name Value
  14. Handler_discover 1
  15. flush tables;
  16. insert into t1 values (2, "Auto 2");
  17. show status like 'handler_discover%';
  18. Variable_name Value
  19. Handler_discover 2
  20. insert into t1 values (3, "Discover 3");
  21. show status like 'handler_discover%';
  22. Variable_name Value
  23. Handler_discover 2
  24. flush tables;
  25. select * from t1 order by id;
  26. id name
  27. 1 Autodiscover
  28. 2 Auto 2
  29. 3 Discover 3
  30. show status like 'handler_discover%';
  31. Variable_name Value
  32. Handler_discover 3
  33. flush tables;
  34. update t1 set name="Autodiscover" where id = 2;
  35. show status like 'handler_discover%';
  36. Variable_name Value
  37. Handler_discover 4
  38. select * from t1 order by id;
  39. id name
  40. 1 Autodiscover
  41. 2 Autodiscover
  42. 3 Discover 3
  43. show status like 'handler_discover%';
  44. Variable_name Value
  45. Handler_discover 4
  46. flush tables;
  47. delete from  t1 where id = 3;
  48. select * from t1 order by id;
  49. id name
  50. 1 Autodiscover
  51. 2 Autodiscover
  52. show status like 'handler_discover%';
  53. Variable_name Value
  54. Handler_discover 5
  55. drop table t1;
  56. flush status;
  57. create table t2(
  58. id int not null primary key,
  59. name char(22)
  60. ) engine=ndb;
  61. insert into t2 values (1, "Discoverer");
  62. select * from t2;
  63. id name
  64. 1 Discoverer
  65. show status like 'handler_discover%';
  66. Variable_name Value
  67. Handler_discover 0
  68. flush tables;
  69. select * from t2;
  70. id name
  71. 1 Discoverer
  72. show status like 'handler_discover%';
  73. Variable_name Value
  74. Handler_discover 1
  75. drop table t2;
  76. flush status;
  77. create table t3(
  78. id int not null primary key,
  79. name char(255)
  80. ) engine=ndb;
  81. insert into t3 values (1, "Explorer");
  82. select * from t3;
  83. id name
  84. 1 Explorer
  85. show status like 'handler_discover%';
  86. Variable_name Value
  87. Handler_discover 0
  88. flush tables;
  89. create table t3(
  90. id int not null primary key,
  91. name char(20), a int, b float, c char(24)
  92. ) engine=ndb;
  93. ERROR 42S01: Table 't3' already exists
  94. show status like 'handler_discover%';
  95. Variable_name Value
  96. Handler_discover 0
  97. create table IF NOT EXISTS t3(
  98. id int not null primary key,
  99. id2 int not null,
  100. name char(20)
  101. ) engine=ndb;
  102. Warnings:
  103. Note 1050 Table 't3' already exists
  104. show status like 'handler_discover%';
  105. Variable_name Value
  106. Handler_discover 0
  107. SHOW CREATE TABLE t3;
  108. Table Create Table
  109. t3 CREATE TABLE `t3` (
  110.   `id` int(11) NOT NULL default '0',
  111.   `name` char(255) default NULL,
  112.   PRIMARY KEY  (`id`)
  113. ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
  114. select * from t3;
  115. id name
  116. 1 Explorer
  117. show status like 'handler_discover%';
  118. Variable_name Value
  119. Handler_discover 1
  120. drop table t3;
  121. flush status;
  122. create table t7(
  123. id int not null primary key,
  124. name char(255)
  125. ) engine=ndb;
  126. create table t6(
  127. id int not null primary key,
  128. name char(255)
  129. ) engine=MyISAM;
  130. insert into t7 values (1, "Explorer");
  131. insert into t6 values (2, "MyISAM table");
  132. select * from t7;
  133. id name
  134. 1 Explorer
  135. show status like 'handler_discover%';
  136. Variable_name Value
  137. Handler_discover 0
  138. flush tables;
  139. show tables from test;
  140. Tables_in_test
  141. t6
  142. t7
  143. show status like 'handler_discover%';
  144. Variable_name Value
  145. Handler_discover 1
  146. flush tables;
  147. show table status;
  148. Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
  149. t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL
  150. t7 ndbcluster 9 Fixed 1 0 # # # 0 NULL # # NULL # NULL
  151. show status like 'handler_discover%';
  152. Variable_name Value
  153. Handler_discover 2
  154. drop table t6, t7;
  155. flush status;
  156. create table t4(
  157. id int not null primary key,
  158. name char(27)
  159. ) engine=ndb;
  160. insert into t4 values (1, "Automatic");
  161. select * from t4;
  162. id name
  163. 1 Automatic
  164. select * from t4;
  165. ERROR 42S02: Table 'test.t4' doesn't exist
  166. select * from t4;
  167. ERROR 42S02: Table 'test.t4' doesn't exist
  168. show status like 'handler_discover%';
  169. Variable_name Value
  170. Handler_discover 0
  171. drop table t4;
  172. flush status;
  173. create table t4(
  174. id int not null primary key,
  175. id2 int,
  176. name char(27)
  177. ) engine=ndb;
  178. insert into t4 values (1, 76, "Automatic2");
  179. select * from t4;
  180. id id2 name
  181. 1 76 Automatic2
  182. flush tables;
  183. SHOW TABLES;
  184. Tables_in_test
  185. select * from t4;
  186. ERROR 42S02: Table 'test.t4' doesn't exist
  187. flush status;
  188. create table t1(id int) engine=ndbcluster;
  189. create table t2(id int, b char(255)) engine=myisam;
  190. create table t3(id int, c char(255)) engine=ndbcluster;
  191. create table t4(id int) engine=myisam;
  192. create table t5(id int, d char(56)) engine=ndbcluster;
  193. create table t6(id int) engine=ndbcluster;
  194. create table t7(id int) engine=ndbcluster;
  195. create table t8(id int, e char(34)) engine=myisam;
  196. create table t9(id int) engine=myisam;
  197. insert into t2 values (2, "myisam table 2");
  198. insert into t3 values (3, "ndb table 3");
  199. insert into t5 values (5, "ndb table 5");
  200. insert into t6 values (6);
  201. insert into t8 values (8, "myisam table 8");
  202. insert into t9 values (9);
  203. SHOW TABLES;
  204. Tables_in_test
  205. t1
  206. t2
  207. t4
  208. t8
  209. t9
  210. t7
  211. t6
  212. select * from t6;
  213. id
  214. 6
  215. select * from t7;
  216. id
  217. show status like 'handler_discover%';
  218. Variable_name Value
  219. Handler_discover 2
  220. drop table t1, t2, t4, t6, t7, t8, t9;
  221. flush status;
  222. create table t1(id int) engine=ndbcluster;
  223. create table t2(id int, b char(255)) engine=myisam;
  224. create table t3(id int, c char(255)) engine=ndbcluster;
  225. create table t4(id int) engine=myisam;
  226. create table t5(id int, d char(56)) engine=ndbcluster;
  227. create table t6(id int) engine=ndbcluster;
  228. create table t7(id int) engine=ndbcluster;
  229. create table t8(id int, e char(34)) engine=myisam;
  230. create table t9(id int) engine=myisam;
  231. insert into t2 values (2, "myisam table 2");
  232. insert into t3 values (3, "ndb table 3");
  233. insert into t5 values (5, "ndb table 5");
  234. insert into t6 values (6);
  235. insert into t8 values (8, "myisam table 8");
  236. insert into t9 values (9);
  237. SHOW TABLES LIKE 't6';
  238. Tables_in_test (t6)
  239. t6
  240. show status like 'handler_discover%';
  241. Variable_name Value
  242. Handler_discover 1
  243. create table t3(a int);
  244. ERROR 42S01: Table 't3' already exists
  245. create table t5(a int);
  246. ERROR 42S01: Table 't5' already exists
  247. SHOW TABLES LIKE 't%';
  248. Tables_in_test (t%)
  249. t1
  250. t2
  251. t4
  252. t6
  253. t8
  254. t9
  255. t7
  256. show status like 'handler_discover%';
  257. Variable_name Value
  258. Handler_discover 2
  259. drop table t1, t2, t4, t6, t7, t8, t9;
  260. flush status;
  261. create table t1(id int) engine=ndbcluster;
  262. create table t2(id int, b char(255)) engine=ndbcluster;
  263. create table t3(id int, c char(255)) engine=ndbcluster;
  264. create table t4(id int) engine=myisam;
  265. insert into t1 values (1);
  266. insert into t2 values (2, "table 2");
  267. insert into t3 values (3, "ndb table 3");
  268. insert into t4 values (4);
  269. flush tables;
  270. select * from t1, t2, t3, t4;
  271. id id b id c id
  272. 1 2 table 2 3 ndb table 3 4
  273. show status like 'handler_discover%';
  274. Variable_name Value
  275. Handler_discover 3
  276. drop table t1, t2, t3, t4;
  277. flush status;
  278. show status like 'handler_discover%';
  279. Variable_name Value
  280. Handler_discover 0
  281. create table t5(
  282. id int not null primary key,
  283. name char(200)
  284. ) engine=ndb;
  285. insert into t5 values (1, "Magnus");
  286. select * from t5;
  287. id name
  288. 1 Magnus
  289. ALTER TABLE t5 ADD COLUMN adress char(255) FIRST;
  290. select * from t5;
  291. adress id name
  292. NULL 1 Magnus
  293. insert into t5 values 
  294. ("Adress for record 2", 2, "Carl-Gustav"), 
  295. ("Adress for record 3", 3, "Karl-Emil");
  296. update t5 set name="Bertil" where id = 2;
  297. select * from t5 order by id;
  298. adress id name
  299. NULL 1 Magnus
  300. Adress for record 2 2 Bertil
  301. Adress for record 3 3 Karl-Emil
  302. show status like 'handler_discover%';
  303. Variable_name Value
  304. Handler_discover 0
  305. drop table t5;
  306. flush status;
  307. show status like 'handler_discover%';
  308. Variable_name Value
  309. Handler_discover 0
  310. create table t6(
  311. id int not null primary key,
  312. name char(20)
  313. ) engine=ndb;
  314. insert into t6 values (1, "Magnus");
  315. select * from t6;
  316. id name
  317. 1 Magnus
  318. ALTER TABLE t6 ADD COLUMN adress char(255) FIRST;
  319. select * from t6;
  320. adress id name
  321. NULL 1 Magnus
  322. insert into t6 values 
  323. ("Adress for record 2", 2, "Carl-Gustav"), 
  324. ("Adress for record 3", 3, "Karl-Emil");
  325. update t6 set name="Bertil" where id = 2;
  326. select * from t6 order by id;
  327. adress id name
  328. NULL 1 Magnus
  329. Adress for record 2 2 Bertil
  330. Adress for record 3 3 Karl-Emil
  331. show status like 'handler_discover%';
  332. Variable_name Value
  333. Handler_discover 0
  334. drop table t6;
  335. show tables;
  336. Tables_in_test
  337. create table t1 (a int,b longblob) engine=ndb;
  338. show tables;
  339. Tables_in_test
  340. t1
  341. create database test2;
  342. use test2;
  343. show tables;
  344. Tables_in_test2
  345. select * from t1;
  346. ERROR 42S02: Table 'test2.t1' doesn't exist
  347. create table t2 (b int,c longblob) engine=ndb;
  348. use test;
  349. select * from t1;
  350. a b
  351. show tables;
  352. Tables_in_test
  353. t1
  354. drop table t1;
  355. use test2;
  356. drop table t2;
  357. drop database test2;
  358. show databases;
  359. Database
  360. mysql
  361. test
  362. use test;
  363. CREATE TABLE t9 (
  364. a int NOT NULL PRIMARY KEY,
  365. b int
  366. ) engine=ndb;
  367. insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
  368. create table t10 (
  369. a int not null primary key,
  370. b blob
  371. ) engine=ndb;
  372. insert into t10 values (1, 'kalle');