~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/eval0eval.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-21 01:02:23 UTC
  • mto: (960.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 961.
  • Revision ID: osullivan.padraig@gmail.com-20090321010223-j8cph7eeyt1u3xol
Fixed function object to ensure it correctly returns a boolean type since
memcmp returns an integer. Added some more comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/**************************************************//**
20
 
@file include/eval0eval.h
 
19
/******************************************************
21
20
SQL evaluator: evaluates simple data structures, like expressions, in
22
21
a query graph
23
22
 
32
31
#include "pars0sym.h"
33
32
#include "pars0pars.h"
34
33
 
35
 
/*****************************************************************//**
 
34
/*********************************************************************
36
35
Free the buffer from global dynamic memory for a value of a que_node,
37
36
if it has been allocated in the above function. The freeing for pushed
38
37
column values is done in sel_col_prefetch_buf_free. */
40
39
void
41
40
eval_node_free_val_buf(
42
41
/*===================*/
43
 
        que_node_t*     node);  /*!< in: query graph node */
44
 
/*****************************************************************//**
 
42
        que_node_t*     node);  /* in: query graph node */
 
43
/*********************************************************************
45
44
Evaluates a symbol table symbol. */
46
45
UNIV_INLINE
47
46
void
48
47
eval_sym(
49
48
/*=====*/
50
 
        sym_node_t*     sym_node);      /*!< in: symbol table node */
51
 
/*****************************************************************//**
 
49
        sym_node_t*     sym_node);      /* in: symbol table node */
 
50
/*********************************************************************
52
51
Evaluates an expression. */
53
52
UNIV_INLINE
54
53
void
55
54
eval_exp(
56
55
/*=====*/
57
 
        que_node_t*     exp_node);      /*!< in: expression */
58
 
/*****************************************************************//**
 
56
        que_node_t*     exp_node);      /* in: expression */
 
57
/*********************************************************************
59
58
Sets an integer value as the value of an expression node. */
60
59
UNIV_INLINE
61
60
void
62
61
eval_node_set_int_val(
63
62
/*==================*/
64
 
        que_node_t*     node,   /*!< in: expression node */
65
 
        lint            val);   /*!< in: value to set */
66
 
/*****************************************************************//**
67
 
Gets an integer value from an expression node.
68
 
@return integer value */
 
63
        que_node_t*     node,   /* in: expression node */
 
64
        lint            val);   /* in: value to set */
 
65
/*********************************************************************
 
66
Gets an integer value from an expression node. */
69
67
UNIV_INLINE
70
68
lint
71
69
eval_node_get_int_val(
72
70
/*==================*/
73
 
        que_node_t*     node);  /*!< in: expression node */
74
 
/*****************************************************************//**
 
71
                                /* out: integer value */
 
72
        que_node_t*     node);  /* in: expression node */
 
73
/*********************************************************************
75
74
Copies a binary string value as the value of a query graph node. Allocates a
76
75
new buffer if necessary. */
77
76
UNIV_INLINE
78
77
void
79
78
eval_node_copy_and_alloc_val(
80
79
/*=========================*/
81
 
        que_node_t*     node,   /*!< in: query graph node */
82
 
        const byte*     str,    /*!< in: binary string */
83
 
        ulint           len);   /*!< in: string length or UNIV_SQL_NULL */
84
 
/*****************************************************************//**
 
80
        que_node_t*     node,   /* in: query graph node */
 
81
        const byte*     str,    /* in: binary string */
 
82
        ulint           len);   /* in: string length or UNIV_SQL_NULL */
 
83
/*********************************************************************
85
84
Copies a query node value to another node. */
86
85
UNIV_INLINE
87
86
void
88
87
eval_node_copy_val(
89
88
/*===============*/
90
 
        que_node_t*     node1,  /*!< in: node to copy to */
91
 
        que_node_t*     node2); /*!< in: node to copy from */
92
 
/*****************************************************************//**
93
 
Gets a iboolean value from a query node.
94
 
@return iboolean value */
 
89
        que_node_t*     node1,  /* in: node to copy to */
 
90
        que_node_t*     node2); /* in: node to copy from */
 
91
/*********************************************************************
 
92
Gets a iboolean value from a query node. */
95
93
UNIV_INLINE
96
94
ibool
97
95
eval_node_get_ibool_val(
98
96
/*====================*/
99
 
        que_node_t*     node);  /*!< in: query graph node */
100
 
/*****************************************************************//**
101
 
Evaluates a comparison node.
102
 
@return the result of the comparison */
 
97
                                /* out: iboolean value */
 
98
        que_node_t*     node);  /* in: query graph node */
 
99
/*********************************************************************
 
100
Evaluates a comparison node. */
103
101
UNIV_INTERN
104
102
ibool
105
103
eval_cmp(
106
104
/*=====*/
107
 
        func_node_t*    cmp_node);      /*!< in: comparison node */
 
105
                                        /* out: the result of the comparison */
 
106
        func_node_t*    cmp_node);      /* in: comparison node */
108
107
 
109
108
 
110
109
#ifndef UNIV_NONINL