File tree Expand file tree Collapse file tree 4 files changed +17
-16
lines changed Expand file tree Collapse file tree 4 files changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -51,3 +51,7 @@ WHERE NAME='test/t';
51
51
TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE
52
52
# test/t 1 6 # Antelope Compact 0
53
53
DROP TABLE t;
54
+ CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
55
+ ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1);
56
+ ALTER TABLE t1 CHANGE c1 c1 INT NOT NULL,ADD KEY(c1);
57
+ DROP TABLE t1;
Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ WHERE NAME='test/t';
71
71
72
72
DROP TABLE t;
73
73
74
+ CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
75
+ ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1);
76
+ ALTER TABLE t1 CHANGE c1 c1 INT NOT NULL,ADD KEY(c1);
77
+ DROP TABLE t1;
78
+
74
79
# Check that all connections opened by test cases in this file are really
75
80
# gone so execution of other tests won't be affected by their presence.
76
81
--source include/wait_until_count_sessions.inc
Original file line number Diff line number Diff line change @@ -1594,6 +1594,7 @@ innobase_create_index_def(
1594
1594
1595
1595
if (key_clustered) {
1596
1596
DBUG_ASSERT (!(key->flags & HA_FULLTEXT));
1597
+ DBUG_ASSERT (key->flags & HA_NOSAME);
1597
1598
index->ind_type |= DICT_CLUSTERED;
1598
1599
} else if (key->flags & HA_FULLTEXT) {
1599
1600
DBUG_ASSERT (!(key->flags & HA_KEYFLAG_MASK
@@ -1909,14 +1910,9 @@ innobase_create_key_defs(
1909
1910
ulint primary_key_number;
1910
1911
1911
1912
if (new_primary) {
1912
- if (n_add == 0 ) {
1913
- DBUG_ASSERT (got_default_clust);
1914
- DBUG_ASSERT (altered_table->s ->primary_key
1915
- == 0 );
1916
- primary_key_number = 0 ;
1917
- } else {
1918
- primary_key_number = *add;
1919
- }
1913
+ DBUG_ASSERT (n_add || got_default_clust);
1914
+ DBUG_ASSERT (n_add || !altered_table->s ->primary_key );
1915
+ primary_key_number = altered_table->s ->primary_key ;
1920
1916
} else if (got_default_clust) {
1921
1917
/* Create the GEN_CLUST_INDEX */
1922
1918
index_def_t * index = indexdef++;
Original file line number Diff line number Diff line change @@ -1595,6 +1595,7 @@ innobase_create_index_def(
1595
1595
1596
1596
if (key_clustered) {
1597
1597
DBUG_ASSERT (!(key->flags & HA_FULLTEXT));
1598
+ DBUG_ASSERT (key->flags & HA_NOSAME);
1598
1599
index->ind_type |= DICT_CLUSTERED;
1599
1600
} else if (key->flags & HA_FULLTEXT) {
1600
1601
DBUG_ASSERT (!(key->flags & HA_KEYFLAG_MASK
@@ -1910,14 +1911,9 @@ innobase_create_key_defs(
1910
1911
ulint primary_key_number;
1911
1912
1912
1913
if (new_primary) {
1913
- if (n_add == 0 ) {
1914
- DBUG_ASSERT (got_default_clust);
1915
- DBUG_ASSERT (altered_table->s ->primary_key
1916
- == 0 );
1917
- primary_key_number = 0 ;
1918
- } else {
1919
- primary_key_number = *add;
1920
- }
1914
+ DBUG_ASSERT (n_add || got_default_clust);
1915
+ DBUG_ASSERT (n_add || !altered_table->s ->primary_key );
1916
+ primary_key_number = altered_table->s ->primary_key ;
1921
1917
} else if (got_default_clust) {
1922
1918
/* Create the GEN_CLUST_INDEX */
1923
1919
index_def_t * index = indexdef++;
You can’t perform that action at this time.
0 commit comments