Changeset: 952d53193b21 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=952d53193b21
Modified Files:
        sql/server/rel_select.c
        sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.sql
        
sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.stable.out
Branch: linear-hashing
Log Message:

Merged with Nov2019


diffs (63 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
@@ -674,10 +674,10 @@ rel_named_table_function(sql_query *quer
        }
 
        if (sq) {
-               for (node *n = sq->exps->h, *m = sf->res->h ; n && m ; n = 
n->next, m = m->next) {
+               for (node *n = sq->exps->h, *m = sf->func->ops->h ; n && m ; n 
= n->next, m = m->next) {
                        sql_exp *e = (sql_exp*) n->data;
-                       sql_subtype *t = (sql_subtype*) m->data;
-                       if (!exp_subtype(e) && rel_set_type_param(sql, t, sq, 
e, 0) < 0)
+                       sql_arg *a = (sql_arg*) m->data;
+                       if (!exp_subtype(e) && rel_set_type_param(sql, 
&(a->type), sq, e, 0) < 0)
                                return NULL;
                }
        }
@@ -5983,10 +5983,10 @@ rel_loader_function(sql_query *query, sy
                return sql_error(sql, 02, SQLSTATE(42000) "SELECT: no such 
operator '%s'", fname);
 
        if (sq) {
-               for (node *n = sq->exps->h, *m = sf->res->h ; n && m ; n = 
n->next, m = m->next) {
+               for (node *n = sq->exps->h, *m = sf->func->ops->h ; n && m ; n 
= n->next, m = m->next) {
                        sql_exp *e = (sql_exp*) n->data;
-                       sql_subtype *t = (sql_subtype*) m->data;
-                       if (!exp_subtype(e) && rel_set_type_param(sql, t, sq, 
e, 0) < 0)
+                       sql_arg *a = (sql_arg*) m->data;
+                       if (!exp_subtype(e) && rel_set_type_param(sql, 
&(a->type), sq, e, 0) < 0)
                                return NULL;
                }
        }
diff --git 
a/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.sql 
b/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.sql
--- a/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.sql
+++ b/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.sql
@@ -10,4 +10,8 @@ prepare with something as (select a from
 exec **('a', 'a');
 drop function get_onet;
 drop table onet;
+
+CREATE FUNCTION twoargs(input1 INT, input2 CLOB) RETURNS TABLE (outt CLOB) 
BEGIN RETURN TABLE(SELECT input1 || input2); END;
+prepare select 1 from twoargs(?,?);
+
 rollback;
diff --git 
a/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.stable.out
 
b/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.stable.out
--- 
a/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.stable.out
+++ 
b/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.stable.out
@@ -120,6 +120,16 @@ stdout of test 'prepared-statement-with-
 [ "a", "b",    "c",    "a"     ]
 #drop function get_onet;
 #drop table onet;
+#CREATE FUNCTION twoargs(input1 INT, input2 CLOB) RETURNS TABLE (outt CLOB) 
BEGIN RETURN TABLE(SELECT input1 || input2); END;
+#prepare select 1 from twoargs(?,?);
+#prepare select 1 from twoargs(?,?);
+% .prepare,    .prepare,       .prepare,       .prepare,       .prepare,       
.prepare # table_name
+% type,        digits, scale,  schema, table,  column # name
+% varchar,     int,    int,    str,    str,    str # type
+% 7,   2,      1,      0,      0,      0 # length
+[ "tinyint",   1,      0,      "",     "",     ""      ]
+[ "int",       32,     0,      NULL,   NULL,   NULL    ]
+[ "clob",      0,      0,      NULL,   NULL,   NULL    ]
 #rollback;
 
 # 13:30:56 >  
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to