File tree Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -186,3 +186,9 @@ connection default;
186
186
xa recover;
187
187
formatID gtrid_length bqual_length data
188
188
DROP TABLE t;
189
+ #
190
+ # MDEV-35104 Invalid (old?) table or database name upon DDL on table with vector key and unique key
191
+ #
192
+ create table t (f varchar(1024) not null, v blob not null, unique(f)) engine=innodb charset=utf8mb3;
193
+ alter table t add vector (v);
194
+ drop table t;
Original file line number Diff line number Diff line change @@ -175,3 +175,10 @@ connection default;
175
175
#xa commit 'x';
176
176
xa recover;
177
177
DROP TABLE t;
178
+
179
+ --echo #
180
+ --echo # MDEV-35104 Invalid (old?) table or database name upon DDL on table with vector key and unique key
181
+ --echo #
182
+ create table t (f varchar(1024) not null, v blob not null, unique(f)) engine=innodb charset=utf8mb3;
183
+ alter table t add vector (v);
184
+ drop table t;
Original file line number Diff line number Diff line change @@ -275,6 +275,22 @@ is_partition(
275
275
276
276
277
277
278
+ /** Checks whether the file name belongs to a to the hlindex
279
+ @param[in] file_name file name
280
+ @return pointer to the end of the table name part of the file name, or NULL */
281
+ static
282
+ char*
283
+ is_hlindex(
284
+ /*=========*/
285
+ char* file_name)
286
+ {
287
+ /* We look for pattern #i# to see if the table is hlindex
288
+ MariaDB table. */
289
+ return strstr(file_name, "#i#");
290
+ }
291
+
292
+
293
+
278
294
/** Return the InnoDB ROW_FORMAT enum value
279
295
@param[in] row_format row_format from "innodb_default_row_format"
280
296
@return InnoDB ROW_FORMAT value from rec_format_t enum. */
@@ -20191,12 +20207,15 @@ innobase_rename_vc_templ(
20191
20207
20192
20208
/* For partition table, remove the partition name and use the
20193
20209
"main" table name to build the template */
20194
- char* is_part = is_partition(tbname);
20195
20210
20196
- if (is_part != NULL ) {
20211
+ if (char * is_part = is_partition(tbname) ) {
20197
20212
*is_part = '\0';
20198
20213
tbnamelen = ulint(is_part - tbname);
20199
20214
}
20215
+ else if (char *is_hli = is_hlindex(tbname)) {
20216
+ *is_hli = '\0';
20217
+ tbnamelen = ulint(is_hli - tbname);
20218
+ }
20200
20219
20201
20220
dbnamelen = filename_to_tablename(dbname, t_dbname,
20202
20221
MAX_DATABASE_NAME_LEN + 1);
You can’t perform that action at this time.
0 commit comments