3617 Jorgen Loland 2011-11-18 [merge]
Merge BUG#12997905 from 5.1 to 5.5
modified:
sql/field.h
sql/field_conv.cc
sql/sql_select.cc
3616 Vasil Dimov 2011-11-18 [merge]
Merge mysql-5.1 -> mysql-5.5
I manually checked that all the conflicting InnoDB changes are in 5.5 already.
Two things I am not sure about - I commented them with XXX in this patch.
I will further check with the authors of the changesets whether these things
should be present or not.
modified:
cmd-line-utils/libedit/histedit.h
cmd-line-utils/libedit/np/unvis.c
cmd-line-utils/libedit/np/vis.c
cmd-line-utils/libedit/read.c
storage/innobase/handler/ha_innodb.cc
storage/innobase/row/row0ins.c
=== modified file 'sql/field.h'
--- a/sql/field.h 2011-07-04 11:53:07 +0000
+++ b/sql/field.h 2011-11-18 13:53:54 +0000
@@ -2227,6 +2227,23 @@ public:
uchar *from_null_ptr,*to_null_ptr;
my_bool *null_row;
uint from_bit,to_bit;
+ /**
+ Number of bytes in the fields pointed to by 'from_ptr' and
+ 'to_ptr'. Usually this is the number of bytes that are copied from
+ 'from_ptr' to 'to_ptr'.
+
+ For variable-length fields (VARCHAR), the first byte(s) describe
+ the actual length of the text. For VARCHARs with length
+ < 256 there is 1 length byte
+ >= 256 there is 2 length bytes
+ Thus, if from_field is VARCHAR(10), from_length (and in most cases
+ to_length) is 11. For VARCHAR(1024), the length is 1026. @see
+ Field_varstring::length_bytes
+
+ Note that for VARCHARs, do_copy() will be do_varstring*() which
+ only copies the length-bytes (1 or 2) + the actual length of the
+ text instead of from/to_length bytes. @see get_copy_func()
+ */
uint from_length,to_length;
Field *from_field,*to_field;
String tmp; // For items
=== modified file 'sql/field_conv.cc'
--- a/sql/field_conv.cc 2011-07-04 11:53:07 +0000
+++ b/sql/field_conv.cc 2011-11-18 13:53:54 +0000
@@ -709,7 +709,7 @@ Copy_field::get_copy_func(Field *to,Fiel
if (((Field_varstring*) to)->length_bytes !=
((Field_varstring*) from)->length_bytes)
return do_field_string;
- if (to_length != from_length)
+ else
return (((Field_varstring*) to)->length_bytes == 1 ?
(from->charset()->mbmaxlen == 1 ? do_varstring1 :
do_varstring1_mb) :
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2011-10-05 09:55:51 +0000
+++ b/sql/sql_select.cc 2011-11-18 13:53:54 +0000
@@ -10894,6 +10894,9 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
if (open_tmp_table(table))
goto err;
+ // Make empty record so random data is not written to disk
+ empty_record(table);
+
thd->mem_root= mem_root_save;
DBUG_RETURN(table);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5 branch (jorgen.loland:3616 to 3617) Bug#12997905 | Jorgen Loland | 21 Nov |