⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mat.mx

📁 一个内存数据库的源代码这是服务器端还有客户端
💻 MX
字号:
@' The contents of this file are subject to the MonetDB Public License@' Version 1.1 (the "License"); you may not use this file except in@' compliance with the License. You may obtain a copy of the License at@' http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html@'@' Software distributed under the License is distributed on an "AS IS"@' basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the@' License for the specific language governing rights and limitations@' under the License.@'@' The Original Code is the MonetDB Database System.@'@' The Initial Developer of the Original Code is CWI.@' Portions created by CWI are Copyright (C) 1997-2007 CWI.@' All Rights Reserved.@f mat@a Martin Kersten@v 1@+ Multiple association tablesA MAT is a convenient way to deal with scaleability. It combines the definitions of several, type compatibleBATs under a single name. This view is only materialized when the operationscan not deal with the components individually,or the incremental operation is not supported.The module is supported by the mal_multitable optimizer.The primitives below are chosen to accomodate the SQLfront-end to produce reasonable efficient code.@malmodule mat;pattern new(b:bat[:oid,:any_2]...):bat[:oid,:any_2]address MATnewcomment "Define a Merge Association Table (MAT) ";pattern pack(b:bat[:oid,:any_2]...):bat[:oid,:any_2]address MATpackcomment "Materialize the MAT into a single BAT";pattern print(b:bat[:oid,:any_2]...):voidaddress MATprint;command expand(grp:str):bat[:oid,:any_2]address MATdummycomment "Replace the group by its components";command iterator(grp:str):bat[:oid,:any_2]address MATdummycomment "Replace the group by its components";command info(g:str, e:str):bat[:oid,:any_2]address MATinfocomment "retrieve the definition from the partition catalogue";@-@{@+ Implementation@include prelude.mx@h#ifdef _INSPECT_H#endif /* _INSPECT_H */@c#include "mal_config.h"#include <stdarg.h>#include "mal_resolve.h"#include "mal_exception.h"#include "mal_interpreter.h"#ifdef WIN32#ifndef LIBMAT#define mat_export extern __declspec(dllimport)#else#define mat_export extern __declspec(dllexport)#endif#else#define mat_export extern#endifmat_export str MATnew(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);mat_export str MATpack(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);mat_export str MATdummy(int *ret, str *grp);mal_export str MATinfo(int *ret, str *grp, str *elm);mal_export str MATprint(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);@- Mal symbol table and environment analysis.@cstrMATnew(MalBlkPtr mb, MalStkPtr stk, InstrPtr p){	(void) mb; (void) stk; (void) p;	return MAL_SUCCEED;}@-The pack operation could be quite expensive, because itmay create a really large BAT.@cstrMATpack(MalBlkPtr mb, MalStkPtr stk, InstrPtr p){	int i,*ret,tpe;	BAT *b, *bn;	tpe= getArgType(mb,p,0);	bn= BATnew(getHeadType(tpe),getTailType(tpe), 0);	if( bn == NULL)		throw(MAL, "mat.pack","Could not allocate storage");	for(i=1; i<p->argc; i++){		b= BATdescriptor(stk->stk[getArg(p,i)].val.ival);		if( b == NULL)			throw(MAL, "mat.pack","Could not access component");		BATins(bn,b,FALSE);		BBPunfix(b->batCacheid);	}	(void) mb;	ret= (int*) getArgReference(stk,p,0);	*ret= bn->batCacheid;	BBPkeepref(bn->batCacheid);	return MAL_SUCCEED;}strMATprint(MalBlkPtr mb, MalStkPtr stk, InstrPtr p){	(void) mb; (void) stk; (void) p;	return MAL_SUCCEED;}strMATdummy(int *ret, str *grp){	(void) grp; (void) ret;	return MAL_SUCCEED;}strMATinfo(int *ret, str *grp, str *elm){	(void) grp; (void) elm; (void) ret;	return MAL_SUCCEED;}@}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -