~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_class.h

  • 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:
1041
1041
  
1042
1042
  thr_lock_type update_lock_default;
1043
1043
 
1044
 
  /* <> 0 if we are inside of trigger or stored function. */
1045
 
  uint32_t in_sub_stmt;
1046
 
 
1047
1044
  /* container for handler's private per-connection data */
1048
1045
  Ha_data ha_data[MAX_HA];
1049
1046
 
1663
1660
 
1664
1661
  inline void set_current_stmt_binlog_row_based_if_mixed()
1665
1662
  {
1666
 
    /*
1667
 
      If in a stored/function trigger, the caller should already have done the
1668
 
      change. We test in_sub_stmt to prevent introducing bugs where people
1669
 
      wouldn't ensure that, and would switch to row-based mode in the middle
1670
 
      of executing a stored function/trigger (which is too late, see also
1671
 
      reset_current_stmt_binlog_row_based()); this condition will make their
1672
 
      tests fail and so force them to propagate the
1673
 
      lex->binlog_row_based_if_mixed upwards to the caller.
1674
 
    */
1675
 
    if ((variables.binlog_format == BINLOG_FORMAT_MIXED) &&
1676
 
        (in_sub_stmt == 0))
 
1663
    if (variables.binlog_format == BINLOG_FORMAT_MIXED)
1677
1664
      current_stmt_binlog_row_based= true;
1678
1665
  }
1679
1666
  inline void set_current_stmt_binlog_row_based()
1692
1679
      CREATE TEMPORARY TABLE t SELECT UUID(); # row-based
1693
1680
      # and row-based does not store updates to temp tables
1694
1681
      # in the binlog.
1695
 
      INSERT INTO u SELECT * FROM t; # stmt-based
1696
 
      and then the INSERT will fail as data inserted into t was not logged.
1697
 
      So we continue with row-based until the temp table is dropped.
1698
 
      If we are in a stored function or trigger, we mustn't reset in the
1699
 
      middle of its execution (as the binary logging way of a stored function
1700
 
      or trigger is decided when it starts executing, depending for example on
1701
 
      the caller (for a stored function: if caller is SELECT or
1702
 
      INSERT/UPDATE/DELETE...).
1703
1682
 
1704
1683
      Don't reset binlog format for NDB binlog injector thread.
1705
1684
    */
1706
 
    if ((temporary_tables == NULL) && (in_sub_stmt == 0))
 
1685
    if (temporary_tables == NULL)
1707
1686
    {
1708
1687
      current_stmt_binlog_row_based= 
1709
1688
        test(variables.binlog_format == BINLOG_FORMAT_ROW);