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

Function find_unit_handler_for_lex

sql/sql_union.cc:1297–1334  ·  view source on GitHub ↗

@brief Recursive subroutine to be called from find_unit_handler() (see below). Must not be called directly, only from find_unit_handler(). */

Source from the content-addressed store, hash-verified

1295 Must not be called directly, only from find_unit_handler().
1296*/
1297static select_handler *find_unit_handler_for_lex(THD *thd,
1298 SELECT_LEX *sel_lex,
1299 SELECT_LEX_UNIT* unit)
1300{
1301 if (!(sel_lex->join))
1302 return nullptr;
1303 for (TABLE_LIST *tbl= sel_lex->join->tables_list; tbl; tbl= tbl->next_local)
1304 {
1305 if (!tbl->table)
1306 continue;
1307 if (tbl->derived)
1308 {
1309 /*
1310 Skip derived table for now as they will be checked
1311 in the subsequent loop
1312 */
1313 continue;
1314 }
1315 handlerton *ht= tbl->table->file->partition_ht();
1316 if (!ht->create_unit)
1317 continue;
1318 select_handler *sh= ht->create_unit(thd, unit);
1319 if (sh)
1320 return sh;
1321 }
1322
1323 for (SELECT_LEX_UNIT *un= sel_lex->first_inner_unit(); un;
1324 un= un->next_unit())
1325 {
1326 for (SELECT_LEX *sl= un->first_select(); sl; sl= sl->next_select())
1327 {
1328 select_handler *uh= find_unit_handler_for_lex(thd, sl, unit);
1329 if (uh)
1330 return uh;
1331 }
1332 }
1333 return nullptr;
1334}
1335
1336
1337/**

Callers 1

find_unit_handlerFunction · 0.85

Calls 6

create_unitMethod · 0.80
first_inner_unitMethod · 0.80
next_unitMethod · 0.80
first_selectMethod · 0.80
next_selectMethod · 0.80
partition_htMethod · 0.45

Tested by

no test coverage detected