~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2011-01-25 07:24:41 UTC
  • mfrom: (2104.3.14 alter-table)
  • Revision ID: brian@tangent.org-20110125072441-gf9f14lkxjhvvku9
Merge in alter/parser

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
#define yyoverflow(A,B,C,D,E,F)               \
47
47
  {                                           \
48
 
    ulong val= *(F);                          \
 
48
    unsigned long val= *(F);                          \
49
49
    if (drizzled::my_yyoverflow((B), (D), &val)) \
50
50
    {                                         \
51
51
      yyerror((char*) (A));                   \
60
60
#define DRIZZLE_YYABORT                         \
61
61
  do                                          \
62
62
  {                                           \
63
 
    LEX::cleanup_lex_after_parse_error(YYSession);\
64
63
    YYABORT;                                  \
65
64
  } while (0)
66
65
 
67
66
#define DRIZZLE_YYABORT_UNLESS(A)         \
68
67
  if (!(A))                             \
69
68
  {                                     \
70
 
    parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };\
71
 
    parser::my_parse_error(pass);\
 
69
    parser::my_parse_error(YYSession->m_lip);\
72
70
    DRIZZLE_YYABORT;                      \
73
71
  }
74
72
 
112
110
 
113
111
static void DRIZZLEerror(const char *s)
114
112
{
115
 
  Session *session= current_session;
116
 
 
117
 
  /*
118
 
    Restore the original LEX if it was replaced when parsing
119
 
    a stored procedure. We must ensure that a parsing error
120
 
    does not leave any side effects in the Session.
121
 
  */
122
 
  LEX::cleanup_lex_after_parse_error(session);
123
 
 
124
 
  /* "parse error" changed into "syntax error" between bison 1.75 and 1.875 */
125
 
  if (strcmp(s,"parse error") == 0 || strcmp(s,"syntax error") == 0)
126
 
    s= ER(ER_SYNTAX_ERROR);
127
 
 
128
 
  parser::error_t pass= { s, session };
129
 
  parser::my_parse_error(pass);
 
113
  parser::errorOn(s);
130
114
}
131
115
 
132
116
} /* namespace drizzled; */
136
120
%union {
137
121
  bool boolean;
138
122
  int  num;
139
 
  ulong ulong_num;
 
123
  unsigned long ulong_num;
140
124
  uint64_t ulonglong_number;
141
125
  int64_t longlong_number;
142
126
  drizzled::LEX_STRING lex_str;
177
161
%{
178
162
namespace drizzled
179
163
{
180
 
bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
 
164
bool my_yyoverflow(short **a, YYSTYPE **b, unsigned long *yystacksize);
181
165
}
182
166
%}
183
167
 
800
784
            }
801
785
            else
802
786
            {
803
 
              session->lex->sql_command= SQLCOM_EMPTY_QUERY;
804
787
              session->lex->statement= new statement::EmptyQuery(YYSession);
805
788
            }
806
789
          }
851
834
          }
852
835
        | CREATE opt_table_options TABLE_SYM opt_if_not_exists table_ident
