mariadb/mysql-test/r
Alexander Nozdrin a0ab253fbd Auto-merge from mysql-trunk-bugfixing.
******
This patch fixes the following bugs:
  - Bug#5889: Exit handler for a warning doesn't hide the warning in
    trigger
  - Bug#9857: Stored procedures: handler for sqlwarning ignored
  - Bug#23032: Handlers declared in a SP do not handle warnings generated
    in sub-SP
  - Bug#36185: Incorrect precedence for warning and exception handlers

The problem was in the way warnings/errors during stored routine execution
were handled. Prior to this patch the logic was as follows:

  - when a warning/an error happens: if we're executing a stored routine,
    and there is a handler for that warning/error, remember the handler,
    ignore the warning/error and continue execution.

  - after a stored routine instruction is executed: check for a remembered
    handler and activate one (if any).

This logic caused several problems:

  - if one instruction generates several warnings (errors) it's impossible
    to choose the right handler -- a handler for the first generated
    condition was chosen and remembered for activation.

  - mess with handling conditions in scopes different from the current one.

  - not putting generated warnings/errors into Warning Info (Diagnostic
    Area) is against The Standard.

The patch changes the logic as follows:

  - Diagnostic Area is cleared on the beginning of each statement that
    either is able to generate warnings, or is able to work with tables.

  - at the end of a stored routine instruction, Diagnostic Area is left
    intact.

  - Diagnostic Area is checked after each stored routine instruction. If
    an instruction generates several condition, it's now possible to take a
    look at all of them and determine an appropriate handler.

mysql-test/r/signal.result:
  Update result file:
    1. handled conditions are not cleared any more;
    2. reflect changes in signal.test
mysql-test/r/signal_demo3.result:
  Update result file: handled conditions are not cleared any more.
  Due to playing with max_error_count, resulting warning lists
  have changed.
mysql-test/r/sp-big.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/r/sp-bugs.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/r/sp-code.result:
  Update result file:
    1. handled conditions are not cleared any more.
    2. add result for a new test case in sp-code.test.
mysql-test/r/sp-error.result:
  Update result file:
    1. handled conditions are not cleared any more.
    2. add result for a new test case in sp-error.test.
mysql-test/r/sp.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/r/sp_trans.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/r/strict.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/r/view.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/suite/funcs_1/r/innodb_storedproc_02.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/suite/funcs_1/r/memory_storedproc_02.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/suite/funcs_1/r/myisam_storedproc_02.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/suite/funcs_1/r/storedproc.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/suite/rpl/r/rpl_row_sp005.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/suite/rpl/r/rpl_row_trig003.result:
  Update result file: handled conditions are not cleared any more.
mysql-test/t/signal.test:
  Make a test case more readable in the result file.
mysql-test/t/sp-code.test:
  Add a test case for Bug#23032 checking that
  No Data takes precedence on Warning.
mysql-test/t/sp-error.test:
  Adding test cases for:
    - Bug#23032
    - Bug#36185
    - Bug#5889
    - Bug#9857
mysql-test/t/sp.test:
  Fixing test case to reflect behavioral changes made by the patch.
sql/sp_head.cc:
  Reset the per-statement warning count before executing
  a stored procedure instruction.
  
  Move to a separate function code which checks the
  completion status of the executed statement and searches
  for a handler.
  
  Remove redundant code now that search for a handler is
  done after execution, errors are always pushed.
sql/sp_pcontext.h:
  Remove unused code.
sql/sp_rcontext.cc:
  - Polish sp_rcontext::find_handler(): use sp_rcontext::m_hfound instead
    of an extra local variable;
  
  - Remove sp_rcontext::handle_condition();
  
  - Introduce sp_rcontext::activate_handler(), which prepares
    previously found handler for execution.
  
  - Move sp_rcontext::enter_handler() code into activate_handler(),
    because enter_handler() is used only from there;
  
  - Cleanups;
  
  - Introduce DBUG_EXECUTE_IF() for a test case in sp-code.test
sql/sp_rcontext.h:
  - Remove unused code
  - Cleanups
