| 792 | */ |
| 793 | |
| 794 | static int |
| 795 | delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options) |
| 796 | { |
| 797 | int error= ER_FOREIGN_SERVER_DOESNT_EXIST; |
| 798 | FOREIGN_SERVER *server; |
| 799 | DBUG_ENTER("delete_server_record_in_cache"); |
| 800 | |
| 801 | DBUG_PRINT("info",("trying to obtain server name %s length %zu", |
| 802 | server_options->server_name.str, |
| 803 | server_options->server_name.length)); |
| 804 | |
| 805 | |
| 806 | if (!(server= (FOREIGN_SERVER *) |
| 807 | my_hash_search(&servers_cache, |
| 808 | (uchar*) server_options->server_name.str, |
| 809 | server_options->server_name.length))) |
| 810 | { |
| 811 | DBUG_PRINT("info", ("server_name %s length %zu not found!", |
| 812 | server_options->server_name.str, |
| 813 | server_options->server_name.length)); |
| 814 | goto end; |
| 815 | } |
| 816 | /* |
| 817 | We succeeded in deletion of the server to the table, now delete |
| 818 | the server from the cache |
| 819 | */ |
| 820 | DBUG_PRINT("info",("deleting server %s length %zd", |
| 821 | server->server_name, |
| 822 | server->server_name_length)); |
| 823 | |
| 824 | my_hash_delete(&servers_cache, (uchar*) server); |
| 825 | |
| 826 | error= 0; |
| 827 | |
| 828 | end: |
| 829 | DBUG_RETURN(error); |
| 830 | } |
| 831 | |
| 832 | |
| 833 | /* |
no test coverage detected