!233 修复set int64类型GUC时的问题

Merge pull request !233 from gentle_hu/master
This commit is contained in:
opengauss-bot
2020-09-18 14:45:58 +08:00
committed by Gitee
5 changed files with 87 additions and 22 deletions

View File

@ -14285,7 +14285,7 @@ bool parse_int64(const char* value, int64* result, const char** hintmsg)
val = strtol(value, &endptr, 10);
#endif
if (endptr == value) {
if (endptr == value || *endptr != '\0') {
return false; /* no HINT for integer syntax error */
}

View File

@ -120,6 +120,13 @@ SHOW parctl_min_cost;
(1 row)
ALTER SYSTEM SET parctl_min_cost TO 1000;
SHOW vacuum_defer_cleanup_age;
vacuum_defer_cleanup_age
--------------------------
0
(1 row)
ALTER SYSTEM SET vacuum_defer_cleanup_age TO 50000;
select pg_sleep(2); -- wait to reload postgres.conf file
pg_sleep
----------
@ -162,6 +169,13 @@ SHOW parctl_min_cost;
(1 row)
ALTER SYSTEM SET parctl_min_cost TO 100000;
SHOW vacuum_defer_cleanup_age;
vacuum_defer_cleanup_age
--------------------------
50000
(1 row)
ALTER SYSTEM SET vacuum_defer_cleanup_age TO 0;
select pg_sleep(2); -- wait to reload postgres.conf file
pg_sleep
----------
@ -216,6 +230,10 @@ ALTER SYSTEM SET parctl_min_cost TO -100;
ERROR: -100 is outside the valid range for parameter "parctl_min_cost" (-1 .. 2147483647)
ALTER SYSTEM SET parctl_min_cost TO 1.1;
ERROR: invalid value for parameter "parctl_min_cost": "1.1"
ALTER SYSTEM SET vacuum_defer_cleanup_age TO 5.1;
ERROR: parameter "vacuum_defer_cleanup_age" requires a numeric value
ALTER SYSTEM SET vacuum_defer_cleanup_age TO '8#@da%';
ERROR: parameter "vacuum_defer_cleanup_age" requires a numeric value
select pg_sleep(2); -- wait to reload postgres.conf file
pg_sleep
----------
@ -383,24 +401,26 @@ END;
-- shoule be audited.
------------------------------------------------------
SELECT type,result,userid,database,client_conninfo,object_name,detail_info FROM pg_query_audit('2000-01-01 08:00:00','9999-01-01 08:00:00');
type | result | userid | database | client_conninfo | object_name | detail_info
----------------+--------+--------+------------+-----------------+-----------------------+------------------------------------------------------
internal_event | ok | 10 | regression | gsql@[local] | null | SELECT pg_delete_audit('2000-01-01 ','9999-01-01');
set_parameter | ok | 10 | regression | gsql@[local] | enable_thread_pool | ALTER SYSTEM SET enable_thread_pool to on;
set_parameter | ok | 10 | regression | gsql@[local] | enable_thread_pool | ALTER SYSTEM SET enable_thread_pool to off;
set_parameter | ok | 10 | regression | gsql@[local] | password_lock_time | ALTER SYSTEM SET password_lock_time to 1.1;
set_parameter | ok | 10 | regression | gsql@[local] | autovacuum | ALTER SYSTEM SET autovacuum to off;
set_parameter | ok | 10 | regression | gsql@[local] | log_destination | ALTER SYSTEM SET log_destination to 'stderr,csvlog';
set_parameter | ok | 10 | regression | gsql@[local] | autovacuum_mode | ALTER SYSTEM SET autovacuum_mode to 'analyze';
set_parameter | ok | 10 | regression | gsql@[local] | parctl_min_cost | ALTER SYSTEM SET parctl_min_cost TO 1000;
set_parameter | ok | 10 | regression | gsql@[local] | password_lock_time | ALTER SYSTEM SET password_lock_time to 1;
set_parameter | ok | 10 | regression | gsql@[local] | autovacuum | ALTER SYSTEM SET autovacuum to on;
set_parameter | ok | 10 | regression | gsql@[local] | log_destination | ALTER SYSTEM SET log_destination to 'stderr';
set_parameter | ok | 10 | regression | gsql@[local] | autovacuum_mode | ALTER SYSTEM SET autovacuum_mode to mix;
set_parameter | ok | 10 | regression | gsql@[local] | parctl_min_cost | ALTER SYSTEM SET parctl_min_cost TO 100000;
set_parameter | ok | 10 | regression | gsql@[local] | ignore_system_indexes | ALTER SYSTEM SET ignore_system_indexes TO on;
set_parameter | ok | 10 | regression | gsql@[local] | ignore_system_indexes | ALTER SYSTEM SET ignore_system_indexes TO off;
set_parameter | ok | 10 | regression | gsql@[local] | parctl_min_cost | ALTER SYSTEM SET parctl_min_cost TO 1000;
set_parameter | ok | 10 | regression | gsql@[local] | parctl_min_cost | ALTER SYSTEM SET parctl_min_cost TO 100000;
(17 rows)
type | result | userid | database | client_conninfo | object_name | detail_info
----------------+--------+--------+------------+-----------------+--------------------------+------------------------------------------------------
internal_event | ok | 10 | regression | gsql@[local] | null | SELECT pg_delete_audit('2000-01-01 ','9999-01-01');
set_parameter | ok | 10 | regression | gsql@[local] | enable_thread_pool | ALTER SYSTEM SET enable_thread_pool to on;
set_parameter | ok | 10 | regression | gsql@[local] | enable_thread_pool | ALTER SYSTEM SET enable_thread_pool to off;
set_parameter | ok | 10 | regression | gsql@[local] | password_lock_time | ALTER SYSTEM SET password_lock_time to 1.1;
set_parameter | ok | 10 | regression | gsql@[local] | autovacuum | ALTER SYSTEM SET autovacuum to off;
set_parameter | ok | 10 | regression | gsql@[local] | log_destination | ALTER SYSTEM SET log_destination to 'stderr,csvlog';
set_parameter | ok | 10 | regression | gsql@[local] | autovacuum_mode | ALTER SYSTEM SET autovacuum_mode to 'analyze';
set_parameter | ok | 10 | regression | gsql@[local] | parctl_min_cost | ALTER SYSTEM SET parctl_min_cost TO 1000;
set_parameter | ok | 10 | regression | gsql@[local] | vacuum_defer_cleanup_age | ALTER SYSTEM SET vacuum_defer_cleanup_age TO 50000;
set_parameter | ok | 10 | regression | gsql@[local] | password_lock_time | ALTER SYSTEM SET password_lock_time to 1;
set_parameter | ok | 10 | regression | gsql@[local] | autovacuum | ALTER SYSTEM SET autovacuum to on;
set_parameter | ok | 10 | regression | gsql@[local] | log_destination | ALTER SYSTEM SET log_destination to 'stderr';
set_parameter | ok | 10 | regression | gsql@[local] | autovacuum_mode | ALTER SYSTEM SET autovacuum_mode to mix;
set_parameter | ok | 10 | regression | gsql@[local] | parctl_min_cost | ALTER SYSTEM SET parctl_min_cost TO 100000;
set_parameter | ok | 10 | regression | gsql@[local] | vacuum_defer_cleanup_age | ALTER SYSTEM SET vacuum_defer_cleanup_age TO 0;
set_parameter | ok | 10 | regression | gsql@[local] | ignore_system_indexes | ALTER SYSTEM SET ignore_system_indexes TO on;
set_parameter | ok | 10 | regression | gsql@[local] | ignore_system_indexes | ALTER SYSTEM SET ignore_system_indexes TO off;
set_parameter | ok | 10 | regression | gsql@[local] | parctl_min_cost | ALTER SYSTEM SET parctl_min_cost TO 1000;
set_parameter | ok | 10 | regression | gsql@[local] | parctl_min_cost | ALTER SYSTEM SET parctl_min_cost TO 100000;
(19 rows)

View File

@ -887,3 +887,30 @@ show analysis_options;
ALL,on(),off(LLVM_COMPILE,HASH_CONFLICT,STREAM_DATA_CHECK)
(1 row)
---
-- int64 type
---
show vacuum_freeze_table_age;
vacuum_freeze_table_age
-------------------------
15000000000
(1 row)
set vacuum_freeze_table_age to 100;
set vacuum_freeze_table_age to 1.3;
ERROR: parameter "vacuum_freeze_table_age" requires a numeric value
set vacuum_freeze_table_age to '1DSADA';
ERROR: parameter "vacuum_freeze_table_age" requires a numeric value
show vacuum_freeze_table_age;
vacuum_freeze_table_age
-------------------------
100
(1 row)
reset vacuum_freeze_table_age;
show vacuum_freeze_table_age;
vacuum_freeze_table_age
-------------------------
15000000000
(1 row)

View File

@ -47,7 +47,8 @@ SHOW autovacuum_mode;
ALTER SYSTEM SET autovacuum_mode to 'analyze';
SHOW parctl_min_cost;
ALTER SYSTEM SET parctl_min_cost TO 1000;
SHOW vacuum_defer_cleanup_age;
ALTER SYSTEM SET vacuum_defer_cleanup_age TO 50000;
select pg_sleep(2); -- wait to reload postgres.conf file
@ -63,6 +64,8 @@ SHOW autovacuum_mode;
ALTER SYSTEM SET autovacuum_mode to mix;
SHOW parctl_min_cost;
ALTER SYSTEM SET parctl_min_cost TO 100000;
SHOW vacuum_defer_cleanup_age;
ALTER SYSTEM SET vacuum_defer_cleanup_age TO 0;
select pg_sleep(2); -- wait to reload postgres.conf file
@ -82,6 +85,8 @@ ALTER SYSTEM SET autovacuum_mode to 123;
ALTER SYSTEM SET autovacuum_mode to lalala;
ALTER SYSTEM SET parctl_min_cost TO -100;
ALTER SYSTEM SET parctl_min_cost TO 1.1;
ALTER SYSTEM SET vacuum_defer_cleanup_age TO 5.1;
ALTER SYSTEM SET vacuum_defer_cleanup_age TO '8#@da%';
select pg_sleep(2); -- wait to reload postgres.conf file
@ -147,3 +152,4 @@ END;
------------------------------------------------------
SELECT type,result,userid,database,client_conninfo,object_name,detail_info FROM pg_query_audit('2000-01-01 08:00:00','9999-01-01 08:00:00');

View File

@ -325,3 +325,15 @@ set analysis_options = "on(STREAM_DATA_CHECK)";
show analysis_options;
reset analysis_options;
show analysis_options;
---
-- int64 type
---
show vacuum_freeze_table_age;
set vacuum_freeze_table_age to 100;
set vacuum_freeze_table_age to 1.3;
set vacuum_freeze_table_age to '1DSADA';
show vacuum_freeze_table_age;
reset vacuum_freeze_table_age;
show vacuum_freeze_table_age;