Commit cdd0b62a authored by pekka@mysql.com's avatar pekka@mysql.com

Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb

into mysql.com:/space/pekka/ndb/version/my50-ndb
parents b9aa67bc 645f5733
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
#define NDB_TYPE_BLOB 20 #define NDB_TYPE_BLOB 20
#define NDB_TYPE_TEXT 21 #define NDB_TYPE_TEXT 21
#define NDB_TYPE_BIT 22 #define NDB_TYPE_BIT 22
#define NDB_TYPE_LONG_VARCHAR 23 #define NDB_TYPE_LONGVARCHAR 23
#define NDB_TYPE_LONG_VARBINARY 24 #define NDB_TYPE_LONGVARBINARY 24
#define NDB_TYPE_TIME 25 #define NDB_TYPE_TIME 25
#define NDB_TYPE_YEAR 26 #define NDB_TYPE_YEAR 26
#define NDB_TYPE_TIMESTAMP 27 #define NDB_TYPE_TIMESTAMP 27
......
...@@ -197,8 +197,8 @@ public: ...@@ -197,8 +197,8 @@ public:
Blob = NDB_TYPE_BLOB, ///< Binary large object (see NdbBlob) Blob = NDB_TYPE_BLOB, ///< Binary large object (see NdbBlob)
Text = NDB_TYPE_TEXT, ///< Text blob Text = NDB_TYPE_TEXT, ///< Text blob
Bit = NDB_TYPE_BIT, ///< Bit, length specifies no of bits Bit = NDB_TYPE_BIT, ///< Bit, length specifies no of bits
Longvarchar = NDB_TYPE_LONG_VARCHAR, ///< Length bytes: 2, little-endian Longvarchar = NDB_TYPE_LONGVARCHAR, ///< Length bytes: 2, little-endian
Longvarbinary = NDB_TYPE_LONG_VARBINARY, ///< Length bytes: 2, little-endian Longvarbinary = NDB_TYPE_LONGVARBINARY, ///< Length bytes: 2, little-endian
Time = NDB_TYPE_TIME, ///< Time without date Time = NDB_TYPE_TIME, ///< Time without date
Year = NDB_TYPE_YEAR, ///< Year 1901-2155 (1 byte) Year = NDB_TYPE_YEAR, ///< Year 1901-2155 (1 byte)
Timestamp = NDB_TYPE_TIMESTAMP ///< Unix time Timestamp = NDB_TYPE_TIMESTAMP ///< Unix time
......
...@@ -88,8 +88,8 @@ public: ...@@ -88,8 +88,8 @@ public:
Blob = NDB_TYPE_BLOB, Blob = NDB_TYPE_BLOB,
Text = NDB_TYPE_TEXT, Text = NDB_TYPE_TEXT,
Bit = NDB_TYPE_BIT, Bit = NDB_TYPE_BIT,
Longvarchar = NDB_TYPE_LONG_VARCHAR, Longvarchar = NDB_TYPE_LONGVARCHAR,
Longvarbinary = NDB_TYPE_LONG_VARBINARY, Longvarbinary = NDB_TYPE_LONGVARBINARY,
Time = NDB_TYPE_TIME, Time = NDB_TYPE_TIME,
Year = NDB_TYPE_YEAR, Year = NDB_TYPE_YEAR,
Timestamp = NDB_TYPE_TIMESTAMP, Timestamp = NDB_TYPE_TIMESTAMP,
......
...@@ -878,6 +878,8 @@ NdbSqlUtil::usable_in_pk(Uint32 typeId, const void* info) ...@@ -878,6 +878,8 @@ NdbSqlUtil::usable_in_pk(Uint32 typeId, const void* info)
const Type& type = getType(typeId); const Type& type = getType(typeId);
switch (type.m_typeId) { switch (type.m_typeId) {
case Type::Char: case Type::Char:
case Type::Varchar:
case Type::Longvarchar:
{ {
const CHARSET_INFO *cs = (const CHARSET_INFO*)info; const CHARSET_INFO *cs = (const CHARSET_INFO*)info;
return return
...@@ -891,6 +893,7 @@ NdbSqlUtil::usable_in_pk(Uint32 typeId, const void* info) ...@@ -891,6 +893,7 @@ NdbSqlUtil::usable_in_pk(Uint32 typeId, const void* info)
case Type::Undefined: case Type::Undefined:
case Type::Blob: case Type::Blob:
case Type::Text: case Type::Text:
case Type::Bit:
break; break;
default: default:
return true; return true;
...@@ -912,6 +915,8 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info) ...@@ -912,6 +915,8 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info)
return false; return false;
switch (type.m_typeId) { switch (type.m_typeId) {
case Type::Char: case Type::Char:
case Type::Varchar:
case Type::Longvarchar:
{ {
const CHARSET_INFO *cs = (const CHARSET_INFO*)info; const CHARSET_INFO *cs = (const CHARSET_INFO*)info;
return return
...@@ -926,6 +931,7 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info) ...@@ -926,6 +931,7 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info)
case Type::Undefined: case Type::Undefined:
case Type::Blob: case Type::Blob:
case Type::Text: case Type::Text:
case Type::Bit: // can be fixed
break; break;
default: default:
return true; return true;
......
...@@ -1647,7 +1647,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, ...@@ -1647,7 +1647,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
} }
// primary key type check // primary key type check
if (col->m_pk && ! NdbSqlUtil::usable_in_pk(col->m_type, col->m_cs)) { if (col->m_pk && ! NdbSqlUtil::usable_in_pk(col->m_type, col->m_cs)) {
m_error.code= 743; m_error.code= (col->m_cs != 0 ? 743 : 739);
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
// distribution key not supported for Char attribute // distribution key not supported for Char attribute
......
...@@ -1047,6 +1047,12 @@ NdbOperation::branch_col(Uint32 type, ...@@ -1047,6 +1047,12 @@ NdbOperation::branch_col(Uint32 type,
} }
} }
Uint32 tempData[2000];
if (((UintPtr)val & 3) != 0) {
memcpy(tempData, val, len);
val = tempData;
}
if (insertATTRINFO(Interpreter::BranchCol(c, 0, 0, false)) == -1) if (insertATTRINFO(Interpreter::BranchCol(c, 0, 0, false)) == -1)
DBUG_RETURN(-1); DBUG_RETURN(-1);
......
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