Changeset: dc2fa5f7d754 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dc2fa5f7d754
Modified Files:
        sql/server/rel_select.c
Branch: Apr2011
Log Message:

look in the 'with' scope before table scope (solves bug 2058).
(transplanted from b86b9b374542300acf62fadc46465cdcb266b8be)


diffs (35 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -1456,15 +1456,8 @@
 
                if (sname && !(s=mvc_bind_schema(sql,sname)))
                        return sql_error(sql, 02, "SELECT: no such schema 
'%s'", sname);
-               if (!s)
-                       s = cur_schema(sql);
-               t = mvc_bind_table(sql, s, tname);
                /* TODO: search path */
                if (!t && !sname) {
-                       s = tmp_schema(sql);
-                       t = mvc_bind_table(sql, s, tname);
-               }
-               if (!t && !sname) {
                        sql_subtype *tpe;
                        if ((tpe = stack_find_type(sql, tname)) != NULL &&
                                tpe->comp_type) {
@@ -1477,6 +1470,15 @@
                                rel_dup(temp_table);
                }
                if (!t && !temp_table) {
+                       if (!s)
+                               s = cur_schema(sql);
+                       t = mvc_bind_table(sql, s, tname);
+                       if (!t && !sname) {
+                               s = tmp_schema(sql);
+                               t = mvc_bind_table(sql, s, tname);
+                       }
+               }
+               if (!t && !temp_table) {
                        return sql_error(sql, 02, "SELECT: no such table '%s'", 
tname);
                } else if (!temp_table && !table_privs(sql, t, PRIV_SELECT)) {
                        return sql_error(sql, 02, "SELECT: access denied for %s 
to table '%s.%s'", stack_get_string(sql, "current_user"), s->base.name, tname);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to