Skip to content

Commit c0745e3

Browse files
committed
bugfix: CREATE...SELECT lost COMMENT and VERSIONING
1 parent 1d8b552 commit c0745e3

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

mysql-test/main/create_select_tmp.result

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,24 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
1818
select * from t2;
1919
ERROR 42S02: Table 'test.t2' doesn't exist
2020
drop table t1;
21+
set sql_mode='ignore_bad_table_options';
22+
create table t1 (
23+
f1 int invisible,
24+
f2 int comment 'a comment',
25+
f3 int foo="bar",
26+
f4 int check(f4 < 10),
27+
f5 int without system versioning
28+
) with system versioning as select 1 as f1,2 as f2,3 as f3,4 as f4,5 as f5;
29+
Warnings:
30+
Warning 1911 Unknown option 'foo'
31+
show create table t1;
32+
Table Create Table
33+
t1 CREATE TABLE `t1` (
34+
`f1` int(11) INVISIBLE DEFAULT NULL,
35+
`f2` int(11) DEFAULT NULL COMMENT 'a comment',
36+
`f3` int(11) DEFAULT NULL `foo`='bar',
37+
`f4` int(11) DEFAULT NULL CHECK (`f4` < 10),
38+
`f5` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
39+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
40+
drop table t1;
41+
set sql_mode=default;

mysql-test/main/create_select_tmp.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,17 @@ select * from t2;
3737
drop table t1;
3838

3939
# End of 4.1 tests
40+
41+
set sql_mode='ignore_bad_table_options';
42+
create table t1 (
43+
f1 int invisible,
44+
f2 int comment 'a comment',
45+
f3 int foo="bar",
46+
f4 int check(f4 < 10),
47+
f5 int without system versioning
48+
) with system versioning as select 1 as f1,2 as f2,3 as f3,4 as f4,5 as f5;
49+
show create table t1;
50+
drop table t1;
51+
set sql_mode=default;
52+
53+
# End of 10.4 tests

sql/field.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10768,6 +10768,9 @@ Column_definition::redefine_stage1_common(const Column_definition *dup_field,
1076810768
vcol_info= dup_field->vcol_info;
1076910769
invisible= dup_field->invisible;
1077010770
check_constraint= dup_field->check_constraint;
10771+
comment= dup_field->comment;
10772+
option_list= dup_field->option_list;
10773+
versioning= dup_field->versioning;
1077110774
}
1077210775

1077310776

0 commit comments

Comments
 (0)