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

Function end_sj_materialize

sql/sql_select.cc:15665–15698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15663*/
15664
15665enum_nested_loop_state
15666end_sj_materialize(JOIN *join, JOIN_TAB *join_tab, bool end_of_records)
15667{
15668 int error;
15669 THD *thd= join->thd;
15670 SJ_MATERIALIZATION_INFO *sjm= join_tab[-1].emb_sj_nest->sj_mat_info;
15671 DBUG_ENTER("end_sj_materialize");
15672 if (!end_of_records)
15673 {
15674 TABLE *table= sjm->table;
15675
15676 List_iterator<Item> it(sjm->sjm_table_cols);
15677 Item *item;
15678 while ((item= it++))
15679 {
15680 if (item->is_null())
15681 DBUG_RETURN(NESTED_LOOP_OK);
15682 }
15683 fill_record(thd, table, table->field, sjm->sjm_table_cols, true, false,
15684 true);
15685 if (unlikely(thd->is_error()))
15686 DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */
15687 if (unlikely((error= table->file->ha_write_tmp_row(table->record[0]))))
15688 {
15689 /* create_myisam_from_heap will generate error if needed */
15690 if (table->file->is_fatal_error(error, HA_CHECK_DUP) &&
15691 create_internal_tmp_table_from_heap(thd, table,
15692 sjm->sjm_table_param.start_recinfo,
15693 &sjm->sjm_table_param.recinfo, error, 1, NULL))
15694 DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */
15695 }
15696 }
15697 DBUG_RETURN(NESTED_LOOP_OK);
15698}
15699
15700
15701/*

Callers

nothing calls this directly

Calls 5

fill_recordFunction · 0.85
is_nullMethod · 0.45
is_errorMethod · 0.45
is_fatal_errorMethod · 0.45

Tested by

no test coverage detected