~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.cc

  • Committer: Brian Aker
  • Date: 2008-11-21 22:11:22 UTC
  • Revision ID: brian@tangent.org-20081121221122-b39onio2vhnmbenm
RemoveĀ oneĀ set.

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
static sys_var_const_str       sys_basedir(&vars, "basedir", drizzle_home);
153
153
static sys_var_long_ptr sys_binlog_cache_size(&vars, "binlog_cache_size",
154
154
                                              &binlog_cache_size);
155
 
static sys_var_session_binlog_format sys_binlog_format(&vars, "binlog_format",
156
 
                                            &SV::binlog_format);
157
155
static sys_var_session_ulong    sys_bulk_insert_buff_size(&vars, "bulk_insert_buffer_size",
158
156
                                                  &SV::bulk_insert_buff_size);
159
157
static sys_var_session_ulong    sys_completion_type(&vars, "completion_type",
802
800
    bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
803
801
}
804
802
 
805
 
bool sys_var_session_binlog_format::is_readonly() const
806
 
{
807
 
  /*
808
 
    Under certain circumstances, the variable is read-only (unchangeable):
809
 
  */
810
 
  Session *session= current_session;
811
 
  /*
812
 
    If RBR and open temporary tables, their CREATE TABLE may not be in the
813
 
    binlog, so we can't toggle to SBR in this connection.
814
 
    The test below will also prevent SET GLOBAL, well it was not easy to test
815
 
    if global or not here.
816
 
    And this test will also prevent switching from RBR to RBR (a no-op which
817
 
    should not happen too often).
818
 
 
819
 
    If we don't have row-based replication compiled in, the variable
820
 
    is always read-only.
821
 
  */
822
 
  if ((session->variables.binlog_format == BINLOG_FORMAT_ROW) &&
823
 
      session->temporary_tables)
824
 
  {
825
 
    my_error(ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR, MYF(0));
826
 
    return 1;
827
 
  }
828
 
  
829
 
  return sys_var_session_enum::is_readonly();
830
 
}
831
 
 
832
 
 
833
 
void fix_binlog_format_after_update(Session *session, enum_var_type)
834
 
{
835
 
  session->reset_current_stmt_binlog_row_based();
836
 
}
837
 
 
838
803
 
839
804
static void fix_max_binlog_size(Session *, enum_var_type)
840
805
{