Commit 99184f54 authored by Mats Kindahl's avatar Mats Kindahl

WL#5151: Conversion between different types

         when replicating

The function create_virtual_tmp_table does not
set db_low_byte_first in the same way as
create_tmp_table does, causing copying from
the virtual table to a real table to get strange
values for SET types on big-endian machines.


mysql-test/extra/rpl_tests/type_conversions.test:
  Adding tests for converting between different-sized sets.
sql/sql_select.cc:
  Settng dh_low_byte_first for tables created
  with create_virtual_tmp_table.
parent 45212610
......@@ -75,6 +75,34 @@ let $target_value = 'master,slave';
let $can_convert = 1;
source extra/rpl_tests/check_type.inc;
let $source_type = SET('0','1','2','3','4','5','6');
let $target_type = SET('0','1','2','3','4','5','6');
let $source_value = '5';
let $target_value = '5';
let $can_convert = 1;
source extra/rpl_tests/check_type.inc;
let $source_type = SET('0','1','2','3','4','5','6');
let $target_type = SET('0','1','2','3','4','5','6','7','8','9','10');
let $source_value = '5';
let $target_value = '5';
let $can_convert = $if_is_non_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type = SET('0','1','2','3','4','5','6','7','8','9','10');
let $target_type = SET('0','1','2','3','4','5','6');
let $source_value = '5';
let $target_value = '5';
let $can_convert = $if_is_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type = SET('0','1','2','3','4','5','6','7','8','9','10');
let $target_type = SET('0','1','2','3','4','5','6');
let $source_value = '7';
let $target_value = '';
let $can_convert = $if_is_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type = TINYINT;
let $target_type = TINYINT;
let $source_value = 1;
......
......@@ -78,6 +78,10 @@ ENUM('master',' CHAR(10) <Correct error>
SET('master','s CHAR(10) <Correct error>
SET('master','s SET('master','s <Correct value>
SET('master','s SET('master','s <Correct value>
SET('0','1','2' SET('0','1','2' <Correct value>
SET('0','1','2' SET('0','1','2' <Correct error>
SET('0','1','2' SET('0','1','2' <Correct error>
SET('0','1','2' SET('0','1','2' <Correct error>
TINYINT TINYINT <Correct value>
TINYINT SMALLINT <Correct error>
TINYINT MEDIUMINT <Correct error>
......@@ -176,6 +180,10 @@ ENUM('master',' CHAR(10) ALL_NON_LOSSY <Correct error>
SET('master','s CHAR(10) ALL_NON_LOSSY <Correct error>
SET('master','s SET('master','s ALL_NON_LOSSY <Correct value>
SET('master','s SET('master','s ALL_NON_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct error>
SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY <Correct error>
TINYINT TINYINT ALL_NON_LOSSY <Correct value>
TINYINT SMALLINT ALL_NON_LOSSY <Correct value>
TINYINT MEDIUMINT ALL_NON_LOSSY <Correct value>
......@@ -274,6 +282,10 @@ ENUM('master',' CHAR(10) ALL_LOSSY <Correct error>
SET('master','s CHAR(10) ALL_LOSSY <Correct error>
SET('master','s SET('master','s ALL_LOSSY <Correct value>
SET('master','s SET('master','s ALL_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct error>
SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_LOSSY <Correct value>
TINYINT TINYINT ALL_LOSSY <Correct value>
TINYINT SMALLINT ALL_LOSSY <Correct error>
TINYINT MEDIUMINT ALL_LOSSY <Correct error>
......@@ -372,6 +384,10 @@ ENUM('master',' CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct error>
SET('master','s CHAR(10) ALL_LOSSY,ALL_NON_LOSSY <Correct error>
SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY <Correct value>
SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYINT TINYINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY <Correct value>
......
......@@ -10398,6 +10398,7 @@ TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list)
share->blob_field= blob_field;
share->fields= field_count;
share->blob_ptr_size= portable_sizeof_char_ptr;
share->db_low_byte_first=1; // True for HEAP and MyISAM
setup_tmp_table_column_bitmaps(table, bitmaps);
/* Create all fields and calculate the total length of record */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment