allow_update.py 1.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
# For step 1, we set all the values as 1
# for step 2, we set all the values as 2
# and so on
# check query result here means not

# clear env set up

# create database db update 1

# create table t (ts timestamp, a int)

# set an init time (such as $t0 = 1604295582000)

# Step 1
insert into t values ($t0, 1);
insert into t values ($t0 - 3, 1);
insert into t values ($t0 + 3, 1);

check query result

# Step 2
insert into t values ($t0, 2);
insert into t values ($t0 - 3, 2);
insert into t values ($t0 + 3, 2);

check query result

# Step 3
insert into t values ($t0 - 4, 3);
insert into t values ($t0 - 2, 3);
insert into t values ($t0 + 2, 3);
insert into t values ($t0 + 4, 3);

check query result

# Step 4
insert into t values ($t0 - 4, 4);
insert into t values ($t0 - 2, 4);
insert into t values ($t0 + 2, 4);
insert into t values ($t0 + 4, 4);

check query result

# Step 4
insert into t values ($t0 - 1, 5);
insert into t values ($t0 + 1, 5);

check query result

# Step 4
insert into t values ($t0 - 4, 6);
insert into t values ($t0 - 3, 6);
insert into t values ($t0 - 2, 6);
insert into t values ($t0 - 1, 6);
insert into t values ($t0, 6);
insert into t values ($t0 + 1, 6);
insert into t values ($t0 + 2, 6);
insert into t values ($t0 + 3, 6);
insert into t values ($t0 + 4, 6);

check query result

# Step 4

restart to commit

check query result