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

Function insert_server

sql/sql_servers.cc:471–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469*/
470
471static int
472insert_server(THD *thd, FOREIGN_SERVER *server)
473{
474 int error= -1;
475 TABLE_LIST tables;
476 TABLE *table;
477 DBUG_ENTER("insert_server");
478
479 tables.init_one_table(&MYSQL_SCHEMA_NAME, &MYSQL_SERVERS_NAME, 0, TL_WRITE);
480
481 /* need to open before acquiring THR_LOCK_plugin or it will deadlock */
482 table= open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT);
483 if (!table || !servers_table_is_valid(table))
484 goto end;
485
486 table->file->row_logging= 0; // Don't log to binary log
487
488 /* insert the server into the table */
489 if (unlikely(error= insert_server_record(table, server)))
490 goto end;
491
492 /* insert the server into the cache */
493 if (unlikely((error= insert_server_record_into_cache(server))))
494 goto end;
495
496end:
497 DBUG_RETURN(error);
498}
499
500
501/*

Callers 1

create_serverFunction · 0.85

Calls 5

open_ltableFunction · 0.85
servers_table_is_validFunction · 0.85
insert_server_recordFunction · 0.85
init_one_tableMethod · 0.80

Tested by

no test coverage detected