Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6918

Problem with schema name starting with number followed by a dot

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 10.13.1.1
    • 10.14.1.0
    • SQL
    • None
    • Normal

    Description

      It seems that there is a problem with schema names that start with a number followed by a dot.
      Please take a look at the following script. Everything works fine but the last line which is a delete statement. Note that having the foreign key constraints was necessary to make it reproduce the problem.

      create schema "1.a";

      create table "1.a"."role"
      (
      "id" integer generated always as identity,
      "name" varchar(255) not null
      );

      alter table "1.a"."role" add constraint "role_pk"
      primary key ("id");

      create table "1.a"."user"
      (
      "id" integer generated always as identity,
      "name" varchar(255) not null
      );

      alter table "1.a"."user" add constraint "user_pk"
      primary key ("id");

      create table "1.a"."user_role"
      (
      "role" integer not null,
      "user" integer not null
      );

      alter table "1.a"."user_role" add constraint "user_role_fk1"
      foreign key ("role")
      references "1.a"."role" ("id")
      on delete cascade;

      alter table "1.a"."user_role" add constraint "user_role_fk2"
      foreign key ("user")
      references "1.a"."user" ("id")
      on delete cascade;

      alter table "1.a"."user_role" add constraint "user_role_u1"
      unique ("user", "role");

      insert into "1.a"."role" ("name") values ('r1');
      insert into "1.a"."user" ("name") values ('u1');
      insert into "1.a"."user_role" ("role","user") values (1,1);

      select * from "1.a"."user";

      delete from "1.a"."user";

      Last delete statement fails. The error is:
      Schema '1' does not exist [SQL State=42Y07, DB Errorcode=20000]

      Attachments

        1. schemaNames.diff
          7 kB
          Bryan Pendleton

        Activity

          People

            bryanpendleton Bryan Pendleton
            hoomanv Hooman Valibeigi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: