1. 22 Oct, 2009 2 commits
    • Alfranio Correia's avatar
      BUG#48091 valgrind errors when slave has double not null and master has double null · 4f164c4c
      Alfranio Correia authored
            
      Backporting BUG#43789 to mysql-5.1-bugteam
                                    
      The replication was generating corrupted data, warning messages on Valgrind
      and aborting on debug mode while replicating a "null" to "not null" field.
      Specifically the unpack_row routine, was considering the slave's table
      definition and trying to retrieve a field value, where there was nothing to be
      retrieved, ignoring the fact that the value was defined as "null" by the master.
                                    
      To fix the problem, we proceed as follows:
                                    
      1 - If it is not STRICT sql_mode, implicit default values are used, regardless
      if it is multi-row or single-row statement.
                                    
      2 - However, if it is STRICT mode, then a we do what follows:
                                    
      2.1 If it is a transactional engine, we do a rollback on the first NULL that is
      to be set into a NOT NULL column and return an error.
                                    
      2.2 If it is a non-transactional engine and it is the first row to be inserted
      with multi-row, we also return the error. Otherwise, we proceed with the
      execution, use implicit default values and print out warning messages.
                              
      Unfortunately, the current patch cannot mimic the behavior showed by the master
      for updates on multi-tables and multi-row inserts. This happens because such
      statements are unfolded in different row events. For instance, considering the
      following updates and strict mode:
                              
      (master)
      create table t1 (a int);
      create table t2 (a int not null);
      insert into t1 values (1);
      insert into t2 values (2);
      update t1, t2 SET t1.a=10, t2.a=NULL;
                              
      t1 would have (10) and t2 would have (0) as this would be handled as a
      multi-row update. On the other hand, if we had the following updates:
                              
      (master)
      create table t1 (a int);
      create table t2 (a int);
                              
      (slave)
      create table t1 (a int);
      create table t2 (a int not null);
                              
      (master)
      insert into t1 values (1);
      insert into t2 values (2);
      update t1, t2 SET t1.a=10, t2.a=NULL;
                              
      On the master t1 would have (10) and t2 would have (NULL). On
      the slave, t1 would have (10) but the update on t1 would fail.
      4f164c4c
    • Alfranio Correia's avatar
      BUG#48091 valgrind errors when slave has double not null and master has double null · 43481054
      Alfranio Correia authored
      Backporting BUG#38173 to mysql-5.1-bugteam
      
      The reason of  the bug was incompatibile with the master side behaviour.
      INSERT query on the master is allowed to insert into a table without specifying
      values of DEFAULT-less fields if sql_mode is not strict.
                        
      Fixed with checking sql_mode by the sql thread to decide how to react.
      Non-strict sql_mode should allow Write_rows event to complete.
                        
      todo: warnings can be shown via show slave status, still this is a 
      separate rather general issue how to show warnings for the slave threads.
      43481054
  2. 21 Oct, 2009 1 commit
  3. 20 Oct, 2009 12 commits
  4. 19 Oct, 2009 6 commits
  5. 18 Oct, 2009 1 commit
    • Ramil Kalimullin's avatar
      Fix for bug#47963: Wrong results when index is used · df0b8e93
      Ramil Kalimullin authored
      Problem: using null microsecond part in a WHERE condition 
      (e.g. WHERE date_time_field <= "YYYY-MM-DD HH:MM:SS.0000") 
      may lead to wrong results due to improper DATETIMEs 
      comparison in some cases.
      
      Fix: comparing DATETIMEs as strings we must trim trailing 0's
      in such cases.
      df0b8e93
  6. 16 Oct, 2009 16 commits
  7. 15 Oct, 2009 2 commits