mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-22 22:37:01 +08:00
Fix test_valid_server_encoding helper function.
Commit c67bef3f325 introduced this test helper function for use by src/test/regress/sql/encoding.sql, but its logic was incorrect. It confused an encoding ID for a boolean so it gave the wrong results for some inputs, and also forgot the usual return macro. The mistake didn't affect values actually used in the test, so there is no change in behavior. Also drop it and another missed function at the end of the test, for consistency. Backpatch-through: 14 Author: Zsolt Parragi <zsolt.parragi@percona.com>
This commit is contained in:
@ -419,7 +419,9 @@ SELECT SUBSTRING(c FROM 3000 FOR 1) FROM toast_4b_utf8;
|
||||
DROP TABLE encoding_tests;
|
||||
DROP TABLE toast_4b_utf8;
|
||||
DROP FUNCTION test_encoding;
|
||||
DROP FUNCTION test_wchars_to_text;
|
||||
DROP FUNCTION test_text_to_wchars;
|
||||
DROP FUNCTION test_valid_server_encoding;
|
||||
DROP FUNCTION test_mblen_func;
|
||||
DROP FUNCTION test_bytea_to_text;
|
||||
DROP FUNCTION test_text_to_bytea;
|
||||
|
||||
@ -1251,7 +1251,7 @@ PG_FUNCTION_INFO_V1(test_valid_server_encoding);
|
||||
Datum
|
||||
test_valid_server_encoding(PG_FUNCTION_ARGS)
|
||||
{
|
||||
return pg_valid_server_encoding(text_to_cstring(PG_GETARG_TEXT_PP(0)));
|
||||
PG_RETURN_BOOL(pg_valid_server_encoding(text_to_cstring(PG_GETARG_TEXT_PP(0))) >= 0);
|
||||
}
|
||||
|
||||
/* Provide SQL access to IsBinaryCoercible() */
|
||||
|
||||
@ -231,7 +231,9 @@ SELECT SUBSTRING(c FROM 3000 FOR 1) FROM toast_4b_utf8;
|
||||
DROP TABLE encoding_tests;
|
||||
DROP TABLE toast_4b_utf8;
|
||||
DROP FUNCTION test_encoding;
|
||||
DROP FUNCTION test_wchars_to_text;
|
||||
DROP FUNCTION test_text_to_wchars;
|
||||
DROP FUNCTION test_valid_server_encoding;
|
||||
DROP FUNCTION test_mblen_func;
|
||||
DROP FUNCTION test_bytea_to_text;
|
||||
DROP FUNCTION test_text_to_bytea;
|
||||
|
||||
Reference in New Issue
Block a user