このページを編集する際は、編集に関する方針に従ってください。
概要 †
- elevelが20以上ならTRUE、それ以外はFALSEを返す。
- 以下のバイナリでリンクされている。
- ipc_test(メイン関数main()/ipc_test/postgresql-8.1.4?)
引数 †
- int elevel -- これが20以上かどうか評価される。
- const char *filename -- 使用されない引数。
- int lineno -- 使用されない引数。
- const char *funcname -- 使用されない引数。
実装 †
bool
errstart(int elevel, const char *filename, int lineno,
const char *funcname)
{
return (elevel >= ERROR);
}
bool
errstart(int elevel, const char *filename, int lineno,
const char *funcname)
{
ErrorData *edata;
- ErrorData/postgresql-8.1.4 -- 以下のメンバを持つ構造体。
- elevelを、intとして定義
- output_to_serverを、bool(charの別名)として定義
- output_to_clientを、bool(charの別名)として定義
- show_funcnameを、bool(charの別名)として定義
- filenameを、const charへのポインタとして定義
- linenoを、intとして定義
- funcnameを、const charへのポインタとして定義
- sqlerrcodeを、intとして定義
- messageを、charへのポインタとして定義
- detailを、charへのポインタとして定義
- hintを、charへのポインタとして定義
- contextを、charへのポインタとして定義
- cursorposを、intとして定義
- internalposを、intとして定義
- internalqueryを、charへのポインタとして定義
- saved_errnoを、intとして定義
bool output_to_server = false;
bool output_to_client = false;
int i;
/*
* Check some cases in which we want to promote an error into a more
* severe error. None of this logic applies for non-error messages.
*/
if (elevel >= ERROR)
{
/*
* If we are inside a critical section, all errors become PANIC
* errors. See miscadmin.h.
*/
if (CritSectionCount > 0)
elevel = PANIC;
/*
* Check reasons for treating ERROR as FATAL:
*
* 1. we have no handler to pass the error to (implies we are in the
* postmaster or in backend startup).
*
* 2. ExitOnAnyError mode switch is set (initdb uses this).
*
* 3. the error occurred after proc_exit has begun to run. (It's
* proc_exit's responsibility to see that this doesn't turn into
* infinite recursion!)
*/
if (elevel == ERROR)
{
if (PG_exception_stack == NULL ||
ExitOnAnyError ||
proc_exit_inprogress)
elevel = FATAL;
}
/*
* If the error level is ERROR or more, errfinish is not going to
* return to caller; therefore, if there is any stacked error already
* in progress it will be lost. This is more or less okay, except we
* do not want to have a FATAL or PANIC error downgraded because the
* reporting process was interrupted by a lower-grade error. So check
* the stack and make sure we panic if panic is warranted.
*/
for (i = 0; i <= errordata_stack_depth; i++)
elevel = Max(elevel, errordata[i].elevel);
- Max()/postgresql-8.1.4 -- 比較して大きなほうの値を返す。
- errordata/postgresql-8.1.4 -- データ型ErrorDataのstatic配列(配列数ERRORDATA_STACK_SIZE(定数5の別名))。ErrorDataは以下のメンバを持つ構造体。
- elevelを、intとして定義
- output_to_serverを、bool(charの別名)として定義
- output_to_clientを、bool(charの別名)として定義
- show_funcnameを、bool(charの別名)として定義
- filenameを、const charへのポインタとして定義
- linenoを、intとして定義
- funcnameを、const charへのポインタとして定義
- sqlerrcodeを、intとして定義
- messageを、charへのポインタとして定義
- detailを、charへのポインタとして定義
- hintを、charへのポインタとして定義
- contextを、charへのポインタとして定義
- cursorposを、intとして定義
- internalposを、intとして定義
- internalqueryを、charへのポインタとして定義
- saved_errnoを、intとして定義
}
/*
* Now decide whether we need to process this report at all; if it's
* warning or less and not enabled for logging, just return FALSE without
* starting up any error logging machinery.
*/
/* Determine whether message is enabled for server log output */
if (IsPostmasterEnvironment)
{
/* Complicated because LOG is sorted out-of-order for this purpose */
if (elevel == LOG || elevel == COMMERROR)
{
if (log_min_messages == LOG)
output_to_server = true;
else if (log_min_messages < FATAL)
output_to_server = true;
}
else
{
/* elevel != LOG */
if (log_min_messages == LOG)
{
if (elevel >= FATAL)
output_to_server = true;
}
/* Neither is LOG */
else if (elevel >= log_min_messages)
output_to_server = true;
}
}
else
{
/* In bootstrap/standalone case, do not sort LOG out-of-order */
output_to_server = (elevel >= log_min_messages);
}
/* Determine whether message is enabled for client output */
if (whereToSendOutput == DestRemote && elevel != COMMERROR)
{
/*
* client_min_messages is honored only after we complete the
* authentication handshake. This is required both for security
* reasons and because many clients can't handle NOTICE messages
* during authentication.
*/
if (ClientAuthInProgress)
output_to_client = (elevel >= ERROR);
else
output_to_client = (elevel >= client_min_messages ||
elevel == INFO);
}
/* Skip processing effort if non-error message will not be output */
if (elevel < ERROR && !output_to_server && !output_to_client)
return false;
/*
* Okay, crank up a stack entry to store the info in.
*/
if (recursion_depth++ > 0 && elevel >= ERROR)
{
/*
* Ooops, error during error processing. Clear ErrorContext as
* discussed at top of file. We will not return to the original
* error's reporter or handler, so we don't need it.
*/
MemoryContextReset(ErrorContext);
- MemoryContextReset()/postgresql-8.1.4
- ErrorContext/postgresql-8.1.4 -- 下記メンバを持つ構造体MemoryContextDataへのポインタ型の変数
- NodeTag列挙型の変数type
- 下記メンバを持つ構造体型MemoryContextMethodsへのポインタmethods
- void*型の関数ポインタalloc
- void型の関数ポインタfree_p
- void*型の関数ポインタrealloc
- void型の関数ポインタinit
- void型の関数ポインタreset
- void型の関数ポインタdelete
- Size型の関数ポインタget_chunk_space
- bool型の関数ポインタis_empty
- void型の関数ポインタstats
- void型の関数ポインタcheck
- MemoryContextDataへのポインタparent(再帰的使用)
- MemoryContextDataへのポインタfirstchild(再帰的使用)
- MemoryContextDataへのポインタnextchild(再帰的使用)
- char型へのポインタname
/*
* If we recurse more than once, the problem might be something broken
* in a context traceback routine. Abandon them too.
*/
if (recursion_depth > 2)
error_context_stack = NULL;
}
if (++errordata_stack_depth >= ERRORDATA_STACK_SIZE)
{
/*
* Wups, stack not big enough. We treat this as a PANIC condition
* because it suggests an infinite loop of errors during error
* recovery.
*/
errordata_stack_depth = -1; /* make room on stack */
ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
}
/* Initialize data for this error frame */
edata = &errordata[errordata_stack_depth];
MemSet(edata, 0, sizeof(ErrorData));
edata->elevel = elevel;
edata->output_to_server = output_to_server;
edata->output_to_client = output_to_client;
edata->filename = filename;
edata->lineno = lineno;
edata->funcname = funcname;
/* Select default errcode based on elevel */
if (elevel >= ERROR)
edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
- ERRCODE_INTERNAL_ERROR/postgresql-8.1.4?
else if (elevel == WARNING)
- WARNING/postgresql-8.1.4?
edata->sqlerrcode = ERRCODE_WARNING;
- ERRCODE_WARNING/postgresql-8.1.4?
else
edata->sqlerrcode = ERRCODE_SUCCESSFUL_COMPLETION;
- ERRCODE_SUCCESSFUL_COMPLETION/postgresql-8.1.4?
/* errno is saved here so that error parameter eval can't change it */
edata->saved_errno = errno;
recursion_depth--;
return true;
}
呼出元 †
備考 †
(postgresql-8.1.4/src/backend/utils/error/elog.cでのコメント)
* errstart --- begin an error-reporting cycle
*
* Create a stack entry and store the given parameters in it. Subsequently,
* errmsg() and perhaps other routines will be called to further populate
* the stack entry. Finally, errfinish() will be called to actually process
* the error report.
*
* Returns TRUE in normal case. Returns FALSE to short-circuit the error
* report (if it's a warning or lower and not to be reported anywhere).
履歴 †
コメント †
- hVbKaSUpjh -- yytkxzkr?
- EwfyeQLaES -- jonn1?
- kQlJvtrhhENZnDumoqd -- Tolfokdl?
- fwuFKXRstGjYNxHOh -- Noper590?
- osHmrxljjw -- Sterq76?
- YgMkbHIIJsUGuMIMGI -- jonn1?
- gnHLwgBAoBOZXmKDY -- Sytbian?
- gPbbUGbRnYDOveKob -- jonn1?
- DKnhguTSWtxMFmDg -- jonn3?
- xcrHgUthzxkxbasggFI -- jonn3?
- IcEHQKLjWeyiJWYra -- jonn2?
- ftXEUvNCOPzGUQhV -- jonn2?
- QeFakXXCdPKHAbZ -- jonn1?
- VMMJJjYmoTtWgjNrgQ -- jonn3?
- NNOMEpHrlBQnOozF -- jonn3?
- KyYtcObfEG -- jonn2?
- ororrxrOMD -- jonn2?
- evcxiLgD -- jonn1?
- HopwBxQx -- jonn2?
- yHidVgZDl -- jonn3?
- BIenCLNeB -- jonn3?
- nVoPAzSOqj -- jonn3?
- PFPETOnFsji -- jonn3?
- qJyHoOINjqG -- jonn3?
- adpMfivWfOib -- jonn3?
- JfRNyrsnrRCfZnc -- jonn3?
- EEXNugxiLRl -- jonn1?
- wzvybhLtmc -- Klpuyr?
- bRCkZaHJdNJCNZ -- jonn2?
- XAwHXfbDcjVWqwF -- jonn2?
- TUyTrEWsqjIbJMdmhG -- jonn3?
- EJFDSdGWsvdFMhXdygr -- jonn3?
- BTFqOAzyGk -- LOprax?
- RgPRtzkYV -- jonn2?
- lOIJzAzwGbYOuV -- jonn1?
- UZpUGUTjZmlqu -- jonn3?
- xDtEpmghsgmUifcml -- jonn2?
- hjmXonyLWkMtucYFxWe -- jonn1?
- uuQHXXhqEcxqPXze -- jonn1?
- guDkLrTNy -- PotU7?
- aZvjqtpw -- jonn2?
- vXqiqjvDuxichEA -- jonn1?
- kClpHMCWzxoSDPP -- jonn1?
- AVOWOCQbpEriVcbc -- jonn2?
- ridASzBYIem -- jonn3?
- KAvTCAgzZWnHvRsaGa -- jonn1?
- MVEDXGqgtTuVnRGPhv -- Jert7?
- gZlKVFHfYCdVIAgkys -- jonn2?
- bxiMDdxGf -- seubnubed?
- gOdPoYjpLeXeWDDnZ -- MixeT5?
- pFzeEzjx -- CoLt2?
- ycSONduOxLxV -- jonn3?
- xeAZhlNX -- jonn2?
- kgDqqKLK -- jonn1?
- YpFdfEJBOSjOEZDUQv -- jonn1?
- lHztobOtsNwUVFs -- jonn2?
- fnhCBagibfw -- jonn2?
- RDzHHzXfUAsc -- jonn2?
- iCiODTjh -- jonn3?
- FijZbFHbOIQaI -- jonn3?
- blRIlGmkqWNkfGjs -- jonn3?
- agIPJVSQzaCUIMqybo -- jonn1?
- SUBeEZUaBNRXIMrne -- jonn2?
- lRHLhvXdRgXAWg -- jonn2?
- sOwHayzSCkyPdbVVZ -- jonn1?
- XSVcLIehayWitUNS -- jonn1?
- aDSUtsuVcjv -- jonn2?
- ZvUsyLXTXBkXuOWh -- jonn1?
- AtJvOIuomaht -- gusnbid?
- PdYbAzJvQcVIcvxUBTp -- jonn1?
- SXCUAyHuNDy -- jonn1?
- CTDQMaSjlHB -- jonn3?
- MySlQOGslOn -- jonn1?
- aEmgCbWWyPRiTWBb -- jonn1?
- tZXaFUTUMuWqplo -- jonn3?
- zEHqcFiFoph -- jonn1?
- wQFhILbxPhDtMsTeOKU -- jonn1?
- eojJdCreyYsKbrUOAR -- jonn3?
- YRSJJrwrjl -- jonn1?
- uXugNgBRaFZdRZCS -- jonn2?
- tBXeTZUI -- jonn1?
- aBFWDlrLUrNOsPg -- jonn2?
- BDyvjKVBD -- jonn3?
- TxILTFjM -- jonn1?
- TrkDuCjZIme -- jonn2?
- QZHhPBXSChn -- jonn3?
- rsKFHxikJBPQCu -- jonn3?
- fzLjGMeIVKo -- jonn3?
- vqrkaPdBUO -- Kope7?
- yXqAYTUFAgD -- jonn2?
- OIiGyzNRVCSeAOOQ -- jonn1?
- yJCJGHsGsBYoLnClKxI -- jonn1?
- aMIjmLfuOzrwWDz -- jonn1?
- XzfIkHACpUSoxopeaDF -- jonn1?
- uLIIsuSyHCaDPX -- jonn1?
- HRJLrCZvejjU -- jonn1?
- wAoyDIeEe -- jonn1?
- mixKZvpxTLLaRWFRxJ -- jonn3?
- fnVzVlFTZxotDruOETK -- jonn2?
- ITiseymMNjnnEwiZa -- jonn3?
- VIoNMJyl -- jonn2?
- YnBzHMff -- jonn3?
- YBsDbZlx -- jonn2?
- FOaLIYPRoaYZ -- jonn3?
- UddkBygbvNQQE -- jonn3?
- fCVOojysEoryoLvZ -- jonn3?
- dtPsWaHCYX -- SelO9?
- GzofExIWietUSGx -- jonn3?
- ASfaYsXgrB -- jonn2?
- NiSTCXAGBCRCzJlwDX -- jonn3?
- xbazxIhzxTzBjiISPA -- jonn1?
- geyCzYokqobwzuTa -- jonn1?
- ingbBGTBSEsDgIdCT -- MareqE?
- mToNFJAbb -- jonn2?
- rNIRQsRDMWphYPMefcA -- jonn3?
- uJckvyCnzmcBVoK -- jonn1?
- jFvmFnSPKanc -- jonn1?
- clbFjRXCAf -- jonn2?
- choVWqVgEcJwfCT -- jonn3?
- jHgXCsNUdGGa -- jonn2?
- RpzRTvJqGAisZ -- jonn2?
- lxeQohCEygHgNWoqXYK -- jonn3?
- DZBCJmrmkwimdLEmaaQ -- jonn3?
- hOHoRjFFolBQ -- jonn3?
- ivPRnWcyftWPNJGny -- jonn2?
- rrbkUSdyP -- jonn2?
- fQXqcQVZIcZ -- jonn1?
- OFbPQPbfAqjNwgvJA -- jonn2?
- CVFfEsuaoHqoeXCNjZ -- jonn2?
- WeSRVHKLyiEVSc -- jonn1?
- aqotoWybbjZ -- jonn3?
- jRyeNaVH -- jonn2?
- sziqyIcuGAOSLkP -- udui3uigb?
- UhdxjaVuLxBAA -- jonn3?
- KBERavtpdD -- jonn1?
- ESlbKDTeuOaaH -- jonn3?
- xIcTeFShdIjkgig -- jonn1?
- pOLyQaahzHT -- jonn1?
- hEKCWCDxbTakmieTkAk -- jonn1?
- PHCSuOVHI -- jonn2?
- AUqJuufaXEIURfhAgSb -- jonn2?
- YyzqTcEwykzB -- jonn3?
- nIIbkHrjhidShAhv -- jonn1?
- iSYFkgtfhlXk -- jonn2?
- eZaJdLxZtkvbGfoT -- jonn1?
- FgBlxoZEyKIKvKlERA -- jonn1?
- DllwbxWe -- jonn2?
- gJwRhnKEOjxJnHaL -- jonn1?
- mUPVVxjJXXN -- jonn3?
- QHrcCWizmF -- jonn1?
- gscKNjFbBdsUoeYZ -- jonn3?
- jMIPWCnG -- jonn1?
- CXQegfkR -- jonn2?
- pPzchPNJPSytyGq -- jonn3?
- aUMnGYFaTsyG -- jonn3?
- qKAzwBkSmlsqqGjxbm -- jonn3?
- pyCLaPecaxIU -- jonn1?
- yDTeRAsiXeUIRe -- jonn3?
- vDJLeWthm -- jonn3?
- uRzjJNPzeO -- jonn1?
- oBvfbnKbfuopwvZ -- jonn2?
- gmZwXcyykMZHmbpqEPF -- jonn3?
- YTbqGMGSYzrcRQXdKr -- jonn2?
- xGjsEJTmWlmpwFWO -- jonn2?
- VroqlojS -- jonn2?
- LiVLKrAGEheAZBci -- Kyta7?
- qEyjiUBgyoGyQXjTPB -- caskbeg?
- OxlcUXVXyIKPDOJcf -- Lytety8?
- FxFuDotwXcgIQ -- Ymde65?