~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Mark Atwood
  • Date: 2011-08-01 05:22:14 UTC
  • mfrom: (1919.3.53 drizzle_pbms)
  • Revision ID: me@mark.atwood.name-20110801052214-3wdsx3xgld6b5v4f
mergeĀ lp:~barry-leslie/drizzle/drizzle_pbms

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
#include <drizzled/table_ident.h>
49
49
#include <drizzled/var.h>
50
50
#include <drizzled/system_variables.h>
51
 
#include <drizzled/lex_input_stream.h>
52
51
 
53
52
int yylex(union ParserType *yylval, drizzled::Session *session);
54
53
 
1149
1148
row_format_or_text:
1150
1149
          row_format
1151
1150
          {
1152
 
            $$.str= YYSession->mem.strdup($1.str, $1.length);
 
1151
            $$.str= YYSession->mem.strmake($1.str, $1.length);
1153
1152
            $$.length= $1.length;
1154
1153
          }
1155
1154
        ;
1836
1835
          default_collation_schema
1837
1836
          {
1838
1837
            Lex.name= $3;
1839
 
            if (Lex.name.str == NULL && Lex.session->copy_db_to(Lex.name.str, Lex.name.length))
 
1838
            if (Lex.name.str == NULL && Lex.copy_db_to(&Lex.name.str, &Lex.name.length))
1840
1839
              DRIZZLE_YYABORT;
1841
1840
          }
1842
1841
        ;
2000
1999
 
2001
2000
            Lex.select_lex.db=$3->db.str;
2002
2001
            if (Lex.select_lex.db == NULL &&
2003
 
                Lex.session->copy_db_to(Lex.select_lex.db, dummy))
 
2002
                Lex.copy_db_to(&Lex.select_lex.db, &dummy))
2004
2003
            {
2005
2004
              DRIZZLE_YYABORT;
2006
2005
            }
3077
3076
          }
3078
3077
          opt_udf_expr_list ')'
3079
3078
          {
 
3079
            Create_func *builder;
3080
3080
            Item *item= NULL;
3081
3081
 
3082
3082
            /*
3088
3088
 
3089
3089
              This will be revised with WL#2128 (SQL PATH)
3090
3090
            */
3091
 
            if (Create_func* builder= find_native_function_builder($1))
 
3091
            builder= find_native_function_builder($1);
 
3092
            if (builder)
3092
3093
            {
3093
3094
              item= builder->create(YYSession, $1, $4);
3094
3095
            }
3095
 
            else if (const plugin::Function* udf= $<udf>3) /* Retrieving the result of service::Function::get */
 
3096
            else
3096
3097
            {
3097
 
                  item= Create_udf_func::s_singleton.create(YYSession, udf, $4);
3098
 
            } 
3099
 
                        else 
3100
 
                        {
3101
 
              /* fix for bug 250065, from Andrew Garner <muzazzi@gmail.com> */
3102
 
              my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", $1.str);
 
3098
              /* Retrieving the result of service::Function::get */
 
3099
              const plugin::Function *udf= $<udf>3;
 
3100
              if (udf)
 
3101
              {
 
3102
                item= Create_udf_func::s_singleton.create(YYSession, udf, $4);
 
3103
              } else {
 
3104
                /* fix for bug 250065, from Andrew Garner <muzazzi@gmail.com> */
 
3105
                my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", $1.str);
 
3106
              }
3103
3107
            }
3104
3108
 
3105
 
            if (not ($$= item))
 
3109
            if (! ($$= item))
3106
3110
            {
3107
3111
              DRIZZLE_YYABORT;
3108
3112
            }
5188
5192
          IDENT_sys    { $$=$1; }
5189
5193
        | keyword
5190
5194
          {
5191
 
            $$.str= YYSession->mem.strdup($1.str, $1.length);
 
5195
            $$.str= YYSession->mem.strmake($1.str, $1.length);
5192
5196
            $$.length= $1.length;
5193
5197
          }
5194
5198
        ;
5470
5474
internal_variable_ident:
5471
5475
          keyword_exception_for_variable
5472
5476
          {
5473
 
            $$.str= YYSession->mem.strdup($1.str, $1.length);
 
5477
            $$.str= YYSession->mem.strmake($1.str, $1.length);
5474
5478
            $$.length= $1.length;
5475
5479
          }
5476
5480
        | IDENT_sys    { $$=$1; }