1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Implement some code review fixes for the fix for Bug#27430

"Crash in subquery code when in PS and table DDL changed after PREPARE"


include/my_sys.h:
  Add two new flags for my_error(). These flags help parameterize
  behavoiur of my_message_sql()
sql/item.cc:
  Update comments.
  Fix a typo in Item_param::set_param_type_and_swap_value()
sql/mysqld.cc:
  Implement two additional flags for my_error():
   - if ME_NO_SP_HANDLER is specified, ignore stored procedure continue/
      exit handlers
   - if ME_NO_WARNING_FOR_ERROR is specified, do not push warning
sql/sql_base.cc:
  Update comments.
  Rename a few methods.
sql/sql_class.h:
  Update and improve comments.
sql/sql_prepare.cc:
  Update comments.
  Style changes.
sql/table.h:
  Update comments.
  Style changes.
  Rename a few methods.
tests/mysql_client_test.c:
  Zero the bind array, to follow C API requirements.
This commit is contained in:
unknown
2008-05-18 01:51:18 +04:00
parent 954787376f
commit 1cf0b5cb89
8 changed files with 92 additions and 71 deletions

View File

@@ -57,16 +57,15 @@
class Metadata_version_observer
{
protected:
virtual ~Metadata_version_observer();
public:
virtual ~Metadata_version_observer();
/**
Check if a change of metadata is OK. In future
the signature of this method may be extended to accept the old
and the new versions, but since currently the check is very
simple, we only need the THD to report an error.
*/
virtual bool check_metadata_change(THD *thd)= 0;
virtual bool report_error(THD *thd)= 0;
};
@@ -2842,6 +2841,19 @@ public:
#define CF_STATUS_COMMAND 4
#define CF_SHOW_TABLE_COMMAND 8
#define CF_WRITE_LOGS_COMMAND 16
/**
Must be set for SQL statements that may contain
Item expressions and/or use joins and tables.
Indicates that the parse tree of such statement may
contain rule-based optimizations that depend on metadata
(i.e. number of columns in a table), and consequently
that the statement must be re-prepared whenever
referenced metadata changes. Must not be set for
statements that themselves change metadata, e.g. RENAME,
ALTER and other DDL, since otherwise will trigger constant
reprepare. Consequently, complex item expressions and
joins are currently prohibited in these statements.
*/
#define CF_REEXECUTION_FRAGILE 32
/* Functions in sql_class.cc */