Bugs item #2780395, was opened at 2009-04-24 13:52 Message generated for change (Comment added) made by sjoerd 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: Open Resolution: Fixed Priority: 3 Private: No Submitted By: Roberto Cornacchia (cornuz) Assigned to: Niels Nes (nielsnes) 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: Sjoerd Mullender (sjoerd) Date: 2009-08-06 17:14 Message: Niels, can you pronounce? ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2009-04-25 20:43 Message: Reopened. I didn't "fix" the bug, I worked around it. First I want a pronouncement on the scoping issue, both in the with statement and in functions. ---------------------------------------------------------------------- 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 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Monetdb-bugs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/monetdb-bugs
