1
0
mirror of https://github.com/MariaDB/server.git synced 2025-10-25 18:38:00 +03:00
Files
mariadb/mysql-test/t/ndb_partition_key.test
unknown 5088fefb63 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/jonas/src/mysql-5.1-push


mysql-test/t/ndb_partition_key.test:
  Auto merged
sql/ha_innodb.h:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
storage/ndb/include/mgmapi/mgmapi.h:
  Auto merged
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  Auto merged
storage/ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
storage/ndb/src/mgmsrv/ConfigInfo.hpp:
  Auto merged
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Auto merged
storage/ndb/tools/Makefile.am:
  Auto merged
storage/ndb/tools/ndb_condig.cpp:
  Auto merged
2005-08-08 22:21:43 +02:00

59 lines
1.4 KiB
Plaintext

-- source include/have_ndb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
# Basic syntax test
#
# Support for partition key verified
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c))
ENGINE = NDB
PARTITION BY KEY (a,b);
insert into t1 values (1,1,1,1);
select * from t1;
update t1 set d = 2 where a = 1 and b = 1 and c = 1;
select * from t1;
delete from t1;
select * from t1;
drop table t1;
# only support for partition key on primary key
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b))
ENGINE = NDB
PARTITION BY KEY (c);
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b))
ENGINE = NDB
PARTITION BY KEY (a);
insert into t1 values
(1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3),
(1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3);
select * from t1 order by b;
DROP TABLE t1;
#
# Test partition and char support
#
CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT,
PRIMARY KEY USING HASH (a,b,c))
ENGINE=NDB
DEFAULT CHARSET=latin1
PARTITION BY KEY (b);
insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1);
# should show only one attribute with DISTRIBUTION KEY
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | sed 's/Version: [0-9]*//' | sed 's/\(Length of frm data: \)[0-9]*/\1#/'
DROP TABLE t1;