1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
|
--source include/have_example_component.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--echo # Simple load test
INSTALL COMPONENT "file://component_example_component1";
UNINSTALL COMPONENT "file://component_example_component1";
--echo # Double load test
INSTALL COMPONENT "file://component_example_component1";
--error ER_COMPONENTS_CANT_LOAD
INSTALL COMPONENT "file://component_example_component1";
UNINSTALL COMPONENT "file://component_example_component1";
--echo # Load not existing
# To hide the path of the file
--replace_regex /.*Can\'t open shared library.*/Can't open shared library/
--error ER_CANT_OPEN_LIBRARY
INSTALL COMPONENT "file://component_example_component4";
--echo # Load with unsatisfied dependencies
--error ER_COMPONENTS_CANT_SATISFY_DEPENDENCY
INSTALL COMPONENT "file://component_example_component3";
--echo # Load with no schema
--error ER_COMPONENTS_NO_SCHEME
INSTALL COMPONENT "file:component_example_component3";
--echo # Load with bad schema
--error ER_COMPONENTS_NO_SCHEME_SERVICE
INSTALL COMPONENT "bad_scheme://component_example_component3";
--echo # Load with path
--error ER_COMPONENTS_CANT_LOAD
INSTALL COMPONENT "file:///component_example_component3";
--error ER_COMPONENTS_CANT_LOAD
INSTALL COMPONENT "file://./component_example_component3";
--error ER_COMPONENTS_CANT_LOAD
INSTALL COMPONENT "file://../component_example_component3";
--echo # Load with unsatisfied dependencies after unload
INSTALL COMPONENT "file://component_example_component1";
UNINSTALL COMPONENT "file://component_example_component1";
--error ER_COMPONENTS_CANT_SATISFY_DEPENDENCY
INSTALL COMPONENT "file://component_example_component3";
-- echo # Unload not existing
--error ER_COMPONENTS_UNLOAD_NOT_LOADED
UNINSTALL COMPONENT "file://component_example_component4";
-- echo # Unload not loaded
--error ER_COMPONENTS_UNLOAD_NOT_LOADED
UNINSTALL COMPONENT "file://component_example_component1";
--error ER_COMPONENTS_UNLOAD_NOT_LOADED
UNINSTALL COMPONENT "file://component_example_component1";
-- echo # Load/unload group of components without dependencies
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component2", "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component1";
UNINSTALL COMPONENT "file://component_example_component2";
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component2", "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
-- echo # Load/unload group of components with dependencies
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component3";
INSTALL COMPONENT "file://component_example_component3", "file://component_example_component1";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component3";
INSTALL COMPONENT "file://component_example_component3", "file://component_example_component1";
UNINSTALL COMPONENT "file://component_example_component3", "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component3", "file://component_example_component1";
UNINSTALL COMPONENT "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
--echo # Test more dependencies and groups
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
--error ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component3";
INSTALL COMPONENT "file://component_example_component2";
--error ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component1";
--echo # Test overlapping groups load/unload
INSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component2", "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component2";
INSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component2", "file://component_example_component3";
--error ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
--error ER_COMPONENTS_CANT_LOAD
INSTALL COMPONENT "file://component_example_component3", "file://component_example_component2";
INSTALL COMPONENT "file://component_example_component3";
--echo # all three components should present
SELECT COUNT(*) FROM mysql.component;
--error ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP
UNINSTALL COMPONENT "file://component_example_component2", "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
--echo # zero components should present
SELECT COUNT(*) FROM mysql.component;
--echo #
--echo # Checking component persistance code. Install a component, shutdown
--echo # and restart the server, the components should present.
--echo #
INSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component2", "file://component_example_component3";
--echo # all three components should present
SELECT COUNT(*) FROM mysql.component;
--echo # shutdown the server from mtr.
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--echo # restart the server.
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
--echo # all three components should present
SELECT COUNT(*) FROM mysql.component;
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
--echo # zero components should present
SELECT COUNT(*) FROM mysql.component;
--echo # shutdown the server from mtr.
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--echo # restart the server.
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
--echo # zero components should present
SELECT COUNT(*) FROM mysql.component;
--echo # Name of component is invalid
--error ER_COMPONENTS_NO_SCHEME
INSTALL COMPONENT "dynamic_loader_test_lib1";
--replace_regex /.*Can\'t open shared library.*/Can't open shared library/
--error ER_CANT_OPEN_LIBRARY
INSTALL COMPONENT "file://dynamic_loader_test_lib2", "dynamic_loader_test_lib3";
--error ER_COMPONENTS_UNLOAD_NOT_LOADED
UNINSTALL COMPONENT "fle://dynamic_loader_test_lib1", "file://dynamic_loader_test_lib3";
--error ER_COMPONENTS_UNLOAD_NOT_LOADED
UNINSTALL COMPONENT "dynamic_loader_test_lib2";
--error ER_COMPONENTS_CANT_LOAD
INSTALL COMPONENT "file://localhost/tmp/dynamic_loader_test_lib1";
--error ER_COMPONENTS_NO_SCHEME_SERVICE
INSTALL COMPONENT "http://dynamic_loader_test_lib1";
--replace_regex /.*Can\'t open shared library.*/Can't open shared library/
--error ER_CANT_OPEN_LIBRARY
INSTALL COMPONENT "file://dynamic_loader_test_lib2", "http://dynamic_loader_test_lib3";
--error ER_COMPONENTS_UNLOAD_NOT_LOADED
UNINSTALL COMPONENT "file://dynamic_loader_test_lib1", "http://dynamic_loader_test_lib3";
--error ER_COMPONENTS_UNLOAD_NOT_LOADED
UNINSTALL COMPONENT "http://dynamic_loader_test_lib2";
--echo #
--echo # Bug #24528148 UNPRIVILEGED USER ABLE TO LOAD COMPONENTS TO
--echo # MYSQL.COMPONENT
--echo #
CREATE USER mysqltest_u1@localhost;
connect (conn1, localhost, mysqltest_u1, ,);
--error ER_TABLEACCESS_DENIED_ERROR
INSTALL COMPONENT "file://component_example_component1";
--error ER_TABLEACCESS_DENIED_ERROR
UNINSTALL COMPONENT "file://component_example_component1";
disconnect conn1;
connection default;
DROP USER mysqltest_u1@localhost;
--echo #
--echo # Bug #27041374: ASSERTION `NEXT_INSERT_ID == 0' FAILED.
--echo #
SET @@session.insert_id=42949672950;
--echo # Must not assert
--error ER_COMPONENT_MANIPULATE_ROW_FAILED
INSTALL COMPONENT
"file://component_example_component2","file://component_example_component3";
--echo # reset back the insert_id and auto_increment
SET @@session.insert_id=0;
ALTER TABLE mysql.component AUTO_INCREMENT=1;
--echo # End of 8.0 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
|