1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

If one declared several continue handler for the same condition on different level of stored procedures, all of them where executed.

Now we only execute the innermost of them (the most relevant).

The solution was to add a 'handled' marker to MYSQL_ERROR and mark all elements for which we have executed a condition handler.
When searching for new conditions, we will ignore any marked element.




.bzrignore:
  Ignore error message file
mysql-test/r/sp.result:
  Added testcase for continue handlers.
mysql-test/t/sp.test:
  Added testcase for continue handlers.
sql/sp_head.cc:
  Mark errors for which we will excute a handler as 'handled'
  Ignore already handled warnings/errors
sql/sql_error.cc:
  Add 'handled' argument to MYSQL_ERROR, so that we can mark the errors/warnings we have handled.
sql/sql_error.h:
  Add 'handled' argument to MYSQL_ERROR, so that we can mark the errors/warnings we have handled.
This commit is contained in:
Michael Widenius
2013-05-06 16:51:41 +03:00
parent aa885cea71
commit d4be9e7bc0
6 changed files with 146 additions and 3 deletions

View File

@ -191,6 +191,17 @@ public:
MYSQL_ERROR::enum_warning_level get_level() const
{ return m_level; }
/** check if condition was handled by a condition handler */
bool handled() const
{
return m_handled;
}
/** mark that condition was handled */
void mark_handled()
{
m_handled= 1;
}
private:
/*
The interface of MYSQL_ERROR is mostly private, by design,
@ -306,6 +317,9 @@ private:
/** MySQL extension, MYSQL_ERRNO condition item. */
uint m_sql_errno;
/** Marker if error/warning was handled by a continue handler */
bool m_handled;
/**
SQL RETURNED_SQLSTATE condition item.
This member is always NUL terminated.