trigger type 2

master
Bill 2 years ago
parent 84105347fc
commit 4333af07f2

@ -75,7 +75,7 @@ class build_manager:
'build.py', 'Makefile', 'build.py', 'Makefile',
'server/server.cpp', 'server/libaquery.cpp', 'server/server.cpp', 'server/libaquery.cpp',
'server/monetdb_conn.cpp', 'server/threading.cpp', 'server/monetdb_conn.cpp', 'server/threading.cpp',
'server/winhelper.cpp' 'server/winhelper.cpp', 'server/monetdb_ext.c'
] ]
headerfiles = ['server/aggregations.h', 'server/hasher.h', 'server/io.h', headerfiles = ['server/aggregations.h', 'server/hasher.h', 'server/io.h',
'server/libaquery.h', 'server/monetdb_conn.h', 'server/pch.hpp', 'server/libaquery.h', 'server/monetdb_conn.h', 'server/pch.hpp',

@ -35,9 +35,9 @@ struct monetdbe_table_data{
void* cols; void* cols;
}; };
size_t extern "C" size_t
monetdbe_get_size(void* dbhdl, const char *table_name); monetdbe_get_size(void* dbhdl, const char *table_name);
void* extern "C" void*
monetdbe_get_col(void* dbhdl, const char *table_name, uint32_t col_id); monetdbe_get_col(void* dbhdl, const char *table_name, uint32_t col_id);
#endif #endif

@ -69,10 +69,13 @@ monetdbe_get_size(monetdbe_database dbhdl, const char *table_name)
monetdbe_database_internal* hdl = (monetdbe_database_internal*)dbhdl; monetdbe_database_internal* hdl = (monetdbe_database_internal*)dbhdl;
backend* be = ((backend *)(((monetdbe_database_internal*)dbhdl)->c->sqlcontext)); backend* be = ((backend *)(((monetdbe_database_internal*)dbhdl)->c->sqlcontext));
mvc *m = be->mvc; mvc *m = be->mvc;
//mvc_trans(m);
sql_table *t = find_table_or_view_on_scope(m, NULL, "sys", table_name, "CATALOG", false); sql_table *t = find_table_or_view_on_scope(m, NULL, "sys", table_name, "CATALOG", false);
if (!t) return 0;
sql_column *col = ol_first_node(t->columns)->data; sql_column *col = ol_first_node(t->columns)->data;
sqlstore* store = m->store; sqlstore* store = m->store;
size_t sz = store->storage_api.count_col(m->session->tr, col, QUICK); size_t sz = store->storage_api.count_col(m->session->tr, col, QUICK);
//mvc_cancel_session(m);
return sz; return sz;
} }
@ -81,10 +84,13 @@ monetdbe_get_col(monetdbe_database dbhdl, const char *table_name, uint32_t col_i
monetdbe_database_internal* hdl = (monetdbe_database_internal*)dbhdl; monetdbe_database_internal* hdl = (monetdbe_database_internal*)dbhdl;
backend* be = ((backend *)(((monetdbe_database_internal*)dbhdl)->c->sqlcontext)); backend* be = ((backend *)(((monetdbe_database_internal*)dbhdl)->c->sqlcontext));
mvc *m = be->mvc; mvc *m = be->mvc;
//mvc_trans(m);
sql_table *t = find_table_or_view_on_scope(m, NULL, "sys", table_name, "CATALOG", false); sql_table *t = find_table_or_view_on_scope(m, NULL, "sys", table_name, "CATALOG", false);
if (!t) return 0;
sql_column *col = ol_fetch(t->columns, col_id); sql_column *col = ol_fetch(t->columns, col_id);
sqlstore* store = m->store; sqlstore* store = m->store;
BAT *b = store->storage_api.bind_col(m->session->tr, col, QUICK); BAT *b = store->storage_api.bind_col(m->session->tr, col, QUICK);
BATiter iter = bat_iterator(b); BATiter iter = bat_iterator(b);
//mvc_cancel_session(m);
return iter.base; return iter.base;
} }

@ -472,7 +472,7 @@ start:
auto fp = fopen(config_name.c_str(), "rb"); auto fp = fopen(config_name.c_str(), "rb");
if(fp == nullptr){ if(fp == nullptr){
puts("ERROR: Procedure not found on disk."); puts("ERROR: Procedure not found on disk.");
return false; return true;
} }
fread(&p.cnt, sizeof(p.cnt), 1, fp); fread(&p.cnt, sizeof(p.cnt), 1, fp);
fread(&p.postproc_modules, sizeof(p.postproc_modules), 1, fp); fread(&p.postproc_modules, sizeof(p.postproc_modules), 1, fp);

@ -211,7 +211,7 @@ public:
iterator_t erase(iterator_t _it) { iterator_t erase(iterator_t _it) {
#ifdef DEBUG #ifdef DEBUG
// Do bound checks // Do bound checks
if (!(size && capicity && container && if (!(size && capacity && container &&
_it >= container && (_it - container) < size)) _it >= container && (_it - container) < size))
return 0; return 0;
#endif #endif

@ -1,3 +1,5 @@
#!aquery
procedure one run procedure one run
procedure two run procedure two run
@ -5,4 +7,5 @@ create table t(a int);
exec exec
create trigger a on t action one when two; create trigger a on t action one when two;
exec exec
insert into t(a) values (1); insert into t(a) values (1);
exec
Loading…
Cancel
Save