Bugs item #2780395, was opened at 2009-04-24 13:52
Message generated for change (Comment added) made by stmane
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2780395&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: SQL CVS Head
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Roberto Cornacchia (cornuz)
>Assigned to: Sjoerd Mullender (sjoerd)
Summary: SQL: query for dump uses a (too) common table name 

Initial Comment:
In my database I have a table named "tf" (very common in IR..)
When I try to dump the database, one of the queries uses "tf" as a name for a 
temporary relation, and this clashes with mine.
Probably a safer name should be used there..




sql>\D
MAPI  = l...@localhost:50151
QUERY = WITH "tf" AS (SELECT "s"."name" AS "sname", "f"."name" AS "name", 
"f"."id" AS "id", "f"."func" AS "func" FROM "sys"."schemas" "s", 
"sys"."functions" "f" WHERE "f"."sql" = TRUE AND "s"."id" = "f"."schema_id" 
UNION SELECT "s"."name" AS "sname", "t"."name" AS "name", "t"."id" AS "id", 
CAST(NULL AS VARCHAR(8196)) AS "func" FROM "sys"."schemas" "s", "sys"."_tables" 
"t" WHERE "t"."type" BETWEEN 0 AND 1 AND "t"."system" = FALSE AND "s"."id" = 
"t"."schema_id" UNION SELECT "s"."name" AS "sname", "tr"."name" AS "name", 
"tr"."id" AS "id", "tr"."statement" AS "func" FROM "sys"."triggers" "tr", 
"sys"."schemas" "s", "sys"."_tables" "t" WHERE "s"."id" = "t"."schema_id" AND 
"t"."id" = "tr"."table_id") SELECT * FROM "tf" ORDER BY "tf"."id"


----------------------------------------------------------------------

>Comment By: Stefan Manegold (stmane)
Date: 2009-04-25 19:19

Message:
Fixed by Sjoerd in MonetDB-clients as of Feb2009-SP2 release (candidate).

Test added in
sql/src/test/BugTracker-2009/Tests/name_clash_with_dump.SF-2780395.sql

----------------------------------------------------------------------

Comment By: Sjoerd Mullender (sjoerd)
Date: 2009-04-24 16:03

Message:
Looks like a scoping problem.
This is very similar to having a function with a parameter name which
happens to be the same as the name of a column of one of the tables that is
used in the function.  There too you get a complaint about ambiguous
names.

I have solved the problem in dump for now by using a less likely name, but
I think the scoping problem should be looked at before we close this bug.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2780395&group_id=56967

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to