@@ -1522,58 +1522,41 @@ class Item: public Value_source,
1522
1522
(*traverser)(this , arg);
1523
1523
}
1524
1524
1525
- virtual bool remove_dependence_processor (void * arg) { return 0 ; }
1525
+ /* ========= Item processors, to be used with Item::walk() ========*/
1526
+ virtual bool remove_dependence_processor (void *arg) { return 0 ; }
1526
1527
virtual bool cleanup_processor (void *arg);
1527
- virtual bool collect_item_field_processor (void * arg) { return 0 ; }
1528
- virtual bool add_field_to_set_processor (void * arg) { return 0 ; }
1528
+ virtual bool cleanup_excluding_const_fields_processor (void *arg) { return cleanup_processor (arg); }
1529
+ virtual bool collect_item_field_processor (void *arg) { return 0 ; }
1530
+ virtual bool collect_outer_ref_processor (void *arg) {return 0 ; }
1531
+ virtual bool check_inner_refs_processor (void *arg) { return 0 ; }
1529
1532
virtual bool find_item_in_field_list_processor (void *arg) { return 0 ; }
1530
1533
virtual bool find_item_processor (void *arg);
1531
- virtual bool change_context_processor (void *context ) { return 0 ; }
1532
- virtual bool reset_query_id_processor (void *query_id_arg ) { return 0 ; }
1534
+ virtual bool change_context_processor (void *arg ) { return 0 ; }
1535
+ virtual bool reset_query_id_processor (void *arg ) { return 0 ; }
1533
1536
virtual bool is_expensive_processor (void *arg) { return 0 ; }
1537
+
1538
+ // FIXME reduce the number of "add field to bitmap" processors
1539
+ virtual bool add_field_to_set_processor (void *arg) { return 0 ; }
1534
1540
virtual bool register_field_in_read_map (void *arg) { return 0 ; }
1535
1541
virtual bool register_field_in_write_map (void *arg) { return 0 ; }
1542
+ virtual bool register_field_in_bitmap (void *arg) { return 0 ; }
1543
+ virtual bool update_table_bitmaps_processor (void *arg) { return 0 ; }
1544
+
1536
1545
virtual bool enumerate_field_refs_processor (void *arg) { return 0 ; }
1537
1546
virtual bool mark_as_eliminated_processor (void *arg) { return 0 ; }
1538
1547
virtual bool eliminate_subselect_processor (void *arg) { return 0 ; }
1539
1548
virtual bool set_fake_select_as_master_processor (void *arg) { return 0 ; }
1540
- virtual bool update_table_bitmaps_processor (void *arg) { return 0 ; }
1541
1549
virtual bool view_used_tables_processor (void *arg) { return 0 ; }
1542
- virtual bool eval_not_null_tables (void *opt_arg ) { return 0 ; }
1543
- virtual bool is_subquery_processor (void *opt_arg ) { return 0 ; }
1550
+ virtual bool eval_not_null_tables (void *arg ) { return 0 ; }
1551
+ virtual bool is_subquery_processor (void *arg ) { return 0 ; }
1544
1552
virtual bool count_sargable_conds (void *arg) { return 0 ; }
1545
- virtual bool limit_index_condition_pushdown_processor (void *opt_arg)
1546
- {
1547
- return FALSE ;
1548
- }
1549
- virtual bool exists2in_processor (void *opt_arg) { return 0 ; }
1550
- virtual bool find_selective_predicates_list_processor (void *opt_arg)
1551
- { return 0 ; }
1552
- virtual bool exclusive_dependence_on_table_processor (void *map)
1553
- { return 0 ; }
1554
- virtual bool exclusive_dependence_on_grouping_fields_processor (void *arg)
1555
- { return 0 ; }
1556
- virtual bool cleanup_excluding_const_fields_processor (void *arg)
1557
- { return cleanup_processor (arg); }
1558
-
1559
- virtual Item *get_copy (THD *thd, MEM_ROOT *mem_root)=0;
1560
-
1561
- /* To call bool function for all arguments */
1562
- struct bool_func_call_args
1563
- {
1564
- Item *original_func_item;
1565
- void (Item::*bool_function)();
1566
- };
1567
-
1568
- /*
1569
- The next function differs from the previous one that a bitmap to be updated
1570
- is passed as uchar *arg.
1571
- */
1572
- virtual bool register_field_in_bitmap (void *arg) { return 0 ; }
1573
-
1574
- bool cache_const_expr_analyzer (uchar **arg);
1575
- Item* cache_const_expr_transformer (THD *thd, uchar *arg);
1576
-
1553
+ virtual bool limit_index_condition_pushdown_processor (void *arg) { return 0 ; }
1554
+ virtual bool exists2in_processor (void *arg) { return 0 ; }
1555
+ virtual bool find_selective_predicates_list_processor (void *arg) { return 0 ; }
1556
+ virtual bool exclusive_dependence_on_table_processor (void *arg) { return 0 ; }
1557
+ virtual bool exclusive_dependence_on_grouping_fields_processor (void *arg) { return 0 ; }
1558
+ virtual bool switch_to_nullable_fields_processor (void *arg) { return 0 ; }
1559
+ virtual bool find_function_processor (void *arg) { return 0 ; }
1577
1560
/*
1578
1561
Check if a partition function is allowed
1579
1562
SYNOPSIS
@@ -1625,44 +1608,15 @@ class Item: public Value_source,
1625
1608
assumes that there are no multi-byte collations amongst the partition
1626
1609
fields.
1627
1610
*/
1628
- virtual bool check_partition_func_processor (void *bool_arg) { return TRUE ;}
1629
- /*
1630
- @brief
1631
- Processor used to mark virtual columns used in partitioning expression
1632
-
1633
- @param
1634
- arg always ignored
1635
-
1636
- @retval
1637
- FALSE always
1638
- */
1639
- virtual bool vcol_in_partition_func_processor (void *arg)
1640
- {
1641
- return FALSE ;
1642
- }
1643
-
1644
- virtual Item* propagate_equal_fields (THD*, const Context &, COND_EQUAL *)
1645
- {
1646
- return this ;
1647
- };
1611
+ virtual bool check_partition_func_processor (void *arg) { return 1 ;}
1612
+ virtual bool vcol_in_partition_func_processor (void *arg) { return 0 ; }
1613
+ /* * Processor used to check acceptability of an item in the defining
1614
+ expression for a virtual column
1648
1615
1649
- Item* propagate_equal_fields_and_change_item_tree (THD *thd,
1650
- const Context &ctx,
1651
- COND_EQUAL *cond,
1652
- Item **place);
1616
+ @param arg always ignored
1653
1617
1654
- /*
1655
- @brief
1656
- Processor used to check acceptability of an item in the defining
1657
- expression for a virtual column
1658
-
1659
- @param
1660
- arg always ignored
1661
-
1662
- @retval
1663
- FALSE the item is accepted in the definition of a virtual column
1664
- @retval
1665
- TRUE otherwise
1618
+ @retval 0 the item is accepted in the definition of a virtual column
1619
+ @retval 1 otherwise
1666
1620
*/
1667
1621
struct vcol_func_processor_result
1668
1622
{
@@ -1673,20 +1627,34 @@ class Item: public Value_source,
1673
1627
{
1674
1628
return mark_unsupported_function (full_name (), arg, VCOL_IMPOSSIBLE);
1675
1629
}
1630
+ virtual bool check_field_expression_processor (void *arg) { return 0 ; }
1676
1631
1677
- virtual bool check_field_expression_processor (void *arg) { return FALSE ; }
1678
-
1679
- /* arg points to REPLACE_EQUAL_FIELD_ARG object */
1680
- virtual Item *replace_equal_field (THD *thd, uchar *arg) { return this ; }
1681
1632
/*
1682
1633
Check if an expression value has allowed arguments, like DATE/DATETIME
1683
1634
for date functions. Also used by partitioning code to reject
1684
1635
timezone-dependent expressions in a (sub)partitioning function.
1685
1636
*/
1686
- virtual bool check_valid_arguments_processor (void *bool_arg)
1637
+ virtual bool check_valid_arguments_processor (void *arg) { return 0 ; }
1638
+ /* ============== End of Item processor list ======================*/
1639
+
1640
+ virtual Item *get_copy (THD *thd, MEM_ROOT *mem_root)=0;
1641
+
1642
+ bool cache_const_expr_analyzer (uchar **arg);
1643
+ Item* cache_const_expr_transformer (THD *thd, uchar *arg);
1644
+
1645
+ virtual Item* propagate_equal_fields (THD*, const Context &, COND_EQUAL *)
1687
1646
{
1688
- return FALSE ;
1689
- }
1647
+ return this ;
1648
+ };
1649
+
1650
+ Item* propagate_equal_fields_and_change_item_tree (THD *thd,
1651
+ const Context &ctx,
1652
+ COND_EQUAL *cond,
1653
+ Item **place);
1654
+
1655
+ /* arg points to REPLACE_EQUAL_FIELD_ARG object */
1656
+ virtual Item *replace_equal_field (THD *thd, uchar *arg) { return this ; }
1657
+
1690
1658
struct Collect_deps_prm
1691
1659
{
1692
1660
List<Item> *parameters;
@@ -1696,31 +1664,6 @@ class Item: public Value_source,
1696
1664
int nest_level;
1697
1665
bool collect;
1698
1666
};
1699
- /* *
1700
- Collect outer references
1701
- */
1702
- virtual bool collect_outer_ref_processor (void *arg) {return FALSE ; }
1703
-
1704
- /* *
1705
- Find a function of a given type
1706
-
1707
- @param arg the function type to search (enum Item_func::Functype)
1708
- @return
1709
- @retval TRUE the function type we're searching for is found
1710
- @retval FALSE the function type wasn't found
1711
-
1712
- @description
1713
- This function can be used (together with Item::walk()) to find functions
1714
- in an item tree fragment.
1715
- */
1716
- virtual bool find_function_processor (void *arg)
1717
- {
1718
- return FALSE ;
1719
- }
1720
-
1721
- virtual bool check_inner_refs_processor (void *arg) { return FALSE ; }
1722
-
1723
- virtual bool switch_to_nullable_fields_processor (void *arg) { return FALSE ; }
1724
1667
1725
1668
/*
1726
1669
For SP local variable returns pointer to Item representing its
0 commit comments