X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=sql%2Fsql.d%2F066-insert-unnorm-games_test.sql;fp=sql%2Fsql.d%2F066-insert-unnorm-games_test.sql;h=930815efa7e99e57bbe5e96b71e589ec7d7dae72;hb=db0ecb0547a5279447768ab01056151e8edbb2f6;hp=0000000000000000000000000000000000000000;hpb=330d75c856cac51f3136b1ab1791c8ef8c564ac0;p=brisk.git diff --git a/sql/sql.d/066-insert-unnorm-games_test.sql b/sql/sql.d/066-insert-unnorm-games_test.sql new file mode 100644 index 0000000..930815e --- /dev/null +++ b/sql/sql.d/066-insert-unnorm-games_test.sql @@ -0,0 +1,37 @@ +DELETE FROM #PFX#bin5_matches WHERE code = 100 OR code = 101; + +INSERT INTO #PFX#bin5_matches (code, ttok, tidx, mazzo_next, mult_next) VALUES (100, 'normalize_points', 2, 1, 1) RETURNING *; +INSERT INTO #PFX#bin5_table_orders (mcode, ucode, pos) VALUES (100, 10101, 0); +INSERT INTO #PFX#bin5_table_orders (mcode, ucode, pos) VALUES (100, 10102, 1); +INSERT INTO #PFX#bin5_table_orders (mcode, ucode, pos) VALUES (100, 10103, 2); +INSERT INTO #PFX#bin5_games (code, mcode, tstamp, act, asta_pnt, pnt, asta_win, friend, mazzo, mult) + VALUES (200, 100, to_timestamp(#NOW# - 1000), 2, 60, 0, -1, -1, 0, 0) RETURNING *; +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (200, 10101, 0); +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (200, 10102, 0); +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (200, 10103, 0); +UPDATE #PFX#bin5_matches SET (mazzo_next, mult_next) = (2, 0) WHERE code = 100; +INSERT INTO #PFX#bin5_games (code, mcode, tstamp, act, asta_pnt, pnt, asta_win, friend, mazzo, mult) + VALUES (201, 100, to_timestamp(#NOW# - 900), 0, 61, 37, 2, 1, 1, 1) RETURNING *; +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (201, 10101, 2); +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (201, 10102, -2); +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (201, 10103, -4); + + +INSERT INTO #PFX#bin5_matches (code, ttok, tidx, mazzo_next, mult_next) VALUES (101, 'normalize_points2', 2, 1, 0) RETURNING *; +INSERT INTO #PFX#bin5_table_orders (mcode, ucode, pos) VALUES (101, 10101, 0); +INSERT INTO #PFX#bin5_table_orders (mcode, ucode, pos) VALUES (101, 10102, 1); +INSERT INTO #PFX#bin5_table_orders (mcode, ucode, pos) VALUES (101, 10103, 2); +INSERT INTO #PFX#bin5_games (code, mcode, tstamp, act, asta_pnt, pnt, asta_win, friend, mazzo, mult) + VALUES (202, 101, to_timestamp(#NOW# - 800), 2, 60, 0, -1, -1, 0, 0) RETURNING *; +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (202, 10101, 0); +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (202, 10102, 0); +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (202, 10103, 0); +UPDATE #PFX#bin5_matches SET (mazzo_next, mult_next) = (2, 0) WHERE code = 100; +INSERT INTO #PFX#bin5_games (code, mcode, tstamp, act, asta_pnt, pnt, asta_win, friend, mazzo, mult) + VALUES (203, 101, to_timestamp(#NOW# - 700), 0, 81, 37, 2, 1, 1, 1) RETURNING *; +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (203, 10101, 6); +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (203, 10102, -6); +INSERT INTO #PFX#bin5_points (gcode, ucode, pts) VALUES (203, 10103, -12); + + +