853
836
          {
854
 
            Lex->sql_command= SQLCOM_CREATE_TABLE;
855
837
            Lex->statement= new statement::CreateTable(YYSession, $5, $2);
856
838
 
857
839
            if (not Lex->select_lex.add_table_to_list(YYSession, $5, NULL,
866
848
          }
867
849
        | CREATE build_method
868
850
          {
869
 
            Lex->sql_command= SQLCOM_CREATE_INDEX;
870
 
            statement::CreateIndex *statement= new statement::CreateIndex(YYSession);
871
 
            Lex->statement= statement;
872
 
 
873
 
            statement->alter_info.flags.set(ALTER_ADD_INDEX);
874
 
            statement->alter_info.build_method= $2;
875
 
            Lex->col_list.empty();
876
 
            statement->change=NULL;
 
851
            Lex->statement= new statement::CreateIndex(YYSession, $2);
877
852
          }
878
853
          opt_unique INDEX_SYM ident key_alg ON table_ident '(' key_list ')' key_options
879
854
          {
890
865
          }
891
866
        | CREATE DATABASE opt_if_not_exists schema_name
892
867
          {
893
 
            Lex->sql_command=SQLCOM_CREATE_DB;
894
868
            Lex->statement= new statement::CreateSchema(YYSession);
895
869
          }
896
870
          opt_create_database_options
954
928
            Lex->lock_option= TL_READ;
955
929
            if (Lex->sql_command == SQLCOM_INSERT)
956
930
            {
957
 
              Lex->sql_command= SQLCOM_INSERT_SELECT;
958
931
              delete Lex->statement;
959
932
              Lex->statement= new statement::InsertSelect(YYSession);
960
933
            }
961
934
            else if (Lex->sql_command == SQLCOM_REPLACE)
962
935
            {
963
 
              Lex->sql_command= SQLCOM_REPLACE_SELECT;
964
936
              delete Lex->statement;
965
937
              Lex->statement= new statement::ReplaceSelect(YYSession);
966
938
            }
1912
1884
          {}
1913
1885
        | ALTER_SYM DATABASE schema_name
1914
1886
          {
1915
 
            Lex->sql_command=SQLCOM_ALTER_DB;
1916
1887
            Lex->statement= new statement::AlterSchema(YYSession);
1917
1888
          }
1918
1889
          default_collation_schema
2166
2137
start:
2167
2138
          START_SYM TRANSACTION_SYM start_transaction_opts
2168
2139
          {
2169
 
            Lex->sql_command= SQLCOM_BEGIN;
2170
2140
            Lex->statement= new statement::StartTransaction(YYSession, (start_transaction_option_t)$3);
2171
2141
          }
2172
2142
        ;
2182
2152
analyze:
2183
2153
          ANALYZE_SYM table_or_tables
2184
2154
          {
2185
 
            Lex->sql_command = SQLCOM_ANALYZE;
2186
2155
            Lex->statement= new statement::Analyze(YYSession);
2187
2156
          }
2188
2157
          table_list
2192
2161
check:
2193
2162
          CHECK_SYM table_or_tables
2194
2163
          {
2195
 
            Lex->sql_command = SQLCOM_CHECK;
2196
2164
            Lex->statement= new statement::Check(YYSession);
2197
2165
          }
2198
2166
          table_list
2202
2170
rename:
2203
2171
          RENAME table_or_tables
2204
2172
          {
2205
 
            Lex->sql_command= SQLCOM_RENAME_TABLE;
2206
2173
            Lex->statement= new statement::RenameTable(YYSession);
2207
2174
          }
2208
2175
          table_to_table_list
2234
2201
select:
2235
2202
          select_init
2236
2203
          {
2237
 
            Lex->sql_command= SQLCOM_SELECT;
2238
2204
            Lex->statement= new statement::Select(YYSession);
2239
2205
          }
2240
2206
        ;
2270
2236
            Select_Lex * sel= Lex->current_select;
2271
2237
            if (Lex->current_select->set_braces(0))
2272
2238
            {
2273
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
2274
 
              parser::my_parse_error(pass);
 
2239
              parser::my_parse_error(YYSession->m_lip);
2275
2240
              DRIZZLE_YYABORT;
2276
2241
            }
2277
2242
            if (sel->linkage == UNION_TYPE &&
2278
2243
                sel->master_unit()->first_select()->braces)
2279
2244
            {
2280
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
2281
 
              parser::my_parse_error(pass);
 
2245
              parser::my_parse_error(YYSession->m_lip);
2282
2246
              DRIZZLE_YYABORT;
2283
2247
            }
2284
2248
          }
3278
3242
            /* disallow "SELECT @@global.global.variable" */
3279
3243
            if ($3.str && $4.str && parser::check_reserved_words(&$3))
3280
3244
            {
3281
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3282
 
              parser::my_parse_error(pass);
 
3245
              parser::my_parse_error(YYSession->m_lip);
3283
3246
              DRIZZLE_YYABORT;
3284
3247
            }
3285
3248
            if (!($$= get_system_var(YYSession, $2, $3, $4)))
3320
3283
          {
3321
3284
            if (Lex->current_select->inc_in_sum_expr())
3322
3285
            {
3323
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3324
 
              parser::my_parse_error(pass);
 
3286
              parser::my_parse_error(YYSession->m_lip);
3325
3287
              DRIZZLE_YYABORT;
3326
3288
            }
3327
3289
          }
3608
3570
            {
3609
3571
              if (sel->set_braces(1))
3610
3572
              {
3611
 
                parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3612
 
                parser::my_parse_error(pass);
 
3573
                parser::my_parse_error(YYSession->m_lip);
3613
3574
                DRIZZLE_YYABORT;
3614
3575
              }
3615
3576
              /* select in braces, can't contain global parameters */
3673
3634
            else if (($3->select_lex && $3->select_lex->master_unit()->is_union()) || $5)
3674
3635
            {
3675
3636
              /* simple nested joins cannot have aliases or unions */
3676
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3677
 
              parser::my_parse_error(pass);
 
3637
              parser::my_parse_error(YYSession->m_lip);
3678
3638
              DRIZZLE_YYABORT;
3679
3639
            }
3680
3640
            else
3709
3669
            Select_Lex * sel= Lex->current_select;
3710
3670
            if (Lex->current_select->set_braces(0))
3711
3671
            {
3712
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3713
 
              parser::my_parse_error(pass);
 
3672
              parser::my_parse_error(YYSession->m_lip);
3714
3673
              DRIZZLE_YYABORT;
3715
3674
            }
3716
3675
            if (sel->linkage == UNION_TYPE &&
3717
3676
                sel->master_unit()->first_select()->braces)
3718
3677
            {
3719
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3720
 
              parser::my_parse_error(pass);
 
3678
              parser::my_parse_error(YYSession->m_lip);
3721
3679
              DRIZZLE_YYABORT;
3722
3680
            }
3723
3681
          }
3754
3712
              DRIZZLE_YYABORT;
3755
3713
            if (!$3 && $$)
3756
3714
            {
3757
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3758
 
              parser::my_parse_error(pass);
 
3715
              parser::my_parse_error(YYSession->m_lip);
3759
3716
              DRIZZLE_YYABORT;
3760
3717
            }
3761
3718
          }
