Skip to content

Commit be7f6e4

Browse files
committed
Add multibyte search_path case conversion coverage
Extend case_conversion.sql to cover multibyte quoted schema names through the search_path code path. The scenario now makes the active identifier_case_switch setting explicit, checks both interchange and normal behavior, and includes a failure case where a quoted schema name stops resolving once the case-conversion mode changes. Also removed the alternative file output, I suppose it was added by mistake because their diff was very small.
1 parent 0da228b commit be7f6e4

File tree

3 files changed

+148
-756
lines changed

3 files changed

+148
-756
lines changed

src/oracle_test/regress/expected/case_conversion.out

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,61 @@ SELECT * FROM "abc";
374374

375375
DROP TABLE "ABC";
376376
DROP TABLE "abc";
377+
--schema
378+
CREATE SCHEMA "中国ABC中国";
379+
SELECT nspname FROM pg_namespace WHERE nspname = '中国abc中国';
380+
nspname
381+
-------------
382+
中国abc中国
383+
(1 row)
384+
385+
SET search_path TO "中国ABC中国", public;
386+
SHOW search_path;
387+
search_path
388+
-----------------------
389+
"中国abc中国", public
390+
(1 row)
391+
392+
SELECT current_schemas(false);
393+
current_schemas
394+
----------------------
395+
{中国abc中国,public}
396+
(1 row)
397+
398+
SET ivorysql.identifier_case_switch = normal;
399+
DROP SCHEMA "中国abc中国";
400+
SET ivorysql.identifier_case_switch = interchange;
401+
RESET search_path;
402+
CREATE SCHEMA "中国def中国";
403+
SELECT nspname FROM pg_namespace WHERE nspname = '中国DEF中国';
404+
nspname
405+
-------------
406+
中国DEF中国
407+
(1 row)
408+
409+
SET search_path TO "中国DEF中国";
410+
SHOW search_path;
411+
search_path
412+
---------------
413+
"中国def中国"
414+
(1 row)
415+
416+
SELECT current_schemas(false);
417+
current_schemas
418+
-----------------
419+
{}
420+
(1 row)
421+
422+
CREATE TABLE "中国DEF中国".t_case_path_qualified(i int);
423+
ERROR: schema "中国def中国" does not exist
424+
LINE 1: CREATE TABLE "中国DEF中国".t_case_path_qualified(i int);
425+
^
426+
CREATE TABLE t_case_path_unqualified(i int);
427+
ERROR: no schema has been selected to create in
428+
LINE 1: CREATE TABLE t_case_path_unqualified(i int);
429+
^
430+
DROP SCHEMA "中国def中国";
431+
RESET search_path;
377432
--database
378433
create database db1;
379434
create database DB2;
@@ -492,6 +547,31 @@ ERROR: relation "abc" does not exist
492547
LINE 1: SELECT * FROM Abc;
493548
^
494549
DROP TABLE "Abc";
550+
--schema
551+
CREATE SCHEMA "中国ABC中国";
552+
SELECT nspname FROM pg_namespace WHERE nspname = '中国abc中国';
553+
nspname
554+
-------------
555+
中国abc中国
556+
(1 row)
557+
558+
SET search_path TO "中国ABC中国", public;
559+
SHOW search_path;
560+
search_path
561+
-----------------------
562+
"中国abc中国", public
563+
(1 row)
564+
565+
SELECT current_schemas(false);
566+
current_schemas
567+
----------------------
568+
{中国abc中国,public}
569+
(1 row)
570+
571+
SET ivorysql.identifier_case_switch = normal;
572+
DROP SCHEMA "中国abc中国";
573+
SET ivorysql.identifier_case_switch = lowercase;
574+
RESET search_path;
495575
--database
496576
create database db1;
497577
create database DB2;
@@ -608,6 +688,31 @@ ERROR: relation "abc" does not exist
608688
LINE 1: SELECT * FROM Abc;
609689
^
610690
DROP TABLE "Abc";
691+
--schema
692+
CREATE SCHEMA "中国ABC中国";
693+
SELECT nspname FROM pg_namespace WHERE nspname = '中国ABC中国';
694+
nspname
695+
-------------
696+
中国ABC中国
697+
(1 row)
698+
699+
SET search_path TO "中国ABC中国", public;
700+
SHOW search_path;
701+
search_path
702+
-----------------------
703+
"中国ABC中国", public
704+
(1 row)
705+
706+
SELECT current_schemas(false);
707+
current_schemas
708+
----------------------
709+
{中国ABC中国,public}
710+
(1 row)
711+
712+
SET ivorysql.identifier_case_switch = interchange;
713+
DROP SCHEMA "中国abc中国";
714+
SET ivorysql.identifier_case_switch = normal;
715+
RESET search_path;
611716
--database
612717
create database db1;
613718
create database DB2;

0 commit comments

Comments
 (0)