List:Commits« Previous MessageNext Message »
From:Staale Smedseng Date:October 29 2008 6:00pm
Subject:bzr commit into mysql-5.1 branch (staale.smedseng:2737) Bug#28299
View as plain text  
#At file:///export/home/tmp/ss156133/z/b28299-51/

 2737 Staale Smedseng	2008-10-29
      This is a patch for Bug #28299 To-number conversion warnings
      work differenly with CHAR and VARCHAR sp variables.
                                    
      The patch provides ER_TRUNCATED_WRONG_VALUE warning messages
      for conversion of VARCHAR to numberic values, in line with
      messages provided for CHAR conversions. Conversions are
      checked for success, and the message is emitted in case of
      failure.
                                    
      The tests are amended to accept the added warning messages,
      and explicit conversion of ON/OFF values is added for
      statements checking system variables. In test
      rpl.rpl_switch_stm_row_mixed checking for warnings is
      temporarily disabled for one statement, as this generates
      warning messages for strings that vary between executions.
modified:
  mysql-test/r/auto_commit_basic.result
  mysql-test/r/automatic_sp_privileges_basic.result
  mysql-test/r/big_tables_basic.result
  mysql-test/r/engine_condition_pushdown_basic.result
  mysql-test/r/flush_basic.result
  mysql-test/r/foreign_key_checks_basic.result
  mysql-test/r/func_math.result
  mysql-test/r/func_str.result
  mysql-test/r/general_log_basic.result
  mysql-test/r/innodb_checksums_basic.result
  mysql-test/r/innodb_doublewrite_basic.result
  mysql-test/r/innodb_file_per_table_basic.result
  mysql-test/r/innodb_locks_unsafe_for_binlog_basic.result
  mysql-test/r/innodb_rollback_on_timeout_basic.result
  mysql-test/r/innodb_support_xa_basic.result
  mysql-test/r/innodb_table_locks_basic.result
  mysql-test/r/keep_files_on_create_basic.result
  mysql-test/r/local_infile_basic.result
  mysql-test/r/log_bin_trust_function_creators_basic.result
  mysql-test/r/log_bin_trust_routine_creators_basic.result
  mysql-test/r/log_queries_not_using_indexes_basic.result
  mysql-test/r/low_priority_updates_basic.result
  mysql-test/r/myisam_use_mmap_basic.result
  mysql-test/r/new_basic.result
  mysql-test/r/old_passwords_basic.result
  mysql-test/r/profiling.result
  mysql-test/r/ps_1general.result
  mysql-test/r/query_cache_wlock_invalidate_basic.result
  mysql-test/r/read_only_basic.result
  mysql-test/r/relay_log_purge_basic.result
  mysql-test/r/secure_auth_basic.result
  mysql-test/r/slave_compressed_protocol_basic.result
  mysql-test/r/slow_query_log_basic.result
  mysql-test/r/sp-vars.result
  mysql-test/r/sql_auto_is_null_basic.result
  mysql-test/r/sql_big_selects_basic.result
  mysql-test/r/sql_big_tables_basic.result
  mysql-test/r/sql_buffer_result_basic.result
  mysql-test/r/sql_log_bin_basic.result
  mysql-test/r/sql_log_off_basic.result
  mysql-test/r/sql_low_priority_updates_basic.result
  mysql-test/r/sql_notes_basic.result
  mysql-test/r/sql_quote_show_create_basic.result
  mysql-test/r/sql_safe_updates_basic.result
  mysql-test/r/sql_warnings_basic.result
  mysql-test/r/sync_frm_basic.result
  mysql-test/r/timed_mutexes_basic.result
  mysql-test/r/type_varchar.result
  mysql-test/r/unique_checks_basic.result
  mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
  mysql-test/t/auto_commit_basic.test
  mysql-test/t/automatic_sp_privileges_basic.test
  mysql-test/t/big_tables_basic.test
  mysql-test/t/engine_condition_pushdown_basic.test
  mysql-test/t/flush_basic.test
  mysql-test/t/foreign_key_checks_basic.test
  mysql-test/t/general_log_basic.test
  mysql-test/t/innodb_checksums_basic.test
  mysql-test/t/innodb_doublewrite_basic.test
  mysql-test/t/innodb_file_per_table_basic.test
  mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test
  mysql-test/t/innodb_rollback_on_timeout_basic.test
  mysql-test/t/innodb_support_xa_basic.test
  mysql-test/t/innodb_table_locks_basic.test
  mysql-test/t/keep_files_on_create_basic.test
  mysql-test/t/local_infile_basic.test
  mysql-test/t/log_bin_trust_function_creators_basic.test
  mysql-test/t/log_bin_trust_routine_creators_basic.test
  mysql-test/t/log_queries_not_using_indexes_basic.test
  mysql-test/t/low_priority_updates_basic.test
  mysql-test/t/myisam_use_mmap_basic.test
  mysql-test/t/new_basic.test
  mysql-test/t/old_passwords_basic.test
  mysql-test/t/query_cache_wlock_invalidate_basic.test
  mysql-test/t/read_only_basic.test
  mysql-test/t/relay_log_purge_basic.test
  mysql-test/t/secure_auth_basic.test
  mysql-test/t/slave_compressed_protocol_basic.test
  mysql-test/t/slow_query_log_basic.test
  mysql-test/t/sp-vars.test
  mysql-test/t/sql_auto_is_null_basic.test
  mysql-test/t/sql_big_selects_basic.test
  mysql-test/t/sql_big_tables_basic.test
  mysql-test/t/sql_buffer_result_basic.test
  mysql-test/t/sql_log_bin_basic.test
  mysql-test/t/sql_log_off_basic.test
  mysql-test/t/sql_low_priority_updates_basic.test
  mysql-test/t/sql_notes_basic.test
  mysql-test/t/sql_quote_show_create_basic.test
  mysql-test/t/sql_safe_updates_basic.test
  mysql-test/t/sql_warnings_basic.test
  mysql-test/t/sync_frm_basic.test
  mysql-test/t/timed_mutexes_basic.test
  mysql-test/t/type_varchar.test
  mysql-test/t/unique_checks_basic.test
  sql/field.cc
  sql/field.h

per-file messages:
  mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
    In test rpl.rpl_switch_stm_row_mixed checking for warnings is
    temporarily disabled for one statement, as this generates
    warning messages for strings that vary between executions.
  sql/field.cc
    Added method to test and push_warning_printf in class
    Field_varstring to warn that conversion has failed.
  sql/field.h
    Added method to test and push_warning_printf in class
    Field_varstring to warn that conversion has failed.
=== modified file 'mysql-test/r/auto_commit_basic.result'
--- a/mysql-test/r/auto_commit_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/auto_commit_basic.result	2008-10-29 17:59:49 +0000
@@ -54,19 +54,19 @@ ERROR HY000: Variable 'autocommit' is a 
 SELECT @@global.autocommit;
 ERROR HY000: Variable 'autocommit' is a SESSION variable
 '#----------------------FN_DYNVARS_003_06------------------------#'
-SELECT @@session.autocommit = VARIABLE_VALUE 
+SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='autocommit';
-@@session.autocommit = VARIABLE_VALUE
-0
+IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
+1
 Bug # 34839: Values in variable and information_schema do not match for autocommit
 '#----------------------FN_DYNVARS_003_07------------------------#'
 SET @@autocommit = 1;
-SELECT @@autocommit = VARIABLE_VALUE
+SELECT IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='autocommit';
-@@autocommit = VARIABLE_VALUE
-0
+IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
+1
 '#---------------------FN_DYNVARS_003_08-------------------------#'
 SET @@autocommit = OFF;
 SELECT @@autocommit;

=== modified file 'mysql-test/r/automatic_sp_privileges_basic.result'
--- a/mysql-test/r/automatic_sp_privileges_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/automatic_sp_privileges_basic.result	2008-10-29 17:59:49 +0000
@@ -53,11 +53,11 @@ ERROR HY000: Variable 'automatic_sp_priv
 SELECT @@session.automatic_sp_privileges;
 ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable
 '#----------------------FN_DYNVARS_004_06------------------------#'
-SELECT @@global.automatic_sp_privileges = VARIABLE_VALUE 
+SELECT IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='automatic_sp_privileges';
-@@global.automatic_sp_privileges = VARIABLE_VALUE
-0
+IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE
+1
 'Bug# 34839: Values in variable and information_schema donot match'
 '#---------------------FN_DYNVARS_004_07----------------------#'
 SET @@global.automatic_sp_privileges = OFF;

=== modified file 'mysql-test/r/big_tables_basic.result'
--- a/mysql-test/r/big_tables_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/big_tables_basic.result	2008-10-29 17:59:49 +0000
@@ -49,11 +49,11 @@ ERROR HY000: Variable 'big_tables' is a 
 SELECT @@global.big_tables;
 ERROR HY000: Variable 'big_tables' is a SESSION variable
 '#----------------------FN_DYNVARS_005_05------------------------#'
-SELECT @@big_tables = VARIABLE_VALUE 
+SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='big_tables';
-@@big_tables = VARIABLE_VALUE
-0
+IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
+1
 Bug # 34839: Values in variable and information_schema do not match for autocommit
 '#---------------------FN_DYNVARS_005_06----------------------#'
 SET @@big_tables = OFF;

=== modified file 'mysql-test/r/engine_condition_pushdown_basic.result'
--- a/mysql-test/r/engine_condition_pushdown_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/engine_condition_pushdown_basic.result	2008-10-29 17:59:49 +0000
@@ -103,10 +103,10 @@ SELECT @@session.engine_condition_pushdo
 res_is_1
 1
 '#----------------------FN_DYNVARS_028_06------------------------#'
-SELECT @@global.engine_condition_pushdown = VARIABLE_VALUE 
+SELECT IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='engine_condition_pushdown';
-@@global.engine_condition_pushdown = VARIABLE_VALUE
+IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@global.engine_condition_pushdown;
 @@global.engine_condition_pushdown