3766
3723
            Lex->derived_tables|= DERIVED_SUBQUERY;
3767
3724
            if (not Lex->expr_allows_subselect)
3768
3725
            {
3769
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3770
 
              parser::my_parse_error(pass);
 
3726
              parser::my_parse_error(YYSession->m_lip);
3771
3727
              DRIZZLE_YYABORT;
3772
3728
            }
3773
3729
            if (Lex->current_select->linkage == GLOBAL_OPTIONS_TYPE || new_select(Lex, 1))
3795
3751
            if (!sel->embedding || sel->end_nested_join(Lex->session))
3796
3752
            {
3797
3753
              /* we are not in parentheses */
3798
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
3799
 
              parser::my_parse_error(pass);
 
3754
              parser::my_parse_error(YYSession->m_lip);
3800
3755
              DRIZZLE_YYABORT;
3801
3756
            }
3802
3757
            embedding= Lex->current_select->embedding;
4068
4023
order_clause:
4069
4024
          ORDER_SYM BY
4070
4025
          {
4071
 
            Select_Lex *sel= Lex->current_select;
4072
 
            Select_Lex_Unit *unit= sel-> master_unit();
4073
 
            if (sel->linkage != GLOBAL_OPTIONS_TYPE &&
4074
 
                sel->olap != UNSPECIFIED_OLAP_TYPE &&
4075
 
                (sel->linkage != UNION_TYPE || sel->braces))
4076
 
            {
4077
 
              my_error(ER_WRONG_USAGE, MYF(0),
4078
 
                       "CUBE/ROLLUP", "ORDER BY");
 
4026
            if (not parser::buildOrderBy(YYSession))
4079
4027
              DRIZZLE_YYABORT;
4080
 
            }
4081
 
            if (Lex->sql_command != SQLCOM_ALTER_TABLE && !unit->fake_select_lex)
4082
 
            {
4083
 
              /*
4084
 
                A query of the of the form (SELECT ...) ORDER BY order_list is
4085
 
                executed in the same way as the query
4086
 
                SELECT ... ORDER BY order_list
4087
 
                unless the SELECT construct contains ORDER BY or LIMIT clauses.
4088
 
                Otherwise we create a fake Select_Lex if it has not been created
4089
 
                yet.
4090
 
              */
4091
 
              Select_Lex *first_sl= unit->first_select();
4092
 
              if (!unit->is_union() &&
4093
 
                  (first_sl->order_list.elements ||
4094
 
                   first_sl->select_limit) &&           
4095
 
                  unit->add_fake_select_lex(Lex->session))
4096
 
                DRIZZLE_YYABORT;
4097
 
            }
4098
4028
          }
