Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 84E03171F9 for ; Mon, 13 Oct 2014 18:44:35 +0000 (UTC) Received: (qmail 55504 invoked by uid 500); 13 Oct 2014 18:44:35 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 55481 invoked by uid 500); 13 Oct 2014 18:44:35 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 55470 invoked by uid 99); 13 Oct 2014 18:44:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2014 18:44:35 +0000 Date: Mon, 13 Oct 2014 18:44:35 +0000 (UTC) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (DERBY-6370) dblook doesn't schema-qualify identifiers in trigger actions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mamta A. Satoor closed DERBY-6370. ---------------------------------- Resolution: Fixed > dblook doesn't schema-qualify identifiers in trigger actions > ------------------------------------------------------------ > > Key: DERBY-6370 > URL: https://issues.apache.org/jira/browse/DERBY-6370 > Project: Derby > Issue Type: Bug > Components: Tools > Affects Versions: 10.10.1.1 > Reporter: Knut Anders Hatlen > Assignee: Mamta A. Satoor > Labels: derby_backport_reject_10_10 > Fix For: 10.11.1.1 > > Attachments: d6370-1a.diff, d6370-2a.diff, d6370-3a.diff > > > dblook doesn't qualify identifiers in the trigger action if they weren't explicitly qualified in the original CREATE TRIGGER statement. > Example: > ij version 10.10 > ij> connect 'jdbc:derby:db;create=true'; > ij> create table s1.t1(x int); > 0 rows inserted/updated/deleted > ij> create table s2.t2(x int); > 0 rows inserted/updated/deleted > ij> set schema s1; > 0 rows inserted/updated/deleted > ij> create trigger tr1 after insert on t1 insert into s2.t2 select * from t1; > 0 rows inserted/updated/deleted > ij> set schema s2; > 0 rows inserted/updated/deleted > ij> create trigger tr2 after insert on s1.t1 insert into t2 select * from s1.t1; > 0 rows inserted/updated/deleted > ij> exit; > Then run dblook on the created database: > -- Timestamp: 2013-10-04 12:46:14.974 > -- Source database is: db > -- Connection URL is: jdbc:derby:db > -- appendLogs: false > -- ---------------------------------------------- > -- DDL Statements for schemas > -- ---------------------------------------------- > CREATE SCHEMA "S1"; > CREATE SCHEMA "S2"; > -- ---------------------------------------------- > -- DDL Statements for tables > -- ---------------------------------------------- > CREATE TABLE "S1"."T1" ("X" INTEGER); > CREATE TABLE "S2"."T2" ("X" INTEGER); > -- ---------------------------------------------- > -- DDL Statements for triggers > -- ---------------------------------------------- > CREATE TRIGGER "S1"."TR1" AFTER INSERT ON "S1"."T1" FOR EACH STATEMENT insert into s2.t2 select * from t1; > CREATE TRIGGER "S2"."TR2" AFTER INSERT ON "S1"."T1" FOR EACH STATEMENT insert into t2 select * from s1.t1; > dblook should either qualify all identifiers in the trigger actions, or contain SET SCHEMA statements before each of the CREATE TRIGGER statements to ensure the correct implicit schema is chosen. -- This message was sent by Atlassian JIRA (v6.3.4#6332)