| 913 | */ |
| 914 | |
| 915 | int update_server_record_in_cache(FOREIGN_SERVER *existing, |
| 916 | FOREIGN_SERVER *altered) |
| 917 | { |
| 918 | int error= 0; |
| 919 | DBUG_ENTER("update_server_record_in_cache"); |
| 920 | |
| 921 | /* |
| 922 | update the members that haven't been change in the altered server struct |
| 923 | with the values of the existing server struct |
| 924 | */ |
| 925 | merge_server_struct(existing, altered); |
| 926 | |
| 927 | /* |
| 928 | delete the existing server struct from the server cache |
| 929 | */ |
| 930 | my_hash_delete(&servers_cache, (uchar*)existing); |
| 931 | |
| 932 | /* |
| 933 | Insert the altered server struct into the server cache |
| 934 | */ |
| 935 | if (my_hash_insert(&servers_cache, (uchar*)altered)) |
| 936 | { |
| 937 | DBUG_PRINT("info", ("had a problem inserting server %s at %p", |
| 938 | altered->server_name,altered)); |
| 939 | error= ER_OUT_OF_RESOURCES; |
| 940 | } |
| 941 | |
| 942 | DBUG_RETURN(error); |
| 943 | } |
| 944 | |
| 945 | |
| 946 | /* |
no test coverage detected