mariadb/mysql-test/suite/funcs_1/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
..
charset_collation.result Fix for Bug#40545, Bug#40209, Bug#40618, Bug#38346 2009-06-19 17:04:25 +02:00
innodb_bitdata.result WL#4203 Reorganize and fix the data dictionary tests of 2008-03-07 17:33:07 +01:00
innodb_cursors.result WL#4203 Reorganize and fix the data dictionary tests of 2008-03-07 17:33:07 +01:00
innodb_func_view.result Fixed more PB2 test failures introduced by backporting WL#2934. 2009-12-22 23:55:56 +03:00
innodb_storedproc_02.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
innodb_storedproc_03.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
innodb_storedproc_06.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
innodb_storedproc_07.result Bug #21099 MySQL 5.0.22 silently creates MyISAM tables even though 2009-10-09 16:52:02 +02:00
innodb_storedproc_08.result backported: 2010-01-15 15:42:15 +04:00
innodb_storedproc_10.result Patch for Bug#21818 (Return value of ROW_COUNT() is incorrect 2010-05-14 09:28:51 +04:00
innodb_trig_03.result Post-backporting patch for WL#4300: fixing funcs_1 test results. 2009-10-11 01:35:01 +04:00
innodb_trig_03e.result Merge from mysql-next-mr. 2009-10-28 10:55:44 +03:00
innodb_trig_08.result Bug#36788 Multiple funcs_1 'trig' tests are failing on vanilla builds 2008-06-02 21:57:11 +02:00
innodb_trig_09.result after-push test update (bug #39265) 2009-02-05 17:51:00 +04:00
innodb_trig_0102.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
innodb_trig_0407.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
innodb_trig_1011ext.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
innodb_trig_frkey.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
innodb_views.result Follow-up for patch that addresses bug #53976 "ALTER TABLE 2010-05-30 11:48:22 +04:00
is_basics_mixed.result merge 2010-07-09 15:40:38 +03:00
is_character_sets.result Bug#35789 wrong datatypes for collation and charset columns in EVENTS, ROUTINES, TRIGGERS 2008-11-13 13:50:20 +04:00
is_cml_innodb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_cml_memory.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_cml_myisam.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_cml_ndb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_coll_char_set_appl.result Fix for Bug#43383 main.variables-big : Weak testing code and result 2009-03-26 19:12:19 +01:00
is_collations.result Bug#35789 wrong datatypes for collation and charset columns in EVENTS, ROUTINES, TRIGGERS 2008-11-13 13:50:20 +04:00
is_column_privileges.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_column_privileges_is_mysql_test.result WL#4203 Reorganize and fix the data dictionary tests of 2008-03-07 17:33:07 +01:00
is_columns.result Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
is_columns_innodb.result merge 2010-07-16 18:04:39 +03:00
is_columns_is.result merge 2010-07-16 18:04:39 +03:00
is_columns_is_embedded.result backported: 2010-01-15 15:42:15 +04:00
is_columns_memory.result merge 2010-07-16 18:04:39 +03:00
is_columns_myisam.result merge 2010-07-16 18:04:39 +03:00
is_columns_myisam_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_columns_mysql.result merge 2010-07-16 18:04:39 +03:00
is_columns_mysql_embedded.result backported: 2010-01-15 15:42:15 +04:00
is_columns_ndb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_engines.result Bug#29263 disabled storage engines omitted in SHOW ENGINES 2008-12-17 19:45:34 +04:00
is_engines_archive.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_blackhole.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_csv.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_federated.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_innodb.result WL#5349 Change default storage engine to InnoDB 2010-06-17 22:51:35 +02:00
is_engines_memory.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_merge.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_myisam.result BUG#54832 - Comment for MyISAM says it is a default engine 2010-07-05 11:34:29 +04:00
is_engines_ndb.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_events.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_key_column_usage.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_key_column_usage_embedded.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
is_routines.result backported: 2010-01-15 15:42:15 +04:00
is_routines_embedded.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
is_schema_privileges.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_schema_privileges_is_mysql_test.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_schemata.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
is_schemata_embedded.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
is_schemata_is_mysql_test.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_statistics.result Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
is_statistics_is.result Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
is_statistics_mysql.result Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
is_statistics_mysql_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_table_constraints.result Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
is_table_constraints_is.result WL#4203 Reorganize and fix the data dictionary tests of 2008-03-07 17:33:07 +01:00
is_table_constraints_mysql.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_table_constraints_mysql_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_table_privileges.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables.result Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
is_tables_embedded.result Fix for 2008-06-16 20:39:58 +02:00
is_tables_innodb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_is.result backported: 2010-01-15 15:42:15 +04:00
is_tables_memory.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_myisam.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_myisam_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_mysql.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_mysql_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_ndb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_triggers.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_triggers_embedded.result Fix for 2008-06-16 20:39:58 +02:00
is_user_privileges.result Manual merge from mysql-next-mr. 2009-11-02 14:10:04 +03:00
is_views.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_views_embedded.result Fix for 2008-06-16 20:39:58 +02:00
memory_bitdata.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
memory_cursors.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
memory_func_view.result Fixed more PB2 test failures introduced by backporting WL#2934. 2009-12-22 23:55:56 +03:00
memory_storedproc_02.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
memory_storedproc_03.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
memory_storedproc_06.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
memory_storedproc_07.result Bug #21099 MySQL 5.0.22 silently creates MyISAM tables even though 2009-10-09 16:52:02 +02:00
memory_storedproc_08.result backported: 2010-01-15 15:42:15 +04:00
memory_storedproc_10.result Patch for Bug#21818 (Return value of ROW_COUNT() is incorrect 2010-05-14 09:28:51 +04:00
memory_trig_03.result Post-backporting patch for WL#4300: fixing funcs_1 test results. 2009-10-11 01:35:01 +04:00
memory_trig_03e.result Merge from mysql-next-mr. 2009-10-28 10:55:44 +03:00
memory_trig_08.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
memory_trig_09.result after-push test update (bug #39265) 2009-02-05 17:51:00 +04:00
memory_trig_0102.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
memory_trig_0407.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
memory_trig_1011ext.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
memory_views.result Follow-up for patch that addresses bug #53976 "ALTER TABLE 2010-05-30 11:48:22 +04:00
myisam_bitdata.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
myisam_cursors.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
myisam_func_view.result Fixed more PB2 test failures introduced by backporting WL#2934. 2009-12-22 23:55:56 +03:00
myisam_storedproc_02.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
myisam_storedproc_03.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
myisam_storedproc_06.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
myisam_storedproc_07.result Bug #21099 MySQL 5.0.22 silently creates MyISAM tables even though 2009-10-09 16:52:02 +02:00
myisam_storedproc_08.result backported: 2010-01-15 15:42:15 +04:00
myisam_storedproc_10.result Patch for Bug#21818 (Return value of ROW_COUNT() is incorrect 2010-05-14 09:28:51 +04:00
myisam_trig_03.result Post-backporting patch for WL#4300: fixing funcs_1 test results. 2009-10-11 01:35:01 +04:00
myisam_trig_03e.result Merge from mysql-next-mr. 2009-10-28 10:55:44 +03:00
myisam_trig_08.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
myisam_trig_09.result after-push test update (bug #39265) 2009-02-05 17:51:00 +04:00
myisam_trig_0102.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
myisam_trig_0407.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
myisam_trig_1011ext.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
myisam_views.result Follow-up for patch that addresses bug #53976 "ALTER TABLE 2010-05-30 11:48:22 +04:00
ndb_bitdata.result Post merge fix for 2008-03-12 12:56:07 +01:00
ndb_cursors.result Post merge fix for 2008-03-12 12:56:07 +01:00
ndb_func_view.result Fixed more PB2 test failures introduced by backporting WL#2934. 2009-12-22 23:55:56 +03:00
ndb_storedproc_02.result Post merge fixes 2009-09-11 01:15:41 -06:00
ndb_storedproc_03.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
ndb_storedproc_06.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
ndb_storedproc_07.result Bug #21099 MySQL 5.0.22 silently creates MyISAM tables even though 2009-10-09 16:52:02 +02:00
ndb_storedproc_08.result backported: 2010-01-15 15:42:15 +04:00
ndb_storedproc_10.result Patch for Bug#21818 (Return value of ROW_COUNT() is incorrect 2010-05-14 09:28:51 +04:00
ndb_trig_03.result Post-backporting patch for WL#4300: fixing funcs_1 test results. 2009-10-11 01:35:01 +04:00
ndb_trig_03e.result Merge from mysql-next-mr. 2009-10-28 10:55:44 +03:00
ndb_trig_08.result Bug#36788 Multiple funcs_1 'trig' tests are failing on vanilla builds 2008-06-02 21:57:11 +02:00
ndb_trig_09.result after-push test update (bug #39265) 2009-02-05 17:51:00 +04:00
ndb_trig_0102.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
ndb_trig_0407.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
ndb_trig_1011ext.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
ndb_views.result Follow-up for patch that addresses bug #53976 "ALTER TABLE 2010-05-30 11:48:22 +04:00
processlist_priv_no_prot.result Bug#24062 Incorrect error msg after execute DROP TABLE IF EXISTS on information_schema 2009-10-23 11:56:30 +05:00
processlist_priv_ps.result Bug#24062 Incorrect error msg after execute DROP TABLE IF EXISTS on information_schema 2009-10-23 11:56:30 +05:00
processlist_val_no_prot.result next-4284 tree: fix the failures of processlist_val_* tests, 2010-02-11 18:19:04 +03:00
processlist_val_ps.result next-4284 tree: fix the failures of processlist_val_* tests, 2010-02-11 18:19:04 +03:00
row_count_func.result Patch for Bug#21818 (Return value of ROW_COUNT() is incorrect 2010-05-14 09:28:51 +04:00
storedproc.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00