MySQL Forums
Forum List  »  NDB clusters

Re: unique key and nulls
Posted by: Adam D
Date: May 10, 2006 07:10PM

I did this on my 5.1.9 test cluster;

mysql> create table MASTER_INDEX (
-> x VARCHAR(15) NOT NULL,
-> y VARCHAR(15),
-> a VARCHAR(1000),
-> b VARCHAR(1000),
-> c VARCHAR(1000),
-> m CHAR(2),
-> n CHAR(2),
-> o CHAR(2),
-> p CHAR(2),
-> PRIMARY KEY HASH (x))
-> ENGINE=NDBCLUSTER;
Query OK, 0 rows affected (0.68 sec)

mysql> desc MASTER_INDEX;
+-------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| x | varchar(15) | NO | PRI | | |
| y | varchar(15) | YES | | | |
| a | varchar(1000) | YES | | | |
| b | varchar(1000) | YES | | | |
| c | varchar(1000) | YES | | | |
| m | char(2) | YES | | | |
| n | char(2) | YES | | | |
| o | char(2) | YES | | | |
| p | char(2) | YES | | | |
+-------+---------------+------+-----+---------+-------+
9 rows in set (0.00 sec)

mysql> create unique index idx_a on MASTER_INDEX(a);
Query OK, 0 rows affected (0.78 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> create unique index idx_b on MASTER_INDEX(b);
Query OK, 0 rows affected (0.75 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> create unique index idx_c on MASTER_INDEX(c);
Query OK, 0 rows affected (0.76 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> create unique index idx_d on MASTER_INDEX(d);
ERROR 1072 (42000): Key column 'd' doesn't exist in table
mysql>

Options: Reply• Quote


Subject
Views
Written By
Posted
2617
May 09, 2006 06:43AM
1720
May 09, 2006 11:42PM
1511
May 10, 2006 06:01AM
2863
May 10, 2006 07:52AM
Re: unique key and nulls
1753
May 10, 2006 07:10PM
1452
May 11, 2006 04:15AM
1623
May 11, 2006 03:20PM
1318
May 11, 2006 04:01PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.