From: Date: January 8 2007 10:39am Subject: bk commit into 5.0 tree (mskold:1.2293) BUG#24820 List-Archive: http://lists.mysql.com/commits/17711 X-Bug: 24820 Message-Id: <20070108093903.29521215100@linux.site> Below is the list of changes that have just been committed into a local 5.0 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 10:38:53+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 10:38:39+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 10:38:39+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 10:38:39+01:00, mskold@stripped +10 -0 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.0 --- 1.22/mysql-test/r/ndb_index_ordered.result 2007-01-08 10:39:02 +01:00 +++ 1.23/mysql-test/r/ndb_index_ordered.result 2007-01-08 10:39:02 +01:00 @@ -658,3 +658,12 @@ insert into t1 (a, c) values (1,'aaa'),( select count(*) from t1 where c<'bbb'; count(*) 1 +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 using hash on nationaldish(countrycode,calories); +ERROR HY000: Can't create table './test/#sql-3c51_2.frm' (errno: 138) +drop table nationaldish; --- 1.25/mysql-test/t/ndb_index_ordered.test 2007-01-08 10:39:02 +01:00 +++ 1.26/mysql-test/t/ndb_index_ordered.test 2007-01-08 10:39:02 +01:00 @@ -356,3 +356,17 @@ insert into t1 (a, c) values (1,'aaa'),( select count(*) from t1 where c<'bbb'; # End of 4.1 tests + +# 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_CANT_CREATE_TABLE +create index i using hash on nationaldish(countrycode,calories); + +drop table nationaldish; --- 1.290/sql/ha_ndbcluster.cc 2007-01-08 10:39:03 +01:00 +++ 1.291/sql/ha_ndbcluster.cc 2007-01-08 10:39:03 +01:00 @@ -1107,6 +1107,16 @@ int ha_ndbcluster::build_index_list(Ndb error= create_unique_index(unique_index_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_UNSUPPORTED_EXTENSION, + ER(ER_UNSUPPORTED_EXTENSION), + "Ndb does not support non-unique " + "hash based indexes"); + error= HA_ERR_UNSUPPORTED; + break; + } error= create_ordered_index(index_name, key_info); break; default: