mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysqldev@production.mysql.com:my/mysql-5.1-release
into mysql.com:/home/bk/w3023-mysql-5.1-new
This commit is contained in:
@ -1086,7 +1086,35 @@ typedef struct st_ha_create_information
|
||||
bool store_on_disk; /* 1 if table stored on disk */
|
||||
} HA_CREATE_INFO;
|
||||
|
||||
/*
|
||||
Class for maintaining hooks used inside operations on tables such
|
||||
as: create table functions, delete table functions, and alter table
|
||||
functions.
|
||||
|
||||
Class is using the Template Method pattern to separate the public
|
||||
usage interface from the private inheritance interface. This
|
||||
imposes no overhead, since the public non-virtual function is small
|
||||
enough to be inlined.
|
||||
|
||||
The hooks are usually used for functions that does several things,
|
||||
e.g., create_table_from_items(), which both create a table and lock
|
||||
it.
|
||||
*/
|
||||
class TABLEOP_HOOKS
|
||||
{
|
||||
public:
|
||||
inline void prelock(TABLE **tables, uint count)
|
||||
{
|
||||
do_prelock(tables, count);
|
||||
}
|
||||
|
||||
private:
|
||||
/* Function primitive that is called prior to locking tables */
|
||||
virtual void do_prelock(TABLE **tables, uint count)
|
||||
{
|
||||
/* Default is to do nothing */
|
||||
}
|
||||
};
|
||||
|
||||
typedef struct st_savepoint SAVEPOINT;
|
||||
extern ulong savepoint_alloc_size;
|
||||
@ -1480,15 +1508,24 @@ public:
|
||||
uint get_index(void) const { return active_index; }
|
||||
virtual int open(const char *name, int mode, uint test_if_locked)=0;
|
||||
virtual int close(void)=0;
|
||||
virtual int ha_write_row(byte * buf);
|
||||
virtual int ha_update_row(const byte * old_data, byte * new_data);
|
||||
virtual int ha_delete_row(const byte * buf);
|
||||
|
||||
/*
|
||||
These functions represent the public interface to *users* of the
|
||||
handler class, hence they are *not* virtual. For the inheritance
|
||||
interface, see the (private) functions write_row(), update_row(),
|
||||
and delete_row() below.
|
||||
*/
|
||||
int ha_external_lock(THD *thd, int lock_type);
|
||||
int ha_write_row(byte * buf);
|
||||
int ha_update_row(const byte * old_data, byte * new_data);
|
||||
int ha_delete_row(const byte * buf);
|
||||
|
||||
/*
|
||||
If the handler does it's own injection of the rows, this member function
|
||||
should return 'true'.
|
||||
*/
|
||||
virtual bool is_injective() const { return false; }
|
||||
|
||||
|
||||
/*
|
||||
SYNOPSIS
|
||||
start_bulk_update()
|
||||
@ -1620,7 +1657,6 @@ public:
|
||||
{ return 0; }
|
||||
virtual int extra_opt(enum ha_extra_function operation, ulong cache_size)
|
||||
{ return extra(operation); }
|
||||
virtual int external_lock(THD *thd, int lock_type) { return 0; }
|
||||
/*
|
||||
In an UPDATE or DELETE, if the row under the cursor was locked by another
|
||||
transaction, and the engine used an optimistic read of the last
|
||||
@ -1894,28 +1930,31 @@ public:
|
||||
{ return COMPATIBLE_DATA_NO; }
|
||||
|
||||
private:
|
||||
|
||||
/*
|
||||
Row-level primitives for storage engines.
|
||||
These should be overridden by the storage engine class. To call
|
||||
these methods, use the corresponding 'ha_*' method above.
|
||||
Row-level primitives for storage engines. These should be
|
||||
overridden by the storage engine class. To call these methods, use
|
||||
the corresponding 'ha_*' method above.
|
||||
*/
|
||||
friend int ndb_add_binlog_index(THD *, void *);
|
||||
virtual int external_lock(THD *thd __attribute__((unused)),
|
||||
int lock_type __attribute__((unused)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int write_row(byte *buf __attribute__((unused)))
|
||||
{
|
||||
return HA_ERR_WRONG_COMMAND;
|
||||
virtual int write_row(byte *buf __attribute__((unused)))
|
||||
{
|
||||
return HA_ERR_WRONG_COMMAND;
|
||||
}
|
||||
|
||||
virtual int update_row(const byte *old_data __attribute__((unused)),
|
||||
byte *new_data __attribute__((unused)))
|
||||
{
|
||||
return HA_ERR_WRONG_COMMAND;
|
||||
{
|
||||
return HA_ERR_WRONG_COMMAND;
|
||||
}
|
||||
|
||||
virtual int delete_row(const byte *buf __attribute__((unused)))
|
||||
{
|
||||
return HA_ERR_WRONG_COMMAND;
|
||||
{
|
||||
return HA_ERR_WRONG_COMMAND;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user