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.

62 lines
1.6 KiB

  1. source include/have_tokudb.inc;
  2. source include/have_innodb.inc;
  3. set default_storage_engine='tokudb';
  4. disable_warnings;
  5. drop table if exists t;
  6. enable_warnings;
  7. create table tt (id int primary key, x int unsigned);
  8. insert into tt values (1,0),(2,pow(2,32)-1);
  9. create table ti like tt;
  10. alter table ti engine=innodb;
  11. insert into ti select * from tt;
  12. set tokudb_disable_slow_update=1;
  13. update noar tt set x=x+1 where id=1;
  14. update noar ti set x=x+1 where id=1;
  15. let $diff_tables = test.tt, test.ti;
  16. source include/diff_tables.inc;
  17. update noar tt set x=x-2 where id=1;
  18. update noar ti set x=if(x<2,0,x-2) where id=1;
  19. let $diff_tables = test.tt, test.ti;
  20. source include/diff_tables.inc;
  21. update noar tt set x=x+1 where id=1;
  22. update noar ti set x=x+1 where id=1;
  23. let $diff_tables = test.tt, test.ti;
  24. source include/diff_tables.inc;
  25. update noar tt set x=x-1 where id=2;
  26. update noar ti set x=x-1 where id=2;
  27. let $diff_tables = test.tt, test.ti;
  28. source include/diff_tables.inc;
  29. update noar tt set x=x+1 where id=2;
  30. update noar ti set x=x+1 where id=2;
  31. let $diff_tables = test.tt, test.ti;
  32. source include/diff_tables.inc;
  33. # test clip at maximum
  34. insert into tt values (4,pow(2,32)-10);
  35. insert into ti values (4,pow(2,32)-10);
  36. update noar tt set x=x+20 where id=4;
  37. update noar ti set x=x+20 where id=4;
  38. let $diff_tables = test.tt, test.ti;
  39. source include/diff_tables.inc;
  40. # test clip at minimum
  41. insert into tt values (5,10);
  42. insert into ti values (5,10);
  43. update noar tt set x=x-20 where id=5;
  44. update noar ti set x=if(x<20,0,x-20) where id=5;
  45. let $diff_tables = test.tt, test.ti;
  46. source include/diff_tables.inc;
  47. drop table tt, ti;