~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log_event.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 20:34:36 UTC
  • Revision ID: brian@tangent.org-20081006203436-4yqpjjgw9kdvq9b4
No need for charsets in replication code (we only have one now).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1579
1579
      auto_increment_offset=    uint2korr(pos+2);
1580
1580
      pos+= 4;
1581
1581
      break;
1582
 
    case Q_CHARSET_CODE:
1583
 
    {
1584
 
      CHECK_SPACE(pos, end, 6);
1585
 
      charset_inited= 1;
1586
 
      memcpy(charset, pos, 6);
1587
 
      pos+= 6;
1588
 
      break;
1589
 
    }
1590
1582
    case Q_TIME_ZONE_CODE:
1591
1583
    {
1592
1584
      if (get_str_len_and_pointer(&pos, &time_zone_str, &time_zone_len, end))
1750
1742
          must take their value from flags2.
1751
1743
        */
1752
1744
        thd->options= flags2|(thd->options & ~OPTIONS_WRITTEN_TO_BIN_LOG);
1753
 
      /*
1754
 
        else, we are in a 3.23/4.0 binlog; we previously received a
1755
 
        Rotate_log_event which reset thd->options and sql_mode etc, so
1756
 
        nothing to do.
1757
 
      */
1758
 
      if (charset_inited)
1759
 
      {
1760
 
        if (rli->cached_charset_compare(charset))
1761
 
        {
1762
 
          /* Verify that we support the charsets found in the event. */
1763
 
          if (!(thd->variables.character_set_client=
1764
 
                get_charset(uint2korr(charset), MYF(MY_WME))) ||
1765
 
              !(thd->variables.collation_connection=
1766
 
                get_charset(uint2korr(charset+2), MYF(MY_WME))) ||
1767
 
              !(thd->variables.collation_server=
1768
 
                get_charset(uint2korr(charset+4), MYF(MY_WME))))
1769
 
          {
1770
 
            /*
1771
 
              We updated the thd->variables with nonsensical values (0). Let's
1772
 
              set them to something safe (i.e. which avoids crash), and we'll
1773
 
              stop with EE_UNKNOWN_CHARSET in compare_errors (unless set to
1774
 
              ignore this error).
1775
 
            */
1776
 
            set_slave_thread_default_charset(thd, rli);
1777
 
            goto compare_errors;
1778
 
          }
1779
 
          thd->update_charset(); // for the charset change to take effect
1780
 
        }
1781
 
      }
1782
1745
      if (time_zone_len)
1783
1746
      {
1784
1747
        String tmp(time_zone_str, time_zone_len, &my_charset_bin);
3271
3234
      master is 4.0 then the events are in the slave's format (conversion).
3272
3235
    */
3273
3236
    set_slave_thread_options(thd);
3274
 
    set_slave_thread_default_charset(thd, rli);
3275
3237
    thd->variables.auto_increment_increment=
3276
3238
      thd->variables.auto_increment_offset= 1;
3277
3239
  }