Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](schema-change) fix the bug of alter column nullable when double writing (#41737) #42351

Merged
merged 5 commits into from
Oct 30, 2024

Commits on Oct 23, 2024

  1. [fix](schema-change) fix the bug of alter column nullable when double…

    … writing (apache#41737)
    
    CREATE TABLE t (
        `k1` VARCHAR(30) NOT NULL,
        `v1` INT NOT NULL
    )
    
    alter table t modify column `v1` INT NULL
    
    insert into value ('1', 2), ('1', 3);
    
    core dump
    
    Schema change leads to double writing, during double writing, the two
    schemas and slots are as follows
    
    ```
    old tablet schema
    k1 varchar not null
    v1 int not null
    ```
    
    ```
    new tablet scheam
    k1 varchar not null
    v1 int null
    ```
    
    ```
    slot
    k1 varchar not null
    v1 int not null
    v1 int null
    ```
    
    During the double writing process, when selecting slots through the
    schema, only the column names and types were compared, without comparing
    the nullable attributes, which led to the selection of the wrong slot.
    Since the slot determines the nullable attribute of the block, the
    nullable attribute of the columns in the block is different from that of
    the columns in the schema, resulting in a core dump.
    luwei16 committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    f2894ba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    02d0052 View commit details
    Browse the repository at this point in the history
  3. fix

    luwei16 committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    0cb8b92 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2024

  1. fix

    luwei16 committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    29f4dec View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2024

  1. fix case

    luwei16 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    03e85d5 View commit details
    Browse the repository at this point in the history