| 1203 | */ |
| 1204 | |
| 1205 | int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options) |
| 1206 | { |
| 1207 | int error= ER_FOREIGN_SERVER_DOESNT_EXIST; |
| 1208 | FOREIGN_SERVER altered, *existing; |
| 1209 | DBUG_ENTER("alter_server"); |
| 1210 | DBUG_PRINT("info", ("server_options->server_name %s", |
| 1211 | server_options->server_name.str)); |
| 1212 | |
| 1213 | mysql_rwlock_wrlock(&THR_LOCK_servers); |
| 1214 | |
| 1215 | if (!(existing= (FOREIGN_SERVER *) my_hash_search(&servers_cache, |
| 1216 | (uchar*) server_options->server_name.str, |
| 1217 | server_options->server_name.length))) |
| 1218 | goto end; |
| 1219 | |
| 1220 | prepare_server_struct_for_update(server_options, existing, &altered); |
| 1221 | |
| 1222 | error= update_server(thd, existing, &altered); |
| 1223 | |
| 1224 | close_mysql_tables(thd); |
| 1225 | |
| 1226 | end: |
| 1227 | DBUG_PRINT("info", ("error returned %d", error)); |
| 1228 | mysql_rwlock_unlock(&THR_LOCK_servers); |
| 1229 | DBUG_RETURN(error); |
| 1230 | } |
| 1231 | |
| 1232 | |
| 1233 | static void copy_option_list(MEM_ROOT *mem, FOREIGN_SERVER *server, |
no test coverage detected