summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <pekka@clam.(none)>2007-01-23 13:22:48 +0100
committerunknown <pekka@clam.(none)>2007-01-23 13:22:48 +0100
commit190c4dd8985d97398bf572729101343467614e8c (patch)
tree1257adcbc0a16216d2a77b0b1f161dab3b3dc11d /sql/ha_ndbcluster.cc
parentf5da01db65e181236fc8028dc3b75c77995d2188 (diff)
parent8bf012189dbb46d398c2afa3914059a6a60c1b44 (diff)
downloadmariadb-git-190c4dd8985d97398bf572729101343467614e8c.tar.gz
Merge clam.ndb.mysql.com:/export/space/pekka/ndb/version/my50-ndb
into clam.ndb.mysql.com:/export/space/pekka/ndb/version/my51-ndb sql/ha_ndbcluster.cc: Auto merged
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc32
1 files changed, 21 insertions, 11 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 67ebde6df39..db011e02009 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -4644,19 +4644,29 @@ static int create_ndb_column(NDBCOL &col,
col.setType(NDBCOL::Text);
col.setCharset(cs);
}
- // Use "<=" even if "<" is the exact condition
- if (field->max_length() <= (1 << 8))
- goto mysql_type_tiny_blob;
- else if (field->max_length() <= (1 << 16))
{
- col.setInlineSize(256);
- col.setPartSize(2000);
- col.setStripeSize(16);
+ Field_blob *field_blob= (Field_blob *)field;
+ /*
+ * max_data_length is 2^8-1, 2^16-1, 2^24-1 for tiny, blob, medium.
+ * Tinyblob gets no blob parts. The other cases are just a crude
+ * way to control part size and striping.
+ *
+ * In mysql blob(256) is promoted to blob(65535) so it does not
+ * in fact fit "inline" in NDB.
+ */
+ if (field_blob->max_data_length() < (1 << 8))
+ goto mysql_type_tiny_blob;
+ else if (field_blob->max_data_length() < (1 << 16))
+ {
+ col.setInlineSize(256);
+ col.setPartSize(2000);
+ col.setStripeSize(16);
+ }
+ else if (field_blob->max_data_length() < (1 << 24))
+ goto mysql_type_medium_blob;
+ else
+ goto mysql_type_long_blob;
}
- else if (field->max_length() <= (1 << 24))
- goto mysql_type_medium_blob;
- else
- goto mysql_type_long_blob;
break;
mysql_type_medium_blob:
case MYSQL_TYPE_MEDIUM_BLOB: