MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
check_conversions.inc
1 --echo **** Checking result of conversions ****
2 disable_query_log;
3 # Create a temporary table containing all conversions
4 # that didn't work as expected, the table should
5 # normally not contain any rows
6 CREATE TEMPORARY TABLE failed_type_conversions ENGINE = 'MyISAM' AS
7  SELECT RPAD(Source, 15, ' ') AS Source_Type,
8  RPAD(Target, 15, ' ') AS Target_Type,
9  RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
10  IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
11  IF(Compare, '<Correct value>',
12  CONCAT("'", On_Slave, "' != '", Expected, "'")))
13  AS Value_On_Slave
14  FROM type_conversions
15  WHERE Compare != 1 OR (Compare IS NULL AND Error IS NULL);
16 enable_query_log;
17 
18 if (`SELECT COUNT(*) FROM failed_type_conversions`)
19 {
20  echo Some type conversions failed, see below:;
21  SELECT * FROM failed_type_conversions;
22  die Type conversion failure;
23 }
24 
25 
26