connect con2,localhost,root,,;
connection default;
create table t1 (
pk int not null primary key,
col1 int not null,
col2 int not null,
key(col1)
) engine=rocksdb;
create table ten(a int primary key);
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table one_k(a int primary key);
insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;
insert into t1 select a,a,a from one_k;
# Start the transaction, get the snapshot
begin;
select * from t1 where col1<10;
pk col1 col2 000 111 222 333 444 555 666 777 888 999
# Connect with another connection and make a conflicting change
connection con2;
begin;
update t1 set col2=123456 where pk=0;
commit;
connection default;
update t1 set col2=col2+1 where col1 < 10 limit 5; ERROR40001: Deadlock found when trying to get lock; try restarting transaction (snapshot conflict)
disconnect con2;
drop table t1, ten, one_k;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.