4099
4029
          order_list
4100
4030
        ;
4101
4031
 
4102
4032
order_list:
4103
4033
          order_list ',' order_ident order_dir
4104
 
          { if (YYSession->add_order_to_list($3,(bool) $4)) DRIZZLE_YYABORT; }
 
4034
          {
 
4035
            if (YYSession->add_order_to_list($3,(bool) $4))
 
4036
              DRIZZLE_YYABORT;
 
4037
          }
4105
4038
        | order_ident order_dir
4106
 
          { if (YYSession->add_order_to_list($1,(bool) $2)) DRIZZLE_YYABORT; }
 
4039
          {
 
4040
            if (YYSession->add_order_to_list($1,(bool) $2))
 
4041
              DRIZZLE_YYABORT;
 
4042
          }
4107
4043
        ;
4108
4044
 
4109
4045
order_dir:
4175
4111
        ;
4176
4112
 
4177
4113
ulong_num:
4178
 
          NUM           { int error; $$= (ulong) internal::my_strtoll10($1.str, (char**) 0, &error); }
4179
 
        | HEX_NUM       { $$= (ulong) strtol($1.str, (char**) 0, 16); }
4180
 
        | LONG_NUM      { int error; $$= (ulong) internal::my_strtoll10($1.str, (char**) 0, &error); }
4181
 
        | ULONGLONG_NUM { int error; $$= (ulong) internal::my_strtoll10($1.str, (char**) 0, &error); }
4182
 
        | DECIMAL_NUM   { int error; $$= (ulong) internal::my_strtoll10($1.str, (char**) 0, &error); }
4183
 
        | FLOAT_NUM     { int error; $$= (ulong) internal::my_strtoll10($1.str, (char**) 0, &error); }
 
4114
          NUM           { int error; $$= (unsigned long) internal::my_strtoll10($1.str, (char**) 0, &error); }
 
4115
        | HEX_NUM       { $$= (unsigned long) strtol($1.str, (char**) 0, 16); }
 
4116
        | LONG_NUM      { int error; $$= (unsigned long) internal::my_strtoll10($1.str, (char**) 0, &error); }
 
4117
        | ULONGLONG_NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.str, (char**) 0, &error); }
 
4118
        | DECIMAL_NUM   { int error; $$= (unsigned long) internal::my_strtoll10($1.str, (char**) 0, &error); }
 
4119
        | FLOAT_NUM     { int error; $$= (unsigned long) internal::my_strtoll10($1.str, (char**) 0, &error); }
4184
4120
        ;
4185
4121
 
4186
4122
ulonglong_num:
4264
4200
          }
4265
4201
        | DROP opt_temporary table_or_tables if_exists table_list
4266
4202
          {
4267
 
            Lex->sql_command = SQLCOM_DROP_TABLE;
4268
4203
            statement::DropTable *statement= new statement::DropTable(YYSession);
4269
4204
            Lex->statement= statement;
4270
4205
            statement->drop_temporary= $2;
4272
4207
          }
4273
4208
        | DROP build_method INDEX_SYM ident ON table_ident {}
4274
4209
          {
4275
 
            Lex->sql_command= SQLCOM_DROP_INDEX;
4276
4210
            statement::DropIndex *statement= new statement::DropIndex(YYSession);
4277
4211
            Lex->statement= statement;
4278
4212
            statement->alter_info.flags.set(ALTER_DROP_INDEX);
4284
4218
          }
4285
4219
        | DROP DATABASE if_exists schema_name
