~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2009-02-10 00:14:40 UTC
  • Revision ID: brian@tangent.org-20090210001440-qjg8eofh3h93064b
Adding Multi-threaded Scheduler into the system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (C) 1997, 2009, Innobase Oy. All Rights Reserved.
4
 
 
5
 
This program is free software; you can redistribute it and/or modify it under
6
 
the terms of the GNU General Public License as published by the Free Software
7
 
Foundation; version 2 of the License.
8
 
 
9
 
This program is distributed in the hope that it will be useful, but WITHOUT
10
 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
 
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
 
 
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
16
 
 
17
 
*****************************************************************************/
18
 
 
19
 
/**************************************************//**
20
 
@file include/eval0eval.h
 
1
/******************************************************
21
2
SQL evaluator: evaluates simple data structures, like expressions, in
22
3
a query graph
23
4
 
 
5
(c) 1997 Innobase Oy
 
6
 
24
7
Created 12/29/1997 Heikki Tuuri
25
8
*******************************************************/
26
9
 
32
15
#include "pars0sym.h"
33
16
#include "pars0pars.h"
34
17
 
35
 
/*****************************************************************//**
 
18
/*********************************************************************
36
19
Free the buffer from global dynamic memory for a value of a que_node,
37
20
if it has been allocated in the above function. The freeing for pushed
38
21
column values is done in sel_col_prefetch_buf_free. */
40
23
void
41
24
eval_node_free_val_buf(
42
25
/*===================*/
43
 
        que_node_t*     node);  /*!< in: query graph node */
44
 
/*****************************************************************//**
 
26
        que_node_t*     node);  /* in: query graph node */
 
27
/*********************************************************************
45
28
Evaluates a symbol table symbol. */
46
29
UNIV_INLINE
47
30
void
48
31
eval_sym(
49
32
/*=====*/
50
 
        sym_node_t*     sym_node);      /*!< in: symbol table node */
51
 
/*****************************************************************//**
 
33
        sym_node_t*     sym_node);      /* in: symbol table node */
 
34
/*********************************************************************
52
35
Evaluates an expression. */
53
36
UNIV_INLINE
54
37
void
55
38
eval_exp(
56
39
/*=====*/
57
 
        que_node_t*     exp_node);      /*!< in: expression */
58
 
/*****************************************************************//**
 
40
        que_node_t*     exp_node);      /* in: expression */
 
41
/*********************************************************************
59
42
Sets an integer value as the value of an expression node. */
60
43
UNIV_INLINE
61
44
void
62
45
eval_node_set_int_val(
63
46
/*==================*/
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 */
 
47
        que_node_t*     node,   /* in: expression node */
 
48
        lint            val);   /* in: value to set */
 
49
/*********************************************************************
 
50
Gets an integer value from an expression node. */
69
51
UNIV_INLINE
70
52
lint
71
53
eval_node_get_int_val(
72
54
/*==================*/
73
 
        que_node_t*     node);  /*!< in: expression node */
74
 
/*****************************************************************//**
 
55
                                /* out: integer value */
 
56
        que_node_t*     node);  /* in: expression node */
 
57
/*********************************************************************
75
58
Copies a binary string value as the value of a query graph node. Allocates a
76
59
new buffer if necessary. */
77
60
UNIV_INLINE
78
61
void
79
62
eval_node_copy_and_alloc_val(
80
63
/*=========================*/
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
 
/*****************************************************************//**
 
64
        que_node_t*     node,   /* in: query graph node */
 
65
        const byte*     str,    /* in: binary string */
 
66
        ulint           len);   /* in: string length or UNIV_SQL_NULL */
 
67
/*********************************************************************
85
68
Copies a query node value to another node. */
86
69
UNIV_INLINE
87
70
void
88
71
eval_node_copy_val(
89
72
/*===============*/
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 */
 
73
        que_node_t*     node1,  /* in: node to copy to */
 
74
        que_node_t*     node2); /* in: node to copy from */
 
75
/*********************************************************************
 
76
Gets a iboolean value from a query node. */
95
77
UNIV_INLINE
96
78
ibool
97
79
eval_node_get_ibool_val(
98
80
/*====================*/
99
 
        que_node_t*     node);  /*!< in: query graph node */
100
 
/*****************************************************************//**
101
 
Evaluates a comparison node.
102
 
@return the result of the comparison */
 
81
                                /* out: iboolean value */
 
82
        que_node_t*     node);  /* in: query graph node */
 
83
/*********************************************************************
 
84
Evaluates a comparison node. */
103
85
UNIV_INTERN
104
86
ibool
105
87
eval_cmp(
106
88
/*=====*/
107
 
        func_node_t*    cmp_node);      /*!< in: comparison node */
 
89
                                        /* out: the result of the comparison */
 
90
        func_node_t*    cmp_node);      /* in: comparison node */
108
91
 
109
92
 
110
93
#ifndef UNIV_NONINL