sql/sql_class.cc:
  Merge THD::raise_condition_no_handler() into THD::raise_condition().
  After the patch raise_condition_no_handler() was called
  in raise_condition() only.
sql/sql_class.h:
  Remove raise_condition_no_handler().
sql/sql_error.cc:
  Remove Warning_info::reserve_space() -- handled conditions are not
  cleared any more, so there is no need for RESIGNAL to re-push them.
sql/sql_error.h:
  Remove Warning_info::reserve_space().
sql/sql_signal.cc:
  Handled conditions are not cleared any more,
  so there is no need for RESIGNAL to re-push them.
2010-07-30 19:28:36 +04:00
..
1st.result
alias.result
almost_full.result
alter_table-big.result
alter_table.result Test for bug #53820 "ALTER a MEDIUMINT column table causes full 2010-07-26 13:22:38 +04:00
analyze.result Revert and fix confusion between tests analyse and analyze. Following the 2010-07-12 10:38:38 -03:00
ansi.result
archive-big.result
archive.result Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE 2010-07-26 12:54:20 -03:00
archive_bitfield.result
archive_gis.result
archive_plugin.result
auto_increment.result
backup.result
bench_count_distinct.result
big_test.require
bigint.result
binary.result
binlog_tx_isolation.result
blackhole_plugin.result
bool.result
bootstrap.result
bug39022.result
bug46080.result
bug46261.result
bug46760.result
bug47671.result
bulk_replace.result
cache_innodb.result
case.result
case_insensitive_file_system.require
case_insensitive_fs.require
case_sensitive_file_system.require
cast.result
change_user.result
check.result
check_var_limit.require
client_xml.result
comment_column.result
comment_column2.result
comment_index.result
comment_table.result
comments.result
commit.result
commit_1innodb.result Bug#54453: Failing assertion: trx->active_trans when renaming a 2010-07-20 14:36:15 -03:00
compare.result
compress.result
concurrent_innodb_safelog.result
concurrent_innodb_unsafelog.result
connect.result
consistent_snapshot.result
constraints.result
contributors.result
count_distinct.result
count_distinct2.result
count_distinct3.result
crash_commit_before.result
create-big.result
create.result
create_not_windows.result
create_select_tmp.result
csv.result
csv_alter_table.result
csv_not_null.result
ctype_ascii.result
ctype_big5.result
ctype_binary.result
ctype_collate.result
ctype_cp932_binlog_row.result
ctype_cp932_binlog_stm.result
ctype_cp1250_ch.result
ctype_cp1251.result
ctype_create.result
ctype_errors.result
ctype_eucjpms.result
ctype_euckr.result
ctype_filename.result
ctype_filesystem.result
ctype_gb2312.result
ctype_gbk.result
ctype_gbk_binlog.result
ctype_hebrew.result
ctype_latin1.result
ctype_latin1_de.result
ctype_latin2.result
ctype_latin2_ch.result
ctype_ldml.result
ctype_many.result
ctype_mb.result
ctype_recoding.result
ctype_sjis.result
ctype_tis620.result
ctype_uca.result
ctype_ucs.result
ctype_ucs2_def.result
ctype_ujis.result
ctype_ujis_ucs2.result
ctype_utf8.result
ctype_utf8mb4.result
ctype_utf8mb4_heap.result
ctype_utf8mb4_innodb.result
ctype_utf8mb4_myisam.result
ctype_utf8mb4_ndb.result
ctype_utf16.result
ctype_utf16_uca.result
ctype_utf32.result
ctype_utf32_uca.result
date_formats.result
ddl_i18n_koi8r.result
ddl_i18n_utf8.result
deadlock_innodb.result
debug_sync.result
default.result
delayed.result
delete.result
deprecated_features.result
derived.result
dirty_close.result
disabled_partition.require
distinct.result
drop-no_root.result
drop.result
drop_debug.result
empty_table.result
endspace.result
error_simulation.result
errors.result
events_1.result
events_2.result
events_bugs.result
events_embedded.result
events_grant.result
events_logs_tests.result
events_microsec.result
events_restart.result
events_scheduling.result
events_stress.result
events_time_zone.result
events_trans.result
events_trans_notembedded.result
execution_constants.result
explain.result
fix_priv_tables.result
flush.result
flush2.result
flush_block_commit.result
flush_block_commit_notembedded.result
flush_read_lock_kill.result
flush_table.result
foreign_key.result
fulltext.result
fulltext2.result
fulltext3.result
fulltext_cache.result
fulltext_distinct.result
fulltext_left_join.result
fulltext_multi.result
fulltext_order_by.result
fulltext_plugin.result
fulltext_update.result
fulltext_var.result
func_analyse.result Revert and fix confusion between tests analyse and analyze. Following the 2010-07-12 10:38:38 -03:00
func_compress.result
func_concat.result
func_crypt.result
func_date_add.result
func_default.result
func_des_encrypt.result
func_digest.result
func_encrypt.result
func_encrypt_nossl.result
func_equal.result
func_gconcat.result
func_group.result
func_group_innodb.result
func_if.result
func_in.result
func_isnull.result
func_like.result
func_math.result
func_misc.result
func_op.result
func_regexp.result
func_rollback.result
func_sapdb.result
func_set.result
func_str.result
func_system.result
func_test.result
func_time.result
func_timestamp.result
gcc296.result
gis-rtree.result
gis.result
grant.result
grant2.result
grant3.result
grant4.result
grant_cache_no_prot.result
grant_cache_ps_prot.result
grant_lowercase_fs.result
greedy_optimizer.result
group_by.result Bug#49771: Incorrect MIN/MAX for date/time values. 2010-07-19 21:11:47 +04:00
group_min_max.result
group_min_max_innodb.result
handler_innodb.result
handler_myisam.result
have_big5.require
have_binlog_format_mixed.require
have_binlog_format_row.require
have_binlog_format_statement.require
have_compress.require
have_cp866.require
have_cp932.require
have_cp1250_ch.require
have_cp1251.require
have_crypt.require
have_debug.require
have_debug_sync.require
have_eucjpms.require
have_euckr.require
have_gb2312.require
have_gbk.require
have_geometry.require
have_koi8r.require
have_latin2_ch.require
have_local_infile.require
have_log_bin.require
have_met_timezone.require
have_moscow_leap_timezone.require
have_mysql_upgrade.result
have_ndb_extra.require
have_ndbapi_examples.require
have_nodebug.require
have_outfile.require
have_partition.require
have_perror.require
have_profiling.require
have_query_cache.require
have_sjis.require
have_ssl.require
have_ssl_is_yes_or_disabled_only.require
have_symlink.require
have_tis620.require
have_ucs2.require
have_ujis.require
have_utf8.require
have_utf8mb4.require
have_utf16.require
have_utf32.require
having.result
heap.result
heap_auto_increment.result
heap_btree.result
heap_hash.result Bug #55472: Assertion failed in heap_rfirst function of hp_rfirst.c on 2010-07-29 01:02:43 +04:00
help.result
implicit_commit.result
index_merge_innodb.result
index_merge_myisam.result
information_schema-big.result
information_schema.result merge 2010-07-15 18:46:41 +03:00
information_schema_chmod.result
information_schema_db.result
information_schema_inno.result
information_schema_parameters.result Addendum #3 to bug #53095 : fixed the wrong mysql-trunk tests. 2010-07-09 15:55:13 +03:00
information_schema_part.result
information_schema_routines.result Addendum #3 to bug #53095 : fixed the wrong mysql-trunk tests. 2010-07-09 15:55:13 +03:00
init_connect.result
init_file.result
innodb_ignore_builtin.result
innodb_mysql_lock.result
innodb_mysql_lock2.result
innodb_mysql_sync.result
insert.result
insert_notembedded.result
insert_select.result
insert_update.result
ipv4_as_ipv6.result
ipv6.result
is_debug_build.require
is_embedded.require
isam.result
join.result
join_crash.result
join_nested.result
join_optimizer.result
join_outer.result
join_outer_innodb.result
key.result
key_cache.result
key_diff.result
key_primary.result
keywords.result
kill.result
limit.result
loaddata.result merge 2010-07-14 15:05:20 +03:00
loaddata_autocom_innodb.result
loadxml.result
locale.result
lock.result
lock_multi.result
lock_multi_bug38499.result
lock_multi_bug38691.result
lock_sync.result
lock_tables_lost_commit.result
log_state.result
log_state_bug33693.result
log_tables-big.result
log_tables.result
log_tables_debug.result
log_tables_upgrade.result
long_tmpdir.result
lowercase0.require
lowercase1.require
lowercase2.require
lowercase_fs_off.result
lowercase_mixed_tmpdir.result
lowercase_mixed_tmpdir_innodb.result
lowercase_table.result
lowercase_table2.result merge 2010-07-21 18:20:29 +03:00
lowercase_table3.result
lowercase_table_grant.result
lowercase_table_qcache.result
lowercase_utf8.result
lowercase_view.result
mdl_sync.result
merge-big.result
merge.result
merge_innodb.result
merge_mmap.result
merge_recover.result
metadata.result
mix2_myisam.result
mix2_myisam_ucs2.result
multi_statement.result
multi_update.result
multi_update2.result
multi_update_tiny_hash.result
myisam-blob.result
myisam-system.result
myisam.result
myisam_crash_before_flush_keys.result
myisam_debug.result
myisampack.result
mysql-bug41486.result
mysql-bug45236.result
mysql.result
mysql_client_test.result
mysql_comments.result
mysql_cp932.result
mysql_locale_posix.result
mysql_protocols.result
mysql_upgrade.result
mysqladmin.result
mysqlbinlog-cp932.result
mysqlbinlog.result
mysqlbinlog2.result
mysqlbinlog_base64.result
mysqlbinlog_row.result
mysqlbinlog_row_big.result
mysqlbinlog_row_innodb.result
mysqlbinlog_row_myisam.result
mysqlbinlog_row_trans.result
mysqlcheck.result
mysqld--help-notwin.result
mysqld--help-win.result
mysqldump-compat.result
mysqldump-max.result
mysqldump-no-binlog.result
mysqldump.result
mysqldump_restore.result
mysqlhotcopy_archive.result
mysqlhotcopy_myisam.result
mysqlshow.result
mysqlslap.result
mysqltest.result
named_pipe.result
ndb_default_cluster.require
negation_elimination.result
no-threads.result
no_binlog.result
not_embedded.require
not_embedded_server.result
not_ndb.require
not_ndb_default.require
not_openssl.require
not_partition.require
not_partition.result
not_true.require
not_valgrind.require
not_windows.require
null.result
null_key.result
odbc.result
olap.result
one_thread_per_connection.require
openssl_1.result
optimizer_switch_eng_cond_pushdown1.result
optimizer_switch_eng_cond_pushdown2.result
order_by.result
order_fill_sortbuf.result
outfile.result
outfile_loaddata.result
overflow.result
packet.result
parser.result
parser_bug21114_innodb.result
parser_not_embedded.result
parser_precedence.result
parser_stack.result
partition.result
partition_archive.result
partition_binlog_stmt.result
partition_blackhole.result
partition_bug18198.result
partition_charset.result
partition_column.result
partition_column_prune.result
partition_csv.result
partition_datatype.result
partition_debug_sync.result
partition_disabled.result
partition_error.result
partition_federated.result
partition_grant.result
partition_hash.result
partition_innodb.result
partition_innodb_plugin.result
partition_innodb_semi_consistent.result
partition_innodb_stmt.result
partition_key_cache.result
partition_list.result
partition_mgm.result
partition_mgm_err.result
partition_mgm_err2.result
partition_not_embedded.result
partition_not_windows.result
partition_open_files_limit.result
partition_order.result
partition_pruning.result
partition_range.result
partition_rename_longfilename.result
partition_symlink.result
partition_sync.result
partition_truncate.result
partition_utf8.result
partition_windows.result
perror-win.result
perror.result
plugin.result
plugin_load.result
plugin_not_embedded.result
preload.result
profiling.result
ps.result
ps_1general.result
ps_2myisam.result
ps_3innodb.result
ps_4heap.result
ps_5merge.result
ps_10nestset.result
ps_11bugs.result
ps_ddl.result
ps_ddl1.result
ps_grant.result
ps_not_windows.result
query_cache.result
query_cache_28249.result
query_cache_debug.result
query_cache_disabled.result
query_cache_merge.result
query_cache_notembedded.result
query_cache_ps_no_prot.result
query_cache_ps_ps_prot.result
query_cache_with_views.result
range.result
read_many_rows_innodb.result
read_only.result
read_only_innodb.result
rename.result
renamedb.result
repair.result
replace.result
rollback.result
round.result
row.result
rowid_order_innodb.result
rpl_colSize.result
rpl_extraColmaster_innodb.result
rpl_extraColmaster_myisam.result
rpl_mysqldump_slave.result bug#54935 2010-07-16 21:25:00 +03:00
schema.result
select.result Merge of mysql-trunk-bugfixing into mysql-trunk-merge. 2010-07-15 10:47:50 -03:00
select_found.result
select_safe.result
server_id.require
server_id1.require
shm.result
show_check.result Bug #55498 SHOW CREATE TRIGGER takes wrong type of metadata lock 2010-07-23 10:44:55 +02:00
show_profile.result
signal.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
signal_code.result
signal_demo1.result
signal_demo2.result
signal_demo3.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
signal_sqlmode.result
single_delete_update.result
skip_grants.result
skip_log_bin.result
skip_name_resolve.result
slave-running.result
slave-stopped.result
sp-big.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
sp-bugs.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
sp-code.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
sp-destruct.result
sp-dynamic.result
sp-error.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
sp-fib.result
sp-lock.result
sp-no-code.result
sp-prelocking.result
sp-security.result
sp-threads.result
sp-ucs2.result
sp-vars.result
sp.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
sp_gis.result
sp_notembedded.result
sp_stress_case.result
sp_sync.result
sp_trans.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
sp_trans_log.result
sql_mode.result
ssl-big.result
ssl.result
ssl_8k_key.result
ssl_compress.result
ssl_connect.result
status.result
status2.result
strict.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
strict_autoinc_1myisam.result
strict_autoinc_2innodb.result
strict_autoinc_3heap.result
subselect.result
subselect2.result
subselect3.result
subselect4.result
subselect_debug.result
subselect_gis.result
subselect_innodb.result
subselect_notembedded.result
sum_distinct-big.result
sum_distinct.result
symlink.result
synchronization.result
sysdate_is_now.result
system_mysql_db.result
system_mysql_db_refs.result
tablelock.result
temp_table.result
testdb_only.require
timezone.result
timezone2.result
timezone3.result
timezone4.result
timezone_grant.result
trigger-compat.result
trigger-trans.result
trigger.result
trigger_notembedded.result
true.require
truncate.result
truncate_coverage.result
type_binary.result
type_bit.result
type_bit_innodb.result
type_blob.result
type_date.result
type_datetime.result
type_decimal.result
type_enum.result
type_float.result
type_nchar.result
type_newdecimal-big.result
type_newdecimal.result
type_ranges.result
type_set.result
type_time.result
type_timestamp.result
type_uint.result
type_varchar.result
type_year.result
udf.result
udf_skip_grants.result
union.result
unsafe_binlog_innodb.result
update.result manual merge from mysql-5.1-bugteam 2010-07-19 11:21:24 +02:00
upgrade.result
user_limits.result
user_var-binlog.result
user_var.result
varbinary.result
variables-big.result
variables-notembedded.result
variables.result A pre-requisite patch for the fix for Bug#52044. 2010-07-27 14:25:53 +04:00
variables_community.result
variables_debug.result
view.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
view_alias.result
view_grant.result
wait_timeout.result
warnings.result
warnings_engine_disabled.result
windows.require
windows.result
xa.result
xml.result