Changeset: fa79ccee4a77 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fa79ccee4a77
Modified Files:
        sql/server/rel_psm.c
        sql/server/sql_parser.y
        
sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out.int128
Branch: Jul2017
Log Message:

approved output

disallow create or replace on system functions


diffs (63 lines):

diff --git a/sql/server/rel_psm.c b/sql/server/rel_psm.c
--- a/sql/server/rel_psm.c
+++ b/sql/server/rel_psm.c
@@ -809,6 +809,9 @@ rel_create_func(mvc *sql, dlist *qname, 
                        }
                        if (mvc_check_dependency(sql, func->base.id, 
!IS_PROC(func) ? FUNC_DEPENDENCY : PROC_DEPENDENCY, NULL))
                                return sql_error(sql, 02, "CREATE OR REPLACE 
%s%s: there are database objects dependent on %s%s %s;", KF, F, kf, fn, 
func->base.name);
+                       if (!sf->sname) {
+                               return sql_error(sql, 02, "CREATE OR REPLACE 
%s%s: not allowed to replace system %s%s %s;", KF, F, kf, fn, func->base.name);
+                       }
 
                        mvc_drop_func(sql, s, func, action);
                        sf = NULL;
diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -712,16 +712,17 @@ create:
 create_or_replace:
        create
 |      CREATE OR REPLACE { $$ = TRUE; }
-
+;
 
 if_exists:
        /* empty */   { $$ = FALSE; }
 |      IF EXISTS     { $$ = TRUE; }
+;
 
 if_not_exists:
        /* empty */   { $$ = FALSE; }
 |      IF NOT EXISTS { $$ = TRUE; }
-
+;
 
 drop:
     DROP               
diff --git 
a/sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out.int128
 
b/sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out.int128
--- 
a/sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out.int128
+++ 
b/sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out.int128
@@ -38,19 +38,17 @@ Ready.
 #  SELECT 0 AS cods, 0 AS elrik, 0 AS ether, 0 AS jaelen, 0 AS sora, SUM(tib0)
 #  FROM t2a
 #  GROUP BY cods, elrik, ether, jaelen, sora;
-% .L11,        .L11,   .L11,   .L11,   .L11,   .L11 # table_name
-% cods,        elrik,  ether,  jaelen, sora,   L1 # name
+% .L32,        .L32,   .L32,   .L32,   .L32,   .L32 # table_name
+% cods,        elrik,  ether,  jaelen, sora,   L7 # name
 % int, int,    int,    int,    int,    hugeint # type
 % 1,   1,      1,      1,      1,      1 # length
-[ 0,   0,      0,      0,      0,      NULL    ]
 #SELECT 0 AS cods, 0 AS elrik, 0 AS ether, 0 AS jaelen, 0 AS sora, SUM(tib0)
 # FROM t2a
 #GROUP BY cods, elrik, ether, jaelen, sora;
-% .L1, .L2,    .L3,    .L4,    .L5,    sys.L7 # table_name
-% cods,        elrik,  ether,  jaelen, sora,   L6 # name
+% .L2, .L4,    .L6,    .L10,   .L12,   sys.L15 # table_name
+% cods,        elrik,  ether,  jaelen, sora,   L14 # name
 % tinyint,     tinyint,        tinyint,        tinyint,        tinyint,        
hugeint # type
 % 1,   1,      1,      1,      1,      1 # length
-[ 0,   0,      0,      0,      0,      NULL    ]
 #drop table t2a;
 #drop table t1a;
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to