~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/eval/eval0eval.c

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include "row0sel.h"
18
18
 
19
19
/* The RND function seed */
20
 
ulint   eval_rnd        = 128367121;
 
20
static ulint    eval_rnd        = 128367121;
21
21
 
22
22
/* Dummy adress used when we should allocate a buffer of size 0 in
23
23
the function below */
24
24
 
25
 
byte    eval_dummy;
 
25
static byte     eval_dummy;
26
26
 
27
27
/*********************************************************************
28
28
Allocate a buffer from global dynamic memory for a value of a que_node.
30
30
freed. If the node already has an allocated buffer, that buffer is freed
31
31
here. NOTE that this is the only function where dynamic memory should be
32
32
allocated for a query node val field. */
33
 
 
 
33
UNIV_INTERN
34
34
byte*
35
35
eval_node_alloc_val_buf(
36
36
/*====================*/
71
71
Free the buffer from global dynamic memory for a value of a que_node,
72
72
if it has been allocated in the above function. The freeing for pushed
73
73
column values is done in sel_col_prefetch_buf_free. */
74
 
 
 
74
UNIV_INTERN
75
75
void
76
76
eval_node_free_val_buf(
77
77
/*===================*/
96
96
 
97
97
/*********************************************************************
98
98
Evaluates a comparison node. */
99
 
 
 
99
UNIV_INTERN
100
100
ibool
101
101
eval_cmp(
102
102
/*=====*/
746
746
                        }
747
747
                }
748
748
 
749
 
                dfield_set_len((dfield_t*) que_node_get_val(func_node),
750
 
                               int_len);
 
749
                dfield_set_len(que_node_get_val(func_node), int_len);
751
750
 
752
751
                return;
753
752
 
769
768
 
770
769
/*********************************************************************
771
770
Evaluates a function node. */
772
 
 
 
771
UNIV_INTERN
773
772
void
774
773
eval_func(
775
774
/*======*/
781
780
 
782
781
        ut_ad(que_node_get_type(func_node) == QUE_NODE_FUNC);
783
782
 
784
 
        class = func_node->klass;
 
783
        class = func_node->class;
785
784
        func = func_node->func;
786
785
 
787
786
        arg = func_node->args;
793
792
                /* The functions are not defined for SQL null argument
794
793
                values, except for eval_cmp and notfound */
795
794
 
796
 
                if ((dfield_get_len(que_node_get_val(arg)) == UNIV_SQL_NULL)
 
795
                if (dfield_is_null(que_node_get_val(arg))
797
796
                    && (class != PARS_FUNC_CMP)
798
797
                    && (func != PARS_NOTFOUND_TOKEN)
799
798
                    && (func != PARS_PRINTF_TOKEN)) {