Commit 22f908db authored by marko's avatar marko

Merge changes by MySQL AB to ha_innodb.cc:

WL#2257 REFERENTIAL_CONSTRAINTS view
WL#3201 pluggable storage engines
parent e8b80a5a
......@@ -42,6 +42,7 @@ have disables the InnoDB inlining in this file. */
#define MAX_ULONG_BIT ((ulong) 1 << (sizeof(ulong)*8-1))
#ifdef WITH_INNOBASE_STORAGE_ENGINE
#include "ha_innodb.h"
pthread_mutex_t innobase_share_mutex, /* to protect innobase_open_files */
......@@ -204,11 +205,15 @@ static int innobase_savepoint(THD* thd, void *savepoint);
static int innobase_release_savepoint(THD* thd, void *savepoint);
static handler *innobase_create_handler(TABLE_SHARE *table);
static const char innobase_hton_name[]= "InnoDB";
static const char innobase_hton_comment[]=
"Supports transactions, row-level locking, and foreign keys";
handlerton innobase_hton = {
MYSQL_HANDLERTON_INTERFACE_VERSION,
"InnoDB",
innobase_hton_name,
SHOW_OPTION_YES,
"Supports transactions, row-level locking, and foreign keys",
innobase_hton_comment,
DB_TYPE_INNODB,
innobase_init,
0, /* slot */
......@@ -1840,7 +1845,6 @@ innobase_commit_complete(
return(0);
}
/*********************************************************************
Rolls back a transaction or the latest SQL statement. */
......@@ -5827,35 +5831,56 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
break;
}
ulong length= 0;
if (foreign->type == DICT_FOREIGN_ON_DELETE_CASCADE) {
length=17;
tmp_buff= "ON DELETE CASCADE";
ulong length;
if (foreign->type & DICT_FOREIGN_ON_DELETE_CASCADE)
{
length=7;
tmp_buff= "CASCADE";
}
else if (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)
{
length=8;
tmp_buff= "SET NULL";
}
else if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION)
{
length=9;
tmp_buff= "NO ACTION";
}
else if (foreign->type == DICT_FOREIGN_ON_DELETE_SET_NULL) {
length=18;
tmp_buff= "ON DELETE SET NULL";
else
{
length=8;
tmp_buff= "RESTRICT";
}
else if (foreign->type == DICT_FOREIGN_ON_DELETE_NO_ACTION) {
length=19;
tmp_buff= "ON DELETE NO ACTION";
f_key_info.delete_method= make_lex_string(thd, f_key_info.delete_method,
tmp_buff, length, 1);
if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)
{
length=7;
tmp_buff= "CASCADE";
}
else if (foreign->type == DICT_FOREIGN_ON_UPDATE_CASCADE) {
length=17;
tmp_buff= "ON UPDATE CASCADE";
else if (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL)
{
length=8;
tmp_buff= "SET NULL";
}
else if (foreign->type == DICT_FOREIGN_ON_UPDATE_SET_NULL) {
length=18;
tmp_buff= "ON UPDATE SET NULL";
else if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION)
{
length=9;
tmp_buff= "NO ACTION";
}
else if (foreign->type == DICT_FOREIGN_ON_UPDATE_NO_ACTION) {
length=19;
tmp_buff= "ON UPDATE NO ACTION";
else
{
length=8;
tmp_buff= "RESTRICT";
}
f_key_info.constraint_method= make_lex_string(thd,
f_key_info.constraint_method,
f_key_info.update_method= make_lex_string(thd, f_key_info.update_method,
tmp_buff, length, 1);
FOREIGN_KEY_INFO *pf_key_info= ((FOREIGN_KEY_INFO *)
thd->memdup((gptr) &f_key_info,
sizeof(FOREIGN_KEY_INFO)));
......@@ -7432,3 +7457,20 @@ bool ha_innobase::check_if_incompatible_data(
return COMPATIBLE_DATA_YES;
}
mysql_declare_plugin(innobase)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
&innobase_hton,
innobase_hton_name,
"Innobase OY",
innobase_hton_comment,
NULL, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100 /* 1.0 */,
0
}
mysql_declare_plugin_end;
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment