MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Marko Mäkelä Date:July 27 2005 12:21pm
Subject:bk commit into 5.0 tree (marko:1.1909) BUG#12186
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of marko. When marko 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.1909 05/07/27 15:21:26 marko@stripped +2 -0
  InnoDB: When fetching a NULL true VARCHAR column, initialize the
  length byte(s) correctly.  (Bug #12186)

  mysql-test/r/innodb.result
    1.124 05/07/27 15:21:14 marko@stripped +4 -4
    Adjust the CHECKSUM TABLE results for true VARCHAR columns that
    are NULL.

  innobase/row/row0sel.c
    1.96 05/07/27 15:21:13 marko@stripped +23 -7
    row_sel_store_mysql_rec(): Set the length of true VARCHAR fields
    that are NULL.  (Bug #12186)

# 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:	marko
# Host:	hundin.mysql.fi
# Root:	/home/marko/mysql-5.0

--- 1.95/innobase/row/row0sel.c	2005-07-22 14:09:52 +03:00
+++ 1.96/innobase/row/row0sel.c	2005-07-27 15:21:13 +03:00
@@ -2522,20 +2522,37 @@
 
 			mysql_rec[templ->mysql_null_byte_offset] |=
 					(byte) (templ->mysql_null_bit_mask);
+			data = mysql_rec + templ->mysql_col_offset;
+			len = templ->mysql_col_len;
+
 			switch (templ->type) {
 			case DATA_VARCHAR:
-			case DATA_CHAR:
 			case DATA_BINARY:
+			case DATA_VARMYSQL:
+				if (templ->mysql_type
+				    == DATA_MYSQL_TRUE_VARCHAR) {
+					/* This is a >= 5.0.3 type
+					true VARCHAR. Store the
+					length of the data into the
+					first one or two bytes of dest. */
+					len -= templ->mysql_length_bytes;
+					data = row_mysql_store_true_var_len(
+						data, len,
+						templ->mysql_length_bytes);
+					ut_a(data + len ==
+					     mysql_rec
+					     + templ->mysql_col_offset
+					     + templ->mysql_col_len);
+				}
+				/* fall through */
+			case DATA_CHAR:
 			case DATA_FIXBINARY:
 			case DATA_MYSQL:
-			case DATA_VARMYSQL:
 			        /* MySQL pads all non-BLOB and non-TEXT
 				string types with space ' ' */
 				if (UNIV_UNLIKELY(templ->mbminlen == 2)) {
 					/* Treat UCS2 as a special case. */
-					data = mysql_rec
-						+ templ->mysql_col_offset;
-					len = templ->mysql_col_len;
+
 					/* There are two UCS2 bytes per char,
 					so the length has to be even. */
 					ut_a(!(len & 1));
@@ -2555,8 +2572,7 @@
 			}
 
 			ut_ad(!pad_char || templ->mbminlen == 1);
-			memset(mysql_rec + templ->mysql_col_offset,
-					pad_char, templ->mysql_col_len);
+			memset(data, pad_char, len);
 		}
 	} 
 

--- 1.123/mysql-test/r/innodb.result	2005-07-14 16:50:57 +03:00
+++ 1.124/mysql-test/r/innodb.result	2005-07-27 15:21:14 +03:00
@@ -1452,16 +1452,16 @@
 checksum table t1, t2, t3, t4;
 Table	Checksum
 test.t1	2948697075
-test.t2	1157260244
-test.t3	1157260244
+test.t2	746325583
+test.t3	746325583
 test.t4	NULL
 Warnings:
 Error	1146	Table 'test.t4' doesn't exist
 checksum table t1, t2, t3, t4 extended;
 Table	Checksum
 test.t1	3092701434
-test.t2	1157260244
-test.t3	1157260244
+test.t2	746325583
+test.t3	746325583
 test.t4	NULL
 Warnings:
 Error	1146	Table 'test.t4' doesn't exist
Thread
bk commit into 5.0 tree (marko:1.1909) BUG#12186Marko Mäkelä27 Jul