~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Stewart Smith
  • Date: 2010-02-15 03:55:09 UTC
  • mto: (1273.13.96 build)
  • mto: This revision was merged to the branch mainline in revision 1308.
  • Revision ID: stewart@flamingspork.com-20100215035509-y6sry4q4yymph2by
move SUBSTR, SUBSTRING and SUBSTR_INDEX to plugins. add parser hooks for substr being a plugin now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3089
3089
        | SUBDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
3090
3090
          { $$= new (YYSession->mem_root) Item_date_add_interval($3, $6, $7, 1); }
3091
3091
        | SUBSTRING '(' expr ',' expr ',' expr ')'
3092
 
          { $$= new (YYSession->mem_root) Item_func_substr($3,$5,$7); }
 
3092
          {
 
3093
            std::string reverse_str("substr");
 
3094
            List<Item> *args= new (YYSession->mem_root) List<Item>;
 
3095
            args->push_back($3);
 
3096
            args->push_back($5);
 
3097
            args->push_back($7);
 
3098
            if (! ($$= reserved_keyword_function(reverse_str, args)))
 
3099
            {
 
3100
              DRIZZLE_YYABORT;
 
3101
            }
 
3102
          }
3093
3103
        | SUBSTRING '(' expr ',' expr ')'
3094
 
          { $$= new (YYSession->mem_root) Item_func_substr($3,$5); }
 
3104
          {
 
3105
            std::string reverse_str("substr");
 
3106
            List<Item> *args= new (YYSession->mem_root) List<Item>;
 
3107
            args->push_back($3);
 
3108
            args->push_back($5);
 
3109
            if (! ($$= reserved_keyword_function(reverse_str, args)))
 
3110
            {
 
3111
              DRIZZLE_YYABORT;
 
3112
            }
 
3113
          }
3095
3114
        | SUBSTRING '(' expr FROM expr FOR_SYM expr ')'
3096
 
          { $$= new (YYSession->mem_root) Item_func_substr($3,$5,$7); }
 
3115
          {
 
3116
            std::string reverse_str("substr");
 
3117
            List<Item> *args= new (YYSession->mem_root) List<Item>;
 
3118
            args->push_back($3);
 
3119
            args->push_back($5);
 
3120
            args->push_back($7);
 
3121
            if (! ($$= reserved_keyword_function(reverse_str, args)))
 
3122
            {
 
3123
              DRIZZLE_YYABORT;
 
3124
            }
 
3125
          }
3097
3126
        | SUBSTRING '(' expr FROM expr ')'
3098
 
          { $$= new (YYSession->mem_root) Item_func_substr($3,$5); }
 
3127
          {
 
3128
            std::string reverse_str("substr");
 
3129
            List<Item> *args= new (YYSession->mem_root) List<Item>;
 
3130
            args->push_back($3);
 
3131
            args->push_back($5);
 
3132
            if (! ($$= reserved_keyword_function(reverse_str, args)))
 
3133
            {
 
3134
              DRIZZLE_YYABORT;
 
3135
            }
 
3136
          }
3099
3137
        | SYSDATE optional_braces
3100
3138
          { $$= new (YYSession->mem_root) Item_func_sysdate_local(); }
3101
3139
        | SYSDATE '(' expr ')'