Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a03997db
Commit
a03997db
authored
May 01, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-6085 ALTER TABLE looses the connection string
parent
26618a54
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
sql/sql_table.cc
sql/sql_table.cc
+3
-0
storage/connect/mysql-test/connect/r/mysql.result
storage/connect/mysql-test/connect/r/mysql.result
+23
-0
storage/connect/mysql-test/connect/t/mysql.test
storage/connect/mysql-test/connect/t/mysql.test
+16
-0
No files found.
sql/sql_table.cc
View file @
a03997db
...
...
@@ -7239,6 +7239,9 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if
(
!
(
used_fields
&
HA_CREATE_USED_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
if
((
create_info
->
fields_option_struct
=
(
ha_field_option_struct
**
)
...
...
storage/connect/mysql-test/connect/r/mysql.result
View file @
a03997db
...
...
@@ -273,3 +273,26 @@ a b c d e
255 65535 4294967295 18446744073709551615 Hello
DROP TABLE t2;
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;
storage/connect/mysql-test/connect/t/mysql.test
View file @
a03997db
...
...
@@ -454,3 +454,19 @@ SELECT * FROM t2;
DROP
TABLE
t2
;
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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment