List:Commits« Previous MessageNext Message »
From:Martin Skold Date:January 8 2007 11:42am
Subject:bk commit into 5.1 tree (mskold:1.2382) BUG#24820
View as plain text  
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-01-08 11:42:32+01:00, mskold@stripped +3 -0
  bug#24820  CREATE INDEX ....USING HASH on NDB table creates ordered index, not HASH
index: Added error checking

  mysql-test/r/ndb_index_ordered.result@stripped, 2007-01-08 11:41:16+01:00, mskold@stripped
+9 -0
    bug#24820  CREATE INDEX ....USING HASH on NDB table creates ordered index, not HASH
index: Added error checking

  mysql-test/t/ndb_index_ordered.test@stripped, 2007-01-08 11:41:15+01:00, mskold@stripped
+14 -0
    bug#24820  CREATE INDEX ....USING HASH on NDB table creates ordered index, not HASH
index: Added error checking

  sql/ha_ndbcluster.cc@stripped, 2007-01-08 11:41:15+01:00, mskold@stripped +12 -1
    bug#24820  CREATE INDEX ....USING HASH on NDB table creates ordered index, not HASH
index: Added error checking

# 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-new-ndb

--- 1.25/mysql-test/r/ndb_index_ordered.result	2007-01-08 11:42:44 +01:00
+++ 1.26/mysql-test/r/ndb_index_ordered.result	2007-01-08 11:42:44 +01:00
@@ -835,3 +835,12 @@ a
 3
 delete from t1;
 drop table t1;
+create table nationaldish (DishID int(10) unsigned NOT NULL AUTO_INCREMENT,
+CountryCode char(3) NOT NULL,
+DishTitle varchar(64) NOT NULL,
+calories smallint(5) unsigned DEFAULT NULL,
+PRIMARY KEY (DishID)
+) ENGINE=ndbcluster;
+create index i on nationaldish(countrycode,calories) using hash;
+ERROR 42000: Table 'nationaldish' uses an extension that doesn't exist in this MySQL
version
+drop table nationaldish;

--- 1.28/mysql-test/t/ndb_index_ordered.test	2007-01-08 11:42:44 +01:00
+++ 1.29/mysql-test/t/ndb_index_ordered.test	2007-01-08 11:42:44 +01:00
@@ -455,3 +455,17 @@ rollback;
 select * from t1 order by a;
 delete from t1;
 drop table t1;
+
+# bug#24820 CREATE INDEX ....USING HASH on NDB table creates ordered index, not HASH
index
+
+create table nationaldish (DishID int(10) unsigned NOT NULL AUTO_INCREMENT,
+                           CountryCode char(3) NOT NULL,
+                           DishTitle varchar(64) NOT NULL,
+                           calories smallint(5) unsigned DEFAULT NULL,
+                           PRIMARY KEY (DishID)
+                           ) ENGINE=ndbcluster;
+
+--error ER_UNSUPPORTED_EXTENSION
+create index i on nationaldish(countrycode,calories) using hash;
+
+drop table nationaldish;

--- 1.389/sql/ha_ndbcluster.cc	2007-01-08 11:42:44 +01:00
+++ 1.390/sql/ha_ndbcluster.cc	2007-01-08 11:42:44 +01:00
@@ -5153,6 +5153,17 @@ int ha_ndbcluster::create_index(const ch
     error= create_unique_index(unique_name, key_info);
     break;
   case ORDERED_INDEX:
+    if (key_info->algorithm == HA_KEY_ALG_HASH)
+    {
+      push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+			  ER_ILLEGAL_HA_CREATE_OPTION,
+			  ER(ER_ILLEGAL_HA_CREATE_OPTION),
+			  ndbcluster_hton_name,
+			  "Ndb does not support non-unique "
+			  "hash based indexes");
+      error= HA_ERR_UNSUPPORTED;
+      break;
+    }
     error= create_ordered_index(name, key_info);
     break;
   default:
@@ -5247,7 +5258,7 @@ int ha_ndbcluster::add_index(TABLE *tabl
     KEY *key= key_info + idx;
     KEY_PART_INFO *key_part= key->key_part;
     KEY_PART_INFO *end= key_part + key->key_parts;
-    NDB_INDEX_TYPE idx_type= get_index_type_from_key(idx, key, false);
+    NDB_INDEX_TYPE idx_type= get_index_type_from_key(idx, key_info, false);
     DBUG_PRINT("info", ("Adding index: '%s'", key_info[idx].name));
     // Add fields to key_part struct
     for (; key_part != end; key_part++)
Thread
bk commit into 5.1 tree (mskold:1.2382) BUG#24820Martin Skold8 Jan