Commit fdc1fd6f authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-11311 Create federated table does not work as expected.

FederatedX wasn't discovering prefix keys correctly.
Of course, as it had the HA_NO_PREFIX_CHAR_KEYS table_flag set...
parent 54caaf68
...@@ -31,6 +31,38 @@ id group a\\b a\\ name ...@@ -31,6 +31,38 @@ id group a\\b a\\ name
1 1 2 NULL foo 1 1 2 NULL foo
2 1 2 NULL fee 2 1 2 NULL fee
DROP TABLE t1; DROP TABLE t1;
create table t1 (
a bigint(20) not null auto_increment,
b bigint(20) not null,
c tinyint(4) not null,
d varchar(4096) not null,
primary key (a),
key (b,c,d(255))
);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) NOT NULL AUTO_INCREMENT,
`b` bigint(20) NOT NULL,
`c` tinyint(4) NOT NULL,
`d` varchar(4096) NOT NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`,`c`,`d`(255))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create table t1 engine=federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) NOT NULL AUTO_INCREMENT,
`b` bigint(20) NOT NULL,
`c` tinyint(4) NOT NULL,
`d` varchar(4096) NOT NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`,`c`,`d`(255))
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'
drop table t1;
drop table t1;
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated; DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
......
...@@ -30,5 +30,29 @@ connection slave; ...@@ -30,5 +30,29 @@ connection slave;
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
#
#
#
create table t1 (
a bigint(20) not null auto_increment,
b bigint(20) not null,
c tinyint(4) not null,
d varchar(4096) not null,
primary key (a),
key (b,c,d(255))
);
show create table t1;
connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval create table t1 engine=federated
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
--replace_result $SLAVE_MYPORT SLAVE_PORT
show create table t1;
drop table t1;
connection slave;
drop table t1;
source include/federated_cleanup.inc; source include/federated_cleanup.inc;
...@@ -330,7 +330,7 @@ class ha_federatedx: public handler ...@@ -330,7 +330,7 @@ class ha_federatedx: public handler
return (HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED return (HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED
| HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS | | HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS |
HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_CAN_REPAIR | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_CAN_REPAIR |
HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE |
HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY); HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY);
} }
/* /*
......
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