summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/extra/rpl_tests/type_conversions.test28
-rw-r--r--mysql-test/suite/rpl/r/rpl_typeconv.result16
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result34
-rw-r--r--sql/sql_select.cc1
4 files changed, 63 insertions, 16 deletions
diff --git a/mysql-test/extra/rpl_tests/type_conversions.test b/mysql-test/extra/rpl_tests/type_conversions.test
index 2be1f6c0bec..6e52da59201 100644
--- a/mysql-test/extra/rpl_tests/type_conversions.test
+++ b/mysql-test/extra/rpl_tests/type_conversions.test
@@ -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;
diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result
index 716956cf2cf..90451759406 100644
--- a/mysql-test/suite/rpl/r/rpl_typeconv.result
+++ b/mysql-test/suite/rpl/r/rpl_typeconv.result
@@ -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>
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
index e08d21b4dcb..1887be44c0c 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
@@ -76,7 +76,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1641
+Last_Errno 1642
Last_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -94,7 +94,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
-Last_SQL_Errno 1641
+Last_SQL_Errno 1642
Last_SQL_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'
Replicate_Ignore_Server_Ids
Master_Server_Id 1
@@ -145,7 +145,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1641
+Last_Errno 1642
Last_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -163,7 +163,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
-Last_SQL_Errno 1641
+Last_SQL_Errno 1642
Last_SQL_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'
Replicate_Ignore_Server_Ids
Master_Server_Id 1
@@ -209,7 +209,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1641
+Last_Errno 1642
Last_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -227,7 +227,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
-Last_SQL_Errno 1641
+Last_SQL_Errno 1642
Last_SQL_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'
Replicate_Ignore_Server_Ids
Master_Server_Id 1
@@ -273,7 +273,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1641
+Last_Errno 1642
Last_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -291,7 +291,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
-Last_SQL_Errno 1641
+Last_SQL_Errno 1642
Last_SQL_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'
Replicate_Ignore_Server_Ids
Master_Server_Id 1
@@ -336,7 +336,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1641
+Last_Errno 1642
Last_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -354,7 +354,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
-Last_SQL_Errno 1641
+Last_SQL_Errno 1642
Last_SQL_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'
Replicate_Ignore_Server_Ids
Master_Server_Id 1
@@ -450,7 +450,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1641
+Last_Errno 1642
Last_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -468,7 +468,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
-Last_SQL_Errno 1641
+Last_SQL_Errno 1642
Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'
Replicate_Ignore_Server_Ids
Master_Server_Id 1
@@ -513,7 +513,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1641
+Last_Errno 1642
Last_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -531,7 +531,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
-Last_SQL_Errno 1641
+Last_SQL_Errno 1642
Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'
Replicate_Ignore_Server_Ids
Master_Server_Id 1
@@ -907,7 +907,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1641
+Last_Errno 1642
Last_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -925,8 +925,10 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
-Last_SQL_Errno 1641
+Last_SQL_Errno 1642
Last_SQL_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
** DROP table t17 ***
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 0e3b3511283..aa9a39b8bc4 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10454,6 +10454,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 */