~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2011-01-24 21:11:46 UTC
  • mto: This revision was merged to the branch mainline in revision 2113.
  • Revision ID: brian@tangent.org-20110124211146-ptzxfdnypgj14box
Fixed case where parser error message might be null.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
#define DRIZZLE_YYABORT_UNLESS(A)         \
68
68
  if (!(A))                             \
69
69
  {                                     \
70
 
    parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };\
71
 
    parser::my_parse_error(pass);\
 
70
    parser::my_parse_error(YYSession->m_lip);\
72
71
    DRIZZLE_YYABORT;                      \
73
72
  }
74
73
 
2256
2255
            Select_Lex * sel= Lex->current_select;
2257
2256
            if (Lex->current_select->set_braces(0))
2258
2257
            {
2259
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
2260
 
              parser::my_parse_error(pass);
 
2258
              parser::my_parse_error(YYSession->m_lip);
2261
2259
              DRIZZLE_YYABORT;
2262
2260
            }
2263
2261
            if (sel->linkage == UNION_TYPE &&
2264
2262
                sel->master_unit()->first_select()->braces)
2265
2263
            {
2266
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
2267
 
              parser::my_parse_error(pass);
 
2264
              parser::my_parse_error(YYSession->m_lip);
2268
2265
              DRIZZLE_YYABORT;
2269
2266
            }
2270
2267
          }
3264
3261
            /* disallow "SELECT @@global.global.variable" */
3265
3262
            if ($3.str && $4.str && parser::check_reserved_words(&$3))
3266
3263
            {
3267
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3268
 
              parser::my_parse_error(pass);
 
3264
              parser::my_parse_error(YYSession->m_lip);
3269
3265
              DRIZZLE_YYABORT;
3270
3266
            }
3271
3267
            if (!($$= get_system_var(YYSession, $2, $3, $4)))
3306
3302
          {
3307
3303
            if (Lex->current_select->inc_in_sum_expr())
3308
3304
            {
3309
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3310
 
              parser::my_parse_error(pass);
 
3305
              parser::my_parse_error(YYSession->m_lip);
3311
3306
              DRIZZLE_YYABORT;
3312
3307
            }
3313
3308
          }
3594
3589
            {
3595
3590
              if (sel->set_braces(1))
3596
3591
              {
3597
 
                parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3598
 
                parser::my_parse_error(pass);
 
3592
                parser::my_parse_error(YYSession->m_lip);
3599
3593
                DRIZZLE_YYABORT;
3600
3594
              }
3601
3595
              /* select in braces, can't contain global parameters */
3659
3653
            else if (($3->select_lex && $3->select_lex->master_unit()->is_union()) || $5)
3660
3654
            {
3661
3655
              /* simple nested joins cannot have aliases or unions */
3662
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3663
 
              parser::my_parse_error(pass);
 
3656
              parser::my_parse_error(YYSession->m_lip);
3664
3657
              DRIZZLE_YYABORT;
3665
3658
            }
3666
3659
            else
3695
3688
            Select_Lex * sel= Lex->current_select;
3696
3689
            if (Lex->current_select->set_braces(0))
3697
3690
            {
3698
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3699
 
              parser::my_parse_error(pass);
 
3691
              parser::my_parse_error(YYSession->m_lip);
3700
3692
              DRIZZLE_YYABORT;
3701
3693
            }
3702
3694
            if (sel->linkage == UNION_TYPE &&
3703
3695
                sel->master_unit()->first_select()->braces)
3704
3696
            {
3705
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3706
 
              parser::my_parse_error(pass);
 
3697
              parser::my_parse_error(YYSession->m_lip);
3707
3698
              DRIZZLE_YYABORT;
3708
3699
            }
3709
3700
          }
3740
3731
              DRIZZLE_YYABORT;
3741
3732
            if (!$3 && $$)
3742
3733
            {
3743
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3744
 
              parser::my_parse_error(pass);
 
3734
              parser::my_parse_error(YYSession->m_lip);
3745
3735
              DRIZZLE_YYABORT;
3746
3736
            }
3747
3737
          }
3752
3742
            Lex->derived_tables|= DERIVED_SUBQUERY;
3753
3743
            if (not Lex->expr_allows_subselect)
3754
3744
            {
3755
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3756
 
              parser::my_parse_error(pass);
 
3745
              parser::my_parse_error(YYSession->m_lip);
3757
3746
              DRIZZLE_YYABORT;
3758
3747
            }
3759
3748
            if (Lex->current_select->linkage == GLOBAL_OPTIONS_TYPE || new_select(Lex, 1))
3781
3770
            if (!sel->embedding || sel->end_nested_join(Lex->session))
3782
3771
            {
3783
3772
              /* we are not in parentheses */
3784
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3785
 
              parser::my_parse_error(pass);
 
3773
              parser::my_parse_error(YYSession->m_lip);
3786
3774
              DRIZZLE_YYABORT;
3787
3775
            }
3788
3776
            embedding= Lex->current_select->embedding;
5820
5808
          {
5821
5809
            if (not Lex->expr_allows_subselect)
5822
5810
            {
5823
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
5824
 
              parser::my_parse_error(pass);
 
5811
              parser::my_parse_error(YYSession->m_lip);
5825
5812
              DRIZZLE_YYABORT;
5826
5813
            }
5827
5814
            /*