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

Function insert

sql/wsrep_schema.cc:445–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445static int insert(TABLE* table) {
446 DBUG_ENTER("Wsrep_schema::insert()");
447 int ret= 0;
448 int error;
449
450 /*
451 Verify that the table has primary key defined.
452 */
453 if (table->s->primary_key >= MAX_KEY ||
454 !table->s->keys_in_use.is_set(table->s->primary_key)) {
455 WSREP_ERROR("No primary key for %s.%s",
456 table->s->db.str, table->s->table_name.str);
457 DBUG_RETURN(1);
458 }
459
460 if ((error= table->file->ha_write_row(table->record[0]))) {
461 if (error == HA_ERR_FOUND_DUPP_KEY) {
462 WSREP_WARN("Duplicate key found when writing into %s.%s",
463 table->s->db.str,
464 table->s->table_name.str);
465 ret= HA_ERR_FOUND_DUPP_KEY;
466 } else {
467 WSREP_ERROR("Error writing into %s.%s: %d",
468 table->s->db.str,
469 table->s->table_name.str,
470 error);
471 ret= 1;
472 }
473 }
474
475 DBUG_RETURN(ret);
476}
477
478static int delete_row(TABLE* table) {
479 int error;

Callers 15

insert_or_searchMethod · 0.85
insert_or_replaceMethod · 0.85
append_fragmentMethod · 0.85
store_allowlistMethod · 0.85
end_of_resultMethod · 0.85
createMethod · 0.85
parse_var_listMethod · 0.85
copyInMethod · 0.85
pageCommitMethod · 0.85
insertMethod · 0.85
push_backMethod · 0.85
push_frontMethod · 0.85

Calls 2

ha_write_rowMethod · 0.80
is_setMethod · 0.45

Tested by

no test coverage detected