@@ -117,11 +117,11 @@ WHERE VARIABLE_NAME='engine_condition_pu
 VARIABLE_VALUE
 OFF
 '#----------------------FN_DYNVARS_028_07------------------------#'
-SELECT @@session.engine_condition_pushdown = VARIABLE_VALUE 
+SELECT IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='engine_condition_pushdown';
-@@session.engine_condition_pushdown = VARIABLE_VALUE
-0
+IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
+1
 SELECT @@session.engine_condition_pushdown;
 @@session.engine_condition_pushdown
 1

=== modified file 'mysql-test/r/flush_basic.result'
--- a/mysql-test/r/flush_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/flush_basic.result	2008-10-29 17:59:49 +0000
@@ -63,11 +63,11 @@ ERROR HY000: Variable 'flush' is a GLOBA
 SELECT @@session.flush;
 ERROR HY000: Variable 'flush' is a GLOBAL variable
 '#----------------------FN_DYNVARS_030_06------------------------#'
-SELECT @@global.flush = VARIABLE_VALUE 
+SELECT IF(@@global.flush, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='flush';
-@@global.flush = VARIABLE_VALUE
-0
+IF(@@global.flush, "ON", "OFF") = VARIABLE_VALUE
+1
 '#---------------------FN_DYNVARS_030_07----------------------#'
 SET @@global.flush = TRUE;
 SELECT @@global.flush;

=== modified file 'mysql-test/r/foreign_key_checks_basic.result'
--- a/mysql-test/r/foreign_key_checks_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/foreign_key_checks_basic.result	2008-10-29 17:59:49 +0000
@@ -65,10 +65,10 @@ SELECT count(VARIABLE_VALUE) FROM INFORM
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_032_07------------------------#'
-SELECT @@session.foreign_key_checks = VARIABLE_VALUE 
+SELECT IF(@@session.foreign_key_checks, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='foreign_key_checks';
-@@session.foreign_key_checks = VARIABLE_VALUE
+IF(@@session.foreign_key_checks, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.foreign_key_checks;
 @@session.foreign_key_checks

=== modified file 'mysql-test/r/func_math.result'
--- a/mysql-test/r/func_math.result	2008-02-19 21:33:43 +0000
+++ b/mysql-test/r/func_math.result	2008-10-29 17:59:49 +0000
@@ -382,6 +382,9 @@ y
 SELECT b DIV 900 y FROM t1 GROUP BY y;
 y
 0
+Warnings:
+Warning	1292	Truncated incorrect INTEGER value: 'str1'
+Warning	1292	Truncated incorrect INTEGER value: 'str2'
 SELECT c DIV 900 y FROM t1 GROUP BY y;
 y
 0

=== modified file 'mysql-test/r/func_str.result'
--- a/mysql-test/r/func_str.result	2008-03-12 08:19:46 +0000
+++ b/mysql-test/r/func_str.result	2008-10-29 17:59:49 +0000
@@ -1153,6 +1153,9 @@ INSERT INTO t2 VALUES (0), (1);
 SELECT * FROM t1, t2 WHERE num=str;
 str	num
 notnumber	0
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: 'notnumber'
+Warning	1292	Truncated incorrect DOUBLE value: 'notnumber'
 SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
 str	num
 notnumber	0

=== modified file 'mysql-test/r/general_log_basic.result'
--- a/mysql-test/r/general_log_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/general_log_basic.result	2008-10-29 17:59:49 +0000
@@ -47,10 +47,10 @@ ERROR HY000: Variable 'general_log' is a
 SELECT @@session.general_log;
 ERROR HY000: Variable 'general_log' is a GLOBAL variable
 '#----------------------FN_DYNVARS_004_05------------------------#'
-SELECT @@global.general_log = VARIABLE_VALUE 
+SELECT IF(@@global.general_log, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='general_log';
-@@global.general_log = VARIABLE_VALUE
+IF(@@global.general_log, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_004_06----------------------#'
 SET @@global.general_log = 0;

=== modified file 'mysql-test/r/innodb_checksums_basic.result'
--- a/mysql-test/r/innodb_checksums_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/innodb_checksums_basic.result	2008-10-29 17:59:49 +0000
@@ -12,11 +12,11 @@ COUNT(@@GLOBAL.innodb_checksums)
 1
 1 Expected
 '#---------------------BS_STVARS_023_03----------------------#'
-SELECT @@GLOBAL.innodb_checksums = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_checksums, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_checksums';
-@@GLOBAL.innodb_checksums = VARIABLE_VALUE
-0
+IF(@@GLOBAL.innodb_checksums, "ON", "OFF") = VARIABLE_VALUE
+1
 1 Expected
 SELECT COUNT(@@GLOBAL.innodb_checksums);
 COUNT(@@GLOBAL.innodb_checksums)

=== modified file 'mysql-test/r/innodb_doublewrite_basic.result'
--- a/mysql-test/r/innodb_doublewrite_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/innodb_doublewrite_basic.result	2008-10-29 17:59:49 +0000
@@ -12,11 +12,11 @@ COUNT(@@GLOBAL.innodb_doublewrite)
 1
 1 Expected
 '#---------------------BS_STVARS_026_03----------------------#'
-SELECT @@GLOBAL.innodb_doublewrite = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_doublewrite';
-@@GLOBAL.innodb_doublewrite = VARIABLE_VALUE
-0
+IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
+1
 1 Expected
 SELECT COUNT(@@GLOBAL.innodb_doublewrite);
 COUNT(@@GLOBAL.innodb_doublewrite)

=== modified file 'mysql-test/r/innodb_file_per_table_basic.result'
--- a/mysql-test/r/innodb_file_per_table_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/innodb_file_per_table_basic.result	2008-10-29 17:59:49 +0000
@@ -12,10 +12,10 @@ COUNT(@@GLOBAL.innodb_file_per_table)
 1
 1 Expected
 '#---------------------BS_STVARS_028_03----------------------#'
-SELECT @@GLOBAL.innodb_file_per_table = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_file_per_table, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_file_per_table';
-@@GLOBAL.innodb_file_per_table = VARIABLE_VALUE
+IF(@@GLOBAL.innodb_file_per_table, "ON", "OFF") = VARIABLE_VALUE
 1
 1 Expected
 SELECT COUNT(@@GLOBAL.innodb_file_per_table);

=== modified file 'mysql-test/r/innodb_locks_unsafe_for_binlog_basic.result'
--- a/mysql-test/r/innodb_locks_unsafe_for_binlog_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/innodb_locks_unsafe_for_binlog_basic.result	2008-10-29 17:59:49 +0000
@@ -12,10 +12,10 @@ COUNT(@@GLOBAL.innodb_locks_unsafe_for_b
 1
 1 Expected
 '#---------------------BS_STVARS_031_03----------------------#'
-SELECT @@GLOBAL.innodb_locks_unsafe_for_binlog = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_locks_unsafe_for_binlog, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_locks_unsafe_for_binlog';
-@@GLOBAL.innodb_locks_unsafe_for_binlog = VARIABLE_VALUE
+IF(@@GLOBAL.innodb_locks_unsafe_for_binlog, "ON", "OFF") = VARIABLE_VALUE
 1
 1 Expected
 SELECT COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog);

=== modified file 'mysql-test/r/innodb_rollback_on_timeout_basic.result'
--- a/mysql-test/r/innodb_rollback_on_timeout_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/innodb_rollback_on_timeout_basic.result	2008-10-29 17:59:49 +0000
@@ -12,10 +12,10 @@ COUNT(@@GLOBAL.innodb_rollback_on_timeou
 1
 1 Expected
 '#---------------------BS_STVARS_039_03----------------------#'
-SELECT @@GLOBAL.innodb_rollback_on_timeout = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_rollback_on_timeout, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_rollback_on_timeout';
-@@GLOBAL.innodb_rollback_on_timeout = VARIABLE_VALUE
+IF(@@GLOBAL.innodb_rollback_on_timeout, "ON", "OFF") = VARIABLE_VALUE
 1
 1 Expected
 SELECT COUNT(@@GLOBAL.innodb_rollback_on_timeout);

=== modified file 'mysql-test/r/innodb_support_xa_basic.result'
--- a/mysql-test/r/innodb_support_xa_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/innodb_support_xa_basic.result	2008-10-29 17:59:49 +0000
@@ -105,10 +105,10 @@ SELECT @@session.innodb_support_xa AS re
 res_is_1
 1
 '#----------------------FN_DYNVARS_046_06------------------------#'
-SELECT @@global.innodb_support_xa =
+SELECT IF(@@global.innodb_support_xa, "ON", "OFF") =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_support_xa';
-@@global.innodb_support_xa =
+IF(@@global.innodb_support_xa, "ON", "OFF") =
 VARIABLE_VALUE
 1
 SELECT @@global.innodb_support_xa;
@@ -119,12 +119,12 @@ WHERE VARIABLE_NAME='innodb_support_xa';
 VARIABLE_VALUE
 OFF
 '#----------------------FN_DYNVARS_046_07------------------------#'
-SELECT @@session.innodb_support_xa =
+SELECT IF(@@session.innodb_support_xa, "ON", "OFF") =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='innodb_support_xa';
-@@session.innodb_support_xa =
+IF(@@session.innodb_support_xa, "ON", "OFF") =
 VARIABLE_VALUE
-0
+1
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
 1

=== modified file 'mysql-test/r/innodb_table_locks_basic.result'
--- a/mysql-test/r/innodb_table_locks_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/innodb_table_locks_basic.result	2008-10-29 17:59:49 +0000
@@ -99,10 +99,10 @@ SELECT @@session.innodb_table_locks AS r
 res_is_1
 1
 '#----------------------FN_DYNVARS_046_06------------------------#'
-SELECT @@global.innodb_table_locks =
+SELECT IF(@@global.innodb_table_locks, "ON", "OFF") =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_table_locks';
-@@global.innodb_table_locks =
+IF(@@global.innodb_table_locks, "ON", "OFF") =
 VARIABLE_VALUE
 1
 SELECT @@global.innodb_table_locks;
@@ -113,12 +113,12 @@ WHERE VARIABLE_NAME='innodb_table_locks'
 VARIABLE_VALUE
 OFF
 '#----------------------FN_DYNVARS_046_07------------------------#'
-SELECT @@session.innodb_table_locks =
+SELECT IF(@@session.innodb_table_locks, "ON", "OFF") =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='innodb_table_locks';
-@@session.innodb_table_locks =
+IF(@@session.innodb_table_locks, "ON", "OFF") =
 VARIABLE_VALUE
-0
+1
 SELECT @@session.innodb_table_locks;
 @@session.innodb_table_locks
 1

=== modified file 'mysql-test/r/keep_files_on_create_basic.result'
--- a/mysql-test/r/keep_files_on_create_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/keep_files_on_create_basic.result	2008-10-29 17:59:49 +0000
@@ -120,16 +120,16 @@ SELECT @@session.keep_files_on_create;
 @@session.keep_files_on_create
 0
 '#------------------FN_DYNVARS_054_06-----------------------#'
-SELECT @@global.keep_files_on_create = VARIABLE_VALUE 
+SELECT IF(@@global.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='keep_files_on_create';
-@@global.keep_files_on_create = VARIABLE_VALUE
+IF(@@global.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE
 1
 '#------------------FN_DYNVARS_054_07-----------------------#'
-SELECT @@session.keep_files_on_create = VARIABLE_VALUE 
+SELECT IF(@@session.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='keep_files_on_create';
-@@session.keep_files_on_create = VARIABLE_VALUE
+IF(@@session.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_001_08----------------------#'
 SET @@keep_files_on_create = OFF;

=== modified file 'mysql-test/r/local_infile_basic.result'
--- a/mysql-test/r/local_infile_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/local_infile_basic.result	2008-10-29 17:59:49 +0000
@@ -53,11 +53,11 @@ ERROR HY000: Variable 'local_infile' is 
 SELECT @@session.local_infile = 1;
 ERROR HY000: Variable 'local_infile' is a GLOBAL variable
 '#----------------------FN_DYNVARS_018_06------------------------#'
-SELECT @@global.local_infile = VARIABLE_VALUE 
+SELECT IF(@@global.local_infile, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='local_infile';
-@@global.local_infile = VARIABLE_VALUE
-0
+IF(@@global.local_infile, "ON", "OFF") = VARIABLE_VALUE
+1
 '#---------------------FN_DYNVARS_018_07----------------------#'
 SET @@global.local_infile = OFF;
 SELECT @@global.local_infile;

=== modified file 'mysql-test/r/log_bin_trust_function_creators_basic.result'
--- a/mysql-test/r/log_bin_trust_function_creators_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/log_bin_trust_function_creators_basic.result	2008-10-29 17:59:49 +0000
@@ -69,12 +69,12 @@ ERROR 42000: Variable 'log_bin_trust_fun
 SET @@global.log_bin_trust_function_creators = test;
 ERROR 42000: Variable 'log_bin_trust_function_creators' can't be set to the value of 'test'
 '#------------------FN_DYNVARS_063_06-----------------------#'
-SELECT @@global.log_bin_trust_function_creators = VARIABLE_VALUE 
+SELECT IF(@@global.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='log_bin_trust_function_creators';
-@@global.log_bin_trust_function_creators = VARIABLE_VALUE
+IF(@@global.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
 1
-SELECT @@session.log_bin_trust_function_creators = VARIABLE_VALUE 
+SELECT IF(@@session.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='log_bin_trust_function_creators';
 ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable

=== modified file 'mysql-test/r/log_bin_trust_routine_creators_basic.result'
--- a/mysql-test/r/log_bin_trust_routine_creators_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/log_bin_trust_routine_creators_basic.result	2008-10-29 17:59:49 +0000
@@ -88,10 +88,10 @@ ERROR 42000: Variable 'log_bin_trust_rou
 SET @@global.log_bin_trust_routine_creators = test;
 ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'test'
 '#------------------FN_DYNVARS_064_06-----------------------#'
-SELECT @@global.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
-@@global.log_bin_trust_routine_creators = VARIABLE_VALUE
+SELECT IF(@@global.log_bin_trust_routine_creators, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
+IF(@@global.log_bin_trust_routine_creators, "ON", "OFF") = VARIABLE_VALUE
 1
-SELECT @@session.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
+SELECT IF(@@session.log_bin_trust_routine_creators, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
 ERROR HY000: Variable 'log_bin_trust_routine_creators' is a GLOBAL variable
 '#---------------------FN_DYNVARS_064_07----------------------#'
 SET @@global.log_bin_trust_routine_creators = TRUE;

=== modified file 'mysql-test/r/log_queries_not_using_indexes_basic.result'
--- a/mysql-test/r/log_queries_not_using_indexes_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/log_queries_not_using_indexes_basic.result	2008-10-29 17:59:49 +0000
@@ -12,11 +12,11 @@ COUNT(@@GLOBAL.log_queries_not_using_ind
 1
 1 Expected
 '#---------------------BS_STVARS_041_03----------------------#'
-SELECT @@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='log_queries_not_using_indexes';
-@@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE
-0
+IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE
+1
 1 Expected
 SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
 COUNT(@@GLOBAL.log_queries_not_using_indexes)

=== modified file 'mysql-test/r/low_priority_updates_basic.result'
--- a/mysql-test/r/low_priority_updates_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/low_priority_updates_basic.result	2008-10-29 17:59:49 +0000
@@ -118,16 +118,16 @@ ERROR 42000: Variable 'low_priority_upda
 SET @@session.low_priority_updates = test;
 ERROR 42000: Variable 'low_priority_updates' can't be set to the value of 'test'
 '#------------------FN_DYNVARS_069_06-----------------------#'
-SELECT @@global.low_priority_updates = VARIABLE_VALUE 
+SELECT IF(@@global.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='low_priority_updates';
-@@global.low_priority_updates = VARIABLE_VALUE
+IF(@@global.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
 1
 '#------------------FN_DYNVARS_069_07-----------------------#'
-SELECT @@session.low_priority_updates = VARIABLE_VALUE 
+SELECT IF(@@session.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='low_priority_updates';
-@@session.low_priority_updates = VARIABLE_VALUE
+IF(@@session.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_069_08----------------------#'
 SET @@low_priority_updates = FALSE;

=== modified file 'mysql-test/r/myisam_use_mmap_basic.result'
--- a/mysql-test/r/myisam_use_mmap_basic.result	2008-04-30 12:49:37 +0000
+++ b/mysql-test/r/myisam_use_mmap_basic.result	2008-10-29 17:59:49 +0000
@@ -11,10 +11,10 @@ COUNT(@@GLOBAL.myisam_use_mmap)
 1
 1 Expected
 '#---------------------BS_STVARS_042_03----------------------#'
-SELECT @@GLOBAL.myisam_use_mmap = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.myisam_use_mmap, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='myisam_use_mmap';
-@@GLOBAL.myisam_use_mmap = VARIABLE_VALUE
+IF(@@GLOBAL.myisam_use_mmap, "ON", "OFF") = VARIABLE_VALUE
 1
 1 Expected
 SELECT COUNT(@@GLOBAL.myisam_use_mmap);

=== modified file 'mysql-test/r/new_basic.result'
--- a/mysql-test/r/new_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/new_basic.result	2008-10-29 17:59:49 +0000
@@ -117,16 +117,16 @@ ERROR 42000: Variable 'new' can't be set
 SET @@session.new = test;
 ERROR 42000: Variable 'new' can't be set to the value of 'test'
 '#------------------FN_DYNVARS_113_06-----------------------#'
-SELECT @@global.new = VARIABLE_VALUE 
+SELECT IF(@@global.new, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='new';
-@@global.new = VARIABLE_VALUE
+IF(@@global.new, "ON", "OFF") = VARIABLE_VALUE
 1
 '#------------------FN_DYNVARS_113_07-----------------------#'
-SELECT @@session.new = VARIABLE_VALUE 
+SELECT IF(@@session.new, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='new';
-@@session.new = VARIABLE_VALUE
+IF(@@session.new, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_113_08----------------------#'
 SET @@new = OFF;

=== modified file 'mysql-test/r/old_passwords_basic.result'
--- a/mysql-test/r/old_passwords_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/old_passwords_basic.result	2008-10-29 17:59:49 +0000
@@ -113,16 +113,16 @@ ERROR 42000: Variable 'old_passwords' ca
 SET @@session.old_passwords = test;
 ERROR 42000: Variable 'old_passwords' can't be set to the value of 'test'
 '#------------------FN_DYNVARS_114_06-----------------------#'
-SELECT @@global.old_passwords = VARIABLE_VALUE 
+SELECT IF(@@global.old_passwords, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='old_passwords';
-@@global.old_passwords = VARIABLE_VALUE
+IF(@@global.old_passwords, "ON", "OFF") = VARIABLE_VALUE
 1
 '#------------------FN_DYNVARS_114_07-----------------------#'
-SELECT @@session.old_passwords = VARIABLE_VALUE 
+SELECT IF(@@session.old_passwords, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='old_passwords';
-@@session.old_passwords = VARIABLE_VALUE
+IF(@@session.old_passwords, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_114_08----------------------#'
 SET @@old_passwords = OFF;

=== modified file 'mysql-test/r/profiling.result'
--- a/mysql-test/r/profiling.result	2007-12-14 13:57:37 +0000
+++ b/mysql-test/r/profiling.result	2008-10-29 17:59:49 +0000
@@ -297,6 +297,13 @@ id
 1
 2
 3
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: 'hello'
+Warning	1292	Truncated incorrect DOUBLE value: 'hello'
+Warning	1292	Truncated incorrect DOUBLE value: 'hello'
+Warning	1292	Truncated incorrect DOUBLE value: 'hello'
+Warning	1292	Truncated incorrect DOUBLE value: 'hello'
+Warning	1292	Truncated incorrect DOUBLE value: 'hello'
 select @@profiling;
 @@profiling
 1

=== modified file 'mysql-test/r/ps_1general.result'
--- a/mysql-test/r/ps_1general.result	2008-08-15 20:42:29 +0000
+++ b/mysql-test/r/ps_1general.result	2008-10-29 17:59:49 +0000
@@ -278,6 +278,9 @@ b	char(10)	YES		NULL	
 SET @arg00=1;
 execute stmt4 using @arg00;
 Field	Type	Null	Key	Default	Extra
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: 'a'
+Warning	1292	Truncated incorrect DOUBLE value: 'b'
 prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
 execute stmt4;
 Field	Type	Null	Key	Default	Extra

=== modified file 'mysql-test/r/query_cache_wlock_invalidate_basic.result'
--- a/mysql-test/r/query_cache_wlock_invalidate_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/query_cache_wlock_invalidate_basic.result	2008-10-29 17:59:49 +0000
@@ -103,10 +103,10 @@ SELECT @@session.query_cache_wlock_inval
 res_is_1
 1
 '#----------------------FN_DYNVARS_135_06------------------------#'
-SELECT @@global.query_cache_wlock_invalidate = VARIABLE_VALUE 
+SELECT IF(@@global.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
-@@global.query_cache_wlock_invalidate = VARIABLE_VALUE
+IF(@@global.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@global.query_cache_wlock_invalidate;
 @@global.query_cache_wlock_invalidate
@@ -117,11 +117,11 @@ WHERE VARIABLE_NAME='query_cache_wlock_i
 VARIABLE_VALUE
 OFF
 '#----------------------FN_DYNVARS_135_07------------------------#'
-SELECT @@session.query_cache_wlock_invalidate = VARIABLE_VALUE 
+SELECT IF(@@session.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
-@@session.query_cache_wlock_invalidate = VARIABLE_VALUE
-0
+IF(@@session.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE
+1
 SELECT @@session.query_cache_wlock_invalidate;
 @@session.query_cache_wlock_invalidate
 1

=== modified file 'mysql-test/r/read_only_basic.result'
--- a/mysql-test/r/read_only_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/read_only_basic.result	2008-10-29 17:59:49 +0000
@@ -82,15 +82,15 @@ SELECT @@read_only;
 @@read_only
 0
 '#----------------------FN_DYNVARS_139_06------------------------#'
-SELECT @@global.read_only = VARIABLE_VALUE 
+SELECT IF(@@global.read_only, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='read_only';
-@@global.read_only = VARIABLE_VALUE
+IF(@@global.read_only, "ON", "OFF") = VARIABLE_VALUE
 1
-SELECT @@read_only = VARIABLE_VALUE 
+SELECT IF(@@read_only, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='read_only';
-@@read_only = VARIABLE_VALUE
+IF(@@read_only, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_139_07----------------------#'
 SET @@global.read_only = 1;

=== modified file 'mysql-test/r/relay_log_purge_basic.result'
--- a/mysql-test/r/relay_log_purge_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/relay_log_purge_basic.result	2008-10-29 17:59:49 +0000
@@ -69,10 +69,10 @@ ERROR HY000: Variable 'relay_log_purge' 
 SELECT @@session.relay_log_purge;
 ERROR HY000: Variable 'relay_log_purge' is a GLOBAL variable
 '#----------------------FN_DYNVARS_141_06------------------------#'
-SELECT @@global.relay_log_purge = VARIABLE_VALUE 
+SELECT IF(@@global.relay_log_purge, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='relay_log_purge';
-@@global.relay_log_purge = VARIABLE_VALUE
+IF(@@global.relay_log_purge, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_141_07----------------------#'
 SET @@global.relay_log_purge = 1;

=== modified file 'mysql-test/r/secure_auth_basic.result'
--- a/mysql-test/r/secure_auth_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/secure_auth_basic.result	2008-10-29 17:59:49 +0000
@@ -68,11 +68,11 @@ WHERE VARIABLE_NAME='secure_auth';
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_143_07------------------------#'
-SELECT @@global.secure_auth = VARIABLE_VALUE 
+SELECT IF(@@global.secure_auth, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='secure_auth';
-@@global.secure_auth = VARIABLE_VALUE
-0
+IF(@@global.secure_auth, "ON", "OFF") = VARIABLE_VALUE
+1
 SELECT @@global.secure_auth;
 @@global.secure_auth
 1

=== modified file 'mysql-test/r/slave_compressed_protocol_basic.result'
--- a/mysql-test/r/slave_compressed_protocol_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/slave_compressed_protocol_basic.result	2008-10-29 17:59:49 +0000
@@ -66,11 +66,11 @@ WHERE VARIABLE_NAME='slave_compressed_pr
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_147_07------------------------#'
-SELECT @@global.slave_compressed_protocol = VARIABLE_VALUE 
+SELECT IF(@@global.slave_compressed_protocol, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='slave_compressed_protocol';
-@@global.slave_compressed_protocol = VARIABLE_VALUE
-0
+IF(@@global.slave_compressed_protocol, "ON", "OFF") = VARIABLE_VALUE
+1
 SELECT @@global.slave_compressed_protocol;
 @@global.slave_compressed_protocol
 1

=== modified file 'mysql-test/r/slow_query_log_basic.result'
--- a/mysql-test/r/slow_query_log_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/slow_query_log_basic.result	2008-10-29 17:59:49 +0000
@@ -47,10 +47,10 @@ ERROR HY000: Variable 'slow_query_log' i
 SELECT @@session.slow_query_log;
 ERROR HY000: Variable 'slow_query_log' is a GLOBAL variable
 '#----------------------FN_DYNVARS_004_05------------------------#'
-SELECT @@global.slow_query_log = VARIABLE_VALUE 
+SELECT IF(@@global.slow_query_log, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='slow_query_log';
-@@global.slow_query_log = VARIABLE_VALUE
+IF(@@global.slow_query_log, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_004_06----------------------#'
 SET @@global.slow_query_log = 0;

=== modified file 'mysql-test/r/sp-vars.result'
--- a/mysql-test/r/sp-vars.result	2007-05-18 12:29:24 +0000
+++ b/mysql-test/r/sp-vars.result	2008-10-29 17:59:49 +0000
@@ -1228,3 +1228,30 @@ f1()	@b
 0	abc
 drop function f1;
 drop table t1;
+
+---------------------------------------------------------------
+BUG#28299
+---------------------------------------------------------------
+
+CREATE PROCEDURE ctest()
+BEGIN
+DECLARE i CHAR(16);
+DECLARE j INT;
+SET i= 'string';
+SET j= 1 + i;
+END|
+CALL ctest();
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: 'string          '
+DROP PROCEDURE ctest;
+CREATE PROCEDURE vctest()
+BEGIN
+DECLARE i VARCHAR(16);
+DECLARE j INT;
+SET i= 'string';
+SET j= 1 + i;
+END|
+CALL vctest();
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: 'string'
+DROP PROCEDURE vctest;

=== modified file 'mysql-test/r/sql_auto_is_null_basic.result'
--- a/mysql-test/r/sql_auto_is_null_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_auto_is_null_basic.result	2008-10-29 17:59:49 +0000
@@ -12,11 +12,11 @@ COUNT(@@SESSION.sql_auto_is_null)
 1
 1 Expected
 '#---------------------BS_STVARS_044_03----------------------#'
-SELECT @@SESSION.sql_auto_is_null = VARIABLE_VALUE 
+SELECT IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_auto_is_null';
-@@SESSION.sql_auto_is_null = VARIABLE_VALUE
-0
+IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE
+1
 1 Expected
 SELECT COUNT(@@SESSION.sql_auto_is_null);
 COUNT(@@SESSION.sql_auto_is_null)

=== modified file 'mysql-test/r/sql_big_selects_basic.result'
--- a/mysql-test/r/sql_big_selects_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_big_selects_basic.result	2008-10-29 17:59:49 +0000
@@ -66,10 +66,10 @@ WHERE VARIABLE_NAME='sql_big_selects';
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_153_07------------------------#'
-SELECT @@session.sql_big_selects = VARIABLE_VALUE 
+SELECT IF(@@session.sql_big_selects, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_big_selects';
-@@session.sql_big_selects = VARIABLE_VALUE
+IF(@@session.sql_big_selects, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.sql_big_selects;
 @@session.sql_big_selects

=== modified file 'mysql-test/r/sql_big_tables_basic.result'
--- a/mysql-test/r/sql_big_tables_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_big_tables_basic.result	2008-10-29 17:59:49 +0000
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_big_tables';
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_154_07------------------------#'
-SELECT @@session.sql_big_tables = VARIABLE_VALUE 
+SELECT IF(@@session.sql_big_tables, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_big_tables';
-@@session.sql_big_tables = VARIABLE_VALUE
+IF(@@session.sql_big_tables, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.sql_big_tables;
 @@session.sql_big_tables

=== modified file 'mysql-test/r/sql_buffer_result_basic.result'
--- a/mysql-test/r/sql_buffer_result_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_buffer_result_basic.result	2008-10-29 17:59:49 +0000
@@ -79,10 +79,10 @@ WHERE VARIABLE_NAME='sql_buffer_result';
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_155_07------------------------#'
-SELECT @@session.sql_buffer_result = VARIABLE_VALUE 
+SELECT IF(@@session.sql_buffer_result, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_buffer_result';
-@@session.sql_buffer_result = VARIABLE_VALUE
+IF(@@session.sql_buffer_result, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.sql_buffer_result;
 @@session.sql_buffer_result

=== modified file 'mysql-test/r/sql_log_bin_basic.result'
--- a/mysql-test/r/sql_log_bin_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_log_bin_basic.result	2008-10-29 17:59:49 +0000
@@ -69,10 +69,10 @@ SELECT count(VARIABLE_VALUE) FROM INFORM
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_156_07------------------------#'
-SELECT @@session.sql_log_bin = VARIABLE_VALUE 
+SELECT IF(@@session.sql_log_bin, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_log_bin';
-@@session.sql_log_bin = VARIABLE_VALUE
+IF(@@session.sql_log_bin, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.sql_log_bin;
 @@session.sql_log_bin

=== modified file 'mysql-test/r/sql_log_off_basic.result'
--- a/mysql-test/r/sql_log_off_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_log_off_basic.result	2008-10-29 17:59:49 +0000
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_log_off';
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_157_07------------------------#'
-SELECT @@session.sql_log_off = VARIABLE_VALUE 
+SELECT IF(@@session.sql_log_off, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_log_off';
-@@session.sql_log_off = VARIABLE_VALUE
+IF(@@session.sql_log_off, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.sql_log_off;
 @@session.sql_log_off

=== modified file 'mysql-test/r/sql_low_priority_updates_basic.result'
--- a/mysql-test/r/sql_low_priority_updates_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_low_priority_updates_basic.result	2008-10-29 17:59:49 +0000
@@ -102,10 +102,10 @@ SELECT @@session.sql_low_priority_update
 res_is_1
 1
 '#----------------------FN_DYNVARS_159_06------------------------#'
-SELECT @@global.sql_low_priority_updates = VARIABLE_VALUE 
+SELECT IF(@@global.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='sql_low_priority_updates';
-@@global.sql_low_priority_updates = VARIABLE_VALUE
+IF(@@global.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@global.sql_low_priority_updates;
 @@global.sql_low_priority_updates
@@ -116,11 +116,11 @@ WHERE VARIABLE_NAME='sql_low_priority_up
 VARIABLE_VALUE
 OFF
 '#----------------------FN_DYNVARS_159_07------------------------#'
-SELECT @@session.sql_low_priority_updates = VARIABLE_VALUE 
+SELECT IF(@@session.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_low_priority_updates';
-@@session.sql_low_priority_updates = VARIABLE_VALUE
-0
+IF(@@session.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
+1
 SELECT @@session.sql_low_priority_updates;
 @@session.sql_low_priority_updates
 1

=== modified file 'mysql-test/r/sql_notes_basic.result'
--- a/mysql-test/r/sql_notes_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_notes_basic.result	2008-10-29 17:59:49 +0000
@@ -69,10 +69,10 @@ SELECT count(VARIABLE_VALUE) FROM INFORM
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_161_07------------------------#'
-SELECT @@session.sql_notes = VARIABLE_VALUE 
+SELECT IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_notes';
-@@session.sql_notes = VARIABLE_VALUE
+IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.sql_notes;
 @@session.sql_notes

=== modified file 'mysql-test/r/sql_quote_show_create_basic.result'
--- a/mysql-test/r/sql_quote_show_create_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_quote_show_create_basic.result	2008-10-29 17:59:49 +0000
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_quote_show_crea
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_162_07------------------------#'
-SELECT @@session.sql_quote_show_create = VARIABLE_VALUE 
+SELECT IF(@@session.sql_quote_show_create, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_quote_show_create';
-@@session.sql_quote_show_create = VARIABLE_VALUE
+IF(@@session.sql_quote_show_create, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.sql_quote_show_create;
 @@session.sql_quote_show_create

=== modified file 'mysql-test/r/sql_safe_updates_basic.result'
--- a/mysql-test/r/sql_safe_updates_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_safe_updates_basic.result	2008-10-29 17:59:49 +0000
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_safe_updates';
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_163_07------------------------#'
-SELECT @@session.sql_safe_updates = VARIABLE_VALUE 
+SELECT IF(@@session.sql_safe_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_safe_updates';
-@@session.sql_safe_updates = VARIABLE_VALUE
+IF(@@session.sql_safe_updates, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.sql_safe_updates;
 @@session.sql_safe_updates

=== modified file 'mysql-test/r/sql_warnings_basic.result'
--- a/mysql-test/r/sql_warnings_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sql_warnings_basic.result	2008-10-29 17:59:49 +0000
@@ -71,10 +71,10 @@ WHERE VARIABLE_NAME='sql_warnings';
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_166_07------------------------#'
-SELECT @@session.sql_warnings = VARIABLE_VALUE 
+SELECT IF(@@session.sql_warnings, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_warnings';
-@@session.sql_warnings = VARIABLE_VALUE
+IF(@@session.sql_warnings, "ON", "OFF") = VARIABLE_VALUE
 1
 SELECT @@session.sql_warnings;
 @@session.sql_warnings

=== modified file 'mysql-test/r/sync_frm_basic.result'
--- a/mysql-test/r/sync_frm_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/sync_frm_basic.result	2008-10-29 17:59:49 +0000
@@ -69,10 +69,10 @@ ERROR HY000: Variable 'sync_frm' is a GL
 SELECT @@session.sync_frm;
 ERROR HY000: Variable 'sync_frm' is a GLOBAL variable
 '#----------------------FN_DYNVARS_169_06------------------------#'
-SELECT @@global.sync_frm = VARIABLE_VALUE 
+SELECT IF(@@global.sync_frm, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='sync_frm';
-@@global.sync_frm = VARIABLE_VALUE
+IF(@@global.sync_frm, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_169_07----------------------#'
 SET @@global.sync_frm = 1;

=== modified file 'mysql-test/r/timed_mutexes_basic.result'
--- a/mysql-test/r/timed_mutexes_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/timed_mutexes_basic.result	2008-10-29 17:59:49 +0000
@@ -67,11 +67,11 @@ WHERE VARIABLE_NAME='timed_mutexes';
 count(VARIABLE_VALUE)
 1
 '#----------------------FN_DYNVARS_177_07------------------------#'
-SELECT @@global.timed_mutexes = VARIABLE_VALUE
+SELECT IF(@@global.timed_mutexes, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='timed_mutexes';
-@@global.timed_mutexes = VARIABLE_VALUE
-0
+IF(@@global.timed_mutexes, "ON", "OFF") = VARIABLE_VALUE
+1
 SELECT @@global.timed_mutexes;
 @@global.timed_mutexes
 1

=== modified file 'mysql-test/r/type_varchar.result'
--- a/mysql-test/r/type_varchar.result	2006-12-05 09:19:56 +0000
+++ b/mysql-test/r/type_varchar.result	2008-10-29 17:59:49 +0000
@@ -489,3 +489,23 @@ Warnings:
 Warning	1292	Truncated incorrect INTEGER value: '1a'
 Warning	1292	Truncated incorrect INTEGER value: 't'
 DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+5 = a
+1
+0
+0
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: 's'
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+5 = a
+1
+0
+0
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: 's               '
+DROP TABLE t1;

=== modified file 'mysql-test/r/unique_checks_basic.result'
--- a/mysql-test/r/unique_checks_basic.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/unique_checks_basic.result	2008-10-29 17:59:49 +0000
@@ -58,10 +58,10 @@ ERROR 42000: Variable 'unique_checks' ca
 SET @@session.unique_checks = 123456789031;
 ERROR 42000: Variable 'unique_checks' can't be set to the value of '123456789031'
 '#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.unique_checks = VARIABLE_VALUE 
+SELECT IF(@@session.unique_checks, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='unique_checks';
-@@session.unique_checks = VARIABLE_VALUE
+IF(@@session.unique_checks, "ON", "OFF") = VARIABLE_VALUE
 1
 '#---------------------FN_DYNVARS_001_08----------------------#'
 SET @@unique_checks = 1;

=== modified file 'mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test'
--- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test	2008-07-03 08:27:25 +0000
+++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test	2008-10-29 17:59:49 +0000
@@ -145,7 +145,9 @@ create table t3 select 1 union select UU
 create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
 create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
 # what if UUID() is first:
+--disable_warnings
 insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+--enable_warnings
 
 # inside a stored procedure
 

=== modified file 'mysql-test/t/auto_commit_basic.test'
--- a/mysql-test/t/auto_commit_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/auto_commit_basic.test	2008-10-29 17:59:49 +0000
@@ -113,7 +113,7 @@ SELECT @@global.autocommit;
 #     Check if the value in SESSION Table matches value in variable     #
 #########################################################################
 
-SELECT @@session.autocommit = VARIABLE_VALUE 
+SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='autocommit';
 --echo Bug # 34839: Values in variable and information_schema do not match for autocommit
@@ -124,7 +124,7 @@ WHERE VARIABLE_NAME='autocommit';
 #########################################################################
 
 SET @@autocommit = 1;
-SELECT @@autocommit = VARIABLE_VALUE
+SELECT IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='autocommit';
 

=== modified file 'mysql-test/t/automatic_sp_privileges_basic.test'
--- a/mysql-test/t/automatic_sp_privileges_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/automatic_sp_privileges_basic.test	2008-10-29 17:59:49 +0000
@@ -113,7 +113,7 @@ SELECT @@session.automatic_sp_privileges
 # Check if the value in GLOBAL Tables matches values in variable             #
 ##############################################################################
 
-SELECT @@global.automatic_sp_privileges = VARIABLE_VALUE 
+SELECT IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='automatic_sp_privileges';
 echo 'Bug# 34839: Values in variable and information_schema donot match';

=== modified file 'mysql-test/t/big_tables_basic.test'
--- a/mysql-test/t/big_tables_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/big_tables_basic.test	2008-10-29 17:59:49 +0000
@@ -107,7 +107,7 @@ SELECT @@global.big_tables;
 # Check if the value in  SESSION Tables matches values in variable           #
 ##############################################################################
 
-SELECT @@big_tables = VARIABLE_VALUE 
+SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='big_tables';
 --echo Bug # 34839: Values in variable and information_schema do not match for autocommit

=== modified file 'mysql-test/t/engine_condition_pushdown_basic.test'
--- a/mysql-test/t/engine_condition_pushdown_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/engine_condition_pushdown_basic.test	2008-10-29 17:59:49 +0000
@@ -160,7 +160,7 @@ SELECT @@session.engine_condition_pushdo
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@global.engine_condition_pushdown = VARIABLE_VALUE 
+SELECT IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='engine_condition_pushdown';
 SELECT @@global.engine_condition_pushdown;
@@ -173,7 +173,7 @@ WHERE VARIABLE_NAME='engine_condition_pu
 #     Check if the value in SESSION Table matches value in variable     #
 #########################################################################
 
-SELECT @@session.engine_condition_pushdown = VARIABLE_VALUE 
+SELECT IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='engine_condition_pushdown';
 SELECT @@session.engine_condition_pushdown;

=== modified file 'mysql-test/t/flush_basic.test'
--- a/mysql-test/t/flush_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/flush_basic.test	2008-10-29 17:59:49 +0000
@@ -120,7 +120,7 @@ SELECT @@session.flush;
 # Check if the value in GLOBAL Tables matches values in variable   #
 ####################################################################
 
-SELECT @@global.flush = VARIABLE_VALUE 
+SELECT IF(@@global.flush, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='flush';
 

=== modified file 'mysql-test/t/foreign_key_checks_basic.test'
--- a/mysql-test/t/foreign_key_checks_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/foreign_key_checks_basic.test	2008-10-29 17:59:49 +0000
@@ -131,7 +131,7 @@ SELECT count(VARIABLE_VALUE) FROM INFORM
 #     Check if the value in GLOBAL Table matches value in variable     #
 #########################################################################
 
-SELECT @@session.foreign_key_checks = VARIABLE_VALUE 
+SELECT IF(@@session.foreign_key_checks, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='foreign_key_checks';
 SELECT @@session.foreign_key_checks;

=== modified file 'mysql-test/t/general_log_basic.test'
--- a/mysql-test/t/general_log_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/general_log_basic.test	2008-10-29 17:59:49 +0000
@@ -103,7 +103,7 @@ SELECT @@session.general_log;
 # Check if the value in GLOBAL Tables matches values in variable             #
 ##############################################################################
 
-SELECT @@global.general_log = VARIABLE_VALUE 
+SELECT IF(@@global.general_log, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='general_log';
 

=== modified file 'mysql-test/t/innodb_checksums_basic.test'
--- a/mysql-test/t/innodb_checksums_basic.test	2008-04-14 15:21:18 +0000
+++ b/mysql-test/t/innodb_checksums_basic.test	2008-10-29 17:59:49 +0000
@@ -52,7 +52,7 @@ SELECT COUNT(@@GLOBAL.innodb_checksums);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
-SELECT @@GLOBAL.innodb_checksums = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_checksums, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_checksums';
 --echo 1 Expected

=== modified file 'mysql-test/t/innodb_doublewrite_basic.test'
--- a/mysql-test/t/innodb_doublewrite_basic.test	2008-04-14 15:21:18 +0000
+++ b/mysql-test/t/innodb_doublewrite_basic.test	2008-10-29 17:59:49 +0000
@@ -52,7 +52,7 @@ SELECT COUNT(@@GLOBAL.innodb_doublewrite
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
-SELECT @@GLOBAL.innodb_doublewrite = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_doublewrite';
 --echo 1 Expected

=== modified file 'mysql-test/t/innodb_file_per_table_basic.test'
--- a/mysql-test/t/innodb_file_per_table_basic.test	2008-04-14 15:21:18 +0000
+++ b/mysql-test/t/innodb_file_per_table_basic.test	2008-10-29 17:59:49 +0000
@@ -52,7 +52,7 @@ SELECT COUNT(@@GLOBAL.innodb_file_per_ta
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
-SELECT @@GLOBAL.innodb_file_per_table = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_file_per_table, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_file_per_table';
 --echo 1 Expected

=== modified file 'mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test'
--- a/mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test	2008-04-14 15:21:18 +0000
+++ b/mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test	2008-10-29 17:59:49 +0000
@@ -52,7 +52,7 @@ SELECT COUNT(@@GLOBAL.innodb_locks_unsaf
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
-SELECT @@GLOBAL.innodb_locks_unsafe_for_binlog = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_locks_unsafe_for_binlog, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_locks_unsafe_for_binlog';
 --echo 1 Expected

=== modified file 'mysql-test/t/innodb_rollback_on_timeout_basic.test'
--- a/mysql-test/t/innodb_rollback_on_timeout_basic.test	2008-04-14 15:21:18 +0000
+++ b/mysql-test/t/innodb_rollback_on_timeout_basic.test	2008-10-29 17:59:49 +0000
@@ -52,7 +52,7 @@ SELECT COUNT(@@GLOBAL.innodb_rollback_on
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
-SELECT @@GLOBAL.innodb_rollback_on_timeout = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_rollback_on_timeout, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_rollback_on_timeout';
 --echo 1 Expected

=== modified file 'mysql-test/t/innodb_support_xa_basic.test'
--- a/mysql-test/t/innodb_support_xa_basic.test	2008-04-14 15:21:18 +0000
+++ b/mysql-test/t/innodb_support_xa_basic.test	2008-10-29 17:59:49 +0000
@@ -169,7 +169,7 @@ SELECT @@session.innodb_support_xa AS re
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@global.innodb_support_xa =
+SELECT IF(@@global.innodb_support_xa, "ON", "OFF") =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_support_xa';
 SELECT @@global.innodb_support_xa;
@@ -182,7 +182,7 @@ SELECT VARIABLE_VALUE FROM INFORMATION_S
 #     Check if the value in SESSION Table matches value in variable     #
 #########################################################################
 
-SELECT @@session.innodb_support_xa =
+SELECT IF(@@session.innodb_support_xa, "ON", "OFF") =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
   WHERE VARIABLE_NAME='innodb_support_xa';
 SELECT @@session.innodb_support_xa;

=== modified file 'mysql-test/t/innodb_table_locks_basic.test'
--- a/mysql-test/t/innodb_table_locks_basic.test	2008-04-14 15:21:18 +0000
+++ b/mysql-test/t/innodb_table_locks_basic.test	2008-10-29 17:59:49 +0000
@@ -167,7 +167,7 @@ SELECT @@session.innodb_table_locks AS r
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@global.innodb_table_locks =
+SELECT IF(@@global.innodb_table_locks, "ON", "OFF") =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_table_locks';
 SELECT @@global.innodb_table_locks;
@@ -179,7 +179,7 @@ SELECT VARIABLE_VALUE FROM INFORMATION_S
 #     Check if the value in SESSION Table matches value in variable     #
 #########################################################################
 
-SELECT @@session.innodb_table_locks =
+SELECT IF(@@session.innodb_table_locks, "ON", "OFF") =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
   WHERE VARIABLE_NAME='innodb_table_locks';
 SELECT @@session.innodb_table_locks;

=== modified file 'mysql-test/t/keep_files_on_create_basic.test'
--- a/mysql-test/t/keep_files_on_create_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/keep_files_on_create_basic.test	2008-10-29 17:59:49 +0000
@@ -156,7 +156,7 @@ SELECT @@session.keep_files_on_create;
 ####################################################################
 
 
-SELECT @@global.keep_files_on_create = VARIABLE_VALUE 
+SELECT IF(@@global.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='keep_files_on_create';
 
@@ -165,7 +165,7 @@ WHERE VARIABLE_NAME='keep_files_on_creat
 #  Check if the value in SESSION Table matches value in variable   #
 ####################################################################
 
-SELECT @@session.keep_files_on_create = VARIABLE_VALUE 
+SELECT IF(@@session.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='keep_files_on_create';
 

=== modified file 'mysql-test/t/local_infile_basic.test'
--- a/mysql-test/t/local_infile_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/local_infile_basic.test	2008-10-29 17:59:49 +0000
@@ -112,7 +112,7 @@ SELECT @@session.local_infile = 1;
 # Check if the value in GLOBAL Tables matches values in variable   #
 ####################################################################
 
-SELECT @@global.local_infile = VARIABLE_VALUE 
+SELECT IF(@@global.local_infile, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='local_infile';
 

=== modified file 'mysql-test/t/log_bin_trust_function_creators_basic.test'
--- a/mysql-test/t/log_bin_trust_function_creators_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/log_bin_trust_function_creators_basic.test	2008-10-29 17:59:49 +0000
@@ -122,12 +122,12 @@ SET @@global.log_bin_trust_function_crea
 ###############################################################################
 
 
-SELECT @@global.log_bin_trust_function_creators = VARIABLE_VALUE 
+SELECT IF(@@global.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='log_bin_trust_function_creators';
 
 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.log_bin_trust_function_creators = VARIABLE_VALUE 
+SELECT IF(@@session.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='log_bin_trust_function_creators';
 

=== modified file 'mysql-test/t/log_bin_trust_routine_creators_basic.test'
--- a/mysql-test/t/log_bin_trust_routine_creators_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/log_bin_trust_routine_creators_basic.test	2008-10-29 17:59:49 +0000
@@ -119,10 +119,10 @@ SET @@global.log_bin_trust_routine_creat
 ###############################################################################
 
 
-SELECT @@global.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
+SELECT IF(@@global.log_bin_trust_routine_creators, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
 
 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
+SELECT IF(@@session.log_bin_trust_routine_creators, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators';
 
 
 --echo '#---------------------FN_DYNVARS_064_07----------------------#'

=== modified file 'mysql-test/t/log_queries_not_using_indexes_basic.test'
--- a/mysql-test/t/log_queries_not_using_indexes_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/log_queries_not_using_indexes_basic.test	2008-10-29 17:59:49 +0000
@@ -53,7 +53,7 @@ SELECT COUNT(@@GLOBAL.log_queries_not_us
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
-SELECT @@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='log_queries_not_using_indexes';
 --echo 1 Expected

=== modified file 'mysql-test/t/low_priority_updates_basic.test'
--- a/mysql-test/t/low_priority_updates_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/low_priority_updates_basic.test	2008-10-29 17:59:49 +0000
@@ -156,7 +156,7 @@ SET @@session.low_priority_updates = tes
 ####################################################################
 
 
-SELECT @@global.low_priority_updates = VARIABLE_VALUE 
+SELECT IF(@@global.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='low_priority_updates';
 
@@ -165,7 +165,7 @@ WHERE VARIABLE_NAME='low_priority_update
 #  Check if the value in SESSION Table matches value in variable   #
 ####################################################################
 
-SELECT @@session.low_priority_updates = VARIABLE_VALUE 
+SELECT IF(@@session.low_priority_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='low_priority_updates';
 

=== modified file 'mysql-test/t/myisam_use_mmap_basic.test'
--- a/mysql-test/t/myisam_use_mmap_basic.test	2008-04-30 12:49:37 +0000
+++ b/mysql-test/t/myisam_use_mmap_basic.test	2008-10-29 17:59:49 +0000
@@ -54,7 +54,7 @@ SELECT COUNT(@@GLOBAL.myisam_use_mmap);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
-SELECT @@GLOBAL.myisam_use_mmap = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.myisam_use_mmap, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='myisam_use_mmap';
 --echo 1 Expected

=== modified file 'mysql-test/t/new_basic.test'
--- a/mysql-test/t/new_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/new_basic.test	2008-10-29 17:59:49 +0000
@@ -154,7 +154,7 @@ SET @@session.new = test;
 ####################################################################
 
 
-SELECT @@global.new = VARIABLE_VALUE 
+SELECT IF(@@global.new, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='new';
 
@@ -163,7 +163,7 @@ WHERE VARIABLE_NAME='new';
 #  Check if the value in SESSION Table matches value in variable   #
 ####################################################################
 
-SELECT @@session.new = VARIABLE_VALUE 
+SELECT IF(@@session.new, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='new';
 

=== modified file 'mysql-test/t/old_passwords_basic.test'
--- a/mysql-test/t/old_passwords_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/old_passwords_basic.test	2008-10-29 17:59:49 +0000
@@ -154,7 +154,7 @@ SET @@session.old_passwords = test;
 ####################################################################
 
 
-SELECT @@global.old_passwords = VARIABLE_VALUE 
+SELECT IF(@@global.old_passwords, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='old_passwords';
 
@@ -163,7 +163,7 @@ WHERE VARIABLE_NAME='old_passwords';
 #  Check if the value in SESSION Table matches value in variable   #
 ####################################################################
 
-SELECT @@session.old_passwords = VARIABLE_VALUE 
+SELECT IF(@@session.old_passwords, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='old_passwords';
 

=== modified file 'mysql-test/t/query_cache_wlock_invalidate_basic.test'
--- a/mysql-test/t/query_cache_wlock_invalidate_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/query_cache_wlock_invalidate_basic.test	2008-10-29 17:59:49 +0000
@@ -165,7 +165,7 @@ SELECT @@session.query_cache_wlock_inval
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@global.query_cache_wlock_invalidate = VARIABLE_VALUE 
+SELECT IF(@@global.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
 SELECT @@global.query_cache_wlock_invalidate;
@@ -178,7 +178,7 @@ WHERE VARIABLE_NAME='query_cache_wlock_i
 #     Check if the value in SESSION Table matches value in variable     #
 #########################################################################
 
-SELECT @@session.query_cache_wlock_invalidate = VARIABLE_VALUE 
+SELECT IF(@@session.query_cache_wlock_invalidate, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='query_cache_wlock_invalidate';
 SELECT @@session.query_cache_wlock_invalidate;

=== modified file 'mysql-test/t/read_only_basic.test'
--- a/mysql-test/t/read_only_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/read_only_basic.test	2008-10-29 17:59:49 +0000
@@ -121,11 +121,11 @@ SELECT @@read_only;
 # Check if the value in GLOBAL & SESSION Tables matches values in variable   #
 ##############################################################################
 
-SELECT @@global.read_only = VARIABLE_VALUE 
+SELECT IF(@@global.read_only, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='read_only';
 
-SELECT @@read_only = VARIABLE_VALUE 
+SELECT IF(@@read_only, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='read_only';
 

=== modified file 'mysql-test/t/relay_log_purge_basic.test'
--- a/mysql-test/t/relay_log_purge_basic.test	2008-04-11 19:59:33 +0000
+++ b/mysql-test/t/relay_log_purge_basic.test	2008-10-29 17:59:49 +0000
@@ -123,7 +123,7 @@ SELECT @@session.relay_log_purge;
 # Check if the value in GLOBAL  Tables matches values in variable   #
 #####################################################################
 
-SELECT @@global.relay_log_purge = VARIABLE_VALUE 
+SELECT IF(@@global.relay_log_purge, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='relay_log_purge';
 

=== modified file 'mysql-test/t/secure_auth_basic.test'
--- a/mysql-test/t/secure_auth_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/secure_auth_basic.test	2008-10-29 17:59:49 +0000
@@ -130,7 +130,7 @@ WHERE VARIABLE_NAME='secure_auth';
 #     Check if the value in GLOBAL Table matches value in variable     #
 ########################################################################
 
-SELECT @@global.secure_auth = VARIABLE_VALUE 
+SELECT IF(@@global.secure_auth, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='secure_auth';
 SELECT @@global.secure_auth;

=== modified file 'mysql-test/t/slave_compressed_protocol_basic.test'
--- a/mysql-test/t/slave_compressed_protocol_basic.test	2008-04-11 19:59:33 +0000
+++ b/mysql-test/t/slave_compressed_protocol_basic.test	2008-10-29 17:59:49 +0000
@@ -127,7 +127,7 @@ WHERE VARIABLE_NAME='slave_compressed_pr
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@global.slave_compressed_protocol = VARIABLE_VALUE 
+SELECT IF(@@global.slave_compressed_protocol, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='slave_compressed_protocol';
 SELECT @@global.slave_compressed_protocol;

=== modified file 'mysql-test/t/slow_query_log_basic.test'
--- a/mysql-test/t/slow_query_log_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/slow_query_log_basic.test	2008-10-29 17:59:49 +0000
@@ -104,7 +104,7 @@ SELECT @@session.slow_query_log;
 # Check if the value in GLOBAL Tables matches values in variable             #
 ##############################################################################
 
-SELECT @@global.slow_query_log = VARIABLE_VALUE 
+SELECT IF(@@global.slow_query_log, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='slow_query_log';
 

=== modified file 'mysql-test/t/sp-vars.test'
--- a/mysql-test/t/sp-vars.test	2007-05-18 12:29:24 +0000
+++ b/mysql-test/t/sp-vars.test	2008-10-29 17:59:49 +0000
@@ -1448,3 +1448,42 @@ drop function f1;
 drop table t1;
 # End of 5.1 tests.
 
+
+###########################################################################
+#
+# Test case for BUG#28299: To-number conversion warnings work
+# differenly with CHAR and VARCHAR sp variables
+#
+###########################################################################
+
+--echo
+--echo ---------------------------------------------------------------
+--echo BUG#28299
+--echo ---------------------------------------------------------------
+--echo
+
+DELIMITER |;
+CREATE PROCEDURE ctest()
+BEGIN
+  DECLARE i CHAR(16);
+  DECLARE j INT;
+  SET i= 'string';
+  SET j= 1 + i;
+END|
+DELIMITER ;|
+
+CALL ctest();
+DROP PROCEDURE ctest;
+
+DELIMITER |;
+CREATE PROCEDURE vctest()
+BEGIN
+  DECLARE i VARCHAR(16);
+  DECLARE j INT;
+  SET i= 'string';
+  SET j= 1 + i;
+END|
+DELIMITER ;|
+
+CALL vctest();
+DROP PROCEDURE vctest;

=== modified file 'mysql-test/t/sql_auto_is_null_basic.test'
--- a/mysql-test/t/sql_auto_is_null_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_auto_is_null_basic.test	2008-10-29 17:59:49 +0000
@@ -55,7 +55,7 @@ SELECT COUNT(@@SESSION.sql_auto_is_null)
 # Check if the value in SESSION Table matches value in variable #
 #################################################################
 
-SELECT @@SESSION.sql_auto_is_null = VARIABLE_VALUE 
+SELECT IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_auto_is_null';
 --echo 1 Expected

=== modified file 'mysql-test/t/sql_big_selects_basic.test'
--- a/mysql-test/t/sql_big_selects_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_big_selects_basic.test	2008-10-29 17:59:49 +0000
@@ -132,7 +132,7 @@ WHERE VARIABLE_NAME='sql_big_selects';
 #     Check if the value in GLOBAL Table matches value in variable     #
 ########################################################################
 
-SELECT @@session.sql_big_selects = VARIABLE_VALUE 
+SELECT IF(@@session.sql_big_selects, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_big_selects';
 SELECT @@session.sql_big_selects;

=== modified file 'mysql-test/t/sql_big_tables_basic.test'
--- a/mysql-test/t/sql_big_tables_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_big_tables_basic.test	2008-10-29 17:59:49 +0000
@@ -135,7 +135,7 @@ WHERE VARIABLE_NAME='sql_big_tables';
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@session.sql_big_tables = VARIABLE_VALUE 
+SELECT IF(@@session.sql_big_tables, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_big_tables';
 SELECT @@session.sql_big_tables;

=== modified file 'mysql-test/t/sql_buffer_result_basic.test'
--- a/mysql-test/t/sql_buffer_result_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_buffer_result_basic.test	2008-10-29 17:59:49 +0000
@@ -144,7 +144,7 @@ WHERE VARIABLE_NAME='sql_buffer_result';
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@session.sql_buffer_result = VARIABLE_VALUE 
+SELECT IF(@@session.sql_buffer_result, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_buffer_result';
 SELECT @@session.sql_buffer_result;

=== modified file 'mysql-test/t/sql_log_bin_basic.test'
--- a/mysql-test/t/sql_log_bin_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_log_bin_basic.test	2008-10-29 17:59:49 +0000
@@ -134,7 +134,7 @@ SELECT count(VARIABLE_VALUE) FROM INFORM
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@session.sql_log_bin = VARIABLE_VALUE 
+SELECT IF(@@session.sql_log_bin, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_log_bin';
 SELECT @@session.sql_log_bin;

=== modified file 'mysql-test/t/sql_log_off_basic.test'
--- a/mysql-test/t/sql_log_off_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_log_off_basic.test	2008-10-29 17:59:49 +0000
@@ -135,7 +135,7 @@ WHERE VARIABLE_NAME='sql_log_off';
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@session.sql_log_off = VARIABLE_VALUE 
+SELECT IF(@@session.sql_log_off, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_log_off';
 SELECT @@session.sql_log_off;

=== modified file 'mysql-test/t/sql_low_priority_updates_basic.test'
--- a/mysql-test/t/sql_low_priority_updates_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_low_priority_updates_basic.test	2008-10-29 17:59:49 +0000
@@ -166,7 +166,7 @@ SELECT @@session.sql_low_priority_update
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@global.sql_low_priority_updates = VARIABLE_VALUE 
+SELECT IF(@@global.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='sql_low_priority_updates';
 SELECT @@global.sql_low_priority_updates;
@@ -179,7 +179,7 @@ WHERE VARIABLE_NAME='sql_low_priority_up
 #     Check if the value in SESSION Table matches value in variable     #
 #########################################################################
 
-SELECT @@session.sql_low_priority_updates = VARIABLE_VALUE 
+SELECT IF(@@session.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_low_priority_updates';
 SELECT @@session.sql_low_priority_updates;

=== modified file 'mysql-test/t/sql_notes_basic.test'
--- a/mysql-test/t/sql_notes_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_notes_basic.test	2008-10-29 17:59:49 +0000
@@ -135,7 +135,7 @@ SELECT count(VARIABLE_VALUE) FROM INFORM
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@session.sql_notes = VARIABLE_VALUE 
+SELECT IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_notes';
 SELECT @@session.sql_notes;

=== modified file 'mysql-test/t/sql_quote_show_create_basic.test'
--- a/mysql-test/t/sql_quote_show_create_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_quote_show_create_basic.test	2008-10-29 17:59:49 +0000
@@ -136,7 +136,7 @@ WHERE VARIABLE_NAME='sql_quote_show_crea
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@session.sql_quote_show_create = VARIABLE_VALUE 
+SELECT IF(@@session.sql_quote_show_create, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_quote_show_create';
 SELECT @@session.sql_quote_show_create;

=== modified file 'mysql-test/t/sql_safe_updates_basic.test'
--- a/mysql-test/t/sql_safe_updates_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_safe_updates_basic.test	2008-10-29 17:59:49 +0000
@@ -135,7 +135,7 @@ WHERE VARIABLE_NAME='sql_safe_updates';
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@session.sql_safe_updates = VARIABLE_VALUE 
+SELECT IF(@@session.sql_safe_updates, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_safe_updates';
 SELECT @@session.sql_safe_updates;

=== modified file 'mysql-test/t/sql_warnings_basic.test'
--- a/mysql-test/t/sql_warnings_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sql_warnings_basic.test	2008-10-29 17:59:49 +0000
@@ -140,7 +140,7 @@ WHERE VARIABLE_NAME='sql_warnings';
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@session.sql_warnings = VARIABLE_VALUE 
+SELECT IF(@@session.sql_warnings, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='sql_warnings';
 SELECT @@session.sql_warnings;

=== modified file 'mysql-test/t/sync_frm_basic.test'
--- a/mysql-test/t/sync_frm_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/sync_frm_basic.test	2008-10-29 17:59:49 +0000
@@ -121,7 +121,7 @@ SELECT @@session.sync_frm;
 # Check if the value in GLOBAL Tables matches values in variable   #
 ####################################################################
 
-SELECT @@global.sync_frm = VARIABLE_VALUE 
+SELECT IF(@@global.sync_frm, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='sync_frm';
 

=== modified file 'mysql-test/t/timed_mutexes_basic.test'
--- a/mysql-test/t/timed_mutexes_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/timed_mutexes_basic.test	2008-10-29 17:59:49 +0000
@@ -128,7 +128,7 @@ WHERE VARIABLE_NAME='timed_mutexes';
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
-SELECT @@global.timed_mutexes = VARIABLE_VALUE
+SELECT IF(@@global.timed_mutexes, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='timed_mutexes';
 SELECT @@global.timed_mutexes;

=== modified file 'mysql-test/t/type_varchar.test'
--- a/mysql-test/t/type_varchar.test	2007-06-06 17:57:07 +0000
+++ b/mysql-test/t/type_varchar.test	2008-10-29 17:59:49 +0000
@@ -198,3 +198,21 @@ SELECT a,(a + 0) FROM t1 ORDER BY a;
 SELECT a,(a DIV 2) FROM t1 ORDER BY a;
 SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a;
 DROP TABLE t1;
+
+#
+# Bug #28299: To-number conversion warnings work differenly with CHAR
+# and VARCHAR sp variables
+#
+# * Verify that 'Truncated incorrect DOUBLE value' is shown for 's' 
+#   when using both CHAR and VARCHAR.
+#
+
+CREATE TABLE t1 (a VARCHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a CHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+DROP TABLE t1;

=== modified file 'mysql-test/t/unique_checks_basic.test'
--- a/mysql-test/t/unique_checks_basic.test	2008-04-10 13:14:28 +0000
+++ b/mysql-test/t/unique_checks_basic.test	2008-10-29 17:59:49 +0000
@@ -121,7 +121,7 @@ SET @@session.unique_checks = 1234567890
 #  Check if the value in SESSION Table matches value in variable   #
 ####################################################################
 
-SELECT @@session.unique_checks = VARIABLE_VALUE 
+SELECT IF(@@session.unique_checks, "ON", "OFF") = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 WHERE VARIABLE_NAME='unique_checks';
 

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2008-07-22 17:53:36 +0000
+++ b/sql/field.cc	2008-10-29 17:59:49 +0000
@@ -7062,25 +7062,56 @@ int Field_varstring::store(longlong nr, 
 }
 
 
+/**
+ *  Check whether the conversion of the varstring value has led to 
+ *  truncation. Issue an error message if this is the case. (Factored
+ *  out from the val_real() and val_int() methods.)
+ */
+void Field_varstring::check_truncation(const char* typestr, CHARSET_INFO* cs, 
+  char* end, uint length, int error)
+{
+  if (!table->in_use->no_errors && 
+       (error || (length != (uint)(end - (char*)ptr+length_bytes) && 
+         !check_if_only_end_space(cs, end, (char*)ptr+length_bytes+length))) )
+  {
+    char buf[max(DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE,
+      LONGLONG_TO_STRING_CONVERSION_BUFFER_SIZE)];
+    String tmp(buf, sizeof(buf), cs);
+    tmp.copy((char*) ptr+length_bytes, length, cs);
+    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                        ER_TRUNCATED_WRONG_VALUE, 
+                        ER(ER_TRUNCATED_WRONG_VALUE),
+                        typestr, tmp.c_ptr());
+  }
+}
+
 double Field_varstring::val_real(void)
 {
   ASSERT_COLUMN_MARKED_FOR_READ;
-  int not_used;
-  char *end_not_used;
+  int error;
+  char *end;
+  double result;
+  CHARSET_INFO* cs= charset();
+  
   uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
-  return my_strntod(field_charset, (char*) ptr+length_bytes, length,
-                    &end_not_used, &not_used);
+  result= my_strntod(cs, (char*)ptr+length_bytes, length, &end, &error);
+  check_truncation("DOUBLE", cs, end, length, error);  
+  return result;
 }
 
 
 longlong Field_varstring::val_int(void)
 {
   ASSERT_COLUMN_MARKED_FOR_READ;
-  int not_used;
-  char *end_not_used;
+  int error;
+  char *end;
+  CHARSET_INFO *cs= charset();
+  
   uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
-  return my_strntoll(field_charset, (char*) ptr+length_bytes, length, 10,
-                     &end_not_used, &not_used);
+  longlong result= my_strntoll(cs, (char*) ptr+length_bytes, length, 10,
+                     &end, &error);
+  check_truncation("INTEGER", cs, end, length, error);
+  return result;
 }
 
 String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
@@ -7092,13 +7123,25 @@ String *Field_varstring::val_str(String 
   return val_ptr;
 }
 
-
 my_decimal *Field_varstring::val_decimal(my_decimal *decimal_value)
 {
   ASSERT_COLUMN_MARKED_FOR_READ;
+  CHARSET_INFO *cs= charset();
   uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
-  str2my_decimal(E_DEC_FATAL_ERROR, (char*) ptr+length_bytes, length,
-                 charset(), decimal_value);
+  int error= str2my_decimal(E_DEC_FATAL_ERROR, (char*) ptr+length_bytes, length,
+                 cs, decimal_value);
+
+  if (!table->in_use->no_errors && error)
+  {
+    char buf[DECIMAL_TO_STRING_CONVERSION_BUFFER_SIZE];
+    String tmp(buf, sizeof(buf), cs);
+    tmp.copy((char*) ptr+length_bytes, length, cs);
+    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                        ER_TRUNCATED_WRONG_VALUE, 
+                        ER(ER_TRUNCATED_WRONG_VALUE),
+                        "DECIMAL", tmp.c_ptr());
+  }
+  
   return decimal_value;
 }
 

=== modified file 'sql/field.h'
--- a/sql/field.h	2008-08-28 09:54:50 +0000
+++ b/sql/field.h	2008-10-29 17:59:49 +0000
@@ -1592,6 +1592,8 @@ public:
   void hash(ulong *nr, ulong *nr2);
 private:
   int do_save_field_metadata(uchar *first_byte);
+  void check_truncation(const char* typestr, CHARSET_INFO* cs, char* end, 
+    uint length, int error);
 };
 
 

Thread
bzr commit into mysql-5.1 branch (staale.smedseng:2737) Bug#28299Staale Smedseng29 Oct