MCPcopy Create free account
hub / github.com/MariaDB/server / clone_server

Function clone_server

sql/sql_servers.cc:1423–1447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1421*/
1422
1423static FOREIGN_SERVER *clone_server(MEM_ROOT *mem, FOREIGN_SERVER *server,
1424 FOREIGN_SERVER *buffer)
1425{
1426 DBUG_ENTER("sql_server.cc:clone_server");
1427
1428 if (!buffer)
1429 buffer= (FOREIGN_SERVER *) alloc_root(mem, sizeof(FOREIGN_SERVER));
1430
1431 buffer->server_name= strmake_root(mem, server->server_name,
1432 server->server_name_length);
1433 buffer->port= server->port;
1434 buffer->server_name_length= server->server_name_length;
1435
1436 /* TODO: We need to examine which of these can really be NULL */
1437 buffer->db= safe_strdup_root(mem, server->db);
1438 buffer->scheme= safe_strdup_root(mem, server->scheme);
1439 buffer->username= safe_strdup_root(mem, server->username);
1440 buffer->password= safe_strdup_root(mem, server->password);
1441 buffer->socket= safe_strdup_root(mem, server->socket);
1442 buffer->owner= safe_strdup_root(mem, server->owner);
1443 buffer->host= safe_strdup_root(mem, server->host);
1444 copy_option_list(mem, buffer, server->option_list);
1445
1446 DBUG_RETURN(buffer);
1447}
1448
1449
1450/*

Callers 1

get_server_by_nameFunction · 0.85

Calls 4

alloc_rootFunction · 0.85
strmake_rootFunction · 0.85
safe_strdup_rootFunction · 0.85
copy_option_listFunction · 0.85

Tested by

no test coverage detected