Commit 9180e86
committed
MDEV-16465 Invalid (old?) table or database name or hang in ha_innobase::delete_table and log semaphore wait upon concurrent DDL with foreign keys
ALTER TABLE locks the table with TL_READ_NO_INSERT, to prevent the source table modifications while it's being copied. But there's an indirect way of modifying a table, via cascade FK actions. After previous commits, an attempt to modify an FK parent table will cause FK children to be prelocked, so the table-being-altered cannot be modified by a cascade FK action, because ALTER holds a lock and prelocking will wait. But if a new FK is being added by this very ALTER, then the target table is not locked yet (it's a temporary table). So, we have to lock FK parents explicitly.1 parent e81f101 commit 9180e86
File tree
6 files changed
+132
-9
lines changed- mysql-test/suite/innodb
- r
- t
- sql
6 files changed
+132
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4806 | 4806 | | |
4807 | 4807 | | |
4808 | 4808 | | |
4809 | | - | |
4810 | | - | |
| 4809 | + | |
| 4810 | + | |
4811 | 4811 | | |
4812 | 4812 | | |
4813 | 4813 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9057 | 9057 | | |
9058 | 9058 | | |
9059 | 9059 | | |
9060 | | - | |
| 9060 | + | |
| 9061 | + | |
9061 | 9062 | | |
| 9063 | + | |
9062 | 9064 | | |
9063 | 9065 | | |
9064 | 9066 | | |
| |||
9067 | 9069 | | |
9068 | 9070 | | |
9069 | 9071 | | |
| 9072 | + | |
| 9073 | + | |
| 9074 | + | |
| 9075 | + | |
| 9076 | + | |
| 9077 | + | |
| 9078 | + | |
| 9079 | + | |
| 9080 | + | |
| 9081 | + | |
| 9082 | + | |
| 9083 | + | |
| 9084 | + | |
| 9085 | + | |
| 9086 | + | |
| 9087 | + | |
| 9088 | + | |
| 9089 | + | |
| 9090 | + | |
| 9091 | + | |
| 9092 | + | |
| 9093 | + | |
| 9094 | + | |
| 9095 | + | |
| 9096 | + | |
| 9097 | + | |
| 9098 | + | |
| 9099 | + | |
| 9100 | + | |
| 9101 | + | |
| 9102 | + | |
| 9103 | + | |
| 9104 | + | |
| 9105 | + | |
| 9106 | + | |
| 9107 | + | |
| 9108 | + | |
| 9109 | + | |
| 9110 | + | |
| 9111 | + | |
| 9112 | + | |
9070 | 9113 | | |
9071 | | - | |
9072 | | - | |
9073 | 9114 | | |
9074 | 9115 | | |
9075 | 9116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1695 | 1695 | | |
1696 | 1696 | | |
1697 | 1697 | | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
1698 | 1706 | | |
1699 | 1707 | | |
1700 | 1708 | | |
1701 | 1709 | | |
1702 | 1710 | | |
1703 | 1711 | | |
1704 | 1712 | | |
1705 | | - | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
| 1713 | + | |
1709 | 1714 | | |
1710 | 1715 | | |
1711 | 1716 | | |
| |||
0 commit comments