Below is the list of changes that have just been committed into a local
5.1 repository of justin.he. When justin.he does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-01-11 17:46:23+08:00, Justin.He@stripped +2 -0
BUG#25295, ALTER TABLE operations for NDB tables require inclusion of ENGINE=ndbcluster
sql/ha_ndbcluster.cc@stripped, 2007-01-11 17:46:11+08:00, Justin.He@stripped
+36 -13
when ALTER TABLE, add check for tablespace and storage type for NDBCLUSTER
sql/sql_table.cc@stripped, 2007-01-11 17:46:11+08:00, Justin.He@stripped +12 -0
remove HA_CREATE_USED_ENGINE bit check for NDBCLUSTER
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: Justin.He
# Host: dev3-240.dev.cn.tlan
# Root: /home/justin.he/mysql/mysql-5.1/bug25295-5.1-new-ndb-bj
--- 1.374/sql/sql_table.cc 2007-01-11 17:46:31 +08:00
+++ 1.375/sql/sql_table.cc 2007-01-11 17:46:31 +08:00
@@ -5029,6 +5029,18 @@
prior to 5.0 branch.
See BUG#6236.
*/
+
+ /*
+ With given engine in ALTER TABLE, it will cause the table copy alway
+ happen even if the table is actually not changed.
+ Here remove create_info->used_fields & HA_CREATE_USED_ENGINE bit check,
+ but this will influence other storage engines, so add if limitation and
+ let the change be only to NDBCLUSTER.
+ Maybe in the near future, we can remove the bit check for all engines.
+ */
+ if (DB_TYPE_NDBCLUSTER == create_info->db_type->db_type)
+ create_info->used_fields &= ~HA_CREATE_USED_ENGINE;
+
if (table->s->fields != create_list->elements ||
table->s->db_type != create_info->db_type ||
table->s->tmp_table ||
--- 1.370/sql/ha_ndbcluster.cc 2007-01-11 17:46:31 +08:00
+++ 1.371/sql/ha_ndbcluster.cc 2007-01-11 17:46:31 +08:00
@@ -4795,6 +4795,19 @@
my_free((char*)data, MYF(0));
my_free((char*)pack_data, MYF(0));
+ if (info->store_on_disk)
+ {
+ if (info->tablespace)
+ tab.setTablespace(info->tablespace);
+ else
+ tab.setTablespace("DEFAULT-TS");
+ }
+ else if (info->tablespace)
+ {
+ tab.setTablespace(info->tablespace);
+ info->store_on_disk = true; //if use tablespace, that also means store on disk
+ }
+
for (i= 0; i < form->s->fields; i++)
{
Field *field= form->field[i];
@@ -4824,19 +4837,6 @@
NdbDictionary::Column::StorageTypeMemory);
}
- if (info->store_on_disk)
- {
- if (info->tablespace)
- tab.setTablespace(info->tablespace);
- else
- tab.setTablespace("DEFAULT-TS");
- }
- else if (info->tablespace)
- {
- tab.setTablespace(info->tablespace);
- info->store_on_disk = true; //if use tablespace, that also means store on disk
- }
-
// No primary key, create shadow key as 64 bit, auto increment
if (form->s->primary_key == MAX_KEY)
{
@@ -10398,10 +10398,21 @@
int pk= 0;
int ai= 0;
+
+ if (info->tablespace)
+ info->store_on_disk = true;
+
for (i= 0; i < table->s->fields; i++)
{
Field *field= table->field[i];
const NDBCOL *col= tab->getColumn(i);
+ if (col->getStorageType() !=
+ (info->store_on_disk ? NdbDictionary::Column::StorageTypeDisk :
NdbDictionary::Column::StorageTypeMemory))
+ {
+ DBUG_PRINT("info", ("storage manner is changed with disk or memory"));
+ DBUG_RETURN(COMPATIBLE_DATA_NO);
+ }
+
if (field->flags & FIELD_IS_RENAMED)
{
DBUG_PRINT("info", ("Field has been renamed, copy table"));
@@ -10419,6 +10430,18 @@
if (field->flags & FIELD_IN_ADD_INDEX)
ai=1;
}
+
+ char *tablespace_name = get_tablespace_name(current_thd);
+ if (info->store_on_disk &&
+ info->tablespace &&
+ tablespace_name &&
+ strcmp(info->tablespace, tablespace_name))
+ {
+ DBUG_PRINT("info", ("tablespace is changed, old tablespace=%s, new tablespace=%s",
+ tablespace_name, info->tablespace));
+ DBUG_RETURN(COMPATIBLE_DATA_NO);
+ }
+
if (table_changes != IS_EQUAL_YES)
DBUG_RETURN(COMPATIBLE_DATA_NO);
| Thread |
|---|
| • bk commit into 5.1 tree (Justin.He:1.2343) BUG#25295 | justin.he | 30 Jan |