@@ -52,40 +52,66 @@ Warnings:
52
52
Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
53
53
Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
54
54
CREATE TABLE t2 LIKE t1;
55
- ERROR HY000: Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
55
+ Warnings:
56
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
57
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
58
+ DROP TABLE t2;
56
59
FLUSH TABLES;
57
60
CREATE TABLE t2 LIKE t1;
58
- ERROR HY000: Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
61
+ Warnings:
62
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
63
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
64
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
65
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
66
+ DROP TABLE t2;
59
67
SHOW CREATE TABLE t1;
60
68
Table Create Table
61
69
t1 CREATE TABLE `t1` (
62
70
`a` char(5) DEFAULT NULL,
63
71
`v` varchar(5) GENERATED ALWAYS AS (`a`) STORED
64
72
) ENGINE=MyISAM DEFAULT CHARSET=latin1
73
+ ALTER TABLE t1 ADD b INT DEFAULT a;
65
74
Warnings:
66
75
Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
67
76
Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
68
- ALTER TABLE t1 ADD b INT DEFAULT a;
69
- ERROR HY000: Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
77
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
78
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
79
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
80
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
70
81
SHOW CREATE TABLE t1;
71
82
Table Create Table
72
83
t1 CREATE TABLE `t1` (
73
84
`a` char(5) DEFAULT NULL,
74
- `v` varchar(5) GENERATED ALWAYS AS (`a`) STORED
85
+ `v` varchar(5) GENERATED ALWAYS AS (`a`) STORED,
86
+ `b` int(11) DEFAULT `a`
75
87
) ENGINE=MyISAM DEFAULT CHARSET=latin1
88
+ Warnings:
89
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
90
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
76
91
SELECT * FROM t1;
77
- a v
78
- 1 1
79
- 2 2
80
- 3 3
92
+ a v b
93
+ 1 1 1
94
+ 2 2 2
95
+ 3 3 3
81
96
FLUSH TABLES;
82
97
ALTER TABLE t1 ADD c INT DEFAULT a;
83
- ERROR HY000: Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
98
+ Warnings:
99
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
100
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
101
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
102
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
103
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
104
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
105
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
106
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
84
107
SELECT * FROM t1;
85
- a v
86
- 1 1
87
- 2 2
88
- 3 3
108
+ a v b c
109
+ 1 1 1 1
110
+ 2 2 2 2
111
+ 3 3 3 3
112
+ Warnings:
113
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
114
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
89
115
DROP TABLE t1;
90
116
#
91
117
# Fixing a Maria-10.2.26 table with a stored VARCHAR column
@@ -177,30 +203,52 @@ Warnings:
177
203
Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
178
204
Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
179
205
CREATE TABLE t2 LIKE t1;
180
- ERROR HY000: Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
206
+ Warnings:
207
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
208
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
209
+ DROP TABLE t2;
181
210
FLUSH TABLES;
182
211
CREATE TABLE t2 LIKE t1;
183
- ERROR HY000: Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
212
+ Warnings:
213
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
214
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
215
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
216
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
217
+ DROP TABLE t2;
184
218
SHOW CREATE TABLE t1;
185
219
Table Create Table
186
220
t1 CREATE TABLE `t1` (
187
221
`a` char(5) DEFAULT NULL,
188
222
`v` varchar(5) GENERATED ALWAYS AS (`a`) VIRTUAL,
189
223
KEY `v` (`v`)
190
224
) ENGINE=MyISAM DEFAULT CHARSET=latin1
225
+ ALTER TABLE t1 ADD b INT DEFAULT a;
191
226
Warnings:
192
227
Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
193
228
Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
194
- ALTER TABLE t1 ADD b INT DEFAULT a;
195
- ERROR HY000: Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
229
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
230
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
231
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
232
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
196
233
FLUSH TABLES;
197
234
ALTER TABLE t1 ADD c INT DEFAULT a;
198
- ERROR HY000: Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
235
+ Warnings:
236
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
237
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
238
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
239
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
240
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
241
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
242
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
243
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
199
244
SELECT * FROM t1;
200
- a v
201
- 1 1
202
- 2 2
203
- 3 3
245
+ a v b c
246
+ 1 1 1 1
247
+ 2 2 2 2
248
+ 3 3 3 3
249
+ Warnings:
250
+ Warning 1901 Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `v`
251
+ Warning 1105 Expression depends on the @@sql_mode value PAD_CHAR_TO_FULL_LENGTH
204
252
DROP TABLE t1;
205
253
#
206
254
# Fixing a Maria-10.2.26 table with a virtual VARCHAR column
0 commit comments