亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? database.c

?? PostgreSQL7.4.6 for Linux
?? C
字號:
/*------------------------------------------------------------------------- * * database.c *	  miscellaneous initialization support stuff * * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION *	  $Header: /cvsroot/pgsql/src/backend/utils/misc/database.c,v 1.58 2003/08/04 02:40:08 momjian Exp $ * *------------------------------------------------------------------------- */#include "postgres.h"#include <fcntl.h>#include <unistd.h>#include "access/xact.h"#include "catalog/catname.h"#include "catalog/catalog.h"#include "catalog/pg_database.h"#include "miscadmin.h"#include "utils/syscache.h"static bool PhonyHeapTupleSatisfiesNow(HeapTupleHeader tuple);/* * ExpandDatabasePath resolves a proposed database path (obtained from * pg_database.datpath) to a full absolute path for further consumption. * NULL means an error, which the caller should process. One reason for * such an error would be an absolute alternative path when no absolute * paths are allowed. */char *ExpandDatabasePath(const char *dbpath){	char		buf[MAXPGPATH];	const char *cp;	int			len;	AssertArg(dbpath);	Assert(DataDir);	if (strlen(dbpath) >= MAXPGPATH)		return NULL;			/* ain't gonna fit nohow */	/* leading path delimiter? then already absolute path */	if (is_absolute_path(dbpath))	{#ifdef ALLOW_ABSOLUTE_DBPATHS		cp = last_path_separator(dbpath);		len = cp - dbpath;		strncpy(buf, dbpath, len);		snprintf(&buf[len], MAXPGPATH - len, "/base/%s", (cp + 1));#else		return NULL;#endif	}	/* path delimiter somewhere? then has leading environment variable */	else if ((cp = first_path_separator(dbpath)) != NULL)	{		const char *envvar;		len = cp - dbpath;		strncpy(buf, dbpath, len);		buf[len] = '\0';		envvar = getenv(buf);		if (envvar == NULL)			return NULL;		snprintf(buf, sizeof(buf), "%s/base/%s", envvar, (cp + 1));	}	else	{		/* no path delimiter? then add the default path prefix */		snprintf(buf, sizeof(buf), "%s/base/%s", DataDir, dbpath);	}	/*	 * check for illegal characters in dbpath these should really throw an	 * error, shouldn't they? or else all callers need to test for NULL	 */	for (cp = buf; *cp; cp++)	{		/*		 * The following characters will not be allowed anywhere in the		 * database path. (Do not include the slash  or '.' here.)		 */		char		illegal_dbpath_chars[] =		"\001\002\003\004\005\006\007\010"		"\011\012\013\014\015\016\017\020"		"\021\022\023\024\025\026\027\030"		"\031\032\033\034\035\036\037"		"'`";		const char *cx;		for (cx = illegal_dbpath_chars; *cx; cx++)			if (*cp == *cx)				return NULL;		/* don't allow access to parent dirs */		if (strncmp(cp, "/../", 4) == 0)			return NULL;	}	return pstrdup(buf);}	/* ExpandDatabasePath() *//* -------------------------------- *	GetRawDatabaseInfo() -- Find the OID and path of the database. * *		The database's oid forms half of the unique key for the system *		caches and lock tables.  We therefore want it initialized before *		we open any relations, since opening relations puts things in the *		cache.	To get around this problem, this code opens and scans the *		pg_database relation by hand. * *		This code knows way more than it should about the layout of *		tuples on disk, but there seems to be no help for that. *		We're pulling ourselves up by the bootstraps here... * -------------------------------- */voidGetRawDatabaseInfo(const char *name, Oid *db_id, char *path){	int			dbfd;	int			nbytes;	int			pathlen;	HeapTupleData tup;	Page		pg;	char	   *dbfname;	Form_pg_database tup_db;	RelFileNode rnode;	rnode.tblNode = 0;	rnode.relNode = RelOid_pg_database;	dbfname = relpath(rnode);	if ((dbfd = open(dbfname, O_RDONLY | PG_BINARY, 0)) < 0)		ereport(FATAL,				(errcode_for_file_access(),				 errmsg("could not open file \"%s\": %m", dbfname)));	pfree(dbfname);	/*	 * read and examine every page in pg_database	 *	 * Raw I/O! Read those tuples the hard way! Yow!	 *	 * Why don't we use the access methods or move this code someplace else?	 * This is really pg_database schema dependent code.  Perhaps it	 * should go in lib/catalog/pg_database? -cim 10/3/90	 *	 * mao replies 4 apr 91:  yeah, maybe this should be moved to	 * lib/catalog.  however, we CANNOT use the access methods since those	 * use the buffer cache, which uses the relation cache, which requires	 * that the dbid be set, which is what we're trying to do here.	 *	 */	pg = (Page) palloc(BLCKSZ);	while ((nbytes = read(dbfd, pg, BLCKSZ)) == BLCKSZ)	{		OffsetNumber max = PageGetMaxOffsetNumber(pg);		OffsetNumber lineoff;		/* look at each tuple on the page */		for (lineoff = FirstOffsetNumber; lineoff <= max; lineoff++)		{			ItemId		lpp = PageGetItemId(pg, lineoff);			/* if it's a freed tuple, ignore it */			if (!ItemIdIsUsed(lpp))				continue;			/* get a pointer to the tuple itself */			tup.t_datamcxt = NULL;			tup.t_data = (HeapTupleHeader) PageGetItem(pg, lpp);			/*			 * Check to see if tuple is valid (committed).			 *			 * XXX warning, will robinson: violation of transaction semantics			 * happens right here.	We cannot really determine if the			 * tuple is valid without checking transaction commit status,			 * and the only way to do that at init time is to paw over			 * pg_clog by hand, too.  Instead of checking, we assume that			 * the inserting transaction committed, and that any deleting			 * transaction did also, unless shown otherwise by on-row			 * commit status bits.			 *			 * All in all, this code is pretty shaky.  We will cross-check			 * our result in ReverifyMyDatabase() in postinit.c.			 *			 * NOTE: if a bogus tuple in pg_database prevents connection to a			 * valid database, a fix is to connect to another database and			 * do "select * from pg_database".	That should cause			 * committed and dead tuples to be marked with correct states.			 *			 * XXX wouldn't it be better to let new backends read the			 * database OID from a flat file, handled the same way we			 * handle the password relation?			 */			if (!PhonyHeapTupleSatisfiesNow(tup.t_data))				continue;			/*			 * Okay, see if this is the one we want.			 */			tup_db = (Form_pg_database) GETSTRUCT(&tup);			if (strcmp(name, NameStr(tup_db->datname)) == 0)			{				/* Found it; extract the OID and the database path. */				*db_id = HeapTupleGetOid(&tup);				pathlen = VARSIZE(&(tup_db->datpath)) - VARHDRSZ;				if (pathlen < 0)					pathlen = 0;	/* pure paranoia */				if (pathlen >= MAXPGPATH)					pathlen = MAXPGPATH - 1;	/* more paranoia */				strncpy(path, VARDATA(&(tup_db->datpath)), pathlen);				path[pathlen] = '\0';				goto done;			}		}	}	/* failed to find it... */	*db_id = InvalidOid;	*path = '\0';done:	close(dbfd);	pfree(pg);}/* * PhonyHeapTupleSatisfiesNow --- cut-down tuple time qual test * * This is a simplified version of HeapTupleSatisfiesNow() that does not * depend on having transaction commit info available.	Any transaction * that touched the tuple is assumed committed unless later marked invalid. * (While we could think about more complex rules, this seems appropriate * for examining pg_database, since both CREATE DATABASE and DROP DATABASE * are non-roll-back-able.) */static boolPhonyHeapTupleSatisfiesNow(HeapTupleHeader tuple){	if (!(tuple->t_infomask & HEAP_XMIN_COMMITTED))	{		if (tuple->t_infomask & HEAP_XMIN_INVALID)			return false;		if (tuple->t_infomask & HEAP_MOVED_OFF)			return false;		/* else assume committed */	}	if (tuple->t_infomask & HEAP_XMAX_INVALID)	/* xid invalid or aborted */		return true;	/* assume xmax transaction committed */	if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)		return true;	return false;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩无一区二区| 色国产综合视频| 加勒比av一区二区| 日本美女视频一区二区| 日本人妖一区二区| 日本视频一区二区| 日韩高清不卡一区二区三区| 免费在线欧美视频| 精品一区二区免费| 成人性视频免费网站| 成人免费不卡视频| 91免费版在线| 欧美精品黑人性xxxx| 欧美一卡2卡3卡4卡| 精品福利一二区| 国产欧美精品一区二区三区四区| 中文字幕中文字幕在线一区| 中文字幕一区二| 亚洲高清免费观看高清完整版在线观看| 亚洲一区免费观看| 精品一区二区影视| 成人免费毛片app| 在线观看日韩毛片| 日韩欧美国产一区二区三区| 国产午夜亚洲精品不卡| 亚洲欧洲综合另类在线| 奇米精品一区二区三区在线观看一| 狠狠狠色丁香婷婷综合激情| 99久久99久久精品国产片果冻| 在线观看精品一区| 久久亚洲一级片| 亚洲视频在线一区| 日本vs亚洲vs韩国一区三区二区| 国产精品一区二区不卡| 欧美日韩一卡二卡| 久久久久久免费| 亚洲午夜精品17c| 成人性生交大片免费看视频在线| 欧美无乱码久久久免费午夜一区 | 日韩一区二区免费在线观看| 国产三级欧美三级日产三级99| 亚洲精品日日夜夜| 美日韩一级片在线观看| 91麻豆swag| 国产日韩欧美不卡| 青青草视频一区| 91婷婷韩国欧美一区二区| 欧美va在线播放| 五月天欧美精品| 色婷婷激情久久| 中文字幕电影一区| 国产精品一级二级三级| 91精品国产综合久久久久久久| 国产91精品一区二区麻豆亚洲| 91高清视频免费看| 国产精品欧美极品| 欧美一区二区三区影视| 亚洲色图丝袜美腿| 国产福利一区二区三区视频| 欧美丰满嫩嫩电影| 亚洲综合色在线| 9i在线看片成人免费| 久久一日本道色综合| 丝袜a∨在线一区二区三区不卡| 91一区二区在线观看| 国产清纯白嫩初高生在线观看91 | 成人性视频免费网站| 5566中文字幕一区二区电影| 中文字幕一区二区三区蜜月| 国产aⅴ综合色| 精品国产精品网麻豆系列| 日本不卡123| 欧美一区二区性放荡片| 青青草精品视频| 成人一区二区三区视频| 欧美日韩高清影院| 一区二区三区加勒比av| 99精品国产一区二区三区不卡| 久久精品水蜜桃av综合天堂| 免费人成网站在线观看欧美高清| 9191成人精品久久| 奇米精品一区二区三区在线观看 | 欧美一区欧美二区| 日韩成人dvd| 欧美成人午夜电影| 国产精品伊人色| 国产日韩精品一区二区三区 | 亚洲综合色噜噜狠狠| 欧美一区午夜精品| 欧美午夜免费电影| |精品福利一区二区三区| 成人免费视频播放| 亚洲日本在线观看| 欧美撒尿777hd撒尿| 日韩一区精品字幕| 国产视频一区二区在线观看| 成人av网在线| 亚洲综合无码一区二区| 欧美一区二区三区精品| 精品在线播放午夜| 自拍视频在线观看一区二区| 一本到不卡免费一区二区| 午夜精品久久久久久久蜜桃app| 91精品国产91久久久久久一区二区| 九一久久久久久| 亚洲欧美日韩久久| 日韩美一区二区三区| jlzzjlzz国产精品久久| 亚洲123区在线观看| 欧美日本在线视频| 久久精品人人做人人综合| 51午夜精品国产| 国产毛片精品一区| 中文欧美字幕免费| 欧美在线制服丝袜| 国产福利精品一区二区| 婷婷久久综合九色综合绿巨人| 欧美一区二区三区四区视频| 久久国产精品色| 亚洲男人电影天堂| 久久蜜桃av一区精品变态类天堂| 91久久奴性调教| 大白屁股一区二区视频| 美腿丝袜亚洲三区| 一区二区三区高清不卡| 国产欧美日韩在线看| 日韩一区二区在线看片| 色综合久久久久| 成人网在线播放| 石原莉奈在线亚洲二区| 国产精品美女一区二区三区| 久久日韩粉嫩一区二区三区 | 亚洲国产一二三| 日韩欧美黄色影院| 在线观看av一区| 国产麻豆精品久久一二三| 日韩极品在线观看| 一区二区久久久久久| 国产精品福利一区| 26uuu另类欧美亚洲曰本| 欧美老肥妇做.爰bbww视频| 色综合天天综合网天天看片| www.亚洲精品| 99久久精品国产观看| 成人一二三区视频| 成人精品gif动图一区| 国产高清久久久久| 狠狠色综合日日| 国产美女在线观看一区| 黑人精品欧美一区二区蜜桃 | 夜夜嗨av一区二区三区网页 | 99精品1区2区| 国产在线视频一区二区| 久久国产欧美日韩精品| 男女男精品视频| 青草av.久久免费一区| 热久久国产精品| 蜜芽一区二区三区| 蜜臀av一区二区三区| 麻豆免费看一区二区三区| 久久精品国产秦先生| 久久精工是国产品牌吗| 激情综合网av| 国产白丝网站精品污在线入口| 国产91露脸合集magnet| 99久久精品免费观看| 在线免费不卡电影| 欧美一级久久久久久久大片| 日韩美一区二区三区| 久久亚洲影视婷婷| 亚洲女同一区二区| 亚洲成av人在线观看| 国内精品伊人久久久久影院对白| 国内精品国产成人| 99久久99精品久久久久久 | 韩国女主播一区| 丁香一区二区三区| 欧美一区二区三区精品| 91精品国产综合久久精品性色| 日韩欧美亚洲国产精品字幕久久久| 精品伦理精品一区| 日韩毛片精品高清免费| 亚洲成av人影院| 国产精品亚洲第一| 91国产丝袜在线播放| 欧美va天堂va视频va在线| 中文字幕日韩av资源站| 日韩高清在线不卡| 成人av小说网| 日韩女优电影在线观看| 综合精品久久久| 久久av老司机精品网站导航| 91视频一区二区三区| 日韩写真欧美这视频| 亚洲嫩草精品久久| 精品亚洲欧美一区| 欧美日韩在线播放三区四区| 久久精品夜夜夜夜久久| 天天影视网天天综合色在线播放| 国产成人综合网|