
create database if not exists derived_tables_bug_test;

use derived_tables_bug_test;

drop table if exists test_table;
create table test_table
(
    id              bigint not null auto_increment,
    test_field      varchar(20),
    primary key(id)
);

insert into test_table
(
    id,
    test_field
)
values
(1, null),
(2, null),
(3, null);

update test_table tt
set 
    tt.test_field = 
        (
            select 'value'
            from (select * from test_table) as tt_derived
            where tt_derived.id = tt.id + 1
        )
where tt.id = 1;
select * from test_table;