Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5a37050

Browse files
author
Vladimir Ershov
committed
fix tests && func names
1 parentbc54115 commit5a37050

File tree

3 files changed

+58
-8
lines changed

3 files changed

+58
-8
lines changed

‎expected/cron_string.out

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
create user __temp_robot;
2+
create user __temp_root WITH SUPERUSER;
3+
SET SESSION AUTHORIZATION __temp_root;
24
select schedule.create_job(
35
'{
46
"name": "Test @reboot",
@@ -52,12 +54,14 @@ select schedule.create_job(
5254
(1 row)
5355

5456
select * from schedule.cron order by id;
55-
id | node | name | comments |rule| next_time_statement | do_sql | same_transaction | onrollback_statement | active | broken | executor | owner | postpone | retry | max_run_time | max_instances | start_date | end_date | reason | _next_exec_time
56-
----+--------+----------------------+----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------------------------------------+------------------+----------------------+--------+--------+--------------+----------+-----------+-------+--------------+---------------+------------+----------+--------+-----------------
57-
1 | master | Test @reboot | | {"crontab": "@reboot", "onstart": 1}| | {"show all"} | f | | t | f | __temp_robot |postgres | | 0 | | 1 | | | |
58-
2 | master | Test 1 | | {"days": [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], "hours": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23], "wdays": [0, 1, 2, 3, 4, 5, 6], "months": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "crontab": "* * * * *", "minutes": [0, 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]} | | {"select 'this is every minute job'"} | f | | t | f | __temp_robot |postgres | @ 2 hours | 0 | | 1 | | | |
59-
3 | master | Test 2 4/4 2/4 * * * | | {"days": [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], "hours": [2, 6, 10, 14, 18, 22], "wdays": [0, 1, 2, 3, 4, 5, 6], "months": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "crontab": "4/4 2/4 * * *", "minutes": [4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56]} | | {"select pg_sleep(10)"} | f | | t | f | __temp_robot |postgres | | 0 | | 1 | | | |
60-
4 | master | Test 3 | | {"days": [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], "hours": [1], "wdays": [0, 4], "months": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "crontab": "23 1 * * THU,SUN", "minutes": [23]} | | {"select 'ok' as ok"} | f | | t | f |postgres | postgres | | 0 | | 1 | | | |
57+
id | node | name | comments | rule | next_time_statement | do_sql | same_transaction | onrollback_statement | active | broken | executor |owner | postpone | retry | max_run_time | max_instances | start_date | end_date | reason | _next_exec_time
58+
----+--------+----------------------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------------------------------------+------------------+----------------------+--------+--------+--------------+-------------+-----------+-------+--------------+---------------+------------+----------+--------+-----------------
59+
1 | master | Test @reboot | | {"crontab": "@reboot", "onstart": 1} | | {"show all"} | f | | t | f | __temp_robot |__temp_root | | 0 | | 1 | | | |
60+
2 | master | Test 1 | | {"days": [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], "hours": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23], "wdays": [0, 1, 2, 3, 4, 5, 6], "crontab": "* * * * *", "minutes": [0, 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]} | | {"select 'this is every minute job'"} | f | | t | f | __temp_robot |__temp_root | @ 2 hours | 0 | | 1 | | | |
61+
3 | master | Test 2 4/4 2/4 * * * | | {"days": [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], "hours": [2, 6, 10, 14, 18, 22], "wdays": [0, 1, 2, 3, 4, 5, 6], "crontab": "4/4 2/4 * * *", "minutes": [4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56]} | | {"select pg_sleep(10)"} | f | | t | f | __temp_robot |__temp_root | | 0 | | 1 | | | |
62+
4 | master | Test 3 | | {"days": [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], "hours": [1], "wdays": [0, 4], "crontab": "23 1 * * THU,SUN", "minutes": [23]} | | {"select 'ok' as ok"} | f | | t | f |__temp_root | __temp_root | | 0 | | 1 | | | |
6163
(4 rows)
6264

65+
RESET SESSION AUTHORIZATION;
66+
drop user __temp_root;
6367
drop user __temp_robot;