4286
4220
          {
4287
 
            Lex->sql_command= SQLCOM_DROP_DB;
4288
4221
            statement::DropSchema *statement= new statement::DropSchema(YYSession);
4289
4222
            Lex->statement= statement;
4290
4223
            statement->drop_if_exists=$3;
4358
4291
insert:
4359
4292
          INSERT
4360
4293
          {
4361
 
            Lex->sql_command= SQLCOM_INSERT;
4362
4294
            Lex->statement= new statement::Insert(YYSession);
4363
4295
            Lex->duplicates= DUP_ERROR;
4364
4296
            init_select(Lex);
4377
4309
replace:
4378
4310
          REPLACE
4379
4311
          {
4380
 
            Lex->sql_command= SQLCOM_REPLACE;
4381
4312
            Lex->statement= new statement::Replace(YYSession);
4382
4313
            Lex->duplicates= DUP_REPLACE;
4383
4314
            init_select(Lex);
4514
4445
          UPDATE_SYM opt_ignore table_ident
4515
4446
          {
4516
4447
            init_select(Lex);
4517
 
            Lex->sql_command= SQLCOM_UPDATE;
4518
4448
            Lex->statement= new statement::Update(YYSession);
4519
4449
            Lex->lock_option= TL_UNLOCK; /* Will be set later */
4520
4450
            Lex->duplicates= DUP_ERROR;
4572
4502
delete:
4573
4503
          DELETE_SYM
4574
4504
          {
4575
 
            Lex->sql_command= SQLCOM_DELETE;
4576
4505
            Lex->statement= new statement::Delete(YYSession);
4577
4506
            init_select(Lex);
4578
4507
            Lex->lock_option= TL_WRITE_DEFAULT;
4605
4534
truncate:
4606
4535
          TRUNCATE_SYM opt_table_sym table_name
4607
4536
          {
4608
 
            Lex->sql_command= SQLCOM_TRUNCATE;
4609
4537
            Lex->statement= new statement::Truncate(YYSession);
4610
4538
            Lex->select_lex.options= 0;
4611
4539
            Lex->select_lex.init_order();
4622
4550
show:
4623
4551
          SHOW
4624
4552
          {
4625
 
            Lex->wild=0;
4626
4553
            Lex->lock_option= TL_READ;
4627
4554
            init_select(Lex);
4628
4555
            Lex->current_select->parsing_place= SELECT_LIST;
 
4556
            "
4629
4557
          }
4630
4558
          show_param
4631
4559
          {}
4786
4714
flush:
4787
4715
          FLUSH_SYM
4788
4716
          {
4789
 
            Lex->sql_command= SQLCOM_FLUSH;
4790
4717
            Lex->statement= new statement::Flush(YYSession);
4791
 
            Lex->type= 0;
4792
4718
          }
4793
4719
          flush_options
4794
4720
          {}
4838
4764
kill:
4839
4765
          KILL_SYM kill_option expr
4840
4766
          {
4841
 
            if ($2)
4842
 
            {
4843
 
              Lex->type= ONLY_KILL_QUERY;
4844
 
            }
4845
 
 
4846
 
            Lex->value_list.empty();
4847
 
            Lex->value_list.push_front($3);
4848
 
            Lex->sql_command= SQLCOM_KILL;
4849
 
            Lex->statement= new statement::Kill(YYSession);
 
4767
            Lex->statement= new statement::Kill(YYSession, $3, $2);
4850
4768
          }
4851
4769
        ;
4852
4770
 
4861
4779
use:
4862
4780
          USE_SYM schema_name
4863
4781
          {
4864
 
            Lex->sql_command=SQLCOM_CHANGE_DB;
4865
4782
            Lex->statement= new statement::ChangeSchema(YYSession);
4866
4783
            Lex->select_lex.db= $2.str;
4867
4784
          }
4872
4789
load:
4873
4790
          LOAD data_file
4874
4791
          {
4875
 
            Lex->sql_command= SQLCOM_LOAD;
4876
4792
            statement::Load *statement= new statement::Load(YYSession);
4877
4793
            Lex->statement= statement;
4878
4794
 
5228
5144
            }
5229
5145
            $$= (sel->parsing_place != IN_HAVING ||
5230
5146
                sel->get_in_sum_expr() > 0) ?
5231
 
                (Item*) new Item_field(Lex->current_context(), $1.str, $3.str,
5232
 
                                       $5.str) :
5233
 
                (Item*) new Item_ref(Lex->current_context(), $1.str, $3.str,
5234
 
                                     $5.str);
 
5147
                (Item*) new Item_field(Lex->current_context(), $1.str, $3.str, $5.str) :
 
5148
                (Item*) new Item_ref(Lex->current_context(), $1.str, $3.str, $5.str);
5235
5149
          }
5236
5150
        ;
5237
5151
 
5515
5429
set:
5516
5430
          SET_SYM opt_option
5517
5431
          {
5518
 
            Lex->sql_command= SQLCOM_SET_OPTION;
5519
5432
            Lex->statement= new statement::SetOption(YYSession);
5520
 
            init_select(Lex);
5521
 
            Lex->option_type=OPT_SESSION;
5522
 
            Lex->var_list.empty();
5523
5433
          }
5524
5434
          option_value_list
5525
5435
          {}
5536
5446
        ;
5537
5447
 
5538
5448
option_type_value:
5539
 
          {
5540
 
          }
 
5449
          { }
5541
5450
          ext_option_value
5542
 
          {
5543
 
          }
 
5451
          { }
5544
5452
        ;
5545
5453
 
5546
5454
option_type:
5661
5569
unlock:
5662
5570
          UNLOCK_SYM
5663
5571
          {
5664
 
            Lex->sql_command= SQLCOM_UNLOCK_TABLES;
5665
5572
            Lex->statement= new statement::UnlockTables(YYSession);
5666
5573
          }
5667
5574
          table_or_tables
5671
5578
begin:
5672
5579
          BEGIN_SYM
5673
5580
          {
5674
 
            Lex->sql_command = SQLCOM_BEGIN;
5675
5581
            Lex->statement= new statement::StartTransaction(YYSession);
5676
5582
          }
5677
5583
          opt_work {}
5704
5610
commit:
5705
5611
          COMMIT_SYM opt_work opt_chain opt_release
5706
5612
          {
5707
 
            Lex->sql_command= SQLCOM_COMMIT;
5708
 
            statement::Commit *statement= new statement::Commit(YYSession);
5709
 
            Lex->statement= statement;
5710
 
            statement->tx_chain= $3;
5711
 
            statement->tx_release= $4;
 
5613
            Lex->statement= new statement::Commit(YYSession, $3, $4);
5712
5614
          }
5713
5615
        ;
5714
5616
 
5715
5617
rollback:
5716
5618
          ROLLBACK_SYM opt_work opt_chain opt_release
5717
5619
          {
5718
 
            Lex->sql_command= SQLCOM_ROLLBACK;
5719
 
            statement::Rollback *statement= new statement::Rollback(YYSession);
5720
 
            Lex->statement= statement;
5721
 
            statement->tx_chain= $3;
5722
 
            statement->tx_release= $4;
 
5620
            Lex->statement= new statement::Rollback(YYSession, $3, $4);
5723
5621
          }
5724
5622
        | ROLLBACK_SYM opt_work TO_SYM opt_savepoint savepoint_ident
5725
5623
          {
5726
 
            Lex->sql_command= SQLCOM_ROLLBACK_TO_SAVEPOINT;
5727
 
            Lex->statement= new statement::RollbackToSavepoint(YYSession);
5728
 
            Lex->ident= $5;
 
5624
            Lex->statement= new statement::RollbackToSavepoint(YYSession, $5);
5729
5625
          }
5730
5626
        ;
5731
5627
 
5732
5628
savepoint:
5733
5629
          SAVEPOINT_SYM savepoint_ident
5734
5630
          {
5735
 
            Lex->sql_command= SQLCOM_SAVEPOINT;
5736
 
            Lex->statement= new statement::Savepoint(YYSession);
5737
 
            Lex->ident= $2;
 
5631
            Lex->statement= new statement::Savepoint(YYSession, $2);
5738
5632
          }
5739
5633
        ;
5740
5634
 
5741
5635
release:
5742
5636
          RELEASE_SYM SAVEPOINT_SYM savepoint_ident
5743
5637
          {
5744
 
            Lex->sql_command= SQLCOM_RELEASE_SAVEPOINT;
5745
 
            Lex->statement= new statement::ReleaseSavepoint(YYSession);
5746
 
            Lex->ident= $3;
 
5638
            Lex->statement= new statement::ReleaseSavepoint(YYSession, $3);
5747
5639
          }
5748
5640
        ;
5749
5641
 
5853
5745
          {
5854
5746
            if (not Lex->expr_allows_subselect)
5855
5747
            {
5856
 
              parser::error_t pass= { ER(ER_SYNTAX_ERROR), YYSession };
5857
 
              parser::my_parse_error(pass);
 
5748
              parser::my_parse_error(YYSession->m_lip);
5858
5749
              DRIZZLE_YYABORT;
5859
5750
            }
5860
5751
            /*