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
|
# Simple load test
INSTALL COMPONENT "file://component_example_component1";
UNINSTALL COMPONENT "file://component_example_component1";
# Double load test
INSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component1";
ERROR HY000: Cannot load component from specified URN: 'file://component_example_component1'.
UNINSTALL COMPONENT "file://component_example_component1";
# Load not existing
INSTALL COMPONENT "file://component_example_component4";
ERROR HY000: Can't open shared library
# Load with unsatisfied dependencies
INSTALL COMPONENT "file://component_example_component3";
ERROR HY000: Cannot satisfy dependency for service 'greetings' required by component 'mysql:example_component3'.
# Load with no schema
INSTALL COMPONENT "file:component_example_component3";
ERROR HY000: Cannot find schema in specified URN: 'file:component_example_component3'.
# Load with bad schema
INSTALL COMPONENT "bad_scheme://component_example_component3";
ERROR HY000: Cannot acquire scheme load service implementation for schema 'bad_scheme' in specified URN: 'bad_scheme://component_example_component3'.
# Load with path
INSTALL COMPONENT "file:///component_example_component3";
ERROR HY000: Cannot load component from specified URN: 'file:///component_example_component3'.
INSTALL COMPONENT "file://./component_example_component3";
ERROR HY000: Cannot load component from specified URN: 'file://./component_example_component3'.
INSTALL COMPONENT "file://../component_example_component3";
ERROR HY000: Cannot load component from specified URN: 'file://../component_example_component3'.
# Load with unsatisfied dependencies after unload
INSTALL COMPONENT "file://component_example_component1";
UNINSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component3";
ERROR HY000: Cannot satisfy dependency for service 'greetings' required by component 'mysql:example_component3'.
# Unload not existing
UNINSTALL COMPONENT "file://component_example_component4";
ERROR HY000: Component specified by URN 'file://component_example_component4' to unload has not been loaded before.
# Unload not loaded
UNINSTALL COMPONENT "file://component_example_component1";
ERROR HY000: Component specified by URN 'file://component_example_component1' to unload has not been loaded before.
UNINSTALL COMPONENT "file://component_example_component1";
ERROR HY000: Component specified by URN 'file://component_example_component1' to unload has not been loaded before.
# 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";
# 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";
# Test more dependencies and groups
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
ERROR HY000: Unregistration of service implementation 'greetings.example_component1' provided by component 'mysql:example_component1' failed during unloading of the component.
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";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
ERROR HY000: Unregistration of service implementation 'greetings.example_component1' provided by component 'mysql:example_component1' failed during unloading of the component.
UNINSTALL COMPONENT "file://component_example_component2";
UNINSTALL COMPONENT "file://component_example_component3";
UNINSTALL COMPONENT "file://component_example_component1";
# 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";
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
ERROR HY000: Unregistration of service implementation 'greetings.example_component1' provided by component 'mysql:example_component1' failed during unloading of the component.
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
INSTALL COMPONENT "file://component_example_component1", "file://component_example_component2";
INSTALL COMPONENT "file://component_example_component3", "file://component_example_component2";
ERROR HY000: Cannot load component from specified URN: 'file://component_example_component2'.
INSTALL COMPONENT "file://component_example_component3";
# all three components should present
SELECT COUNT(*) FROM mysql.component;
COUNT(*)
3
UNINSTALL COMPONENT "file://component_example_component2", "file://component_example_component2";
ERROR HY000: The component with specified URN: 'file://component_example_component2' was specified in group more than once.
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
# zero components should present
SELECT COUNT(*) FROM mysql.component;
COUNT(*)
0
#
# Checking component persistance code. Install a component, shutdown
# and restart the server, the components should present.
#
INSTALL COMPONENT "file://component_example_component1";
INSTALL COMPONENT "file://component_example_component2", "file://component_example_component3";
# all three components should present
SELECT COUNT(*) FROM mysql.component;
COUNT(*)
3
# shutdown the server from mtr.
# restart the server.
# all three components should present
SELECT COUNT(*) FROM mysql.component;
COUNT(*)
3
UNINSTALL COMPONENT "file://component_example_component1", "file://component_example_component2", "file://component_example_component3";
# zero components should present
SELECT COUNT(*) FROM mysql.component;
COUNT(*)
0
# shutdown the server from mtr.
# restart the server.
# zero components should present
SELECT COUNT(*) FROM mysql.component;
COUNT(*)
0
# Name of component is invalid
INSTALL COMPONENT "dynamic_loader_test_lib1";
ERROR HY000: Cannot find schema in specified URN: 'dynamic_loader_test_lib1'.
INSTALL COMPONENT "file://dynamic_loader_test_lib2", "dynamic_loader_test_lib3";
ERROR HY000: Can't open shared library
UNINSTALL COMPONENT "fle://dynamic_loader_test_lib1", "file://dynamic_loader_test_lib3";
ERROR HY000: Component specified by URN 'fle://dynamic_loader_test_lib1' to unload has not been loaded before.
UNINSTALL COMPONENT "dynamic_loader_test_lib2";
ERROR HY000: Component specified by URN 'dynamic_loader_test_lib2' to unload has not been loaded before.
INSTALL COMPONENT "file://localhost/tmp/dynamic_loader_test_lib1";
ERROR HY000: Cannot load component from specified URN: 'file://localhost/tmp/dynamic_loader_test_lib1'.
INSTALL COMPONENT "http://dynamic_loader_test_lib1";
ERROR HY000: Cannot acquire scheme load service implementation for schema 'http' in specified URN: 'http://dynamic_loader_test_lib1'.
INSTALL COMPONENT "file://dynamic_loader_test_lib2", "http://dynamic_loader_test_lib3";
ERROR HY000: Can't open shared library
UNINSTALL COMPONENT "file://dynamic_loader_test_lib1", "http://dynamic_loader_test_lib3";
ERROR HY000: Component specified by URN 'file://dynamic_loader_test_lib1' to unload has not been loaded before.
UNINSTALL COMPONENT "http://dynamic_loader_test_lib2";
ERROR HY000: Component specified by URN 'http://dynamic_loader_test_lib2' to unload has not been loaded before.
#
# Bug #24528148 UNPRIVILEGED USER ABLE TO LOAD COMPONENTS TO
# MYSQL.COMPONENT
#
CREATE USER mysqltest_u1@localhost;
INSTALL COMPONENT "file://component_example_component1";
ERROR 42000: INSERT command denied to user 'mysqltest_u1'@'localhost' for table 'component'
UNINSTALL COMPONENT "file://component_example_component1";
ERROR 42000: DELETE command denied to user 'mysqltest_u1'@'localhost' for table 'component'
DROP USER mysqltest_u1@localhost;
#
# Bug #27041374: ASSERTION `NEXT_INSERT_ID == 0' FAILED.
#
SET @@session.insert_id=42949672950;
# Must not assert
INSTALL COMPONENT
"file://component_example_component2","file://component_example_component3";
ERROR HY000: Failed to manipulate component 'file://component_example_component3' persistence data. Error code 121 from storage engine.
# reset back the insert_id and auto_increment
SET @@session.insert_id=0;
ALTER TABLE mysql.component AUTO_INCREMENT=1;
# End of 8.0 tests
|