BUG #15133 "unique index with nullable value not accepted in federated table"

Added HA_NULL_IN_KEY to table flags to allow for nullable unique indexes
and added test to verify

ha_federated.h:
  BUG #15133 "unique index with nullable value not accepted in federated table"
  added HA_NULL_IN_KEY to table flags to allow for nullable unique indexes
federated.test:
  BUG #15133 "unique index with nullable value not accepted in federated table"
  New test to show that nullable unique indexes work
federated.result:
  BUG #15133 "unique index with nullable value not accepted in federated table"
  New results for new test
parent 71f5b499
......@@ -1784,6 +1784,33 @@ length(a)
5000
drop table t1;
drop table t1;
DROP TABLE IF EXISTS federated.test;
CREATE TABLE federated.test (
`i` int(11) NOT NULL,
`j` int(11) NOT NULL,
`c` varchar(30) default NULL,
PRIMARY KEY (`i`,`j`),
UNIQUE KEY `i` (`i`,`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS federated.test1;
DROP TABLE IF EXISTS federated.test2;
create table federated.test1 (
i int not null,
j int not null,
c varchar(30),
primary key (i,j),
unique key (i, c))
engine = federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/test';
create table federated.test2 (
i int default null,
j int not null,
c varchar(30),
key (i))
engine = federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/test';
drop table federated.test1, federated.test2;
drop table federated.test;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
......
......@@ -1499,4 +1499,49 @@ drop table t1;
connection master;
drop table t1;
#
# BUG #15133: unique index with nullable value not accepted in federated table
#
connection slave;
--disable_warnings
DROP TABLE IF EXISTS federated.test;
CREATE TABLE federated.test (
`i` int(11) NOT NULL,
`j` int(11) NOT NULL,
`c` varchar(30) default NULL,
PRIMARY KEY (`i`,`j`),
UNIQUE KEY `i` (`i`,`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--enable_warnings
connection master;
--disable_warnings
DROP TABLE IF EXISTS federated.test1;
DROP TABLE IF EXISTS federated.test2;
--enable_warnings
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval create table federated.test1 (
i int not null,
j int not null,
c varchar(30),
primary key (i,j),
unique key (i, c))
engine = federated
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/test';
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval create table federated.test2 (
i int default null,
j int not null,
c varchar(30),
key (i))
engine = federated
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/test';
drop table federated.test1, federated.test2;
connection slave;
drop table federated.test;
source include/federated_cleanup.inc;
......@@ -196,7 +196,9 @@ class ha_federated: public handler
/* fix server to be able to get remote server table flags */
return (HA_NOT_EXACT_COUNT |
HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED | HA_REC_NOT_IN_SEQ |
HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS| HA_NO_PREFIX_CHAR_KEYS);
HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS| HA_NO_PREFIX_CHAR_KEYS |
HA_NULL_IN_KEY
);
}
/*
This is a bitmap of flags that says how the storage engine
......
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