mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-6085 ALTER TABLE looses the connection string
This commit is contained in:
@ -7239,6 +7239,9 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||||||
if (!(used_fields & HA_CREATE_USED_TRANSACTIONAL))
|
if (!(used_fields & HA_CREATE_USED_TRANSACTIONAL))
|
||||||
create_info->transactional= table->s->transactional;
|
create_info->transactional= table->s->transactional;
|
||||||
|
|
||||||
|
if (!(used_fields & HA_CREATE_USED_CONNECTION))
|
||||||
|
create_info->connect_string= table->s->connect_string;
|
||||||
|
|
||||||
restore_record(table, s->default_values); // Empty record for DEFAULT
|
restore_record(table, s->default_values); // Empty record for DEFAULT
|
||||||
|
|
||||||
if ((create_info->fields_option_struct= (ha_field_option_struct**)
|
if ((create_info->fields_option_struct= (ha_field_option_struct**)
|
||||||
|
@ -273,3 +273,26 @@ a b c d e
|
|||||||
255 65535 4294967295 18446744073709551615 Hello
|
255 65535 4294967295 18446744073709551615 Hello
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
INSERT INTO t1 VALUES (10),(20),(30);
|
||||||
|
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@localhost:PORT/test/t1';
|
||||||
|
SELECT * FROM t2;
|
||||||
|
a
|
||||||
|
10
|
||||||
|
20
|
||||||
|
30
|
||||||
|
ALTER TABLE t2 MODIFY a TINYINT;
|
||||||
|
Warnings:
|
||||||
|
Warning 1105 This is an outward table, table data were not modified.
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`a` tinyint(4) DEFAULT NULL
|
||||||
|
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mysql://root@localhost:PORT/test/t1' `TABLE_TYPE`='MYSQL'
|
||||||
|
SELECT * FROM t2;
|
||||||
|
a
|
||||||
|
10
|
||||||
|
20
|
||||||
|
30
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -454,3 +454,19 @@ SELECT * FROM t2;
|
|||||||
|
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-6085 ALTER TABLE looses the connection string
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
INSERT INTO t1 VALUES (10),(20),(30);
|
||||||
|
--replace_result $PORT PORT
|
||||||
|
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@localhost:$PORT/test/t1'
|
||||||
|
SELECT * FROM t2;
|
||||||
|
ALTER TABLE t2 MODIFY a TINYINT;
|
||||||
|
--replace_result $PORT PORT
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user