From: Date: October 17 2005 8:11pm Subject: bk commit into 5.0 tree (elliot:1.2048) BUG#13900 List-Archive: http://lists.mysql.com/internals/31185 X-Bug: 13900 Message-Id: <20051017181149.30E1C204301@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.0 repository of emurphy. When emurphy does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2048 05/10/17 14:11:37 elliot@stripped +3 -0 BUG#13900 DATETIME data changes after inserting a new row in a InnoDB table Applying patch from Marko. All tests pass in pentium-debug-max build on Linux. innobase/row/row0upd.c 1.40 05/10/17 14:11:31 elliot@stripped +12 -0 BUG#13900 DATETIME data changes after inserting a new row in a InnoDB table Applying patch from Marko. innobase/include/rem0rec.ic 1.26 05/10/17 14:11:31 elliot@stripped +16 -0 BUG#13900 DATETIME data changes after inserting a new row in a InnoDB table Applying patch from Marko. innobase/include/rem0rec.h 1.18 05/10/17 14:11:31 elliot@stripped +9 -0 BUG#13900 DATETIME data changes after inserting a new row in a InnoDB table Applying patch from Marko. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: elliot # Host: xan.(none) # Root: /home/emurphy/src/bk-clean/mysql-5.0 --- 1.17/innobase/include/rem0rec.h 2005-06-22 05:02:22 -04:00 +++ 1.18/innobase/include/rem0rec.h 2005-10-17 14:11:31 -04:00 @@ -312,6 +312,15 @@ const ulint* offsets,/* in: array returned by rec_get_offsets() */ ulint n); /* in: nth field */ /********************************************************** +Returns nonzero if the SQL NULL bit is set in nth field of rec. */ +UNIV_INLINE +ulint +rec_offs_nth_sql_null( +/*==================*/ + /* out: nonzero if SQL NULL */ + const ulint* offsets,/* in: array returned by rec_get_offsets() */ + ulint n); /* in: nth field */ +/********************************************************** Gets the physical size of a field. */ UNIV_INLINE ulint --- 1.25/innobase/include/rem0rec.ic 2005-06-22 05:02:22 -04:00 +++ 1.26/innobase/include/rem0rec.ic 2005-10-17 14:11:31 -04:00 @@ -955,6 +955,22 @@ } /********************************************************** +Returns nonzero if the SQL NULL bit is set in nth field of rec. */ +UNIV_INLINE +ulint +rec_offs_nth_sql_null( +/*==================*/ + /* out: nonzero if SQL NULL */ + const ulint* offsets,/* in: array returned by rec_get_offsets() */ + ulint n) /* in: nth field */ +{ + ut_ad(rec_offs_validate(NULL, NULL, offsets)); + ut_ad(n < rec_offs_n_fields(offsets)); + return(UNIV_UNLIKELY(rec_offs_base(offsets)[1 + n] + & REC_OFFS_SQL_NULL)); +} + +/********************************************************** Gets the physical size of a field. */ UNIV_INLINE ulint --- 1.39/innobase/row/row0upd.c 2005-08-12 04:29:57 -04:00 +++ 1.40/innobase/row/row0upd.c 2005-10-17 14:11:31 -04:00 @@ -395,6 +395,18 @@ old_len = rec_offs_nth_size(offsets, upd_field->field_no); + if (rec_offs_comp(offsets) + && rec_offs_nth_sql_null(offsets, upd_field->field_no)) { + /* Note that in the compact table format, for a + variable length field, an SQL NULL will use zero + bytes in the offset array at the start of the physical + record, but a zero-length value (empty string) will + use one byte! Thus, we cannot use update-in-place + if we update an SQL NULL varchar to an empty string! */ + + old_len = UNIV_SQL_NULL; + } + if (old_len != new_len) { return(TRUE);