From 0bb8d70fcebc0970f815cce92f85e12bdb20dc60 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 22 Aug 2016 09:20:17 +0200 Subject: [PATCH] initial preparation for local tests --- localtests/test.sh | 14 ++++++++++++++ localtests/unsigned/create.sql | 24 ++++++++++++++++++++++++ localtests/unsigned/test | 20 ++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100755 localtests/test.sh create mode 100644 localtests/unsigned/create.sql create mode 100644 localtests/unsigned/test diff --git a/localtests/test.sh b/localtests/test.sh new file mode 100755 index 0000000..6c03507 --- /dev/null +++ b/localtests/test.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +tests_path=$(dirname $0) +cd $tests_path + +gh-ost-test-mysql-master -e "select 1" +gh-ost-test-mysql-replica -e "select 1" + + +find . ! -path . -type d | cut -d "/" -f 2 | while read test_name ; do + echo "Testing: $test_name" +done diff --git a/localtests/unsigned/create.sql b/localtests/unsigned/create.sql new file mode 100644 index 0000000..d98bb07 --- /dev/null +++ b/localtests/unsigned/create.sql @@ -0,0 +1,24 @@ +drop table if exists gh_ost_test; +create table gh_ost_test ( + id int auto_increment, + i int not null, + bi bigint not null, + iu int unsigned not null, + biu bigint unsigned not null, + primary key(id) +) auto_increment=1; + +drop event if exists gh_ost_test; +delimiter ;; +create event gh_ost_test + on schedule every 1 second + starts current_timestamp + ends current_timestamp + interval 60 second + on completion not preserve + enable + do +begin + insert into gh_ost_test values (null, -2147483647, -9223372036854775807, 4294967295, 18446744073709551615); + set @last_insert_id := cast(last_insert_id() as signed); + update gh_ost_test set i=-2147483647+@last_insert_id, bi=-9223372036854775807+@last_insert_id, iu=4294967295-@last_insert_id, biu=18446744073709551615-@last_insert_id where id < @last_insert_id order by id desc limit 1; +end ;; diff --git a/localtests/unsigned/test b/localtests/unsigned/test new file mode 100644 index 0000000..b76c03f --- /dev/null +++ b/localtests/unsigned/test @@ -0,0 +1,20 @@ +go run go/cmd/gh-ost/main.go \ + --conf=/Users/shlomi-noach/tmp/gh-osc.cnf \ + --port=22297 \ + --database=test \ + --table=gh_ost_test \ + --alter="engine=innodb" \ + --exact-rowcount \ + --switch-to-rbr \ + --initially-drop-old-table \ + --initially-drop-ghost-table \ + --throttle-query="select timestampdiff(second, min(last_update), now()) < 5 from _gh_ost_test_ghc" \ + --serve-socket-file=/tmp/gh-ost.test.sock \ + --initially-drop-socket-file \ + --postpone-cut-over-flag-file=/tmp/gh-ost.postpone.flag \ + --execute \ + --verbose \ + --debug \ + --stack \ + + ~/sandboxes/rsandbox_mysql-5_6_28/m test -e "select * from $t" | md5sum ; ~/sandboxes/rsandbox_mysql-5_6_28/m test -e "select * from _${t}_del" | md5sum ; ~/sandboxes/rsandbox_mysql-5_6_28/m test -e "select * from $t limit 5"