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

Function transform_condition_or_part

sql/sql_derived.cc:1442–1481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1440*/
1441
1442Item *transform_condition_or_part(THD *thd,
1443 Item *cond,
1444 Item_transformer transformer,
1445 uchar *arg)
1446{
1447 if (cond->type() != Item::COND_ITEM ||
1448 ((Item_cond*) cond)->functype() != Item_func::COND_AND_FUNC)
1449 {
1450 Item *new_item= cond->transform(thd, transformer, arg);
1451 // Indicate that the condition is not pushable
1452 if (!new_item)
1453 cond->clear_extraction_flag();
1454 return new_item;
1455 }
1456
1457 List_iterator<Item> li(*((Item_cond*) cond)->argument_list());
1458 Item *item;
1459 while ((item=li++))
1460 {
1461 Item *new_item= item->transform(thd, transformer, arg);
1462 if (!new_item)
1463 {
1464 // Indicate that the condition is not pushable
1465 item->clear_extraction_flag();
1466 li.remove();
1467 }
1468 else
1469 li.replace(new_item);
1470 }
1471
1472 switch (((Item_cond*) cond)->argument_list()->elements)
1473 {
1474 case 0:
1475 return NULL;
1476 case 1:
1477 return ((Item_cond*) cond)->argument_list()->head();
1478 default:
1479 return cond;
1480 }
1481}
1482
1483
1484/**

Callers 1

Calls 8

clear_extraction_flagMethod · 0.80
argument_listMethod · 0.80
typeMethod · 0.45
functypeMethod · 0.45
transformMethod · 0.45
removeMethod · 0.45
replaceMethod · 0.45
headMethod · 0.45

Tested by

no test coverage detected