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

Function join_read_always_key

sql/sql_select.cc:25482–25518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25480*/
25481
25482static int
25483join_read_always_key(JOIN_TAB *tab)
25484{
25485 int error;
25486 TABLE *table= tab->table;
25487
25488 /* Initialize the index first */
25489 if (!table->file->inited)
25490 {
25491 if (unlikely((error= table->file->ha_index_init(tab->ref.key,
25492 tab->sorted))))
25493 {
25494 (void) report_error(table, error);
25495 return 1;
25496 }
25497 }
25498
25499 if (unlikely(cp_buffer_from_ref(tab->join->thd, table, &tab->ref)))
25500 return -1;
25501 if (unlikely((error=
25502 table->file->prepare_index_key_scan_map(tab->ref.key_buff,
25503 make_prev_keypart_map(tab->ref.key_parts)))))
25504 {
25505 report_error(table,error);
25506 return -1;
25507 }
25508 if ((error= table->file->ha_index_read_map(table->record[0],
25509 tab->ref.key_buff,
25510 make_prev_keypart_map(tab->ref.key_parts),
25511 HA_READ_KEY_EXACT)))
25512 {
25513 if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
25514 return report_error(table, error);
25515 return -1; /* purecov: inspected */
25516 }
25517 return 0;
25518}
25519
25520
25521/**

Callers 1

Calls 6

report_errorFunction · 0.85
cp_buffer_from_refFunction · 0.85
make_prev_keypart_mapFunction · 0.85
ha_index_initMethod · 0.80
ha_index_read_mapMethod · 0.80

Tested by

no test coverage detected