Skip to content

Commit

Permalink
Filling out the truncation tests:
Browse files Browse the repository at this point in the history
- Adding scripts to do the various truncates we want run
- Clustertest code to run those truncates, and to drop test_237 table from
  replication so we can validate that bug #237 is properly fixed
  • Loading branch information
Christopher Browne committed Oct 6, 2011
1 parent 45f7547 commit c68dcbd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
33 changes: 20 additions & 13 deletions clustertest/regression/testtruncate/testtruncate.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,32 @@ function do_test(coordinator) {

run_sample_load(coordinator);

// now, truncate line_items
var TruncateList = ["truncate-basic", "truncate-cascade", "truncate-multiple"];

// another data load
run_sample_load(coordinator);

// now, truncate orders with cascade
for (var i=0 ; i < TruncateList.length; i++) {
var sqlScript = coordinator.readFile('regression/testtruncate/' + TruncateList[i] + '.sql');
psql = coordinator.createPsqlCommand('db1',sqlScript);
psql.run();
coordinator.join(psql);

// another data load
run_sample_load(coordinator);
run_sample_load(coordinator);
}

// truncate customers, orders, line_items

// drop test_237 out of replication
var slonikScript = "set drop table (origin=1, id=237);";
var preamble = get_slonik_preamble();
run_slonik('Drop test_237 table', coordinator, preamble, slonikScript);

// final data load
run_sample_load(coordinator);
wait_for_sync(coordinator);

// drop test_237 out of replication

// truncate test_237 on both db1 and db2
var dblist = ["db1", "db2"];
for (var i=0 ; i < dblist.length; i++) {
var sqlScript = coordinator.readFile('regression/testtruncate/truncate-237.sql');
psql = coordinator.createPsqlCommand(dblist[i],sqlScript);
psql.run();
coordinator.join(psql);
}

wait_for_sync(coordinator);
coordinator.log("done");
Expand Down
1 change: 1 addition & 0 deletions clustertest/regression/testtruncate/truncate-237.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
truncate test_237;
1 change: 1 addition & 0 deletions clustertest/regression/testtruncate/truncate-basic.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
truncate line_items;
1 change: 1 addition & 0 deletions clustertest/regression/testtruncate/truncate-cascade.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
truncate orders with cascade;
1 change: 1 addition & 0 deletions clustertest/regression/testtruncate/truncate-multiple.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
truncate customers, orders, line_items;

0 comments on commit c68dcbd

Please sign in to comment.