#At file:///mnt/raid/alik/MySQL/bzr/wl4264/6.0-rt-wl4264.2/
2761 Alexander Nozdrin 2008-12-04 [merge]
Pull from 6.0-runtime
modified:
sql/Makefile.am
sql/mysql_priv.h
sql/si_objects.cc
sql/sp_head.cc
sql/sql_base.cc
sql/sql_class.cc
sql/sql_class.h
sql/sql_parse.cc
sql/sql_prepare.cc
=== modified file 'sql/Makefile.am'
--- a/sql/Makefile.am 2008-11-20 15:29:58 +0000
+++ b/sql/Makefile.am 2008-12-03 16:53:23 +0000
@@ -99,7 +99,7 @@ noinst_HEADERS = item.h item_func.h item
probes.h sql_audit.h transaction.h \
contributors.h sql_servers.h ddl_blocker.h \
si_objects.h si_logs.h sql_plist.h mdl.h records.h \
- rpl_handler.h replication.h
+ rpl_handler.h replication.h sql_prepare.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h 2008-11-28 21:35:11 +0000
+++ b/sql/mysql_priv.h 2008-12-03 16:53:23 +0000
@@ -1137,25 +1137,6 @@ void free_max_user_conn(void);
pthread_handler_t handle_bootstrap(void *arg);
int mysql_execute_command(THD *thd);
-class Ed_result;
-/**
- Execute a fragment of server code in an isolated context, so that
- it doesn't leave any effect on THD. THD must have no open tables.
- The code must not leave any open tables around.
- The result of execution (if any) is stored in Ed_result.
-*/
-
-class Server_runnable
-{
-public:
- virtual bool execute_server_code(THD *thd)= 0;
- virtual ~Server_runnable();
-};
-
-bool mysql_execute_direct(THD *thd, LEX_STRING query, Ed_result *result);
-bool mysql_execute_direct(THD *thd, Server_runnable *ed_runnable,
- Ed_result *result);
-
bool do_command(THD *thd);
bool dispatch_command(enum enum_server_command command, THD *thd,
char* packet, uint packet_length);
@@ -1479,19 +1460,6 @@ enum enum_schema_tables get_schema_table
#define is_schema_db(X) \
!my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str, (X))
-
-/* sql_prepare.cc */
-
-void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length);
-void mysql_stmt_execute(THD *thd, char *packet, uint packet_length);
-void mysql_stmt_close(THD *thd, char *packet);
-void mysql_sql_stmt_prepare(THD *thd);
-void mysql_sql_stmt_execute(THD *thd);
-void mysql_sql_stmt_close(THD *thd);
-void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length);
-void mysql_stmt_reset(THD *thd, char *packet);
-void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length);
-void reinit_stmt_before_use(THD *thd, LEX *lex);
/* sql_handler.cc */
bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen);
=== modified file 'sql/si_objects.cc'
--- a/sql/si_objects.cc 2008-12-04 13:37:53 +0000
+++ b/sql/si_objects.cc 2008-12-04 13:49:57 +0000
@@ -16,6 +16,7 @@
/** @file Server Service Interface for Backup: the implementation. */
#include "mysql_priv.h"
+#include "sql_prepare.h"
#include "si_objects.h"
#include "ddl_blocker.h"
=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc 2008-11-27 16:36:09 +0000
+++ b/sql/sp_head.cc 2008-12-03 16:53:23 +0000
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysql_priv.h"
+#include "sql_prepare.h"
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation
#endif
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc 2008-11-27 16:36:09 +0000
+++ b/sql/sql_base.cc 2008-12-03 16:53:23 +0000
@@ -22,6 +22,7 @@
#include "sp.h"
#include "sql_trigger.h"
#include "transaction.h"
+#include "sql_prepare.h"
#include <m_ctype.h>
#include <my_dir.h>
#include <hash.h>
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2008-11-18 22:30:59 +0000
+++ b/sql/sql_class.cc 2008-12-03 16:53:23 +0000
@@ -202,19 +202,6 @@ bool foreign_key_prefix(Key *a, Key *b)
** Thread specific functions
****************************************************************************/
-/** Push an error to the error stack and return TRUE for now. */
-
-bool
-Reprepare_observer::report_error(THD *thd)
-{
- my_error(ER_NEED_REPREPARE, MYF(ME_NO_WARNING_FOR_ERROR|ME_NO_SP_HANDLER));
-
- m_invalidated= TRUE;
-
- return TRUE;
-}
-
-
/*
The following functions form part of the C plugin API
*/
=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h 2008-11-18 22:30:59 +0000
+++ b/sql/sql_class.h 2008-12-03 16:53:23 +0000
@@ -25,52 +25,10 @@
#include "rpl_tblmap.h"
#include "mdl.h"
-/**
- An interface that is used to take an action when
- the locking module notices that a table version has changed
- since the last execution. "Table" here may refer to any kind of
- table -- a base table, a temporary table, a view or an
- information schema table.
-
- When we open and lock tables for execution of a prepared
- statement, we must verify that they did not change
- since statement prepare. If some table did change, the statement
- parse tree *may* be no longer valid, e.g. in case it contains
- optimizations that depend on table metadata.
-
- This class provides an interface (a method) that is
- invoked when such a situation takes place.
- The implementation of the method simply reports an error, but
- the exact details depend on the nature of the SQL statement.
-
- At most 1 instance of this class is active at a time, in which
- case THD::m_reprepare_observer is not NULL.
-
- @sa check_and_update_table_version() for details of the
- version tracking algorithm
-
- @sa Open_tables_state::m_reprepare_observer for the life cycle
- of metadata observers.
-*/
-
-class Reprepare_observer
-{
-public:
- /**
- 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.
- */
- bool report_error(THD *thd);
- bool is_invalidated() const { return m_invalidated; }
- void reset_reprepare_observer() { m_invalidated= FALSE; }
-private:
- bool m_invalidated;
-};
#include <waiting_threads.h>
+class Reprepare_observer;
class Relay_log_info;
class Query_log_event;
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2008-11-27 16:36:09 +0000
+++ b/sql/sql_parse.cc 2008-12-03 16:53:23 +0000
@@ -31,6 +31,7 @@
#include <ddl_blocker.h>
#include "sql_audit.h"
#include "transaction.h"
+#include "sql_prepare.h"
#ifdef BACKUP_TEST
#include "backup/backup_test.h"
=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc 2008-11-28 21:35:11 +0000
+++ b/sql/sql_prepare.cc 2008-12-03 16:53:23 +0000
@@ -83,6 +83,7 @@ When one supplies long data for a placeh
at statement execute.
*/
+#include "sql_prepare.h"
#include "mysql_priv.h"
#include "sql_select.h" // for JOIN
#include "sql_cursor.h"
@@ -183,8 +184,8 @@ private:
void swap_prepared_statement(Prepared_statement *copy);
};
-
/**
+ Execute one SQL statement in an isolated context.
*/
class Execute_sql_statement: public Server_runnable
@@ -2870,7 +2871,23 @@ Select_fetch_protocol_binary::send_data(
}
/*******************************************************************
-*
+* Reprepare_observer
+*******************************************************************/
+/** Push an error to the error stack and return TRUE for now. */
+
+bool
+Reprepare_observer::report_error(THD *thd)
+{
+ my_error(ER_NEED_REPREPARE, MYF(ME_NO_WARNING_FOR_ERROR|ME_NO_SP_HANDLER));
+
+ m_invalidated= TRUE;
+
+ return TRUE;
+}
+
+
+/*******************************************************************
+* Server_runnable
*******************************************************************/
Server_runnable::~Server_runnable()
| Thread |
|---|
| • bzr commit into mysql-6.0-runtime branch (alik:2761) | Alexander Nozdrin | 4 Dec |