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

Method period_setup_conds

sql/sql_select.cc:1159–1197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1157}
1158
1159int SELECT_LEX::period_setup_conds(THD *thd, TABLE_LIST *tables)
1160{
1161 DBUG_ENTER("SELECT_LEX::period_setup_conds");
1162 const bool update_conds= !skip_setup_conds(thd);
1163
1164 Query_arena backup;
1165 Query_arena *arena= thd->activate_stmt_arena_if_needed(&backup);
1166
1167 DBUG_ASSERT(!tables->next_local && tables->table);
1168
1169 Item *result= NULL;
1170 for (TABLE_LIST *table= tables; table; table= table->next_local)
1171 {
1172 if (!table->table)
1173 continue;
1174 vers_select_conds_t &conds= table->period_conditions;
1175 if (!table->table->s->period.name.streq_safe(conds.name))
1176 {
1177 my_error(ER_PERIOD_NOT_FOUND, MYF(0), conds.name.str);
1178 if (arena)
1179 thd->restore_active_arena(arena, &backup);
1180 DBUG_RETURN(-1);
1181 }
1182
1183 if (update_conds)
1184 {
1185 conds.period= &table->table->s->period;
1186 result= and_items(thd, result,
1187 period_get_condition(thd, table, this, &conds, true));
1188 }
1189 }
1190 if (update_conds)
1191 where= and_items(thd, where, result);
1192
1193 if (arena)
1194 thd->restore_active_arena(arena, &backup);
1195
1196 DBUG_RETURN(0);
1197}
1198
1199int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
1200{

Callers 2

handle_endMethod · 0.80
prepare_innerMethod · 0.80

Calls 7

skip_setup_condsFunction · 0.85
my_errorFunction · 0.85
and_itemsFunction · 0.85
period_get_conditionFunction · 0.85
streq_safeMethod · 0.80
restore_active_arenaMethod · 0.80

Tested by

no test coverage detected