You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.5 KiB

  1. --source include/big_test.inc
  2. --source include/galera_cluster.inc
  3. # Save original auto_increment_offset values.
  4. --let $node_1=node_1
  5. --let $node_2=node_2
  6. --source include/auto_increment_offset_save.inc
  7. --connection node_1
  8. SET SESSION innodb_lock_wait_timeout=600;
  9. SET SESSION lock_wait_timeout=600;
  10. CREATE TABLE ten (f1 INTEGER) engine=InnoDB;
  11. INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
  12. CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
  13. INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
  14. --connection node_2
  15. SET SESSION wsrep_sync_wait = 0;
  16. --let $wsrep_provider_options_node2 = `SELECT @@wsrep_provider_options`
  17. SET SESSION wsrep_sync_wait = 15;
  18. SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H';
  19. SELECT COUNT(*) FROM t1;
  20. INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
  21. --connection node_1
  22. SELECT COUNT(*) FROM t1;
  23. UPDATE t1 SET f2 = 1;
  24. --connection node_2
  25. SELECT COUNT(*) FROM t1 WHERE f2 = 1;
  26. --connection node_1
  27. START TRANSACTION;
  28. SELECT COUNT(*) FROM t1;
  29. UPDATE t1 SET f2 = 3;
  30. --connection node_2
  31. START TRANSACTION;
  32. UPDATE t1 SET f2 = 4;
  33. --connection node_1
  34. COMMIT;
  35. --connection node_2
  36. --error ER_LOCK_DEADLOCK
  37. COMMIT;
  38. --disable_query_log
  39. --eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node2';
  40. --enable_query_log
  41. --source include/auto_increment_offset_restore.inc
  42. DROP TABLE t1;
  43. DROP TABLE ten;