~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 17:35:06 UTC
  • Revision ID: brian@tangent.org-20081006173506-799lz31igxfrqb9a
Removed dead bit around SP/Triggers

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
bool end_active_trans(THD *thd)
72
72
{
73
 
  int error=0;
74
 
  if (unlikely(thd->in_sub_stmt))
75
 
  {
76
 
    my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
77
 
    return(1);
78
 
  }
 
73
  int error= 0;
 
74
 
79
75
  if (thd->transaction.xid_state.xa_state != XA_NOTR)
80
76
  {
81
77
    my_error(ER_XAER_RMFAIL, MYF(0),
100
96
 
101
97
bool begin_trans(THD *thd)
102
98
{
103
 
  int error=0;
104
 
  if (unlikely(thd->in_sub_stmt))
105
 
  {
106
 
    my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
107
 
    return 1;
108
 
  }
 
99
  int error= 0;
109
100
  if (thd->locked_tables)
110
101
  {
111
102
    thd->lock=thd->locked_tables;
271
262
  bool do_release= 0;
272
263
  int res= 0;
273
264
 
274
 
  if (unlikely(thd->in_sub_stmt))
275
 
  {
276
 
    my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
277
 
    return(1);
278
 
  }
279
265
  if (thd->transaction.xid_state.xa_state != XA_NOTR)
280
266
  {
281
267
    my_error(ER_XAER_RMFAIL, MYF(0),
895
881
 
896
882
void log_slow_statement(THD *thd)
897
883
{
898
 
  /*
899
 
    The following should never be true with our current code base,
900
 
    but better to keep this here so we don't accidently try to log a
901
 
    statement in a trigger or stored function
902
 
  */
903
 
  if (unlikely(thd->in_sub_stmt))
904
 
    return;                           // Don't set time for sub stmt
905
 
 
906
884
  logging_post_do(thd);
907
885
 
908
886
  return;
2380
2358
    break;
2381
2359
  }
2382
2360
  case SQLCOM_SAVEPOINT:
2383
 
    if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) ||
2384
 
          thd->in_sub_stmt) || !opt_using_transactions)
 
2361
    if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) || !opt_using_transactions)
2385
2362
      my_ok(thd);
2386
2363
    else
2387
2364
    {
2608
2585
 
2609
2586
void mysql_reset_thd_for_next_command(THD *thd)
2610
2587
{
2611
 
  assert(! thd->in_sub_stmt);
2612
2588
  thd->free_list= 0;
2613
2589
  thd->select_number= 1;
2614
2590
  /*
3629
3605
  select_errors=0;                              /* Write if more errors */
3630
3606
  bool tmp_write_to_binlog= 1;
3631
3607
 
3632
 
  assert(!thd || !thd->in_sub_stmt);
3633
 
 
3634
3608
  if (options & REFRESH_LOG)
3635
3609
  {
3636
3610
    /*