|
| 1 | +result_format: 2 |
| 2 | + |
| 3 | + |
| 4 | +SELECT * FROM information_schema.plugins WHERE PLUGIN_NAME = 'ndbinfo'; |
| 5 | +PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE |
| 6 | +ndbinfo 0.1 ACTIVE STORAGE ENGINE 50139.0 NULL NULL Sun Microsystems Inc. MySQL Cluster system information storage engine GPL |
| 7 | + |
| 8 | +## Creation of temporary tables should not be supported by NDBINFO engine |
| 9 | +CREATE TEMPORARY TABLE `t1` ( |
| 10 | + `dummy` INT UNSIGNED |
| 11 | +) ENGINE=NDBINFO; |
| 12 | +ERROR HY000: Table storage engine 'ndbinfo' does not support the create option 'TEMPORARY' |
| 13 | + |
| 14 | +@have_ndbinfo:= COUNT(*) |
| 15 | +1 |
| 16 | +USE ndbinfo; |
| 17 | + |
| 18 | +SHOW CREATE TABLE ndb$tables; |
| 19 | +Table Create Table |
| 20 | +ndb$tables CREATE TABLE `ndb$tables` ( |
| 21 | + `table_id` int(10) unsigned DEFAULT NULL, |
| 22 | + `table_name` varchar(512) DEFAULT NULL, |
| 23 | + `comment` varchar(512) DEFAULT NULL |
| 24 | +) ENGINE=NDBINFO DEFAULT CHARSET=latin1 |
| 25 | + |
| 26 | +SELECT * FROM ndb$tables; |
| 27 | +table_id table_name comment |
| 28 | +0 tables |
| 29 | +1 columns |
| 30 | +2 memusage |
| 31 | +3 logdestination |
| 32 | +4 backup_records |
| 33 | +5 backup_parameters |
| 34 | +6 pools |
| 35 | +7 test |
| 36 | +8 trp_status |
| 37 | +SELECT COUNT(*) FROM ndb$tables; |
| 38 | +COUNT(*) |
| 39 | +9 |
| 40 | +SELECT * FROM ndb$tables WHERE table_id = 2; |
| 41 | +table_id table_name comment |
| 42 | +2 memusage |
| 43 | +SELECT * FROM ndb$tables WHERE table_id > 5; |
| 44 | +table_id table_name comment |
| 45 | +6 pools |
| 46 | +7 test |
| 47 | +8 trp_status |
| 48 | +SELECT * FROM ndb$tables WHERE table_name = 'LOGDESTINATION'; |
| 49 | +table_id table_name comment |
| 50 | +3 logdestination |
| 51 | +SELECT COUNT(*) FROM ndb$tables t1, ndb$tables t2 WHERE t1.table_id = t1.table_id; |
| 52 | +COUNT(*) |
| 53 | +81 |
| 54 | + |
| 55 | +SELECT table_id, table_name, comment from ndb$tables |
| 56 | + WHERE table_id > 2 AND table_id <= 5 ORDER BY table_id; |
| 57 | +table_id table_name comment |
| 58 | +3 logdestination |
| 59 | +4 backup_records |
| 60 | +5 backup_parameters |
| 61 | +SELECT table_id FROM ndb$tables WHERE table_id = 2 ORDER BY table_name; |
| 62 | +table_id |
| 63 | +2 |
| 64 | +SELECT table_id, table_name FROM ndb$tables ORDER BY table_name; |
| 65 | +table_id table_name |
| 66 | +5 backup_parameters |
| 67 | +4 backup_records |
| 68 | +1 columns |
| 69 | +3 logdestination |
| 70 | +2 memusage |
| 71 | +6 pools |
| 72 | +0 tables |
| 73 | +7 test |
| 74 | +8 trp_status |
| 75 | + |
| 76 | +SELECT table_id, column_id, column_name FROM ndb$columns LIMIT 7; |
| 77 | +table_id column_id column_name |
| 78 | +0 0 table_id |
| 79 | +0 1 table_name |
| 80 | +0 2 comment |
| 81 | +1 0 table_id |
| 82 | +1 1 column_id |
| 83 | +1 2 column_name |
| 84 | +1 3 column_type |
| 85 | + |
| 86 | +UPDATE ndb$tables SET table_id=2 WHERE table_id=3; |
| 87 | +ERROR HY000: Table 'ndb$tables' is read only |
| 88 | + |
| 89 | +UPDATE ndb$tables SET table_id=9 WHERE 1=0; |
| 90 | +ERROR HY000: Table 'ndb$tables' is read only |
| 91 | + |
| 92 | +UPDATE ndb$tables SET table_id=9 WHERE table_id > 1; |
| 93 | +ERROR HY000: Table 'ndb$tables' is read only |
| 94 | + |
| 95 | +DELETE FROM ndb$tables WHERE table_id=3; |
| 96 | +ERROR HY000: Table 'ndb$tables' is read only |
| 97 | + |
| 98 | +DELETE FROM ndb$tables WHERE 1=0; |
| 99 | +ERROR HY000: Table 'ndb$tables' is read only |
| 100 | + |
| 101 | +DELETE FROM ndb$tables WHERE table_id > 1; |
| 102 | +ERROR HY000: Table 'ndb$tables' is read only |
| 103 | + |
| 104 | +FLUSH TABLES; |
| 105 | +SELECT table_id FROM ndb$tables; |
| 106 | +table_id |
| 107 | +0 |
| 108 | +1 |
| 109 | +2 |
| 110 | +3 |
| 111 | +4 |
| 112 | +5 |
| 113 | +6 |
| 114 | +7 |
| 115 | +8 |
| 116 | + |
| 117 | +TRUNCATE ndb$tables; |
| 118 | +ERROR HY000: Table 'ndb$tables' is read only |
| 119 | + |
| 120 | +## Variables and status |
| 121 | +SHOW GLOBAL STATUS LIKE 'ndbinfo\_%'; |
| 122 | +Variable_name Value |
| 123 | +SHOW GLOBAL VARIABLES LIKE 'ndbinfo\_%'; |
| 124 | +Variable_name Value |
| 125 | +ndbinfo_database ndbinfo |
| 126 | +ndbinfo_max_bytes 0 |
| 127 | +ndbinfo_max_rows 10 |
| 128 | +ndbinfo_show_hidden OFF |
| 129 | +ndbinfo_table_prefix ndb$ |
| 130 | + |
| 131 | +SELECT counter, HEX(counter2) FROM ndb$test LIMIT 10; |
| 132 | +counter HEX(counter2) |
| 133 | +0 0 |
| 134 | +1 100000000 |
| 135 | +2 200000000 |
| 136 | +3 300000000 |
| 137 | +4 400000000 |
| 138 | +5 500000000 |
| 139 | +6 600000000 |
| 140 | +7 700000000 |
| 141 | +8 800000000 |
| 142 | +9 900000000 |
| 143 | + |
| 144 | +SHOW TABLES LIKE 'ndb$te%'; |
| 145 | +Tables_in_ndbinfo (ndb$te%) |
| 146 | +set @@ndbinfo_show_hidden=TRUE; |
| 147 | +SHOW TABLES LIKE 'ndb$te%'; |
| 148 | +Tables_in_ndbinfo (ndb$te%) |
| 149 | +ndb$test |
| 150 | +set @@ndbinfo_show_hidden=default; |
| 151 | + |
| 152 | +set @@ndbinfo_table_prefix="somethingelse"; |
| 153 | +ERROR HY000: Variable 'ndbinfo_table_prefix' is a read only variable |
| 154 | + |
| 155 | +set @@ndbinfo_database="somethingelse"; |
| 156 | +ERROR HY000: Variable 'ndbinfo_database' is a read only variable |
| 157 | + |
| 158 | +## Cleanup |
| 159 | +DROP DATABASE ndbinfo; |
0 commit comments