1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

BUG#17138: Error in stored procedure due to fatal error when not really

a fatal error. New handling of ignore error in place.


mysql-test/t/partition.test:
  New test case
sql/ha_ndbcluster.h:
  New handler method to check if error can be ignored
sql/ha_partition.h:
  New handler method to check if error can be ignored
sql/handler.h:
  New handler method to check if error can be ignored
sql/sql_acl.cc:
  Use new handler method
sql/sql_insert.cc:
  Use new handler method
sql/sql_table.cc:
  Use new handler method
sql/sql_union.cc:
  Use new handler method
sql/sql_update.cc:
  Use new handler method
This commit is contained in:
unknown
2006-06-19 20:56:50 -04:00
parent b19c1896ad
commit d90d673daf
9 changed files with 86 additions and 23 deletions

View File

@@ -974,7 +974,28 @@ public:
bool has_transactions()
{ return (ha_table_flags() & HA_NO_TRANSACTIONS) == 0; }
virtual uint extra_rec_buf_length() const { return 0; }
/*
This method is used to analyse the error to see whether the error
is ignorable or not, certain handlers can have more error that are
ignorable than others. E.g. the partition handler can get inserts
into a range where there is no partition and this is an ignorable
error.
*/
#define HA_CHECK_DUPP_KEY 1
#define HA_CHECK_DUPP_UNIQUE 2
#define HA_CHECK_DUPP (CHECK_DUPP_KEY + CHECK_DUPP_UNIQUE)
virtual bool cannot_ignore_error(int error, uint flags)
{
if (!error ||
((flags & HA_CHECK_DUPP_KEY) &&
error == HA_ERR_FOUND_DUPP_KEY) ||
((flags & HA_CHECK_DUPP_UNIQUE) &&
error == HA_ERR_FOUND_DUPP_UNIQUE))
return FALSE;
return TRUE;
}
/*
Number of rows in table. It will only be called if
(table_flags() & (HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT)) != 0
@@ -1026,7 +1047,7 @@ public:
DBUG_RETURN(rnd_end());
}
int ha_reset();
/* this is necessary in many places, e.g. in HANDLER command */
int ha_index_or_rnd_end()
{