Below is the list of changes that have just been committed into a local
5.1 repository of marty. When marty 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-04-13 09:35:12+02:00, mskold@stripped +2 -0
Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.1-wl3627
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1-wl3680
MERGE: 1.2338.1.2
sql/ha_ndbcluster.cc@stripped, 2007-04-13 09:35:07+02:00, mskold@stripped +33 -0
Merge
MERGE: 1.372.1.1
sql/table.cc@stripped, 2007-04-13 09:27:43+02:00, mskold@stripped +0 -0
Auto merged
MERGE: 1.269.1.1
# 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: mskold
# Host: linux.site
# Root: /windows/Linux_space/MySQL/mysql-5.1-wl3680/RESYNC
--- 1.271/sql/table.cc 2007-04-13 09:35:26 +02:00
+++ 1.272/sql/table.cc 2007-04-13 09:35:26 +02:00
@@ -1290,6 +1290,8 @@ static int open_binary_frm(THD *thd, TAB
if (use_hash)
(void) hash_check(&share->name_hash);
#endif
+ if (buff)
+ my_free(buff, MYF(0));
DBUG_RETURN (0);
err:
--- 1.374/sql/ha_ndbcluster.cc 2007-04-13 09:35:26 +02:00
+++ 1.375/sql/ha_ndbcluster.cc 2007-04-13 09:35:26 +02:00
@@ -644,6 +644,25 @@ static bool ndb_supported_type(enum_fiel
}
#endif /* !DBUG_OFF */
+/*
+ Check if MySQL field type is mapped to a dynamic Ndb attribute
+*/
+static bool field_type_is_dynamic(enum_field_types type)
+{
+ switch (type) {
+ case MYSQL_TYPE_VAR_STRING:
+ case MYSQL_TYPE_VARCHAR:
+ case MYSQL_TYPE_TINY_BLOB:
+ case MYSQL_TYPE_BLOB:
+ case MYSQL_TYPE_MEDIUM_BLOB:
+ case MYSQL_TYPE_LONG_BLOB:
+ case MYSQL_TYPE_GEOMETRY:
+ return TRUE;
+ default:
+ break;
+ }
+ return FALSE;
+}
/*
Instruct NDB to set the value of the hidden primary key
@@ -4776,7 +4795,7 @@ int ha_ndbcluster::create(const char *na
bool create_from_engine= (info->table_options & HA_OPTION_CREATE_FROM_ENGINE);
bool is_truncate= (thd->lex->sql_command == SQLCOM_TRUNCATE);
char tablespace[FN_LEN];
- bool disk_storage= FALSE;
+ bool disk_storage= FALSE, use_tablespace= FALSE;
DBUG_ENTER("ha_ndbcluster::create");
DBUG_PRINT("enter", ("name: %s", name));
@@ -4855,7 +4874,7 @@ int ha_ndbcluster::create(const char *na
my_free((char*)pack_data, MYF(0));
if (info->storage_media == HA_SM_DISK)
- disk_storage= TRUE;
+ disk_storage= use_tablespace= TRUE;
for (i= 0; i < form->s->fields; i++)
{
@@ -4876,13 +4895,51 @@ int ha_ndbcluster::create(const char *na
col.setStorageType(NdbDictionary::Column::StorageTypeMemory);
break;
case(HA_SM_DISK):
- disk_storage= true;
+ use_tablespace= true;
col.setStorageType(NdbDictionary::Column::StorageTypeDisk);
break;
case(HA_SM_MEMORY):
col.setStorageType(NdbDictionary::Column::StorageTypeMemory);
break;
}
+
+ switch (field->field_format()) {
+ case(FIELD_FORMAT_TYPE_FIXED):
+ col.setDynamic(false);
+ break;
+ case(FIELD_FORMAT_TYPE_DYNAMIC):
+ col.setDynamic(true);
+ break;
+ case(FIELD_FORMAT_TYPE_DEFAULT):
+ default:
+ if (info->row_type==ROW_TYPE_DEFAULT)
+ {
+ bool is_dynamic= field_type_is_dynamic(field->type());
+
+ col.setDynamic(is_dynamic);
+ }
+ else
+ col.setDynamic(info->row_type==ROW_TYPE_DYNAMIC);
+ break;
+ }
+ DBUG_PRINT("info", ("Column %s is declared %s", field->field_name, (col.getDynamic())?"dynamic":"static"));
+ if (col.getStorageType() == NdbDictionary::Column::StorageTypeDisk)
+ {
+ if (col.getDynamic())
+ {
+ DBUG_PRINT("info", ("Dynamic disk stored column %s changed to static", field->field_name));
+ col.setDynamic(false);
+ }
+ if (field->field_format() == FIELD_FORMAT_TYPE_DYNAMIC)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ "DYNAMIC field %s declared with "
+ "STORAGE DISK is not supported, "
+ "field will become STATIC",
+ field->field_name);
+ }
+ }
tab.addColumn(col);
if (col.getPrimaryKey())
pk_length += (field->pack_length() + 3) / 4;
@@ -4911,7 +4968,7 @@ int ha_ndbcluster::create(const char *na
}
}
- if (disk_storage)
+ if (use_tablespace)
{
if (info->tablespace)
tab.setTablespaceName(info->tablespace);
@@ -4930,14 +4987,17 @@ int ha_ndbcluster::create(const char *na
"STORAGE DISK");
DBUG_RETURN(HA_ERR_UNSUPPORTED);
}
- disk_storage= TRUE; //if use tablespace, that also means store on disk
+ /*
+ if use tablespace, that also means store on disk
+ */
+ use_tablespace= disk_storage= TRUE;
tab.setTablespaceName(info->tablespace);
}
DBUG_PRINT("info", ("Table %s is %s stored with tables space %s",
m_tabname,
(disk_storage)?"disk":"memory",
- (disk_storage)?tab.getTablespaceName():"undefined"));
+ (use_tablespace)?tab.getTablespaceName():"undefined"));
// No primary key, create shadow key as 64 bit, auto increment
if (form->s->primary_key == MAX_KEY)
| Thread |
|---|
| • bk commit into 5.1 tree (mskold:1.2342) | Martin Skold | 13 Apr |