Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
Description
Some character encodings are proper subsets of others. ASCII is a proper subset of latin1 or latin2 or UTF-8. The 3-byte UTF-8 is a proper subset of the 4-byte UTF-8.
When the character encoding of a column changes such that the storage encoding does not change, we should avoid rebuilding the table.
Likewise, when the collation of a column changes such that the encoding stays the same, we should avoid rebuilding the table.
Collations do not matter if the column is not indexed.
If the collation of an indexed column changes, then the affected indexes may have to be rebuilt. For certain collations we might avoid that as well. For example, changing the encoding and collation from binary 3-byte to binary 4-byte UTF-8 might not require any change.
When the collation change involves a column that is part of the PRIMARY KEY and we have determined that a collation change is necessary, then the whole table will have to be rebuilt.
Attachments
Issue Links
- blocks
-
MDEV-11424 Instant ALTER TABLE of failure-free record format changes
-
- Closed
-
- causes
-
MDEV-18584 Avoid copying when altering CHAR column in InnoDB table
-
- Confirmed
-
-
MDEV-19284 INSTANT ALTER with ucs2-to-utf16 conversion produces bad data
-
- Closed
-
-
MDEV-19285 INSTANT ALTER from ascii_general_ci to latin1_general_ci produces corrupt data
-
- Closed
-
-
MDEV-19524 Server crashes in Bitmap<64u>::is_clear_all / Field_longstr::csinfo_change_allows_instant_alter
-
- Closed
-
-
MDEV-20565 Assertion failure on CHANGE COLUMN…SYSTEM VERSIONING
-
- Closed
-
-
MDEV-22333 Assertion `len <= fixed_len' failed in rec_get_converted_size_comp_prefix_low on ALTER + INSERT
-
- Confirmed
-
-
MDEV-22334 Assertion `col->len == len' failed in innobase_rename_or_enlarge_column_try on ALTER
-
- Closed
-
-
MDEV-27280 server crashes on CHECK TABLE after COLLATE change for utf8mb4
-
- Closed
-
- is blocked by
-
MDEV-15563 Instant failure-free data type conversions
-
- Closed
-
-
MDEV-17965 Allow instant VARCHAR increase of indexed fields
-
- Closed
-
- relates to
-
MDEV-17773 Avoid table rebuild in ALTER TABLE on collation or charset changes for ENUM and SET
-
- Open
-
-
MDEV-27859 Instant change of ENUM is refused because of COLLATE mismatch
-
- Confirmed
-
-
MDEV-17301 Change of COLLATE unnecessarily requires ALGORITHM=COPY
-
- Closed
-
-
MDEV-26294 Duplicate entries in unique index not detected when changing collation with INPLACE / NOCOPY algoritm
-
- Closed
-
-
MDEV-27864 Alter table modify column for same data type copying table
-
- Closed
-
-
MDEV-28323 Redundant Item_func_conv_charset on WHERE utf8mb4_field=utf8mb3_field
-
- Open
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue blocks |
Assignee | Thirunarayanan B [ thiru ] | Eugene Kosov [ kevg ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Epic Link | PT-80 [ 68561 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Target end | 12/Feb/19 [ 2019-02-12 ] |
Comment | [ test ] |
Comment |
[ @marko, hello.
From Jira: > Correct: ROW_FORMAT=REDUNDANT will reserve n*mbmaxlen bytes for {{CHAR(n)}}. It will do that even when the column is NULL. The idea is to allow update-in-place. It's impossible in this case: ``` set names utf8mb4; create table t ( a char(4) charset utf8mb3 ) engine=innodb, row_format=redundant; insert into t values ('фыва'); alter table t modify a char(4) charset utf8mb4, algorithm=instant; update t set a=':thinking_face::thinking_face::thinking_face::thinking_face:'; ``` Actual allocated size for field `a` should be checked and it's small DELETE/INSERT should be performed instead. But inserting ':thinking_face::thinking_face::thinking_face:' is fine for update-in-place. So it looks like instant `ALTER CHARSET` is possible for `ROW_FORMAT=REDUNDANT` but additional checks are needed to be added. For example in `calc_row_difference()`: read an actual buffer length from an old record. ] |
Link |
This issue relates to |
Assignee | Eugene Kosov [ kevg ] | Marko Mäkelä [ marko ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Marko Mäkelä [ marko ] | Eugene Kosov [ kevg ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Link | This issue is blocked by MDEV-17520 [ MDEV-17520 ] |
Link | This issue relates to MDEV-17773 [ MDEV-17773 ] |
Link |
This issue is blocked by |
Link | This issue is blocked by MDEV-17520 [ MDEV-17520 ] |
Link |
This issue is blocked by |
Link | This issue is blocked by MDEV-18326 [ MDEV-18326 ] |
Link |
This issue causes |
Link | This issue causes MDEV-18584 [ MDEV-18584 ] |
issue.field.resolutiondate | 2019-02-14 18:44:02.0 | 2019-02-14 18:44:02.868 |
Fix Version/s | 10.4.3 [ 23230 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Link |
This issue causes |
Link |
This issue causes |
Link | This issue is blocked by MDEV-18326 [ MDEV-18326 ] |
NRE Projects | NRE-310017 RM_104_NRE | NRE-310017 RM_104_NRE RM_102ES_CANDIDATE RM_103ES_CANDIDATE |
Link |
This issue causes |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue causes |
Link |
This issue causes |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue causes |
Link |
This issue causes |
Link |
This issue causes |
Link | This issue causes MDEV-22333 [ MDEV-22333 ] |
Workflow | MariaDB v3 [ 86023 ] | MariaDB v4 [ 133495 ] |
Link |
This issue causes |
Link |
This issue causes |
Link |
This issue relates to |
Link |
This issue causes |
Link | This issue relates to MDEV-27859 [ MDEV-27859 ] |
Link | This issue relates to MDEV-28323 [ MDEV-28323 ] |
Link |
This issue relates to |