[PATCH] Regression test fix for Czech locale
I attached fix which modify foreign_data test. It fix problem with Czech
collation when numbers are ordered after letters. I retyped affected
column to name datatype which uses bitwise cmp.
Zdenek
Attachments:
reg_fd.patchtext/x-patch; charset=UTF-8; name=reg_fd.patchDownload
diff -Nrc pgsql_psql.c3158b216657/src/test/regress/expected/foreign_data.out pgsql_psql/src/test/regress/expected/foreign_data.out
*** pgsql_psql.c3158b216657/src/test/regress/expected/foreign_data.out 2009-03-06 12:55:46.721051870 +0100
--- pgsql_psql/src/test/regress/expected/foreign_data.out 2009-03-06 12:55:46.726090204 +0100
***************
*** 628,634 ****
(8 rows)
-- Information schema
! SELECT * FROM information_schema.foreign_data_wrappers ORDER BY 1, 2;
foreign_data_wrapper_catalog | foreign_data_wrapper_name | authorization_identifier | library_name | foreign_data_wrapper_language
------------------------------+---------------------------+--------------------------+--------------+-------------------------------
regression | dummy | foreign_data_user | | c
--- 628,634 ----
(8 rows)
-- Information schema
! SELECT * FROM information_schema.foreign_data_wrappers ORDER BY foreign_data_wrapper_catalog, foreign_data_wrapper_name;
foreign_data_wrapper_catalog | foreign_data_wrapper_name | authorization_identifier | library_name | foreign_data_wrapper_language
------------------------------+---------------------------+--------------------------+--------------+-------------------------------
regression | dummy | foreign_data_user | | c
***************
*** 636,648 ****
regression | postgresql | foreign_data_user | | c
(3 rows)
! SELECT * FROM information_schema.foreign_data_wrapper_options ORDER BY 1, 2, 3;
foreign_data_wrapper_catalog | foreign_data_wrapper_name | option_name | option_value
------------------------------+---------------------------+--------------+--------------
regression | foo | test_wrapper | true
(1 row)
! SELECT * FROM information_schema.foreign_servers ORDER BY 1, 2;
foreign_server_catalog | foreign_server_name | foreign_data_wrapper_catalog | foreign_data_wrapper_name | foreign_server_type | foreign_server_version | authorization_identifier
------------------------+---------------------+------------------------------+---------------------------+---------------------+------------------------+--------------------------
regression | s4 | regression | foo | oracle | | foreign_data_user
--- 636,648 ----
regression | postgresql | foreign_data_user | | c
(3 rows)
! SELECT * FROM information_schema.foreign_data_wrapper_options ORDER BY foreign_data_wrapper_catalog, foreign_data_wrapper_name, option_name;
foreign_data_wrapper_catalog | foreign_data_wrapper_name | option_name | option_value
------------------------------+---------------------------+--------------+--------------
regression | foo | test_wrapper | true
(1 row)
! SELECT * FROM information_schema.foreign_servers ORDER BY foreign_server_catalog, foreign_server_name::name;
foreign_server_catalog | foreign_server_name | foreign_data_wrapper_catalog | foreign_data_wrapper_name | foreign_server_type | foreign_server_version | authorization_identifier
------------------------+---------------------+------------------------------+---------------------------+---------------------+------------------------+--------------------------
regression | s4 | regression | foo | oracle | | foreign_data_user
***************
*** 653,659 ****
regression | st2 | regression | foo | | | regress_test_role
(6 rows)
! SELECT * FROM information_schema.foreign_server_options ORDER BY 1, 2, 3;
foreign_server_catalog | foreign_server_name | option_name | option_value
------------------------+---------------------+-----------------+--------------
regression | s4 | dbname | b
--- 653,659 ----
regression | st2 | regression | foo | | | regress_test_role
(6 rows)
! SELECT * FROM information_schema.foreign_server_options ORDER BY foreign_server_catalog, foreign_server_name::name, option_name;
foreign_server_catalog | foreign_server_name | option_name | option_value
------------------------+---------------------+-----------------+--------------
regression | s4 | dbname | b
***************
*** 664,670 ****
regression | s8 | dbname | db1
(6 rows)
! SELECT * FROM information_schema.user_mappings ORDER BY lower(authorization_identifier), 2, 3;
authorization_identifier | foreign_server_catalog | foreign_server_name
--------------------------+------------------------+---------------------
foreign_data_user | regression | s4
--- 664,670 ----
regression | s8 | dbname | db1
(6 rows)
! SELECT * FROM information_schema.user_mappings ORDER BY lower(authorization_identifier), foreign_server_catalog, foreign_server_name::name;
authorization_identifier | foreign_server_catalog | foreign_server_name
--------------------------+------------------------+---------------------
foreign_data_user | regression | s4
***************
*** 677,683 ****
regress_test_role | regression | st1
(8 rows)
! SELECT * FROM information_schema.user_mapping_options ORDER BY lower(authorization_identifier), 2, 3, 4;
authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
--------------------------+------------------------+---------------------+-------------+--------------
foreign_data_user | regression | s8 | password | public
--- 677,683 ----
regress_test_role | regression | st1
(8 rows)
! SELECT * FROM information_schema.user_mapping_options ORDER BY lower(authorization_identifier), foreign_server_catalog, foreign_server_name::name, option_name;
authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
--------------------------+------------------------+---------------------+-------------+--------------
foreign_data_user | regression | s8 | password | public
***************
*** 689,695 ****
regress_test_role | regression | st1 | username | bob
(7 rows)
! SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' ORDER BY 1, 2, 3, 4, 5;
grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
-------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
foreign_data_user | foreign_data_user | regression | | foo | FOREIGN DATA WRAPPER | USAGE | YES
--- 689,695 ----
regress_test_role | regression | st1 | username | bob
(7 rows)
! SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' ORDER BY grantor, grantee, object_catalog, object_schema, object_name;
grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
-------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
foreign_data_user | foreign_data_user | regression | | foo | FOREIGN DATA WRAPPER | USAGE | YES
***************
*** 698,704 ****
foreign_data_user | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
(4 rows)
! SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' ORDER BY 1, 2, 3, 4, 5;
grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
-------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
foreign_data_user | foreign_data_user | regression | | foo | FOREIGN DATA WRAPPER | USAGE | YES
--- 698,704 ----
foreign_data_user | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
(4 rows)
! SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' ORDER BY grantor, grantee, object_catalog, object_schema, object_name;
grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
-------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
foreign_data_user | foreign_data_user | regression | | foo | FOREIGN DATA WRAPPER | USAGE | YES
***************
*** 708,714 ****
(4 rows)
SET ROLE regress_test_role;
! SELECT * FROM information_schema.user_mapping_options ORDER BY 1, 2, 3, 4;
authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
--------------------------+------------------------+---------------------+-------------+--------------
PUBLIC | regression | st1 | modified | 1
--- 708,714 ----
(4 rows)
SET ROLE regress_test_role;
! SELECT * FROM information_schema.user_mapping_options ORDER BY authorization_identifier, foreign_server_catalog, foreign_server_name::name, option_name;
authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
--------------------------+------------------------+---------------------+-------------+--------------
PUBLIC | regression | st1 | modified | 1
***************
*** 718,731 ****
regress_test_role | regression | st1 | username | bob
(5 rows)
! SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' ORDER BY 1, 2, 3, 4, 5;
grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
-------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
foreign_data_user | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
(2 rows)
! SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' ORDER BY 1, 2, 3, 4, 5;
grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
-------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
--- 718,731 ----
regress_test_role | regression | st1 | username | bob
(5 rows)
! SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' ORDER BY grantor, grantee, object_catalog, object_schema, object_name;
grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
-------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
foreign_data_user | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
(2 rows)
! SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' ORDER BY grantor, grantee, object_catalog, object_schema, object_name;
grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
-------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
***************
*** 734,740 ****
DROP USER MAPPING FOR current_user SERVER st1;
SET ROLE regress_test_role2;
! SELECT * FROM information_schema.user_mapping_options ORDER BY 1, 2, 3, 4;
authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
--------------------------+------------------------+---------------------+-------------+--------------
regress_test_role | regression | s6 | username |
--- 734,740 ----
DROP USER MAPPING FOR current_user SERVER st1;
SET ROLE regress_test_role2;
! SELECT * FROM information_schema.user_mapping_options ORDER BY authorization_identifier, foreign_server_catalog, foreign_server_name, option_name;
authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
--------------------------+------------------------+---------------------+-------------+--------------
regress_test_role | regression | s6 | username |
diff -Nrc pgsql_psql.c3158b216657/src/test/regress/sql/foreign_data.sql pgsql_psql/src/test/regress/sql/foreign_data.sql
*** pgsql_psql.c3158b216657/src/test/regress/sql/foreign_data.sql 2009-03-06 12:55:46.723698954 +0100
--- pgsql_psql/src/test/regress/sql/foreign_data.sql 2009-03-06 12:55:46.727194787 +0100
***************
*** 256,276 ****
-- Information schema
! SELECT * FROM information_schema.foreign_data_wrappers ORDER BY 1, 2;
! SELECT * FROM information_schema.foreign_data_wrapper_options ORDER BY 1, 2, 3;
! SELECT * FROM information_schema.foreign_servers ORDER BY 1, 2;
! SELECT * FROM information_schema.foreign_server_options ORDER BY 1, 2, 3;
! SELECT * FROM information_schema.user_mappings ORDER BY lower(authorization_identifier), 2, 3;
! SELECT * FROM information_schema.user_mapping_options ORDER BY lower(authorization_identifier), 2, 3, 4;
! SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' ORDER BY 1, 2, 3, 4, 5;
! SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' ORDER BY 1, 2, 3, 4, 5;
SET ROLE regress_test_role;
! SELECT * FROM information_schema.user_mapping_options ORDER BY 1, 2, 3, 4;
! SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' ORDER BY 1, 2, 3, 4, 5;
! SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' ORDER BY 1, 2, 3, 4, 5;
DROP USER MAPPING FOR current_user SERVER st1;
SET ROLE regress_test_role2;
! SELECT * FROM information_schema.user_mapping_options ORDER BY 1, 2, 3, 4;
RESET ROLE;
--- 256,276 ----
-- Information schema
! SELECT * FROM information_schema.foreign_data_wrappers ORDER BY foreign_data_wrapper_catalog, foreign_data_wrapper_name;
! SELECT * FROM information_schema.foreign_data_wrapper_options ORDER BY foreign_data_wrapper_catalog, foreign_data_wrapper_name, option_name;
! SELECT * FROM information_schema.foreign_servers ORDER BY foreign_server_catalog, foreign_server_name::name;
! SELECT * FROM information_schema.foreign_server_options ORDER BY foreign_server_catalog, foreign_server_name::name, option_name;
! SELECT * FROM information_schema.user_mappings ORDER BY lower(authorization_identifier), foreign_server_catalog, foreign_server_name::name;
! SELECT * FROM information_schema.user_mapping_options ORDER BY lower(authorization_identifier), foreign_server_catalog, foreign_server_name::name, option_name;
! SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' ORDER BY grantor, grantee, object_catalog, object_schema, object_name;
! SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' ORDER BY grantor, grantee, object_catalog, object_schema, object_name;
SET ROLE regress_test_role;
! SELECT * FROM information_schema.user_mapping_options ORDER BY authorization_identifier, foreign_server_catalog, foreign_server_name::name, option_name;
! SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' ORDER BY grantor, grantee, object_catalog, object_schema, object_name;
! SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' ORDER BY grantor, grantee, object_catalog, object_schema, object_name;
DROP USER MAPPING FOR current_user SERVER st1;
SET ROLE regress_test_role2;
! SELECT * FROM information_schema.user_mapping_options ORDER BY authorization_identifier, foreign_server_catalog, foreign_server_name, option_name;
RESET ROLE;
Zdenek Kotala wrote:
I attached fix which modify foreign_data test. It fix problem with Czech
collation when numbers are ordered after letters. I retyped affected
column to name datatype which uses bitwise cmp.
I have trouble understanding why this makes any sense at all. The only
thing you seem to be doing here is replacing the ORDER BY column-number
clauses by others that reference the column by name.
Isn't this a bug in how column numbers are (not) being used by ORDER BY?
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Alvaro Herrera píše v pá 06. 03. 2009 v 12:16 -0300:
Zdenek Kotala wrote:
I attached fix which modify foreign_data test. It fix problem with Czech
collation when numbers are ordered after letters. I retyped affected
column to name datatype which uses bitwise cmp.I have trouble understanding why this makes any sense at all. The only
thing you seem to be doing here is replacing the ORDER BY column-number
clauses by others that reference the column by name.
And I cast foreign_server_name to name datatype (which is original
datatype in catalog table). See my buildfarm member:
http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=gothic_moth&dt=2009-03-04%2021:06:01
for details.
Isn't this a bug in how column numbers are (not) being used by ORDER BY?
you cannot use 3::name. It is reason why I replaced numbers with names
and I did it for all select here. It has seemed that is better idea do
it everywhere and be consistent.
Zdenek
Zdenek Kotala wrote:
I attached fix which modify foreign_data test. It fix problem with Czech
collation when numbers are ordered after letters. I retyped affected
column to name datatype which uses bitwise cmp.
I have chosen a different fix: rename the identifiers so the ordering
problem doesn't arise. Czech locale should work now.