~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/eval/eval0eval.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (C) 1997, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
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., 59 Temple
15
 
Place, Suite 330, Boston, MA 02111-1307 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
 
15
St, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
65
65
 
66
66
        dfield = que_node_get_val(node);
67
67
 
68
 
        data = dfield_get_data(dfield);
 
68
        data = static_cast<unsigned char *>(dfield_get_data(dfield));
69
69
 
70
70
        if (data && data != &eval_dummy) {
71
71
                mem_free(data);
74
74
        if (size == 0) {
75
75
                data = &eval_dummy;
76
76
        } else {
77
 
                data = mem_alloc(size);
 
77
                data = static_cast<unsigned char *>(mem_alloc(size));
78
78
        }
79
79
 
80
80
        que_node_set_val_buf_size(node, size);
102
102
 
103
103
        dfield = que_node_get_val(node);
104
104
 
105
 
        data = dfield_get_data(dfield);
 
105
        data = static_cast<unsigned char *>(dfield_get_data(dfield));
106
106
 
107
107
        if (que_node_get_val_buf_size(node) > 0) {
108
108
                ut_a(data);
384
384
/*==========*/
385
385
        func_node_t*    func_node)      /*!< in: function node */
386
386
{
387
 
        que_node_t*     arg1;
388
 
        que_node_t*     arg2;
389
387
        sym_node_t*     cursor;
390
388
        sel_node_t*     sel_node;
391
389
        ibool           ibool_val;
392
390
 
393
 
        arg1 = func_node->args;
394
 
        arg2 = que_node_get_next(arg1);
395
 
 
396
391
        ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);
397
392
 
398
 
        cursor = arg1;
 
393
        cursor = static_cast<sym_node_t *>(func_node->args);
399
394
 
400
395
        ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL);
401
396
 
441
436
 
442
437
        arg3 = que_node_get_next(arg2);
443
438
 
444
 
        str1 = dfield_get_data(que_node_get_val(arg1));
 
439
        str1 = static_cast<unsigned char *>(dfield_get_data(que_node_get_val(arg1)));
445
440
 
446
441
        len1 = (ulint)eval_node_get_int_val(arg2);
447
442
        len2 = (ulint)eval_node_get_int_val(arg3);
476
471
        arg3 = que_node_get_next(arg2);
477
472
        arg4 = que_node_get_next(arg3);
478
473
 
479
 
        str1 = dfield_get_data(que_node_get_val(arg1));
480
 
        str2 = dfield_get_data(que_node_get_val(arg2));
 
474
        str1 = static_cast<unsigned char *>(dfield_get_data(que_node_get_val(arg1)));
 
475
        str2 = static_cast<unsigned char *>(dfield_get_data(que_node_get_val(arg2)));
481
476
 
482
477
        len1 = (ulint)eval_node_get_int_val(arg3);
483
478
        len2 = (ulint)eval_node_get_int_val(arg4);
518
513
        dfield1 = que_node_get_val(arg1);
519
514
        dfield2 = que_node_get_val(arg2);
520
515
 
521
 
        str1 = dfield_get_data(dfield1);
522
 
        str2 = dfield_get_data(dfield2);
 
516
        str1 = static_cast<unsigned char *>(dfield_get_data(dfield1));
 
517
        str2 = static_cast<unsigned char *>(dfield_get_data(dfield2));
523
518
 
524
519
        len1 = dfield_get_len(dfield1);
525
520
        len2 = dfield_get_len(dfield2);
582
577
 
583
578
        dfield = que_node_get_val(arg1);
584
579
 
585
 
        str1 = dfield_get_data(dfield);
 
580
        str1 = static_cast<unsigned char *>(dfield_get_data(dfield));
586
581
        len1 = dfield_get_len(dfield);
587
582
 
588
583
        if (len1 > 4) {
664
659
 
665
660
        arg1 = func_node->args;
666
661
 
667
 
        str1 = dfield_get_data(que_node_get_val(arg1));
 
662
        str1 = static_cast<unsigned char *>(dfield_get_data(que_node_get_val(arg1)));
668
663
 
669
664
        if (dtype_get_mtype(que_node_get_data_type(arg1)) != DATA_INT) {
670
665
 
792
787
        func_node_t*    func_node)      /*!< in: function node */
793
788
{
794
789
        que_node_t*     arg;
795
 
        ulint           class;
 
790
        ulint           func_class;
796
791
        ulint           func;
797
792
 
798
793
        ut_ad(que_node_get_type(func_node) == QUE_NODE_FUNC);
799
794
 
800
 
        class = func_node->class;
 
795
        func_class = func_node->func_class;
801
796
        func = func_node->func;
802
797
 
803
798
        arg = func_node->args;
810
805
                values, except for eval_cmp and notfound */
811
806
 
812
807
                if (dfield_is_null(que_node_get_val(arg))
813
 
                    && (class != PARS_FUNC_CMP)
 
808
                    && (func_class != PARS_FUNC_CMP)
814
809
                    && (func != PARS_NOTFOUND_TOKEN)
815
810
                    && (func != PARS_PRINTF_TOKEN)) {
816
811
                        ut_error;
819
814
                arg = que_node_get_next(arg);
820
815
        }
821
816
 
822
 
        if (class == PARS_FUNC_CMP) {
 
817
        if (func_class == PARS_FUNC_CMP) {
823
818
                eval_cmp(func_node);
824
 
        } else if (class == PARS_FUNC_ARITH) {
 
819
        } else if (func_class == PARS_FUNC_ARITH) {
825
820
                eval_arith(func_node);
826
 
        } else if (class == PARS_FUNC_AGGREGATE) {
 
821
        } else if (func_class == PARS_FUNC_AGGREGATE) {
827
822
                eval_aggregate(func_node);
828
 
        } else if (class == PARS_FUNC_PREDEFINED) {
 
823
        } else if (func_class == PARS_FUNC_PREDEFINED) {
829
824
 
830
825
                if (func == PARS_NOTFOUND_TOKEN) {
831
826
                        eval_notfound(func_node);
845
840
                        eval_predefined(func_node);
846
841
                }
847
842
        } else {
848
 
                ut_ad(class == PARS_FUNC_LOGICAL);
 
843
                ut_ad(func_class == PARS_FUNC_LOGICAL);
849
844
 
850
845
                eval_logical(func_node);
851
846
        }