Commit graph

16 commits

Author SHA1 Message Date
Thirunarayanan Balathandayuthapani
a2312b6fb2 MDEV-32017 Auto-increment no longer works for explicit FTS_DOC_ID
- InnoDB should avoid the sync commit operation when
there is nothing in fulltext cache. This is caused by
commit 1248fe7277 (MDEV-27582)
2023-10-12 14:48:43 +05:30
Alexander Barkov
f1544424de MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
Thirunarayanan Balathandayuthapani
1248fe7277 MDEV-27582 Fulltext DDL decrements the FTS_DOC_ID value
- InnoDB FTS DDL decrements the FTS_DOC_ID when there is a
deleted marked record involved. FTS_DOC_ID must never be
reused. The purpose of FTS_DOC_ID is to be a unique row
identifier that will be changed whenever a fulltext indexed
column is updated.
2022-03-03 19:03:31 +05:30
Marko Mäkelä
1864a8ea93 Merge 10.2 into 10.3 2021-05-24 09:38:49 +03:00
Thirunarayanan Balathandayuthapani
349d77ecdd MDEV-25721 Double free of table when inplace alter
FTS add index fails

Problem:
========
InnoDB double frees the table if auxiliary fts table
creation fails and fails to set the dict operation
for the transaction. It leads to failure while
dropping newly added index.

Solution:
=========
  InnoDB should avoid double freeing and set the
dictionary operation of transaction in
fts_create_common_tables()
2021-05-23 15:53:59 +05:30
Marko Mäkelä
049811ec3c Merge 10.2 into 10.3 2021-01-19 08:31:03 +02:00
Thirunarayanan Balathandayuthapani
fdc4b7a6b2 MDEV-21478 Inplace ALTER fails to report error when FTS_DOC_ID
with wrong data type is added

  Inplace alter fails to report error when fts_doc_id column with
wrong data type is added.

prepare_inplace_alter_table_dict(): Should check whether the column
is fts_doc_id. It should be of bigint type, should accept non null
data type and it should be in capital letters.
2021-01-11 18:12:59 +05:30
Marko Mäkelä
1df1a63924 Merge 10.2 into 10.3 2020-07-02 06:17:51 +03:00
Thirunarayanan Balathandayuthapani
e30c4cfc7a MDEV-22811 DDL fails to drop and re-create FTS index
Problem:
========
- InnoDB clears the fts resource when last FTS index is being dropped
if the table has user defined FTS_DOC_ID. While creating the new fts
index, InnoDB expects to have FTS resources.

Fix:
===
fts_drop_index(): Removed the fts resource clear.

fts_clear_all(): Clear the fts resource when there are no new fts
index to be added.

commit_cache_norebuild(), row_merge_drop_indexes():
Tries to call fts resource after removing associated fts index
from table object
2020-06-18 15:49:39 +05:30
Marko Mäkelä
4e75bfcb21 MDEV-18152 Assertion 'num_fts_index <= 1' failed
InnoDB does not allow creating multiple FULLTEXT INDEX
in ALGORITHM=INPLACE. This constraint was not being properly
enforced after MariaDB started to support ALGORITHM=INSTANT
and instant ADD COLUMN.

As a side effect of this bug, we again allow ALGORITHM=INPLACE
to rebuild a table when one FULLTEXT INDEX survives.
Also, we are returning a more accurate reason for refusing LOCK=NONE.

innobase_fulltext_exist(): Return the number of fulltext indexes.

ha_innobase::check_if_supported_inplace_alter(): If the table
needs to be rebuilt, refuse the operation if multiple fulltext
indexes would remain.
2019-01-18 12:39:19 +02:00
Thirunarayanan Balathandayuthapani
c5b28e55f6 MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT
Remove the warning for InnoDB rebuilding table to add column FTS_DOC_ID.
2018-05-07 14:58:11 +05:30
Thirunarayanan Balathandayuthapani
85cc6b70bd MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT
Introduced new alter algorithm type called NOCOPY & INSTANT for
inplace alter operation.

NOCOPY - Algorithm refuses any alter operation that would
rebuild the clustered index. It is a subset of INPLACE algorithm.

INSTANT - Algorithm allow any alter operation that would
modify only meta data. It is a subset of NOCOPY algorithm.

Introduce new variable called alter_algorithm. The values are
DEFAULT(0), COPY(1), INPLACE(2), NOCOPY(3), INSTANT(4)

Message to deprecate old_alter_table variable and make it alias
for alter_algorithm variable.

alter_algorithm variable for slave is always set to default.
2018-05-07 14:58:11 +05:30
Thirunarayanan Balathandayuthapani
fa68b88b5d MDEV-15828 Server crash or assertion `num_fts_index <= 1' failure up on ALTER TABLE adding two fulltext indexes
- Inplace alter shouldn't support if the number of newly added fts index
exceeds 1 even though the table undergoes rebuild. It is a regression of
MDEV-14016
2018-04-18 13:39:03 +05:30
Marko Mäkelä
3d798be1d4 MDEV-14655 Assertion `!fts_index' failed in prepare_inplace_alter_table_dict
MariaDB inherits the MySQL limitation that ALGORITHM=INPLACE cannot
create more than one FULLTEXT INDEX at a time. As part of the MDEV-11369
Instant ADD COLUMN refactoring, MariaDB 10.3.2 accidentally stopped
enforcing the restriction.

Actually, it is a bug in MySQL 5.6 and MariaDB 10.0 that an ALTER TABLE
statement with multiple ADD FULLTEXT INDEX but without explicit
ALGORITHM=INPLACE would return in an error message, rather than
executing the operation with ALGORITHM=COPY.

ha_innobase::check_if_supported_inplace_alter(): Enforce the restriction
on multiple FULLTEXT INDEX.

prepare_inplace_alter_table_dict(): Replace some code with debug
assertions. A "goto error_handled" at this point would result in
another error, because the reference count of ctx->new_table would be 0.
2018-01-15 10:57:16 +02:00
Monty
af7490f95d Remove end . from error messages to get them consistent
Fixed a few failing tests
2016-10-05 01:11:08 +03:00
unknown
4a38b9db9a Innodb full text search tests. 2013-09-24 16:47:33 +03:00