Changeset: a2f70a576335 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a2f70a576335
Modified Files:
        sql/backends/monet5/sql_scenario.c
        sql/server/sql_qc.c
        sql/server/sql_qc.h
Branch: Jul2017
Log Message:

Save no_mitosis flag in query cache.
This should fix bug 6498.


diffs (61 lines):

diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -1128,6 +1128,7 @@ SQLparser(Client c)
        } else if (caching(m) && cachable(m, NULL) && m->emode != m_prepare && 
(be->q = qc_match(m->qc, m->sym, m->args, m->argc, m->scanner.key ^ 
m->session->schema->base.id)) != NULL) {
                /* query template was found in the query cache */
                scanner_query_processed(&(m->scanner));
+               m->no_mitosis = be->q->no_mitosis;
        } else {
                sql_rel *r;
 
@@ -1176,7 +1177,8 @@ SQLparser(Client c)
                                                  m->args,      /* the argument 
list */
                                                  m->argc, m->scanner.key ^ 
m->session->schema->base.id,        /* the statement hash key */
                                                  m->emode == m_prepare ? 
Q_PREPARE : m->type,  /* the type of the statement */
-                                                 escaped_q);
+                                                 escaped_q,
+                                                 m->no_mitosis);
                        }
                        if(!be->q) {
                                err = 1;
diff --git a/sql/server/sql_qc.c b/sql/server/sql_qc.c
--- a/sql/server/sql_qc.c
+++ b/sql/server/sql_qc.c
@@ -238,7 +238,7 @@ qc_match(qc *cache, symbol *s, atom **pa
 }
 
 cq *
-qc_insert(qc *cache, sql_allocator *sa, sql_rel *r, char *qname,  symbol *s, 
atom **params, int paramlen, int key, int type, char *cmd)
+qc_insert(qc *cache, sql_allocator *sa, sql_rel *r, char *qname,  symbol *s, 
atom **params, int paramlen, int key, int type, char *cmd, int no_mitosis)
 {
        int i, namelen;
        cq *n = MNEW(cq);
@@ -275,6 +275,7 @@ qc_insert(qc *cache, sql_allocator *sa, 
        n->count = 1;
        namelen = 5 + ((n->id+7)>>3) + ((cache->clientid+7)>>3);
        n->name = sa_alloc(sa, namelen);
+       n->no_mitosis = no_mitosis;
        if(!n->name) {
                _DELETE(n->params);
                _DELETE(n);
diff --git a/sql/server/sql_qc.h b/sql/server/sql_qc.h
--- a/sql/server/sql_qc.h
+++ b/sql/server/sql_qc.h
@@ -29,6 +29,7 @@ typedef struct cq {
        int key;                /* the hash key for the query text */
        char *codestring;       /* keep code in string form to aid debugging */
        char *name;             /* name of cache query */
+       int no_mitosis;         /* run query without mitosis */
        int count;              /* number of times the query is matched */
 } cq;
 
@@ -44,7 +45,7 @@ extern void qc_destroy(qc *cache);
 extern void qc_clean(qc *cache);
 extern cq *qc_find(qc *cache, int id);
 extern cq *qc_match(qc *cache, symbol *s, atom **params, int plen, int key);
-extern cq *qc_insert(qc *cache, sql_allocator *sa, sql_rel *r, char *qname, 
symbol *s, atom **params, int paramlen, int key, int type, char *codedstr);
+extern cq *qc_insert(qc *cache, sql_allocator *sa, sql_rel *r, char *qname, 
symbol *s, atom **params, int paramlen, int key, int type, char *codedstr, int 
no_mitosis);
 extern void qc_delete(qc *cache, cq *q);
 extern int qc_size(qc *cache);
 extern int qc_isaquerytemplate(char *nme);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to