~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Mark Atwood
  • Date: 2011-10-18 16:54:23 UTC
  • mfrom: (2440.2.4 rf)
  • Revision ID: me@mark.atwood.name-20111018165423-vboh6wowjnvn434f
mergeĀ lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
#include <drizzled/var.h>
50
50
#include <drizzled/system_variables.h>
51
51
#include <drizzled/lex_input_stream.h>
 
52
#include <drizzled/show.h>
52
53
 
53
54
int yylex(union ParserType *yylval, drizzled::Session *session);
54
55
 
3169
3170
        | AVG_SYM '(' DISTINCT in_sum_expr ')'
3170
3171
          { $$=new Item_sum_avg_distinct($4); }
3171
3172
        | COUNT_SYM '(' opt_all '*' ')'
3172
 
          { $$=new Item_sum_count(new Item_int((int32_t) 0L,1)); }
 
3173
          { $$=new Item_sum_count(new Item_int(0, 1)); }
3173
3174
        | COUNT_SYM '(' in_sum_expr ')'
3174
3175
          { $$=new Item_sum_count($3); }
3175
3176
        | COUNT_SYM '(' DISTINCT
4932
4933
              it is OK only emulate fix_fields, because we need only
4933
4934
              value of constant
4934
4935
            */
4935
 
            $$= tmp ?
4936
 
              tmp->quick_fix_field(), tmp->val_str((String*) 0) :
4937
 
              (String*) 0;
 
4936
            $$= tmp ? tmp->quick_fix_field(), tmp->val_str(NULL) : NULL;
4938
4937
          }
4939
4938
        | BIN_NUM
4940
4939
          {
4941
 
            Item *tmp= new Item_bin_string($1.data(), $1.size());
 
4940
            Item *tmp= new Item_bin_string($1);
4942
4941
            /*
4943
4942
              it is OK only emulate fix_fields, because we need only
4944
4943
              value of constant
4945
4944
            */
4946
 
            $$= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) :
4947
 
              (String*) 0;
 
4945
            $$= tmp ? tmp->quick_fix_field(), tmp->val_str(NULL) : NULL;
4948
4946
          }
4949
4947
        ;
4950
4948
 
4969
4967
        | FALSE_SYM { $$= new drizzled::item::False(); }
4970
4968
        | TRUE_SYM { $$= new drizzled::item::True(); }
4971
4969
        | HEX_NUM { $$ = new Item_hex_string($1);}
4972
 
        | BIN_NUM { $$= new Item_bin_string($1.data(), $1.size()); }
 
4970
        | BIN_NUM { $$= new Item_bin_string($1); }
4973
4971
        | DATE_SYM text_literal { $$ = $2; }
4974
4972
        | TIMESTAMP_SYM text_literal { $$ = $2; }
4975
4973
        ;
4977
4975
integer_literal:
4978
4976
          text_literal { $$ = $1; }
4979
4977
        | HEX_NUM { $$ = new Item_hex_string($1);}
4980
 
        | BIN_NUM { $$= new Item_bin_string($1.data(), $1.size()); }
 
4978
        | BIN_NUM { $$= new Item_bin_string($1); }
4981
4979
        | NUM_literal { $$ = $1; }
4982
4980
        | NULL_SYM
4983
4981
          {