Commit 3ef12423 authored by mskold@mysql.com's avatar mskold@mysql.com

Merge marty@192.168.123.145:MySQL/mysql-5.1-new

into  mysql.com:/usr/local/home/marty/MySQL/mysql-5.1-new-wl1892
parents 8c73ef09 c7e17f55
...@@ -595,6 +595,38 @@ CREATE TABLE event ( ...@@ -595,6 +595,38 @@ CREATE TABLE event (
ends DATETIME default NULL, ends DATETIME default NULL,
status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED',
on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP',
sql_mode set(
'REAL_AS_FLOAT',
'PIPES_AS_CONCAT',
'ANSI_QUOTES',
'IGNORE_SPACE',
'NOT_USED',
'ONLY_FULL_GROUP_BY',
'NO_UNSIGNED_SUBTRACTION',
'NO_DIR_IN_CREATE',
'POSTGRESQL',
'ORACLE',
'MSSQL',
'DB2',
'MAXDB',
'NO_KEY_OPTIONS',
'NO_TABLE_OPTIONS',
'NO_FIELD_OPTIONS',
'MYSQL323',
'MYSQL40',
'ANSI',
'NO_AUTO_VALUE_ON_ZERO',
'NO_BACKSLASH_ESCAPES',
'STRICT_TRANS_TABLES',
'STRICT_ALL_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'INVALID_DATES',
'ERROR_FOR_DIVISION_BY_ZERO',
'TRADITIONAL',
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT '' NOT NULL,
comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
PRIMARY KEY (definer, db, name) PRIMARY KEY (definer, db, name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
......
...@@ -203,6 +203,7 @@ event CREATE TABLE `event` ( ...@@ -203,6 +203,7 @@ event CREATE TABLE `event` (
`ends` datetime default NULL, `ends` datetime default NULL,
`status` enum('ENABLED','DISABLED') NOT NULL default 'ENABLED', `status` enum('ENABLED','DISABLED') NOT NULL default 'ENABLED',
`on_completion` enum('DROP','PRESERVE') NOT NULL default 'DROP', `on_completion` enum('DROP','PRESERVE') NOT NULL default 'DROP',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL default '',
`comment` char(64) character set utf8 collate utf8_bin NOT NULL default '', `comment` char(64) character set utf8 collate utf8_bin NOT NULL default '',
PRIMARY KEY (`definer`,`db`,`name`) PRIMARY KEY (`definer`,`db`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'
......
...@@ -791,6 +791,38 @@ then ...@@ -791,6 +791,38 @@ then
c_ev="$c_ev ends DATETIME default NULL," c_ev="$c_ev ends DATETIME default NULL,"
c_ev="$c_ev status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED'," c_ev="$c_ev status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED',"
c_ev="$c_ev on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP'," c_ev="$c_ev on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP',"
c_ev="$c_ev sql_mode set("
c_ev="$c_ev 'REAL_AS_FLOAT',"
c_ev="$c_ev 'PIPES_AS_CONCAT',"
c_ev="$c_ev 'ANSI_QUOTES',"
c_ev="$c_ev 'IGNORE_SPACE',"
c_ev="$c_ev 'NOT_USED',"
c_ev="$c_ev 'ONLY_FULL_GROUP_BY',"
c_ev="$c_ev 'NO_UNSIGNED_SUBTRACTION',"
c_ev="$c_ev 'NO_DIR_IN_CREATE',"
c_ev="$c_ev 'POSTGRESQL',"
c_ev="$c_ev 'ORACLE',"
c_ev="$c_ev 'MSSQL',"
c_ev="$c_ev 'DB2',"
c_ev="$c_ev 'MAXDB',"
c_ev="$c_ev 'NO_KEY_OPTIONS',"
c_ev="$c_ev 'NO_TABLE_OPTIONS',"
c_ev="$c_ev 'NO_FIELD_OPTIONS',"
c_ev="$c_ev 'MYSQL323',"
c_ev="$c_ev 'MYSQL40',"
c_ev="$c_ev 'ANSI',"
c_ev="$c_ev 'NO_AUTO_VALUE_ON_ZERO',"
c_ev="$c_ev 'NO_BACKSLASH_ESCAPES',"
c_ev="$c_ev 'STRICT_TRANS_TABLES',"
c_ev="$c_ev 'STRICT_ALL_TABLES',"
c_ev="$c_ev 'NO_ZERO_IN_DATE',"
c_ev="$c_ev 'NO_ZERO_DATE',"
c_ev="$c_ev 'INVALID_DATES',"
c_ev="$c_ev 'ERROR_FOR_DIVISION_BY_ZERO',"
c_ev="$c_ev 'TRADITIONAL',"
c_ev="$c_ev 'NO_AUTO_CREATE_USER',"
c_ev="$c_ev 'HIGH_NOT_PRECEDENCE'"
c_ev="$c_ev ) DEFAULT '' NOT NULL,"
c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',"
c_ev="$c_ev PRIMARY KEY (definer, db, name)" c_ev="$c_ev PRIMARY KEY (definer, db, name)"
c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';"
......
...@@ -589,6 +589,38 @@ CREATE TABLE event ( ...@@ -589,6 +589,38 @@ CREATE TABLE event (
ends DATETIME default NULL, ends DATETIME default NULL,
status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED',
on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP',
sql_mode set(
'REAL_AS_FLOAT',
'PIPES_AS_CONCAT',
'ANSI_QUOTES',
'IGNORE_SPACE',
'NOT_USED',
'ONLY_FULL_GROUP_BY',
'NO_UNSIGNED_SUBTRACTION',
'NO_DIR_IN_CREATE',
'POSTGRESQL',
'ORACLE',
'MSSQL',
'DB2',
'MAXDB',
'NO_KEY_OPTIONS',
'NO_TABLE_OPTIONS',
'NO_FIELD_OPTIONS',
'MYSQL323',
'MYSQL40',
'ANSI',
'NO_AUTO_VALUE_ON_ZERO',
'NO_BACKSLASH_ESCAPES',
'STRICT_TRANS_TABLES',
'STRICT_ALL_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'INVALID_DATES',
'ERROR_FOR_DIVISION_BY_ZERO',
'TRADITIONAL',
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT '' NOT NULL,
comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
PRIMARY KEY (db,name) PRIMARY KEY (db,name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
...@@ -602,4 +634,36 @@ ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT ...@@ -602,4 +634,36 @@ ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT
ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL;
ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event DROP PRIMARY KEY;
ALTER TABLE event ADD PRIMARY KEY(definer, db, name); ALTER TABLE event ADD PRIMARY KEY(definer, db, name);
ALTER TABLE event ADD sql_mode
set('REAL_AS_FLOAT',
'PIPES_AS_CONCAT',
'ANSI_QUOTES',
'IGNORE_SPACE',
'NOT_USED',
'ONLY_FULL_GROUP_BY',
'NO_UNSIGNED_SUBTRACTION',
'NO_DIR_IN_CREATE',
'POSTGRESQL',
'ORACLE',
'MSSQL',
'DB2',
'MAXDB',
'NO_KEY_OPTIONS',
'NO_TABLE_OPTIONS',
'NO_FIELD_OPTIONS',
'MYSQL323',
'MYSQL40',
'ANSI',
'NO_AUTO_VALUE_ON_ZERO',
'NO_BACKSLASH_ESCAPES',
'STRICT_TRANS_TABLES',
'STRICT_ALL_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'INVALID_DATES',
'ERROR_FOR_DIVISION_BY_ZERO',
'TRADITIONAL',
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT '' NOT NULL;
...@@ -70,6 +70,7 @@ enum evex_table_field ...@@ -70,6 +70,7 @@ enum evex_table_field
EVEX_FIELD_ENDS, EVEX_FIELD_ENDS,
EVEX_FIELD_STATUS, EVEX_FIELD_STATUS,
EVEX_FIELD_ON_COMPLETION, EVEX_FIELD_ON_COMPLETION,
EVEX_FIELD_SQL_MODE,
EVEX_FIELD_COMMENT, EVEX_FIELD_COMMENT,
EVEX_FIELD_COUNT /* a cool trick to count the number of fields :) */ EVEX_FIELD_COUNT /* a cool trick to count the number of fields :) */
} ; } ;
......
...@@ -8913,6 +8913,33 @@ ha_ndbcluster::generate_scan_filter(Ndb_cond_stack *ndb_cond_stack, ...@@ -8913,6 +8913,33 @@ ha_ndbcluster::generate_scan_filter(Ndb_cond_stack *ndb_cond_stack,
DBUG_RETURN(0); DBUG_RETURN(0);
} }
/*
get table space info for SHOW CREATE TABLE
*/
char* ha_ndbcluster::get_tablespace_create_info()
{
const char tablespace_key[]= " TABLESPACE ";
const char storage_key[]= " STORAGE DISK";
char* str= 0;
Ndb *ndb= get_ndb();
NDBDICT *ndbdict= ndb->getDictionary();
ndb->setDatabaseName(m_dbname);
const NDBTAB *ndbtab= ndbdict->getTable(m_tabname);
if (ndbtab == 0)
return 0;
// TODO retrieve table space name if there is one
return 0;
const char *tablespace_name= "<name>";
uint len= sizeof(tablespace_key) + strlen(tablespace_name) + sizeof(storage_key);
str= my_malloc(len, MYF(0));
strxnmov(str, len, tablespace_key, tablespace_name, storage_key, NullS);
return(str);
}
/* /*
Implements the SHOW NDB STATUS command. Implements the SHOW NDB STATUS command.
*/ */
......
...@@ -701,6 +701,7 @@ private: ...@@ -701,6 +701,7 @@ private:
uint set_up_partition_info(partition_info *part_info, uint set_up_partition_info(partition_info *part_info,
TABLE *table, TABLE *table,
void *tab); void *tab);
char* get_tablespace_create_info();
int set_range_data(void *tab, partition_info* part_info); int set_range_data(void *tab, partition_info* part_info);
int set_list_data(void *tab, partition_info* part_info); int set_list_data(void *tab, partition_info* part_info);
int complemented_pk_read(const byte *old_data, byte *new_data, int complemented_pk_read(const byte *old_data, byte *new_data,
......
...@@ -1713,6 +1713,8 @@ public: ...@@ -1713,6 +1713,8 @@ public:
{ return FALSE; } { return FALSE; }
virtual char* get_foreign_key_create_info() virtual char* get_foreign_key_create_info()
{ return(NULL);} /* gets foreign key create string from InnoDB */ { return(NULL);} /* gets foreign key create string from InnoDB */
virtual char* get_tablespace_create_info()
{ return(NULL);} /* gets tablespace create string from handler */
/* used in ALTER TABLE; 1 if changing storage engine is allowed */ /* used in ALTER TABLE; 1 if changing storage engine is allowed */
virtual bool can_switch_engines() { return 1; } virtual bool can_switch_engines() { return 1; }
/* used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */ /* used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */
......
...@@ -1135,6 +1135,17 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, ...@@ -1135,6 +1135,17 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
packet->append(STRING_WITH_LEN("\n)")); packet->append(STRING_WITH_LEN("\n)"));
if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) && !foreign_db_mode) if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) && !foreign_db_mode)
{ {
/*
Get possible table space definitions and append them
to the CREATE TABLE statement
*/
if ((for_str= file->get_tablespace_create_info()))
{
packet->append(for_str, strlen(for_str));
my_free(for_str, MYF(0));
}
/* /*
IF check_create_info IF check_create_info
THEN add ENGINE only if it was used when creating the table THEN add ENGINE only if it was used when creating the table
......
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