‎pgpro_scheduler--1.0.sql

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ $BODY$
804804
LANGUAGE plpgsql
805805
SECURITY DEFINER;
806806

807-
CREATEFUNCTIONschedule.get_user_owned_cron() RETURNS SETOFschedule.cron_recAS
807+
CREATEFUNCTIONschedule.get_owned_cron() RETURNS SETOFschedule.cron_recAS
808808
$BODY$
809809
DECLARE
810810
iischedule.cron;
@@ -820,7 +820,8 @@ $BODY$
820820
LANGUAGE plpgsql
821821
SECURITY DEFINER;
822822

823-
CREATEFUNCTIONschedule.get_user_owned_cron(usenametext) RETURNS SETOFschedule.cron_recAS
823+
824+
CREATEFUNCTIONschedule.get_owned_cron(usenametext) RETURNS SETOFschedule.cron_recAS
824825
$BODY$
825826
DECLARE
826827
iischedule.cron;
@@ -840,6 +841,26 @@ $BODY$
840841
LANGUAGE plpgsql
841842
SECURITY DEFINER;
842843

844+
CREATEFUNCTIONschedule.get_user_owned_cron() RETURNS SETOFschedule.cron_recAS
845+
$BODY$
846+
BEGIN
847+
RETURN QUERYSELECT*fromschedule.get_owned_cron();
848+
END
849+
$BODY$
850+
LANGUAGE plpgsql
851+
SECURITY DEFINER;
852+
853+
CREATEFUNCTIONschedule.get_user_owned_cron(usenametext) RETURNS SETOFschedule.cron_recAS
854+
$BODY$
855+
BEGIN
856+
RETURN QUERYSELECT*fromschedule.get_owned_cron(usename);
857+
END
858+
$BODY$
859+
LANGUAGE plpgsql
860+
SECURITY DEFINER;
861+
862+
863+
843864
CREATEFUNCTIONschedule.get_user_cron() RETURNS SETOFschedule.cron_recAS
844865
$BODY$
845866
DECLARE
@@ -910,6 +931,16 @@ $BODY$
910931
LANGUAGE plpgsql
911932
SECURITY DEFINER;
912933

934+
CREATEFUNCTIONschedule.get_active_jobs(usenametext) RETURNS SETOFschedule.cron_jobAS
935+
$BODY$
936+
DECLARE
937+
BEGIN
938+
RETURN QUERYSELECT*FROMschedule.get_user_active_jobs(usename);
939+
END
940+
$BODY$
941+
LANGUAGE plpgsql
942+
SECURITY DEFINER;
943+
913944
CREATEFUNCTIONschedule.get_active_jobs() RETURNS SETOFschedule.cron_jobAS
914945
$BODY$
915946
DECLARE
@@ -983,6 +1014,15 @@ $BODY$
9831014
LANGUAGE plpgsql
9841015
SECURITY DEFINER;
9851016

1017+
CREATEFUNCTIONschedule.get_log(usenametext) RETURNS SETOFschedule.cron_jobAS
1018+
$BODY$
1019+
BEGIN
1020+
RETURN QUERYSELECT*FROMschedule.get_user_log(usename);
1021+
END
1022+
$BODY$
1023+
LANGUAGE plpgsql
1024+
SECURITY DEFINER;
1025+
9861026
CREATEFUNCTIONschedule.get_log() RETURNS SETOFschedule.cron_jobAS
9871027
$BODY$
9881028
BEGIN

‎sql/cron_string.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
createuser__temp_robot;
2+
createuser__temp_root WITH SUPERUSER;
3+
4+
SET SESSION AUTHORIZATION __temp_root;
5+
26
selectschedule.create_job(
37
'{
48
"name": "Test @reboot",
@@ -37,4 +41,6 @@ select schedule.create_job(
3741

3842
select*fromschedule.cronorder by id;
3943

44+
RESET SESSION AUTHORIZATION;
45+
dropuser __temp_root;
4046
dropuser __temp_robot;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp