~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/sum.h

  • Committer: Mats Kindahl
  • Date: 2008-08-26 07:32:59 UTC
  • mto: (489.1.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: mats@mysql.com-20080826073259-9k4evtajgldgolli
Replaced use of thd_proc_info() macro with calls to
set_proc_info() and get_proc_info() internally.  Introduced
functions set_thd_proc_info() and get_thd_proc_info() for
external users, i.e., plug-ins.

The set_thd_proc_info() accepted callers info that can be used to
print debug output, but the information was not used. The return
value was changed to void and the old value is not fetched any
more. To be able to get the value of proc_info for external
users, the function get_thd_proc_info() was introduced.

The thd_proc_info() macro called set_thd_proc_info() but almost
never used the return value of set_thd_proc_info() so the macro
was replaced with a call of THD::set_proc_info().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008-2009 Sun Microsystems
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; version 2 of the License.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
19
 
 
20
 
#ifndef DRIZZLED_OPTIMIZER_SUM_H
21
 
#define DRIZZLED_OPTIMIZER_SUM_H
22
 
 
23
 
namespace drizzled
24
 
{
25
 
 
26
 
namespace optimizer
27
 
{
28
 
 
29
 
/**
30
 
  Test if the predicate compares a field with constants.
31
 
 
32
 
  @param func_item        Predicate item
33
 
  @param[out] args        Here we store the field followed by constants
34
 
  @param[out] inv_order   Is set to 1 if the predicate is of the form
35
 
                          'const op field'
36
 
 
37
 
  @retval
38
 
    0        func_item is a simple predicate: a field is compared with
39
 
    constants
40
 
  @retval
41
 
    1        Otherwise
42
 
*/
43
 
bool simple_pred(Item_func *func_item, Item **args, bool &inv_order);
44
 
 
45
 
/**
46
 
  Substitutes constants for some COUNT(), MIN() and MAX() functions.
47
 
 
48
 
  @param tables                list of leaves of join table tree
49
 
  @param all_fields            All fields to be returned
50
 
  @param conds                 WHERE clause
51
 
 
52
 
  @note
53
 
    This function is only called for queries with sum functions and no
54
 
    GROUP BY part.
55
 
 
56
 
  @retval
57
 
    0                    no errors
58
 
  @retval
59
 
    1                    if all items were resolved
60
 
  @retval
61
 
    HA_ERR_KEY_NOT_FOUND on impossible conditions
62
 
  @retval
63
 
    HA_ERR_... if a deadlock or a lock wait timeout happens, for example
64
 
*/
65
 
int sum_query(TableList *tables, List<Item> &all_fields, COND *conds);
66
 
 
67
 
} /* namespace optimizer */
68
 
 
69
 
} /* namespace drizzled */
70
 
 
71
 
#endif /* DRIZZLED_OPTIMIZER_SUM_H */