Commit 65e806cb authored by Bruce Momjian's avatar Bruce Momjian

pgindent run for 9.0

parent 16040575
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Copyright (c) 2008-2010, PostgreSQL Global Development Group * Copyright (c) 2008-2010, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.13 2010/02/16 22:19:59 adunstan Exp $ * $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.14 2010/02/26 02:00:31 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -27,11 +27,11 @@ static int auto_explain_log_format = EXPLAIN_FORMAT_TEXT; ...@@ -27,11 +27,11 @@ static int auto_explain_log_format = EXPLAIN_FORMAT_TEXT;
static bool auto_explain_log_nested_statements = false; static bool auto_explain_log_nested_statements = false;
static const struct config_enum_entry format_options[] = { static const struct config_enum_entry format_options[] = {
{"text", EXPLAIN_FORMAT_TEXT, false}, {"text", EXPLAIN_FORMAT_TEXT, false},
{"xml", EXPLAIN_FORMAT_XML, false}, {"xml", EXPLAIN_FORMAT_XML, false},
{"json", EXPLAIN_FORMAT_JSON, false}, {"json", EXPLAIN_FORMAT_JSON, false},
{"yaml", EXPLAIN_FORMAT_YAML, false}, {"yaml", EXPLAIN_FORMAT_YAML, false},
{NULL, 0, false} {NULL, 0, false}
}; };
/* Current nesting depth of ExecutorRun calls */ /* Current nesting depth of ExecutorRun calls */
...@@ -231,7 +231,7 @@ explain_ExecutorEnd(QueryDesc *queryDesc) ...@@ -231,7 +231,7 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
msec = queryDesc->totaltime->total * 1000.0; msec = queryDesc->totaltime->total * 1000.0;
if (msec >= auto_explain_log_min_duration) if (msec >= auto_explain_log_min_duration)
{ {
ExplainState es; ExplainState es;
ExplainInitState(&es); ExplainInitState(&es);
es.analyze = (queryDesc->instrument_options && auto_explain_log_analyze); es.analyze = (queryDesc->instrument_options && auto_explain_log_analyze);
...@@ -257,7 +257,7 @@ explain_ExecutorEnd(QueryDesc *queryDesc) ...@@ -257,7 +257,7 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
ereport(LOG, ereport(LOG,
(errmsg("duration: %.3f ms plan:\n%s", (errmsg("duration: %.3f ms plan:\n%s",
msec, es.str->data), msec, es.str->data),
errhidestmt(true))); errhidestmt(true)));
pfree(es.str->data); pfree(es.str->data);
} }
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_cash.c,v 1.10 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_cash.c,v 1.11 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -57,8 +57,8 @@ gbt_cashlt(const void *a, const void *b) ...@@ -57,8 +57,8 @@ gbt_cashlt(const void *a, const void *b)
static int static int
gbt_cashkey_cmp(const void *a, const void *b) gbt_cashkey_cmp(const void *a, const void *b)
{ {
cashKEY *ia = (cashKEY*)(((Nsrt *) a)->t); cashKEY *ia = (cashKEY *) (((Nsrt *) a)->t);
cashKEY *ib = (cashKEY*)(((Nsrt *) b)->t); cashKEY *ib = (cashKEY *) (((Nsrt *) b)->t);
if (ia->lower == ib->lower) if (ia->lower == ib->lower)
{ {
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_date.c,v 1.8 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_date.c,v 1.9 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -73,9 +73,9 @@ gbt_datelt(const void *a, const void *b) ...@@ -73,9 +73,9 @@ gbt_datelt(const void *a, const void *b)
static int static int
gbt_datekey_cmp(const void *a, const void *b) gbt_datekey_cmp(const void *a, const void *b)
{ {
dateKEY *ia = (dateKEY*)(((Nsrt *) a)->t); dateKEY *ia = (dateKEY *) (((Nsrt *) a)->t);
dateKEY *ib = (dateKEY*)(((Nsrt *) b)->t); dateKEY *ib = (dateKEY *) (((Nsrt *) b)->t);
int res; int res;
res = DatumGetInt32(DirectFunctionCall2(date_cmp, DateADTGetDatum(ia->lower), DateADTGetDatum(ib->lower))); res = DatumGetInt32(DirectFunctionCall2(date_cmp, DateADTGetDatum(ia->lower), DateADTGetDatum(ib->lower)));
if (res == 0) if (res == 0)
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_float4.c,v 1.9 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_float4.c,v 1.10 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -56,8 +56,8 @@ gbt_float4lt(const void *a, const void *b) ...@@ -56,8 +56,8 @@ gbt_float4lt(const void *a, const void *b)
static int static int
gbt_float4key_cmp(const void *a, const void *b) gbt_float4key_cmp(const void *a, const void *b)
{ {
float4KEY *ia = (float4KEY*)(((Nsrt *) a)->t); float4KEY *ia = (float4KEY *) (((Nsrt *) a)->t);
float4KEY *ib = (float4KEY*)(((Nsrt *) b)->t); float4KEY *ib = (float4KEY *) (((Nsrt *) b)->t);
if (ia->lower == ib->lower) if (ia->lower == ib->lower)
{ {
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_float8.c,v 1.9 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_float8.c,v 1.10 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -57,8 +57,8 @@ gbt_float8lt(const void *a, const void *b) ...@@ -57,8 +57,8 @@ gbt_float8lt(const void *a, const void *b)
static int static int
gbt_float8key_cmp(const void *a, const void *b) gbt_float8key_cmp(const void *a, const void *b)
{ {
float8KEY *ia = (float8KEY*)(((Nsrt *) a)->t); float8KEY *ia = (float8KEY *) (((Nsrt *) a)->t);
float8KEY *ib = (float8KEY*)(((Nsrt *) b)->t); float8KEY *ib = (float8KEY *) (((Nsrt *) b)->t);
if (ia->lower == ib->lower) if (ia->lower == ib->lower)
{ {
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_inet.c,v 1.11 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_inet.c,v 1.12 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -60,8 +60,8 @@ gbt_inetlt(const void *a, const void *b) ...@@ -60,8 +60,8 @@ gbt_inetlt(const void *a, const void *b)
static int static int
gbt_inetkey_cmp(const void *a, const void *b) gbt_inetkey_cmp(const void *a, const void *b)
{ {
inetKEY *ia = (inetKEY*)(((Nsrt *) a)->t); inetKEY *ia = (inetKEY *) (((Nsrt *) a)->t);
inetKEY *ib = (inetKEY*)(((Nsrt *) b)->t); inetKEY *ib = (inetKEY *) (((Nsrt *) b)->t);
if (ia->lower == ib->lower) if (ia->lower == ib->lower)
{ {
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_int2.c,v 1.9 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_int2.c,v 1.10 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -56,8 +56,8 @@ gbt_int2lt(const void *a, const void *b) ...@@ -56,8 +56,8 @@ gbt_int2lt(const void *a, const void *b)
static int static int
gbt_int2key_cmp(const void *a, const void *b) gbt_int2key_cmp(const void *a, const void *b)
{ {
int16KEY *ia = (int16KEY*)(((Nsrt *) a)->t); int16KEY *ia = (int16KEY *) (((Nsrt *) a)->t);
int16KEY *ib = (int16KEY*)(((Nsrt *) b)->t); int16KEY *ib = (int16KEY *) (((Nsrt *) b)->t);
if (ia->lower == ib->lower) if (ia->lower == ib->lower)
{ {
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_int4.c,v 1.9 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_int4.c,v 1.10 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -57,8 +57,8 @@ gbt_int4lt(const void *a, const void *b) ...@@ -57,8 +57,8 @@ gbt_int4lt(const void *a, const void *b)
static int static int
gbt_int4key_cmp(const void *a, const void *b) gbt_int4key_cmp(const void *a, const void *b)
{ {
int32KEY *ia = (int32KEY*)(((Nsrt *) a)->t); int32KEY *ia = (int32KEY *) (((Nsrt *) a)->t);
int32KEY *ib = (int32KEY*)(((Nsrt *) b)->t); int32KEY *ib = (int32KEY *) (((Nsrt *) b)->t);
if (ia->lower == ib->lower) if (ia->lower == ib->lower)
{ {
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_int8.c,v 1.9 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_int8.c,v 1.10 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -57,8 +57,8 @@ gbt_int8lt(const void *a, const void *b) ...@@ -57,8 +57,8 @@ gbt_int8lt(const void *a, const void *b)
static int static int
gbt_int8key_cmp(const void *a, const void *b) gbt_int8key_cmp(const void *a, const void *b)
{ {
int64KEY *ia = (int64KEY*)(((Nsrt *) a)->t); int64KEY *ia = (int64KEY *) (((Nsrt *) a)->t);
int64KEY *ib = (int64KEY*)(((Nsrt *) b)->t); int64KEY *ib = (int64KEY *) (((Nsrt *) b)->t);
if (ia->lower == ib->lower) if (ia->lower == ib->lower)
{ {
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_interval.c,v 1.13 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_interval.c,v 1.14 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -65,9 +65,9 @@ gbt_intvlt(const void *a, const void *b) ...@@ -65,9 +65,9 @@ gbt_intvlt(const void *a, const void *b)
static int static int
gbt_intvkey_cmp(const void *a, const void *b) gbt_intvkey_cmp(const void *a, const void *b)
{ {
intvKEY *ia = (intvKEY*)(((Nsrt *) a)->t); intvKEY *ia = (intvKEY *) (((Nsrt *) a)->t);
intvKEY *ib = (intvKEY*)(((Nsrt *) b)->t); intvKEY *ib = (intvKEY *) (((Nsrt *) b)->t);
int res; int res;
res = DatumGetInt32(DirectFunctionCall2(interval_cmp, IntervalPGetDatum(&ia->lower), IntervalPGetDatum(&ib->lower))); res = DatumGetInt32(DirectFunctionCall2(interval_cmp, IntervalPGetDatum(&ia->lower), IntervalPGetDatum(&ib->lower)));
if (res == 0) if (res == 0)
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_macaddr.c,v 1.9 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_macaddr.c,v 1.10 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -63,9 +63,9 @@ gbt_macadlt(const void *a, const void *b) ...@@ -63,9 +63,9 @@ gbt_macadlt(const void *a, const void *b)
static int static int
gbt_macadkey_cmp(const void *a, const void *b) gbt_macadkey_cmp(const void *a, const void *b)
{ {
macKEY *ia = (macKEY*)(((Nsrt *) a)->t); macKEY *ia = (macKEY *) (((Nsrt *) a)->t);
macKEY *ib = (macKEY*)(((Nsrt *) b)->t); macKEY *ib = (macKEY *) (((Nsrt *) b)->t);
int res; int res;
res = DatumGetInt32(DirectFunctionCall2(macaddr_cmp, MacaddrPGetDatum(&ia->lower), MacaddrPGetDatum(&ib->lower))); res = DatumGetInt32(DirectFunctionCall2(macaddr_cmp, MacaddrPGetDatum(&ia->lower), MacaddrPGetDatum(&ib->lower)));
if (res == 0) if (res == 0)
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_oid.c,v 1.9 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_oid.c,v 1.10 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -57,8 +57,8 @@ gbt_oidlt(const void *a, const void *b) ...@@ -57,8 +57,8 @@ gbt_oidlt(const void *a, const void *b)
static int static int
gbt_oidkey_cmp(const void *a, const void *b) gbt_oidkey_cmp(const void *a, const void *b)
{ {
oidKEY *ia = (oidKEY*)(((Nsrt *) a)->t); oidKEY *ia = (oidKEY *) (((Nsrt *) a)->t);
oidKEY *ib = (oidKEY*)(((Nsrt *) b)->t); oidKEY *ib = (oidKEY *) (((Nsrt *) b)->t);
if (ia->lower == ib->lower) if (ia->lower == ib->lower)
{ {
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_time.c,v 1.17 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_time.c,v 1.18 2010/02/26 02:00:31 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -101,9 +101,9 @@ gbt_timelt(const void *a, const void *b) ...@@ -101,9 +101,9 @@ gbt_timelt(const void *a, const void *b)
static int static int
gbt_timekey_cmp(const void *a, const void *b) gbt_timekey_cmp(const void *a, const void *b)
{ {
timeKEY *ia = (timeKEY*)(((Nsrt *) a)->t); timeKEY *ia = (timeKEY *) (((Nsrt *) a)->t);
timeKEY *ib = (timeKEY*)(((Nsrt *) b)->t); timeKEY *ib = (timeKEY *) (((Nsrt *) b)->t);
int res; int res;
res = DatumGetInt32(DirectFunctionCall2(time_cmp, TimeADTGetDatumFast(ia->lower), TimeADTGetDatumFast(ib->lower))); res = DatumGetInt32(DirectFunctionCall2(time_cmp, TimeADTGetDatumFast(ia->lower), TimeADTGetDatumFast(ib->lower)));
if (res == 0) if (res == 0)
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_ts.c,v 1.18 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_ts.c,v 1.19 2010/02/26 02:00:32 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
#include "btree_utils_num.h" #include "btree_utils_num.h"
...@@ -99,9 +99,9 @@ gbt_tslt(const void *a, const void *b) ...@@ -99,9 +99,9 @@ gbt_tslt(const void *a, const void *b)
static int static int
gbt_tskey_cmp(const void *a, const void *b) gbt_tskey_cmp(const void *a, const void *b)
{ {
tsKEY *ia = (tsKEY*)(((Nsrt *) a)->t); tsKEY *ia = (tsKEY *) (((Nsrt *) a)->t);
tsKEY *ib = (tsKEY*)(((Nsrt *) b)->t); tsKEY *ib = (tsKEY *) (((Nsrt *) b)->t);
int res; int res;
res = DatumGetInt32(DirectFunctionCall2(timestamp_cmp, TimestampGetDatumFast(ia->lower), TimestampGetDatumFast(ib->lower))); res = DatumGetInt32(DirectFunctionCall2(timestamp_cmp, TimestampGetDatumFast(ia->lower), TimestampGetDatumFast(ib->lower)));
if (res == 0) if (res == 0)
......
/* /*
* $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_var.c,v 1.22 2009/12/02 13:13:24 teodor Exp $ * $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_var.c,v 1.23 2010/02/26 02:00:32 momjian Exp $
*/ */
#include "btree_gist.h" #include "btree_gist.h"
...@@ -444,7 +444,7 @@ gbt_vsrt_cmp(const void *a, const void *b, void *arg) ...@@ -444,7 +444,7 @@ gbt_vsrt_cmp(const void *a, const void *b, void *arg)
GBT_VARKEY_R ar = gbt_var_key_readable(((const Vsrt *) a)->t); GBT_VARKEY_R ar = gbt_var_key_readable(((const Vsrt *) a)->t);
GBT_VARKEY_R br = gbt_var_key_readable(((const Vsrt *) b)->t); GBT_VARKEY_R br = gbt_var_key_readable(((const Vsrt *) b)->t);
const gbtree_vinfo *tinfo = (const gbtree_vinfo *) arg; const gbtree_vinfo *tinfo = (const gbtree_vinfo *) arg;
int res; int res;
res = (*tinfo->f_cmp) (ar.lower, br.lower); res = (*tinfo->f_cmp) (ar.lower, br.lower);
if (res == 0) if (res == 0)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Darko Prenosil <Darko.Prenosil@finteh.hr> * Darko Prenosil <Darko.Prenosil@finteh.hr>
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in> * Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
* *
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.90 2010/02/24 05:20:49 itagaki Exp $ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.91 2010/02/26 02:00:32 momjian Exp $
* Copyright (c) 2001-2010, PostgreSQL Global Development Group * Copyright (c) 2001-2010, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED; * ALL RIGHTS RESERVED;
* *
...@@ -101,7 +101,7 @@ static void dblink_security_check(PGconn *conn, remoteConn *rconn); ...@@ -101,7 +101,7 @@ static void dblink_security_check(PGconn *conn, remoteConn *rconn);
static void dblink_res_error(const char *conname, PGresult *res, const char *dblink_context_msg, bool fail); static void dblink_res_error(const char *conname, PGresult *res, const char *dblink_context_msg, bool fail);
static char *get_connect_string(const char *servername); static char *get_connect_string(const char *servername);
static char *escape_param_str(const char *from); static char *escape_param_str(const char *from);
static int get_nondropped_natts(Oid relid); static int get_nondropped_natts(Oid relid);
/* Global */ /* Global */
static remoteConn *pconn = NULL; static remoteConn *pconn = NULL;
...@@ -506,15 +506,15 @@ PG_FUNCTION_INFO_V1(dblink_fetch); ...@@ -506,15 +506,15 @@ PG_FUNCTION_INFO_V1(dblink_fetch);
Datum Datum
dblink_fetch(PG_FUNCTION_ARGS) dblink_fetch(PG_FUNCTION_ARGS)
{ {
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
PGresult *res = NULL; PGresult *res = NULL;
char *conname = NULL; char *conname = NULL;
remoteConn *rconn = NULL; remoteConn *rconn = NULL;
PGconn *conn = NULL; PGconn *conn = NULL;
StringInfoData buf; StringInfoData buf;
char *curname = NULL; char *curname = NULL;
int howmany = 0; int howmany = 0;
bool fail = true; /* default to backward compatible */ bool fail = true; /* default to backward compatible */
DBLINK_INIT; DBLINK_INIT;
...@@ -572,8 +572,8 @@ dblink_fetch(PG_FUNCTION_ARGS) ...@@ -572,8 +572,8 @@ dblink_fetch(PG_FUNCTION_ARGS)
/* /*
* Try to execute the query. Note that since libpq uses malloc, the * Try to execute the query. Note that since libpq uses malloc, the
* PGresult will be long-lived even though we are still in a * PGresult will be long-lived even though we are still in a short-lived
* short-lived memory context. * memory context.
*/ */
res = PQexec(conn, buf.data); res = PQexec(conn, buf.data);
if (!res || if (!res ||
...@@ -645,16 +645,16 @@ dblink_get_result(PG_FUNCTION_ARGS) ...@@ -645,16 +645,16 @@ dblink_get_result(PG_FUNCTION_ARGS)
static Datum static Datum
dblink_record_internal(FunctionCallInfo fcinfo, bool is_async) dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
{ {
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
char *msg; char *msg;
PGresult *res = NULL; PGresult *res = NULL;
PGconn *conn = NULL; PGconn *conn = NULL;
char *connstr = NULL; char *connstr = NULL;
char *sql = NULL; char *sql = NULL;
char *conname = NULL; char *conname = NULL;
remoteConn *rconn = NULL; remoteConn *rconn = NULL;
bool fail = true; /* default to backward compatible */ bool fail = true; /* default to backward compatible */
bool freeconn = false; bool freeconn = false;
/* check to see if caller supports us returning a tuplestore */ /* check to see if caller supports us returning a tuplestore */
if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo))
...@@ -764,7 +764,7 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async) ...@@ -764,7 +764,7 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
static void static void
materializeResult(FunctionCallInfo fcinfo, PGresult *res) materializeResult(FunctionCallInfo fcinfo, PGresult *res)
{ {
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
Assert(rsinfo->returnMode == SFRM_Materialize); Assert(rsinfo->returnMode == SFRM_Materialize);
...@@ -780,8 +780,8 @@ materializeResult(FunctionCallInfo fcinfo, PGresult *res) ...@@ -780,8 +780,8 @@ materializeResult(FunctionCallInfo fcinfo, PGresult *res)
is_sql_cmd = true; is_sql_cmd = true;
/* /*
* need a tuple descriptor representing one TEXT column to * need a tuple descriptor representing one TEXT column to return
* return the command status string as our result tuple * the command status string as our result tuple
*/ */
tupdesc = CreateTemplateTupleDesc(1, false); tupdesc = CreateTemplateTupleDesc(1, false);
TupleDescInitEntry(tupdesc, (AttrNumber) 1, "status", TupleDescInitEntry(tupdesc, (AttrNumber) 1, "status",
...@@ -831,16 +831,16 @@ materializeResult(FunctionCallInfo fcinfo, PGresult *res) ...@@ -831,16 +831,16 @@ materializeResult(FunctionCallInfo fcinfo, PGresult *res)
if (ntuples > 0) if (ntuples > 0)
{ {
AttInMetadata *attinmeta; AttInMetadata *attinmeta;
Tuplestorestate *tupstore; Tuplestorestate *tupstore;
MemoryContext oldcontext; MemoryContext oldcontext;
int row; int row;
char **values; char **values;
attinmeta = TupleDescGetAttInMetadata(tupdesc); attinmeta = TupleDescGetAttInMetadata(tupdesc);
oldcontext = MemoryContextSwitchTo( oldcontext = MemoryContextSwitchTo(
rsinfo->econtext->ecxt_per_query_memory); rsinfo->econtext->ecxt_per_query_memory);
tupstore = tuplestore_begin_heap(true, false, work_mem); tupstore = tuplestore_begin_heap(true, false, work_mem);
rsinfo->setResult = tupstore; rsinfo->setResult = tupstore;
rsinfo->setDesc = tupdesc; rsinfo->setDesc = tupdesc;
...@@ -1281,13 +1281,13 @@ dblink_build_sql_insert(PG_FUNCTION_ARGS) ...@@ -1281,13 +1281,13 @@ dblink_build_sql_insert(PG_FUNCTION_ARGS)
"attributes too large"))); "attributes too large")));
/* /*
* ensure we don't ask for more pk attributes than we have * ensure we don't ask for more pk attributes than we have non-dropped
* non-dropped columns * columns
*/ */
nondropped_natts = get_nondropped_natts(relid); nondropped_natts = get_nondropped_natts(relid);
if (pknumatts > nondropped_natts) if (pknumatts > nondropped_natts)
ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("number of primary key fields exceeds number of specified relation attributes"))); errmsg("number of primary key fields exceeds number of specified relation attributes")));
/* /*
* Source array is made up of key values that will be used to locate the * Source array is made up of key values that will be used to locate the
...@@ -1388,13 +1388,13 @@ dblink_build_sql_delete(PG_FUNCTION_ARGS) ...@@ -1388,13 +1388,13 @@ dblink_build_sql_delete(PG_FUNCTION_ARGS)
"attributes too large"))); "attributes too large")));
/* /*
* ensure we don't ask for more pk attributes than we have * ensure we don't ask for more pk attributes than we have non-dropped
* non-dropped columns * columns
*/ */
nondropped_natts = get_nondropped_natts(relid); nondropped_natts = get_nondropped_natts(relid);
if (pknumatts > nondropped_natts) if (pknumatts > nondropped_natts)
ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("number of primary key fields exceeds number of specified relation attributes"))); errmsg("number of primary key fields exceeds number of specified relation attributes")));
/* /*
* Target array is made up of key values that will be used to build the * Target array is made up of key values that will be used to build the
...@@ -1487,13 +1487,13 @@ dblink_build_sql_update(PG_FUNCTION_ARGS) ...@@ -1487,13 +1487,13 @@ dblink_build_sql_update(PG_FUNCTION_ARGS)
"attributes too large"))); "attributes too large")));
/* /*
* ensure we don't ask for more pk attributes than we have * ensure we don't ask for more pk attributes than we have non-dropped
* non-dropped columns * columns
*/ */
nondropped_natts = get_nondropped_natts(relid); nondropped_natts = get_nondropped_natts(relid);
if (pknumatts > nondropped_natts) if (pknumatts > nondropped_natts)
ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("number of primary key fields exceeds number of specified relation attributes"))); errmsg("number of primary key fields exceeds number of specified relation attributes")));
/* /*
* Source array is made up of key values that will be used to locate the * Source array is made up of key values that will be used to locate the
...@@ -1551,7 +1551,7 @@ dblink_current_query(PG_FUNCTION_ARGS) ...@@ -1551,7 +1551,7 @@ dblink_current_query(PG_FUNCTION_ARGS)
} }
/* /*
* Retrieve async notifications for a connection. * Retrieve async notifications for a connection.
* *
* Returns an setof record of notifications, or an empty set if none recieved. * Returns an setof record of notifications, or an empty set if none recieved.
* Can optionally take a named connection as parameter, but uses the unnamed connection per default. * Can optionally take a named connection as parameter, but uses the unnamed connection per default.
...@@ -1563,14 +1563,14 @@ PG_FUNCTION_INFO_V1(dblink_get_notify); ...@@ -1563,14 +1563,14 @@ PG_FUNCTION_INFO_V1(dblink_get_notify);
Datum Datum
dblink_get_notify(PG_FUNCTION_ARGS) dblink_get_notify(PG_FUNCTION_ARGS)
{ {
PGconn *conn = NULL; PGconn *conn = NULL;
remoteConn *rconn = NULL; remoteConn *rconn = NULL;
PGnotify *notify; PGnotify *notify;
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
TupleDesc tupdesc; TupleDesc tupdesc;
Tuplestorestate *tupstore; Tuplestorestate *tupstore;
MemoryContext per_query_ctx; MemoryContext per_query_ctx;
MemoryContext oldcontext; MemoryContext oldcontext;
DBLINK_INIT; DBLINK_INIT;
if (PG_NARGS() == 1) if (PG_NARGS() == 1)
...@@ -2484,4 +2484,3 @@ get_nondropped_natts(Oid relid) ...@@ -2484,4 +2484,3 @@ get_nondropped_natts(Oid relid)
relation_close(rel, AccessShareLock); relation_close(rel, AccessShareLock);
return nondropped_natts; return nondropped_natts;
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Copyright (c) 2007-2010, PostgreSQL Global Development Group * Copyright (c) 2007-2010, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/contrib/dict_xsyn/dict_xsyn.c,v 1.8 2010/01/02 16:57:32 momjian Exp $ * $PostgreSQL: pgsql/contrib/dict_xsyn/dict_xsyn.c,v 1.9 2010/02/26 02:00:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -147,7 +147,7 @@ dxsyn_init(PG_FUNCTION_ARGS) ...@@ -147,7 +147,7 @@ dxsyn_init(PG_FUNCTION_ARGS)
List *dictoptions = (List *) PG_GETARG_POINTER(0); List *dictoptions = (List *) PG_GETARG_POINTER(0);
DictSyn *d; DictSyn *d;
ListCell *l; ListCell *l;
char *filename = NULL; char *filename = NULL;
d = (DictSyn *) palloc0(sizeof(DictSyn)); d = (DictSyn *) palloc0(sizeof(DictSyn));
d->len = 0; d->len = 0;
......
/* /*
* $PostgreSQL: pgsql/contrib/hstore/hstore.h,v 1.9 2009/09/30 19:50:22 tgl Exp $ * $PostgreSQL: pgsql/contrib/hstore/hstore.h,v 1.10 2010/02/26 02:00:32 momjian Exp $
*/ */
#ifndef __HSTORE_H__ #ifndef __HSTORE_H__
#define __HSTORE_H__ #define __HSTORE_H__
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* HEntry: there is one of these for each key _and_ value in an hstore * HEntry: there is one of these for each key _and_ value in an hstore
* *
* the position offset points to the _end_ so that we can get the length * the position offset points to the _end_ so that we can get the length
* by subtraction from the previous entry. the ISFIRST flag lets us tell * by subtraction from the previous entry. the ISFIRST flag lets us tell
* whether there is a previous entry. * whether there is a previous entry.
*/ */
typedef struct typedef struct
...@@ -51,7 +51,7 @@ typedef struct ...@@ -51,7 +51,7 @@ typedef struct
/* /*
* it's not possible to get more than 2^28 items into an hstore, * it's not possible to get more than 2^28 items into an hstore,
* so we reserve the top few bits of the size field. See hstore_compat.c * so we reserve the top few bits of the size field. See hstore_compat.c
* for one reason why. Some bits are left for future use here. * for one reason why. Some bits are left for future use here.
*/ */
#define HS_FLAG_NEWVERSION 0x80000000 #define HS_FLAG_NEWVERSION 0x80000000
...@@ -88,7 +88,7 @@ typedef struct ...@@ -88,7 +88,7 @@ typedef struct
* evaluation here. * evaluation here.
*/ */
#define HS_COPYITEM(dent_,dbuf_,dptr_,sptr_,klen_,vlen_,vnull_) \ #define HS_COPYITEM(dent_,dbuf_,dptr_,sptr_,klen_,vlen_,vnull_) \
do { \ do { \
memcpy((dptr_), (sptr_), (klen_)+(vlen_)); \ memcpy((dptr_), (sptr_), (klen_)+(vlen_)); \
(dptr_) += (klen_)+(vlen_); \ (dptr_) += (klen_)+(vlen_); \
(dent_)++->entry = ((dptr_) - (dbuf_) - (vlen_)) & HENTRY_POSMASK; \ (dent_)++->entry = ((dptr_) - (dbuf_) - (vlen_)) & HENTRY_POSMASK; \
...@@ -119,7 +119,7 @@ typedef struct ...@@ -119,7 +119,7 @@ typedef struct
/* finalize a newly-constructed hstore */ /* finalize a newly-constructed hstore */
#define HS_FINALIZE(hsp_,count_,buf_,ptr_) \ #define HS_FINALIZE(hsp_,count_,buf_,ptr_) \
do { \ do { \
int buflen = (ptr_) - (buf_); \ int buflen = (ptr_) - (buf_); \
if ((count_)) \ if ((count_)) \
ARRPTR(hsp_)[0].entry |= HENTRY_ISFIRST; \ ARRPTR(hsp_)[0].entry |= HENTRY_ISFIRST; \
if ((count_) != HS_COUNT((hsp_))) \ if ((count_) != HS_COUNT((hsp_))) \
...@@ -133,7 +133,7 @@ typedef struct ...@@ -133,7 +133,7 @@ typedef struct
/* ensure the varlena size of an existing hstore is correct */ /* ensure the varlena size of an existing hstore is correct */
#define HS_FIXSIZE(hsp_,count_) \ #define HS_FIXSIZE(hsp_,count_) \
do { \ do { \
int bl = (count_) ? HSE_ENDPOS(ARRPTR(hsp_)[2*(count_)-1]) : 0; \ int bl = (count_) ? HSE_ENDPOS(ARRPTR(hsp_)[2*(count_)-1]) : 0; \
SET_VARSIZE((hsp_), CALCDATASIZE((count_),bl)); \ SET_VARSIZE((hsp_), CALCDATASIZE((count_),bl)); \
} while (0) } while (0)
...@@ -172,7 +172,7 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs); ...@@ -172,7 +172,7 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs);
#define HStoreExistsStrategyNumber 9 #define HStoreExistsStrategyNumber 9
#define HStoreExistsAnyStrategyNumber 10 #define HStoreExistsAnyStrategyNumber 10
#define HStoreExistsAllStrategyNumber 11 #define HStoreExistsAllStrategyNumber 11
#define HStoreOldContainsStrategyNumber 13 /* backwards compatibility */ #define HStoreOldContainsStrategyNumber 13 /* backwards compatibility */
/* /*
* defining HSTORE_POLLUTE_NAMESPACE=0 will prevent use of old function names; * defining HSTORE_POLLUTE_NAMESPACE=0 will prevent use of old function names;
......
/* /*
* $PostgreSQL: pgsql/contrib/hstore/hstore_compat.c,v 1.1 2009/09/30 19:50:22 tgl Exp $ * $PostgreSQL: pgsql/contrib/hstore/hstore_compat.c,v 1.2 2010/02/26 02:00:32 momjian Exp $
* *
* Notes on old/new hstore format disambiguation. * Notes on old/new hstore format disambiguation.
* *
...@@ -106,24 +106,24 @@ typedef struct ...@@ -106,24 +106,24 @@ typedef struct
pos:31; pos:31;
} HOldEntry; } HOldEntry;
static int hstoreValidNewFormat(HStore *hs); static int hstoreValidNewFormat(HStore *hs);
static int hstoreValidOldFormat(HStore *hs); static int hstoreValidOldFormat(HStore *hs);
/* /*
* Validity test for a new-format hstore. * Validity test for a new-format hstore.
* 0 = not valid * 0 = not valid
* 1 = valid but with "slop" in the length * 1 = valid but with "slop" in the length
* 2 = exactly valid * 2 = exactly valid
*/ */
static int static int
hstoreValidNewFormat(HStore *hs) hstoreValidNewFormat(HStore *hs)
{ {
int count = HS_COUNT(hs); int count = HS_COUNT(hs);
HEntry *entries = ARRPTR(hs); HEntry *entries = ARRPTR(hs);
int buflen = (count) ? HSE_ENDPOS(entries[2*(count)-1]) : 0; int buflen = (count) ? HSE_ENDPOS(entries[2 * (count) - 1]) : 0;
int vsize = CALCDATASIZE(count,buflen); int vsize = CALCDATASIZE(count, buflen);
int i; int i;
if (hs->size_ & HS_FLAG_NEWVERSION) if (hs->size_ & HS_FLAG_NEWVERSION)
return 2; return 2;
...@@ -139,10 +139,10 @@ hstoreValidNewFormat(HStore *hs) ...@@ -139,10 +139,10 @@ hstoreValidNewFormat(HStore *hs)
/* entry position must be nondecreasing */ /* entry position must be nondecreasing */
for (i = 1; i < 2*count; ++i) for (i = 1; i < 2 * count; ++i)
{ {
if (HSE_ISFIRST(entries[i]) if (HSE_ISFIRST(entries[i])
|| (HSE_ENDPOS(entries[i]) < HSE_ENDPOS(entries[i-1]))) || (HSE_ENDPOS(entries[i]) < HSE_ENDPOS(entries[i - 1])))
return 0; return 0;
} }
...@@ -150,9 +150,9 @@ hstoreValidNewFormat(HStore *hs) ...@@ -150,9 +150,9 @@ hstoreValidNewFormat(HStore *hs)
for (i = 1; i < count; ++i) for (i = 1; i < count; ++i)
{ {
if (HS_KEYLEN(entries,i) < HS_KEYLEN(entries,i-1)) if (HS_KEYLEN(entries, i) < HS_KEYLEN(entries, i - 1))
return 0; return 0;
if (HSE_ISNULL(entries[2*i])) if (HSE_ISNULL(entries[2 * i]))
return 0; return 0;
} }
...@@ -164,18 +164,18 @@ hstoreValidNewFormat(HStore *hs) ...@@ -164,18 +164,18 @@ hstoreValidNewFormat(HStore *hs)
/* /*
* Validity test for an old-format hstore. * Validity test for an old-format hstore.
* 0 = not valid * 0 = not valid
* 1 = valid but with "slop" in the length * 1 = valid but with "slop" in the length
* 2 = exactly valid * 2 = exactly valid
*/ */
static int static int
hstoreValidOldFormat(HStore *hs) hstoreValidOldFormat(HStore *hs)
{ {
int count = hs->size_; int count = hs->size_;
HOldEntry *entries = (HOldEntry *) ARRPTR(hs); HOldEntry *entries = (HOldEntry *) ARRPTR(hs);
int vsize; int vsize;
int lastpos = 0; int lastpos = 0;
int i; int i;
if (hs->size_ & HS_FLAG_NEWVERSION) if (hs->size_ & HS_FLAG_NEWVERSION)
return 0; return 0;
...@@ -188,7 +188,7 @@ hstoreValidOldFormat(HStore *hs) ...@@ -188,7 +188,7 @@ hstoreValidOldFormat(HStore *hs)
if (count > 0xFFFFFFF) if (count > 0xFFFFFFF)
return 0; return 0;
if (CALCDATASIZE(count,0) > VARSIZE(hs)) if (CALCDATASIZE(count, 0) > VARSIZE(hs))
return 0; return 0;
if (entries[0].pos != 0) if (entries[0].pos != 0)
...@@ -198,14 +198,14 @@ hstoreValidOldFormat(HStore *hs) ...@@ -198,14 +198,14 @@ hstoreValidOldFormat(HStore *hs)
for (i = 1; i < count; ++i) for (i = 1; i < count; ++i)
{ {
if (entries[i].keylen < entries[i-1].keylen) if (entries[i].keylen < entries[i - 1].keylen)
return 0; return 0;
} }
/* /*
* entry position must be strictly increasing, except for the * entry position must be strictly increasing, except for the first entry
* first entry (which can be ""=>"" and thus zero-length); and * (which can be ""=>"" and thus zero-length); and all entries must be
* all entries must be properly contiguous * properly contiguous
*/ */
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
...@@ -216,7 +216,7 @@ hstoreValidOldFormat(HStore *hs) ...@@ -216,7 +216,7 @@ hstoreValidOldFormat(HStore *hs)
+ ((entries[i].valisnull) ? 0 : entries[i].vallen)); + ((entries[i].valisnull) ? 0 : entries[i].vallen));
} }
vsize = CALCDATASIZE(count,lastpos); vsize = CALCDATASIZE(count, lastpos);
if (vsize > VARSIZE(hs)) if (vsize > VARSIZE(hs))
return 0; return 0;
...@@ -255,108 +255,100 @@ hstoreUpgrade(Datum orig) ...@@ -255,108 +255,100 @@ hstoreUpgrade(Datum orig)
if (valid_new) if (valid_new)
{ {
/* /*
* force the "new version" flag and the correct varlena * force the "new version" flag and the correct varlena length,
* length, but only if we have a writable copy already * but only if we have a writable copy already (which we almost
* (which we almost always will, since short new-format * always will, since short new-format values won't come through
* values won't come through here) * here)
*/ */
if (writable) if (writable)
{ {
HS_SETCOUNT(hs,HS_COUNT(hs)); HS_SETCOUNT(hs, HS_COUNT(hs));
HS_FIXSIZE(hs,HS_COUNT(hs)); HS_FIXSIZE(hs, HS_COUNT(hs));
} }
return hs; return hs;
} }
else else
{ {
elog(ERROR,"invalid hstore value found"); elog(ERROR, "invalid hstore value found");
} }
} }
/* /*
* this is the tricky edge case. It is only possible in some * this is the tricky edge case. It is only possible in some quite extreme
* quite extreme cases (the hstore must have had a lot * cases (the hstore must have had a lot of wasted padding space at the
* of wasted padding space at the end). * end). But the only way a "new" hstore value could get here is if we're
* But the only way a "new" hstore value could get here is if * upgrading in place from a pre-release version of hstore-new (NOT
* we're upgrading in place from a pre-release version of * contrib/hstore), so we work off the following assumptions: 1. If you're
* hstore-new (NOT contrib/hstore), so we work off the following * moving from old contrib/hstore to hstore-new, you're required to fix up
* assumptions: * any potential conflicts first, e.g. by running ALTER TABLE ... USING
* 1. If you're moving from old contrib/hstore to hstore-new, * col::text::hstore; on all hstore columns before upgrading. 2. If you're
* you're required to fix up any potential conflicts first, * moving from old contrib/hstore to new contrib/hstore, then "new" values
* e.g. by running ALTER TABLE ... USING col::text::hstore; * are impossible here 3. If you're moving from pre-release hstore-new to
* on all hstore columns before upgrading. * hstore-new, then "old" values are impossible here 4. If you're moving
* 2. If you're moving from old contrib/hstore to new * from pre-release hstore-new to new contrib/hstore, you're not doing so
* contrib/hstore, then "new" values are impossible here * as an in-place upgrade, so there is no issue So the upshot of all this
* 3. If you're moving from pre-release hstore-new to hstore-new, * is that we can treat all the edge cases as "new" if we're being built
* then "old" values are impossible here * as hstore-new, and "old" if we're being built as contrib/hstore.
* 4. If you're moving from pre-release hstore-new to new
* contrib/hstore, you're not doing so as an in-place upgrade,
* so there is no issue
* So the upshot of all this is that we can treat all the edge
* cases as "new" if we're being built as hstore-new, and "old"
* if we're being built as contrib/hstore.
* *
* XXX the WARNING can probably be downgraded to DEBUG1 once this * XXX the WARNING can probably be downgraded to DEBUG1 once this has been
* has been beta-tested. But for now, it would be very useful to * beta-tested. But for now, it would be very useful to know if anyone can
* know if anyone can actually reach this case in a non-contrived * actually reach this case in a non-contrived setting.
* setting.
*/ */
if (valid_new) if (valid_new)
{ {
#if HSTORE_IS_HSTORE_NEW #if HSTORE_IS_HSTORE_NEW
elog(WARNING,"ambiguous hstore value resolved as hstore-new"); elog(WARNING, "ambiguous hstore value resolved as hstore-new");
/* /*
* force the "new version" flag and the correct varlena * force the "new version" flag and the correct varlena length, but
* length, but only if we have a writable copy already * only if we have a writable copy already (which we almost always
* (which we almost always will, since short new-format * will, since short new-format values won't come through here)
* values won't come through here)
*/ */
if (writable) if (writable)
{ {
HS_SETCOUNT(hs,HS_COUNT(hs)); HS_SETCOUNT(hs, HS_COUNT(hs));
HS_FIXSIZE(hs,HS_COUNT(hs)); HS_FIXSIZE(hs, HS_COUNT(hs));
} }
return hs; return hs;
#else #else
elog(WARNING,"ambiguous hstore value resolved as hstore-old"); elog(WARNING, "ambiguous hstore value resolved as hstore-old");
#endif #endif
} }
/* /*
* must have an old-style value. Overwrite it in place as a new-style * must have an old-style value. Overwrite it in place as a new-style one,
* one, making sure we have a writable copy first. * making sure we have a writable copy first.
*/ */
if (!writable) if (!writable)
hs = (HStore *) PG_DETOAST_DATUM_COPY(orig); hs = (HStore *) PG_DETOAST_DATUM_COPY(orig);
{ {
int count = hs->size_; int count = hs->size_;
HEntry *new_entries = ARRPTR(hs); HEntry *new_entries = ARRPTR(hs);
HOldEntry *old_entries = (HOldEntry *) ARRPTR(hs); HOldEntry *old_entries = (HOldEntry *) ARRPTR(hs);
int i; int i;
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
{ {
uint32 pos = old_entries[i].pos; uint32 pos = old_entries[i].pos;
uint32 keylen = old_entries[i].keylen; uint32 keylen = old_entries[i].keylen;
uint32 vallen = old_entries[i].vallen; uint32 vallen = old_entries[i].vallen;
bool isnull = old_entries[i].valisnull; bool isnull = old_entries[i].valisnull;
if (isnull) if (isnull)
vallen = 0; vallen = 0;
new_entries[2*i].entry = (pos + keylen) & HENTRY_POSMASK; new_entries[2 * i].entry = (pos + keylen) & HENTRY_POSMASK;
new_entries[2*i+1].entry = (((pos + keylen + vallen) & HENTRY_POSMASK) new_entries[2 * i + 1].entry = (((pos + keylen + vallen) & HENTRY_POSMASK)
| ((isnull) ? HENTRY_ISNULL : 0)); | ((isnull) ? HENTRY_ISNULL : 0));
} }
if (count) if (count)
new_entries[0].entry |= HENTRY_ISFIRST; new_entries[0].entry |= HENTRY_ISFIRST;
HS_SETCOUNT(hs,count); HS_SETCOUNT(hs, count);
HS_FIXSIZE(hs,count); HS_FIXSIZE(hs, count);
} }
return hs; return hs;
...@@ -368,9 +360,9 @@ Datum hstore_version_diag(PG_FUNCTION_ARGS); ...@@ -368,9 +360,9 @@ Datum hstore_version_diag(PG_FUNCTION_ARGS);
Datum Datum
hstore_version_diag(PG_FUNCTION_ARGS) hstore_version_diag(PG_FUNCTION_ARGS)
{ {
HStore *hs = (HStore *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); HStore *hs = (HStore *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
int valid_new = hstoreValidNewFormat(hs); int valid_new = hstoreValidNewFormat(hs);
int valid_old = hstoreValidOldFormat(hs); int valid_old = hstoreValidOldFormat(hs);
PG_RETURN_INT32(valid_old*10 + valid_new); PG_RETURN_INT32(valid_old * 10 + valid_new);
} }
/* /*
* $PostgreSQL: pgsql/contrib/hstore/hstore_gin.c,v 1.7 2009/09/30 19:50:22 tgl Exp $ * $PostgreSQL: pgsql/contrib/hstore/hstore_gin.c,v 1.8 2010/02/26 02:00:32 momjian Exp $
*/ */
#include "postgres.h" #include "postgres.h"
...@@ -36,10 +36,10 @@ gin_extract_hstore(PG_FUNCTION_ARGS) ...@@ -36,10 +36,10 @@ gin_extract_hstore(PG_FUNCTION_ARGS)
HStore *hs = PG_GETARG_HS(0); HStore *hs = PG_GETARG_HS(0);
int32 *nentries = (int32 *) PG_GETARG_POINTER(1); int32 *nentries = (int32 *) PG_GETARG_POINTER(1);
Datum *entries = NULL; Datum *entries = NULL;
HEntry *hsent = ARRPTR(hs); HEntry *hsent = ARRPTR(hs);
char *ptr = STRPTR(hs); char *ptr = STRPTR(hs);
int count = HS_COUNT(hs); int count = HS_COUNT(hs);
int i; int i;
*nentries = 2 * count; *nentries = 2 * count;
if (count) if (count)
...@@ -49,21 +49,21 @@ gin_extract_hstore(PG_FUNCTION_ARGS) ...@@ -49,21 +49,21 @@ gin_extract_hstore(PG_FUNCTION_ARGS)
{ {
text *item; text *item;
item = makeitem(HS_KEY(hsent,ptr,i), HS_KEYLEN(hsent,i)); item = makeitem(HS_KEY(hsent, ptr, i), HS_KEYLEN(hsent, i));
*VARDATA(item) = KEYFLAG; *VARDATA(item) = KEYFLAG;
entries[2*i] = PointerGetDatum(item); entries[2 * i] = PointerGetDatum(item);
if (HS_VALISNULL(hsent,i)) if (HS_VALISNULL(hsent, i))
{ {
item = makeitem(NULL, 0); item = makeitem(NULL, 0);
*VARDATA(item) = NULLFLAG; *VARDATA(item) = NULLFLAG;
} }
else else
{ {
item = makeitem(HS_VAL(hsent,ptr,i), HS_VALLEN(hsent,i)); item = makeitem(HS_VAL(hsent, ptr, i), HS_VALLEN(hsent, i));
*VARDATA(item) = VALFLAG; *VARDATA(item) = VALFLAG;
} }
entries[2*i+1] = PointerGetDatum(item); entries[2 * i + 1] = PointerGetDatum(item);
} }
PG_RETURN_POINTER(entries); PG_RETURN_POINTER(entries);
...@@ -103,14 +103,15 @@ gin_extract_hstore_query(PG_FUNCTION_ARGS) ...@@ -103,14 +103,15 @@ gin_extract_hstore_query(PG_FUNCTION_ARGS)
else if (strategy == HStoreExistsAnyStrategyNumber || else if (strategy == HStoreExistsAnyStrategyNumber ||
strategy == HStoreExistsAllStrategyNumber) strategy == HStoreExistsAllStrategyNumber)
{ {
ArrayType *query = PG_GETARG_ARRAYTYPE_P(0); ArrayType *query = PG_GETARG_ARRAYTYPE_P(0);
Datum *key_datums; Datum *key_datums;
bool *key_nulls; bool *key_nulls;
int key_count; int key_count;
int i,j; int i,
j;
int32 *nentries = (int32 *) PG_GETARG_POINTER(1); int32 *nentries = (int32 *) PG_GETARG_POINTER(1);
Datum *entries = NULL; Datum *entries = NULL;
text *item; text *item;
deconstruct_array(query, deconstruct_array(query,
TEXTOID, -1, false, 'i', TEXTOID, -1, false, 'i',
...@@ -145,8 +146,10 @@ gin_consistent_hstore(PG_FUNCTION_ARGS) ...@@ -145,8 +146,10 @@ gin_consistent_hstore(PG_FUNCTION_ARGS)
{ {
bool *check = (bool *) PG_GETARG_POINTER(0); bool *check = (bool *) PG_GETARG_POINTER(0);
StrategyNumber strategy = PG_GETARG_UINT16(1); StrategyNumber strategy = PG_GETARG_UINT16(1);
/* HStore *query = PG_GETARG_HS(2); */ /* HStore *query = PG_GETARG_HS(2); */
int32 nkeys = PG_GETARG_INT32(3); int32 nkeys = PG_GETARG_INT32(3);
/* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */ /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
bool *recheck = (bool *) PG_GETARG_POINTER(5); bool *recheck = (bool *) PG_GETARG_POINTER(5);
bool res = true; bool res = true;
...@@ -178,7 +181,7 @@ gin_consistent_hstore(PG_FUNCTION_ARGS) ...@@ -178,7 +181,7 @@ gin_consistent_hstore(PG_FUNCTION_ARGS)
} }
else if (strategy == HStoreExistsAllStrategyNumber) else if (strategy == HStoreExistsAllStrategyNumber)
{ {
int i; int i;
for (i = 0; res && i < nkeys; ++i) for (i = 0; res && i < nkeys; ++i)
if (!check[i]) if (!check[i])
......
/* /*
* $PostgreSQL: pgsql/contrib/hstore/hstore_gist.c,v 1.11 2009/09/30 19:50:22 tgl Exp $ * $PostgreSQL: pgsql/contrib/hstore/hstore_gist.c,v 1.12 2010/02/26 02:00:32 momjian Exp $
*/ */
#include "postgres.h" #include "postgres.h"
...@@ -118,20 +118,20 @@ ghstore_compress(PG_FUNCTION_ARGS) ...@@ -118,20 +118,20 @@ ghstore_compress(PG_FUNCTION_ARGS)
HStore *val = DatumGetHStoreP(entry->key); HStore *val = DatumGetHStoreP(entry->key);
HEntry *hsent = ARRPTR(val); HEntry *hsent = ARRPTR(val);
char *ptr = STRPTR(val); char *ptr = STRPTR(val);
int count = HS_COUNT(val); int count = HS_COUNT(val);
int i; int i;
SET_VARSIZE(res, CALCGTSIZE(0)); SET_VARSIZE(res, CALCGTSIZE(0));
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
{ {
int h; int h;
h = crc32_sz((char *) HS_KEY(hsent,ptr,i), HS_KEYLEN(hsent,i)); h = crc32_sz((char *) HS_KEY(hsent, ptr, i), HS_KEYLEN(hsent, i));
HASH(GETSIGN(res), h); HASH(GETSIGN(res), h);
if (!HS_VALISNULL(hsent,i)) if (!HS_VALISNULL(hsent, i))
{ {
h = crc32_sz((char *) HS_VAL(hsent,ptr,i), HS_VALLEN(hsent,i)); h = crc32_sz((char *) HS_VAL(hsent, ptr, i), HS_VALLEN(hsent, i));
HASH(GETSIGN(res), h); HASH(GETSIGN(res), h);
} }
} }
...@@ -511,6 +511,7 @@ ghstore_consistent(PG_FUNCTION_ARGS) ...@@ -511,6 +511,7 @@ ghstore_consistent(PG_FUNCTION_ARGS)
{ {
GISTTYPE *entry = (GISTTYPE *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key); GISTTYPE *entry = (GISTTYPE *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key);
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
/* Oid subtype = PG_GETARG_OID(3); */ /* Oid subtype = PG_GETARG_OID(3); */
bool *recheck = (bool *) PG_GETARG_POINTER(4); bool *recheck = (bool *) PG_GETARG_POINTER(4);
bool res = true; bool res = true;
...@@ -530,18 +531,18 @@ ghstore_consistent(PG_FUNCTION_ARGS) ...@@ -530,18 +531,18 @@ ghstore_consistent(PG_FUNCTION_ARGS)
HStore *query = PG_GETARG_HS(1); HStore *query = PG_GETARG_HS(1);
HEntry *qe = ARRPTR(query); HEntry *qe = ARRPTR(query);
char *qv = STRPTR(query); char *qv = STRPTR(query);
int count = HS_COUNT(query); int count = HS_COUNT(query);
int i; int i;
for (i = 0; res && i < count; ++i) for (i = 0; res && i < count; ++i)
{ {
int crc = crc32_sz((char *) HS_KEY(qe,qv,i), HS_KEYLEN(qe,i)); int crc = crc32_sz((char *) HS_KEY(qe, qv, i), HS_KEYLEN(qe, i));
if (GETBIT(sign, HASHVAL(crc))) if (GETBIT(sign, HASHVAL(crc)))
{ {
if (!HS_VALISNULL(qe,i)) if (!HS_VALISNULL(qe, i))
{ {
crc = crc32_sz((char *) HS_VAL(qe,qv,i), HS_VALLEN(qe,i)); crc = crc32_sz((char *) HS_VAL(qe, qv, i), HS_VALLEN(qe, i));
if (!GETBIT(sign, HASHVAL(crc))) if (!GETBIT(sign, HASHVAL(crc)))
res = false; res = false;
} }
...@@ -559,11 +560,11 @@ ghstore_consistent(PG_FUNCTION_ARGS) ...@@ -559,11 +560,11 @@ ghstore_consistent(PG_FUNCTION_ARGS)
} }
else if (strategy == HStoreExistsAllStrategyNumber) else if (strategy == HStoreExistsAllStrategyNumber)
{ {
ArrayType *query = PG_GETARG_ARRAYTYPE_P(1); ArrayType *query = PG_GETARG_ARRAYTYPE_P(1);
Datum *key_datums; Datum *key_datums;
bool *key_nulls; bool *key_nulls;
int key_count; int key_count;
int i; int i;
deconstruct_array(query, deconstruct_array(query,
TEXTOID, -1, false, 'i', TEXTOID, -1, false, 'i',
...@@ -571,7 +572,8 @@ ghstore_consistent(PG_FUNCTION_ARGS) ...@@ -571,7 +572,8 @@ ghstore_consistent(PG_FUNCTION_ARGS)
for (i = 0; res && i < key_count; ++i) for (i = 0; res && i < key_count; ++i)
{ {
int crc; int crc;
if (key_nulls[i]) if (key_nulls[i])
continue; continue;
crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ); crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ);
...@@ -581,11 +583,11 @@ ghstore_consistent(PG_FUNCTION_ARGS) ...@@ -581,11 +583,11 @@ ghstore_consistent(PG_FUNCTION_ARGS)
} }
else if (strategy == HStoreExistsAnyStrategyNumber) else if (strategy == HStoreExistsAnyStrategyNumber)
{ {
ArrayType *query = PG_GETARG_ARRAYTYPE_P(1); ArrayType *query = PG_GETARG_ARRAYTYPE_P(1);
Datum *key_datums; Datum *key_datums;
bool *key_nulls; bool *key_nulls;
int key_count; int key_count;
int i; int i;
deconstruct_array(query, deconstruct_array(query,
TEXTOID, -1, false, 'i', TEXTOID, -1, false, 'i',
...@@ -595,7 +597,8 @@ ghstore_consistent(PG_FUNCTION_ARGS) ...@@ -595,7 +597,8 @@ ghstore_consistent(PG_FUNCTION_ARGS)
for (i = 0; !res && i < key_count; ++i) for (i = 0; !res && i < key_count; ++i)
{ {
int crc; int crc;
if (key_nulls[i]) if (key_nulls[i])
continue; continue;
crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ); crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ);
......
This diff is collapsed.
This diff is collapsed.
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
* isn.c * isn.c
* PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC) * PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC)
* *
* Author: German Mendez Bravo (Kronuz) * Author: German Mendez Bravo (Kronuz)
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/contrib/isn/isn.c,v 1.13 2010/02/05 04:34:51 momjian Exp $ * $PostgreSQL: pgsql/contrib/isn/isn.c,v 1.14 2010/02/26 02:00:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
* isn.h * isn.h
* PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC) * PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC)
* *
* Author: German Mendez Bravo (Kronuz) * Author: German Mendez Bravo (Kronuz)
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/contrib/isn/isn.h,v 1.9 2010/02/05 04:34:51 momjian Exp $ * $PostgreSQL: pgsql/contrib/isn/isn.h,v 1.10 2010/02/26 02:00:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Originally by * Originally by
* B. Palmer, bpalmer@crimelabs.net 1-17-2001 * B. Palmer, bpalmer@crimelabs.net 1-17-2001
* *
* $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.37 2010/02/07 20:48:08 tgl Exp $ * $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.38 2010/02/26 02:00:32 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -440,7 +440,7 @@ sql_exec_dumpalldbs(PGconn *conn, struct options * opts) ...@@ -440,7 +440,7 @@ sql_exec_dumpalldbs(PGconn *conn, struct options * opts)
/* get the oid and database name from the system pg_database table */ /* get the oid and database name from the system pg_database table */
snprintf(todo, sizeof(todo), snprintf(todo, sizeof(todo),
"SELECT d.oid AS \"Oid\", datname AS \"Database Name\", " "SELECT d.oid AS \"Oid\", datname AS \"Database Name\", "
"spcname AS \"Tablespace\" FROM pg_catalog.pg_database d JOIN pg_catalog.pg_tablespace t ON " "spcname AS \"Tablespace\" FROM pg_catalog.pg_database d JOIN pg_catalog.pg_tablespace t ON "
"(dattablespace = t.oid) ORDER BY 2"); "(dattablespace = t.oid) ORDER BY 2");
sql_exec(conn, todo, opts->quiet); sql_exec(conn, todo, opts->quiet);
...@@ -456,10 +456,10 @@ sql_exec_dumpalltables(PGconn *conn, struct options * opts) ...@@ -456,10 +456,10 @@ sql_exec_dumpalltables(PGconn *conn, struct options * opts)
char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" "; char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" ";
snprintf(todo, sizeof(todo), snprintf(todo, sizeof(todo),
"SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s " "SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s "
"FROM pg_class c " "FROM pg_class c "
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace "
" LEFT JOIN pg_catalog.pg_database d ON d.datname = pg_catalog.current_database()," " LEFT JOIN pg_catalog.pg_database d ON d.datname = pg_catalog.current_database(),"
" pg_catalog.pg_tablespace t " " pg_catalog.pg_tablespace t "
"WHERE relkind IN ('r'%s%s) AND " "WHERE relkind IN ('r'%s%s) AND "
" %s" " %s"
...@@ -527,7 +527,7 @@ sql_exec_searchtables(PGconn *conn, struct options * opts) ...@@ -527,7 +527,7 @@ sql_exec_searchtables(PGconn *conn, struct options * opts)
/* now build the query */ /* now build the query */
todo = (char *) myalloc(650 + strlen(qualifiers)); todo = (char *) myalloc(650 + strlen(qualifiers));
snprintf(todo, 650 + strlen(qualifiers), snprintf(todo, 650 + strlen(qualifiers),
"SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s\n" "SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s\n"
"FROM pg_catalog.pg_class c \n" "FROM pg_catalog.pg_class c \n"
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace \n" " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace \n"
" LEFT JOIN pg_catalog.pg_database d ON d.datname = pg_catalog.current_database(),\n" " LEFT JOIN pg_catalog.pg_database d ON d.datname = pg_catalog.current_database(),\n"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Author: Laurenz Albe <laurenz.albe@wien.gv.at> * Author: Laurenz Albe <laurenz.albe@wien.gv.at>
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/contrib/passwordcheck/passwordcheck.c,v 1.2 2010/01/02 16:57:32 momjian Exp $ * $PostgreSQL: pgsql/contrib/passwordcheck/passwordcheck.c,v 1.3 2010/02/26 02:00:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -66,12 +66,12 @@ check_password(const char *username, ...@@ -66,12 +66,12 @@ check_password(const char *username,
switch (password_type) switch (password_type)
{ {
case PASSWORD_TYPE_MD5: case PASSWORD_TYPE_MD5:
/* /*
* Unfortunately we cannot perform exhaustive checks on * Unfortunately we cannot perform exhaustive checks on encrypted
* encrypted passwords - we are restricted to guessing. * passwords - we are restricted to guessing. (Alternatively, we
* (Alternatively, we could insist on the password being * could insist on the password being presented non-encrypted, but
* presented non-encrypted, but that has its own security * that has its own security disadvantages.)
* disadvantages.)
* *
* We only check for username = password. * We only check for username = password.
*/ */
...@@ -84,6 +84,7 @@ check_password(const char *username, ...@@ -84,6 +84,7 @@ check_password(const char *username,
break; break;
case PASSWORD_TYPE_PLAINTEXT: case PASSWORD_TYPE_PLAINTEXT:
/* /*
* For unencrypted passwords we can perform better checks * For unencrypted passwords we can perform better checks
*/ */
...@@ -106,8 +107,8 @@ check_password(const char *username, ...@@ -106,8 +107,8 @@ check_password(const char *username,
for (i = 0; i < pwdlen; i++) for (i = 0; i < pwdlen; i++)
{ {
/* /*
* isalpha() does not work for multibyte encodings * isalpha() does not work for multibyte encodings but let's
* but let's consider non-ASCII characters non-letters * consider non-ASCII characters non-letters
*/ */
if (isalpha((unsigned char) password[i])) if (isalpha((unsigned char) password[i]))
pwd_has_letter = true; pwd_has_letter = true;
...@@ -117,7 +118,7 @@ check_password(const char *username, ...@@ -117,7 +118,7 @@ check_password(const char *username,
if (!pwd_has_letter || !pwd_has_nonletter) if (!pwd_has_letter || !pwd_has_nonletter)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("password must contain both letters and nonletters"))); errmsg("password must contain both letters and nonletters")));
#ifdef USE_CRACKLIB #ifdef USE_CRACKLIB
/* call cracklib to check password */ /* call cracklib to check password */
......
/* /*
* $PostgreSQL: pgsql/contrib/pg_standby/pg_standby.c,v 1.27 2009/11/04 12:51:30 heikki Exp $ * $PostgreSQL: pgsql/contrib/pg_standby/pg_standby.c,v 1.28 2010/02/26 02:00:32 momjian Exp $
* *
* *
* pg_standby.c * pg_standby.c
...@@ -576,6 +576,7 @@ main(int argc, char **argv) ...@@ -576,6 +576,7 @@ main(int argc, char **argv)
} }
#ifndef WIN32 #ifndef WIN32
/* /*
* You can send SIGUSR1 to trigger failover. * You can send SIGUSR1 to trigger failover.
* *
...@@ -614,9 +615,10 @@ main(int argc, char **argv) ...@@ -614,9 +615,10 @@ main(int argc, char **argv)
} }
break; break;
case 'l': /* Use link */ case 'l': /* Use link */
/* /*
* Link feature disabled, possibly permanently. Linking * Link feature disabled, possibly permanently. Linking causes
* causes a problem after recovery ends that is not currently * a problem after recovery ends that is not currently
* resolved by PostgreSQL. 25 Jun 2009 * resolved by PostgreSQL. 25 Jun 2009
*/ */
#ifdef NOT_USED #ifdef NOT_USED
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* Copyright (c) 2008-2010, PostgreSQL Global Development Group * Copyright (c) 2008-2010, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/contrib/pg_stat_statements/pg_stat_statements.c,v 1.12 2010/01/08 00:38:19 itagaki Exp $ * $PostgreSQL: pgsql/contrib/pg_stat_statements/pg_stat_statements.c,v 1.13 2010/02/26 02:00:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -76,18 +76,18 @@ typedef struct pgssHashKey ...@@ -76,18 +76,18 @@ typedef struct pgssHashKey
*/ */
typedef struct Counters typedef struct Counters
{ {
int64 calls; /* # of times executed */ int64 calls; /* # of times executed */
double total_time; /* total execution time in seconds */ double total_time; /* total execution time in seconds */
int64 rows; /* total # of retrieved or affected rows */ int64 rows; /* total # of retrieved or affected rows */
int64 shared_blks_hit; /* # of shared buffer hits */ int64 shared_blks_hit; /* # of shared buffer hits */
int64 shared_blks_read; /* # of shared disk blocks read */ int64 shared_blks_read; /* # of shared disk blocks read */
int64 shared_blks_written;/* # of shared disk blocks written */ int64 shared_blks_written; /* # of shared disk blocks written */
int64 local_blks_hit; /* # of local buffer hits */ int64 local_blks_hit; /* # of local buffer hits */
int64 local_blks_read; /* # of local disk blocks read */ int64 local_blks_read; /* # of local disk blocks read */
int64 local_blks_written; /* # of local disk blocks written */ int64 local_blks_written; /* # of local disk blocks written */
int64 temp_blks_read; /* # of temp blocks read */ int64 temp_blks_read; /* # of temp blocks read */
int64 temp_blks_written; /* # of temp blocks written */ int64 temp_blks_written; /* # of temp blocks written */
double usage; /* usage factor */ double usage; /* usage factor */
} Counters; } Counters;
/* /*
...@@ -148,7 +148,7 @@ static const struct config_enum_entry track_options[] = ...@@ -148,7 +148,7 @@ static const struct config_enum_entry track_options[] =
static int pgss_max; /* max # statements to track */ static int pgss_max; /* max # statements to track */
static int pgss_track; /* tracking level */ static int pgss_track; /* tracking level */
static bool pgss_track_utility; /* whether to track utility commands */ static bool pgss_track_utility; /* whether to track utility commands */
static bool pgss_save; /* whether to save stats across shutdown */ static bool pgss_save; /* whether to save stats across shutdown */
...@@ -175,12 +175,12 @@ static void pgss_ExecutorRun(QueryDesc *queryDesc, ...@@ -175,12 +175,12 @@ static void pgss_ExecutorRun(QueryDesc *queryDesc,
long count); long count);
static void pgss_ExecutorEnd(QueryDesc *queryDesc); static void pgss_ExecutorEnd(QueryDesc *queryDesc);
static void pgss_ProcessUtility(Node *parsetree, static void pgss_ProcessUtility(Node *parsetree,
const char *queryString, ParamListInfo params, bool isTopLevel, const char *queryString, ParamListInfo params, bool isTopLevel,
DestReceiver *dest, char *completionTag); DestReceiver *dest, char *completionTag);
static uint32 pgss_hash_fn(const void *key, Size keysize); static uint32 pgss_hash_fn(const void *key, Size keysize);
static int pgss_match_fn(const void *key1, const void *key2, Size keysize); static int pgss_match_fn(const void *key1, const void *key2, Size keysize);
static void pgss_store(const char *query, double total_time, uint64 rows, static void pgss_store(const char *query, double total_time, uint64 rows,
const BufferUsage *bufusage); const BufferUsage *bufusage);
static Size pgss_memsize(void); static Size pgss_memsize(void);
static pgssEntry *entry_alloc(pgssHashKey *key); static pgssEntry *entry_alloc(pgssHashKey *key);
static void entry_dealloc(void); static void entry_dealloc(void);
...@@ -231,7 +231,7 @@ _PG_init(void) ...@@ -231,7 +231,7 @@ _PG_init(void)
NULL); NULL);
DefineCustomBoolVariable("pg_stat_statements.track_utility", DefineCustomBoolVariable("pg_stat_statements.track_utility",
"Selects whether utility commands are tracked by pg_stat_statements.", "Selects whether utility commands are tracked by pg_stat_statements.",
NULL, NULL,
&pgss_track_utility, &pgss_track_utility,
true, true,
...@@ -356,8 +356,8 @@ pgss_shmem_startup(void) ...@@ -356,8 +356,8 @@ pgss_shmem_startup(void)
on_shmem_exit(pgss_shmem_shutdown, (Datum) 0); on_shmem_exit(pgss_shmem_shutdown, (Datum) 0);
/* /*
* Attempt to load old statistics from the dump file, if this is the * Attempt to load old statistics from the dump file, if this is the first
* first time through and we weren't told not to. * time through and we weren't told not to.
*/ */
if (found || !pgss_save) if (found || !pgss_save)
return; return;
...@@ -592,7 +592,7 @@ pgss_ProcessUtility(Node *parsetree, const char *queryString, ...@@ -592,7 +592,7 @@ pgss_ProcessUtility(Node *parsetree, const char *queryString,
instr_time start; instr_time start;
instr_time duration; instr_time duration;
uint64 rows = 0; uint64 rows = 0;
BufferUsage bufusage; BufferUsage bufusage;
bufusage = pgBufferUsage; bufusage = pgBufferUsage;
INSTR_TIME_SET_CURRENT(start); INSTR_TIME_SET_CURRENT(start);
......
This diff is collapsed.
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* unaccent.c * unaccent.c
* Text search unaccent dictionary * Text search unaccent dictionary
* *
* Copyright (c) 2009-2010, PostgreSQL Global Development Group * Copyright (c) 2009-2010, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/contrib/unaccent/unaccent.c,v 1.4 2010/01/02 16:57:33 momjian Exp $ * $PostgreSQL: pgsql/contrib/unaccent/unaccent.c,v 1.5 2010/02/26 02:00:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -25,26 +25,27 @@ ...@@ -25,26 +25,27 @@
PG_MODULE_MAGIC; PG_MODULE_MAGIC;
/* /*
* Unaccent dictionary uses uncompressed suffix tree to find a * Unaccent dictionary uses uncompressed suffix tree to find a
* character to replace. Each node of tree is an array of * character to replace. Each node of tree is an array of
* SuffixChar struct with length = 256 (n-th element of array * SuffixChar struct with length = 256 (n-th element of array
* corresponds to byte) * corresponds to byte)
*/ */
typedef struct SuffixChar { typedef struct SuffixChar
struct SuffixChar *nextChar; {
char *replaceTo; struct SuffixChar *nextChar;
int replacelen; char *replaceTo;
int replacelen;
} SuffixChar; } SuffixChar;
/* /*
* placeChar - put str into tree's structure, byte by byte. * placeChar - put str into tree's structure, byte by byte.
*/ */
static SuffixChar* static SuffixChar *
placeChar(SuffixChar *node, unsigned char *str, int lenstr, char *replaceTo, int replacelen) placeChar(SuffixChar *node, unsigned char *str, int lenstr, char *replaceTo, int replacelen)
{ {
SuffixChar *curnode; SuffixChar *curnode;
if ( !node ) if (!node)
{ {
node = palloc(sizeof(SuffixChar) * 256); node = palloc(sizeof(SuffixChar) * 256);
memset(node, 0, sizeof(SuffixChar) * 256); memset(node, 0, sizeof(SuffixChar) * 256);
...@@ -52,20 +53,20 @@ placeChar(SuffixChar *node, unsigned char *str, int lenstr, char *replaceTo, int ...@@ -52,20 +53,20 @@ placeChar(SuffixChar *node, unsigned char *str, int lenstr, char *replaceTo, int
curnode = node + *str; curnode = node + *str;
if ( lenstr == 1 ) if (lenstr == 1)
{ {
if ( curnode->replaceTo ) if (curnode->replaceTo)
elog(WARNING, "duplicate TO argument, use first one"); elog(WARNING, "duplicate TO argument, use first one");
else else
{ {
curnode->replacelen = replacelen; curnode->replacelen = replacelen;
curnode->replaceTo = palloc( replacelen ); curnode->replaceTo = palloc(replacelen);
memcpy(curnode->replaceTo, replaceTo, replacelen); memcpy(curnode->replaceTo, replaceTo, replacelen);
} }
} }
else else
{ {
curnode->nextChar = placeChar( curnode->nextChar, str+1, lenstr-1, replaceTo, replacelen); curnode->nextChar = placeChar(curnode->nextChar, str + 1, lenstr - 1, replaceTo, replacelen);
} }
return node; return node;
...@@ -75,13 +76,13 @@ placeChar(SuffixChar *node, unsigned char *str, int lenstr, char *replaceTo, int ...@@ -75,13 +76,13 @@ placeChar(SuffixChar *node, unsigned char *str, int lenstr, char *replaceTo, int
* initSuffixTree - create suffix tree from file. Function converts * initSuffixTree - create suffix tree from file. Function converts
* UTF8-encoded file into current encoding. * UTF8-encoded file into current encoding.
*/ */
static SuffixChar* static SuffixChar *
initSuffixTree(char *filename) initSuffixTree(char *filename)
{ {
SuffixChar * volatile rootSuffixTree = NULL; SuffixChar *volatile rootSuffixTree = NULL;
MemoryContext ccxt = CurrentMemoryContext; MemoryContext ccxt = CurrentMemoryContext;
tsearch_readline_state trst; tsearch_readline_state trst;
volatile bool skip; volatile bool skip;
filename = get_tsearch_config_filename(filename, "rules"); filename = get_tsearch_config_filename(filename, "rules");
if (!tsearch_readline_begin(&trst, filename)) if (!tsearch_readline_begin(&trst, filename))
...@@ -90,34 +91,34 @@ initSuffixTree(char *filename) ...@@ -90,34 +91,34 @@ initSuffixTree(char *filename)
errmsg("could not open unaccent file \"%s\": %m", errmsg("could not open unaccent file \"%s\": %m",
filename))); filename)));
do do
{ {
char src[4096]; char src[4096];
char trg[4096]; char trg[4096];
int srclen; int srclen;
int trglen; int trglen;
char *line = NULL; char *line = NULL;
skip = true; skip = true;
PG_TRY(); PG_TRY();
{ {
/* /*
* pg_do_encoding_conversion() (called by tsearch_readline()) * pg_do_encoding_conversion() (called by tsearch_readline()) will
* will emit exception if it finds untranslatable characters in current locale. * emit exception if it finds untranslatable characters in current
* We just skip such characters. * locale. We just skip such characters.
*/ */
while ((line = tsearch_readline(&trst)) != NULL) while ((line = tsearch_readline(&trst)) != NULL)
{ {
if ( sscanf(line, "%s\t%s\n", src, trg)!=2 ) if (sscanf(line, "%s\t%s\n", src, trg) != 2)
continue; continue;
srclen = strlen(src); srclen = strlen(src);
trglen = strlen(trg); trglen = strlen(trg);
rootSuffixTree = placeChar(rootSuffixTree, rootSuffixTree = placeChar(rootSuffixTree,
(unsigned char*)src, srclen, (unsigned char *) src, srclen,
trg, trglen); trg, trglen);
skip = false; skip = false;
pfree(line); pfree(line);
} }
...@@ -141,7 +142,7 @@ initSuffixTree(char *filename) ...@@ -141,7 +142,7 @@ initSuffixTree(char *filename)
} }
PG_END_TRY(); PG_END_TRY();
} }
while(skip); while (skip);
tsearch_readline_end(&trst); tsearch_readline_end(&trst);
...@@ -151,13 +152,13 @@ initSuffixTree(char *filename) ...@@ -151,13 +152,13 @@ initSuffixTree(char *filename)
/* /*
* findReplaceTo - find multibyte character in tree * findReplaceTo - find multibyte character in tree
*/ */
static SuffixChar * static SuffixChar *
findReplaceTo( SuffixChar *node, unsigned char *src, int srclen ) findReplaceTo(SuffixChar *node, unsigned char *src, int srclen)
{ {
while( node ) while (node)
{ {
node = node + *src; node = node + *src;
if ( srclen == 1 ) if (srclen == 1)
return node; return node;
src++; src++;
...@@ -169,13 +170,13 @@ findReplaceTo( SuffixChar *node, unsigned char *src, int srclen ) ...@@ -169,13 +170,13 @@ findReplaceTo( SuffixChar *node, unsigned char *src, int srclen )
} }
PG_FUNCTION_INFO_V1(unaccent_init); PG_FUNCTION_INFO_V1(unaccent_init);
Datum unaccent_init(PG_FUNCTION_ARGS); Datum unaccent_init(PG_FUNCTION_ARGS);
Datum Datum
unaccent_init(PG_FUNCTION_ARGS) unaccent_init(PG_FUNCTION_ARGS)
{ {
List *dictoptions = (List *) PG_GETARG_POINTER(0); List *dictoptions = (List *) PG_GETARG_POINTER(0);
SuffixChar *rootSuffixTree = NULL; SuffixChar *rootSuffixTree = NULL;
bool fileloaded = false; bool fileloaded = false;
ListCell *l; ListCell *l;
foreach(l, dictoptions) foreach(l, dictoptions)
...@@ -188,8 +189,8 @@ unaccent_init(PG_FUNCTION_ARGS) ...@@ -188,8 +189,8 @@ unaccent_init(PG_FUNCTION_ARGS)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("multiple Rules parameters"))); errmsg("multiple Rules parameters")));
rootSuffixTree = initSuffixTree(defGetString(defel)); rootSuffixTree = initSuffixTree(defGetString(defel));
fileloaded = true; fileloaded = true;
} }
else else
{ {
...@@ -211,51 +212,52 @@ unaccent_init(PG_FUNCTION_ARGS) ...@@ -211,51 +212,52 @@ unaccent_init(PG_FUNCTION_ARGS)
} }
PG_FUNCTION_INFO_V1(unaccent_lexize); PG_FUNCTION_INFO_V1(unaccent_lexize);
Datum unaccent_lexize(PG_FUNCTION_ARGS); Datum unaccent_lexize(PG_FUNCTION_ARGS);
Datum Datum
unaccent_lexize(PG_FUNCTION_ARGS) unaccent_lexize(PG_FUNCTION_ARGS)
{ {
SuffixChar *rootSuffixTree = (SuffixChar*)PG_GETARG_POINTER(0); SuffixChar *rootSuffixTree = (SuffixChar *) PG_GETARG_POINTER(0);
char *srcchar = (char *) PG_GETARG_POINTER(1); char *srcchar = (char *) PG_GETARG_POINTER(1);
int32 len = PG_GETARG_INT32(2); int32 len = PG_GETARG_INT32(2);
char *srcstart, *trgchar = NULL; char *srcstart,
*trgchar = NULL;
int charlen; int charlen;
TSLexeme *res = NULL; TSLexeme *res = NULL;
SuffixChar *node; SuffixChar *node;
srcstart = srcchar; srcstart = srcchar;
while( srcchar - srcstart < len ) while (srcchar - srcstart < len)
{ {
charlen = pg_mblen(srcchar); charlen = pg_mblen(srcchar);
node = findReplaceTo( rootSuffixTree, (unsigned char *) srcchar, charlen ); node = findReplaceTo(rootSuffixTree, (unsigned char *) srcchar, charlen);
if ( node && node->replaceTo ) if (node && node->replaceTo)
{ {
if ( !res ) if (!res)
{ {
/* allocate res only it it's needed */ /* allocate res only it it's needed */
res = palloc0(sizeof(TSLexeme) * 2); res = palloc0(sizeof(TSLexeme) * 2);
res->lexeme = trgchar = palloc( len * pg_database_encoding_max_length() + 1 /* \0 */ ); res->lexeme = trgchar = palloc(len * pg_database_encoding_max_length() + 1 /* \0 */ );
res->flags = TSL_FILTER; res->flags = TSL_FILTER;
if ( srcchar != srcstart ) if (srcchar != srcstart)
{ {
memcpy(trgchar, srcstart, srcchar - srcstart); memcpy(trgchar, srcstart, srcchar - srcstart);
trgchar += (srcchar - srcstart); trgchar += (srcchar - srcstart);
} }
} }
memcpy( trgchar, node->replaceTo, node->replacelen ); memcpy(trgchar, node->replaceTo, node->replacelen);
trgchar += node->replacelen; trgchar += node->replacelen;
} }
else if ( res ) else if (res)
{ {
memcpy( trgchar, srcchar, charlen ); memcpy(trgchar, srcchar, charlen);
trgchar += charlen; trgchar += charlen;
} }
srcchar += charlen; srcchar += charlen;
} }
if ( res ) if (res)
*trgchar = '\0'; *trgchar = '\0';
PG_RETURN_POINTER(res); PG_RETURN_POINTER(res);
...@@ -265,15 +267,15 @@ unaccent_lexize(PG_FUNCTION_ARGS) ...@@ -265,15 +267,15 @@ unaccent_lexize(PG_FUNCTION_ARGS)
* Function-like wrapper for dictionary * Function-like wrapper for dictionary
*/ */
PG_FUNCTION_INFO_V1(unaccent_dict); PG_FUNCTION_INFO_V1(unaccent_dict);
Datum unaccent_dict(PG_FUNCTION_ARGS); Datum unaccent_dict(PG_FUNCTION_ARGS);
Datum Datum
unaccent_dict(PG_FUNCTION_ARGS) unaccent_dict(PG_FUNCTION_ARGS)
{ {
text *str; text *str;
int strArg; int strArg;
Oid dictOid; Oid dictOid;
TSDictionaryCacheEntry *dict; TSDictionaryCacheEntry *dict;
TSLexeme *res; TSLexeme *res;
if (PG_NARGS() == 1) if (PG_NARGS() == 1)
{ {
...@@ -290,25 +292,25 @@ unaccent_dict(PG_FUNCTION_ARGS) ...@@ -290,25 +292,25 @@ unaccent_dict(PG_FUNCTION_ARGS)
dict = lookup_ts_dictionary_cache(dictOid); dict = lookup_ts_dictionary_cache(dictOid);
res = (TSLexeme *) DatumGetPointer(FunctionCall4(&(dict->lexize), res = (TSLexeme *) DatumGetPointer(FunctionCall4(&(dict->lexize),
PointerGetDatum(dict->dictData), PointerGetDatum(dict->dictData),
PointerGetDatum(VARDATA(str)), PointerGetDatum(VARDATA(str)),
Int32GetDatum(VARSIZE(str) - VARHDRSZ), Int32GetDatum(VARSIZE(str) - VARHDRSZ),
PointerGetDatum(NULL))); PointerGetDatum(NULL)));
PG_FREE_IF_COPY(str, strArg); PG_FREE_IF_COPY(str, strArg);
if ( res == NULL ) if (res == NULL)
{ {
PG_RETURN_TEXT_P(PG_GETARG_TEXT_P_COPY(strArg)); PG_RETURN_TEXT_P(PG_GETARG_TEXT_P_COPY(strArg));
} }
else if ( res->lexeme == NULL ) else if (res->lexeme == NULL)
{ {
pfree(res); pfree(res);
PG_RETURN_TEXT_P(PG_GETARG_TEXT_P_COPY(strArg)); PG_RETURN_TEXT_P(PG_GETARG_TEXT_P_COPY(strArg));
} }
else else
{ {
text *txt = cstring_to_text(res->lexeme); text *txt = cstring_to_text(res->lexeme);
pfree(res->lexeme); pfree(res->lexeme);
pfree(res); pfree(res);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/common/reloptions.c,v 1.32 2010/01/22 16:40:18 rhaas Exp $ * $PostgreSQL: pgsql/src/backend/access/common/reloptions.c,v 1.33 2010/02/26 02:00:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1210,7 +1210,7 @@ bytea * ...@@ -1210,7 +1210,7 @@ bytea *
attribute_reloptions(Datum reloptions, bool validate) attribute_reloptions(Datum reloptions, bool validate)
{ {
relopt_value *options; relopt_value *options;
AttributeOpts *aopts; AttributeOpts *aopts;
int numoptions; int numoptions;
static const relopt_parse_elt tab[] = { static const relopt_parse_elt tab[] = {
{"n_distinct", RELOPT_TYPE_REAL, offsetof(AttributeOpts, n_distinct)}, {"n_distinct", RELOPT_TYPE_REAL, offsetof(AttributeOpts, n_distinct)},
...@@ -1241,7 +1241,7 @@ bytea * ...@@ -1241,7 +1241,7 @@ bytea *
tablespace_reloptions(Datum reloptions, bool validate) tablespace_reloptions(Datum reloptions, bool validate)
{ {
relopt_value *options; relopt_value *options;
TableSpaceOpts *tsopts; TableSpaceOpts *tsopts;
int numoptions; int numoptions;
static const relopt_parse_elt tab[] = { static const relopt_parse_elt tab[] = {
{"random_page_cost", RELOPT_TYPE_REAL, offsetof(TableSpaceOpts, random_page_cost)}, {"random_page_cost", RELOPT_TYPE_REAL, offsetof(TableSpaceOpts, random_page_cost)},
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* These functions provide conversion between rowtypes that are logically * These functions provide conversion between rowtypes that are logically
* equivalent but might have columns in a different order or different sets * equivalent but might have columns in a different order or different sets
* of dropped columns. There is some overlap of functionality with the * of dropped columns. There is some overlap of functionality with the
* executor's "junkfilter" routines, but these functions work on bare * executor's "junkfilter" routines, but these functions work on bare
* HeapTuples rather than TupleTableSlots. * HeapTuples rather than TupleTableSlots.
* *
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/common/tupconvert.c,v 1.3 2010/01/02 16:57:33 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/common/tupconvert.c,v 1.4 2010/02/26 02:00:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -88,7 +88,7 @@ convert_tuples_by_position(TupleDesc indesc, ...@@ -88,7 +88,7 @@ convert_tuples_by_position(TupleDesc indesc,
int32 atttypmod; int32 atttypmod;
if (att->attisdropped) if (att->attisdropped)
continue; /* attrMap[i] is already 0 */ continue; /* attrMap[i] is already 0 */
noutcols++; noutcols++;
atttypid = att->atttypid; atttypid = att->atttypid;
atttypmod = att->atttypmod; atttypmod = att->atttypmod;
...@@ -137,22 +137,22 @@ convert_tuples_by_position(TupleDesc indesc, ...@@ -137,22 +137,22 @@ convert_tuples_by_position(TupleDesc indesc,
nincols, noutcols))); nincols, noutcols)));
/* /*
* Check to see if the map is one-to-one and the tuple types are the * Check to see if the map is one-to-one and the tuple types are the same.
* same. (We check the latter because if they're not, we want to do * (We check the latter because if they're not, we want to do conversion
* conversion to inject the right OID into the tuple datum.) * to inject the right OID into the tuple datum.)
*/ */
if (indesc->natts == outdesc->natts && if (indesc->natts == outdesc->natts &&
indesc->tdtypeid == outdesc->tdtypeid) indesc->tdtypeid == outdesc->tdtypeid)
{ {
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
if (attrMap[i] == (i+1)) if (attrMap[i] == (i + 1))
continue; continue;
/* /*
* If it's a dropped column and the corresponding input * If it's a dropped column and the corresponding input column is
* column is also dropped, we needn't convert. However, * also dropped, we needn't convert. However, attlen and attalign
* attlen and attalign must agree. * must agree.
*/ */
if (attrMap[i] == 0 && if (attrMap[i] == 0 &&
indesc->attrs[i]->attisdropped && indesc->attrs[i]->attisdropped &&
...@@ -182,10 +182,10 @@ convert_tuples_by_position(TupleDesc indesc, ...@@ -182,10 +182,10 @@ convert_tuples_by_position(TupleDesc indesc,
/* preallocate workspace for Datum arrays */ /* preallocate workspace for Datum arrays */
map->outvalues = (Datum *) palloc(n * sizeof(Datum)); map->outvalues = (Datum *) palloc(n * sizeof(Datum));
map->outisnull = (bool *) palloc(n * sizeof(bool)); map->outisnull = (bool *) palloc(n * sizeof(bool));
n = indesc->natts + 1; /* +1 for NULL */ n = indesc->natts + 1; /* +1 for NULL */
map->invalues = (Datum *) palloc(n * sizeof(Datum)); map->invalues = (Datum *) palloc(n * sizeof(Datum));
map->inisnull = (bool *) palloc(n * sizeof(bool)); map->inisnull = (bool *) palloc(n * sizeof(bool));
map->invalues[0] = (Datum) 0; /* set up the NULL entry */ map->invalues[0] = (Datum) 0; /* set up the NULL entry */
map->inisnull[0] = true; map->inisnull[0] = true;
return map; return map;
...@@ -193,7 +193,7 @@ convert_tuples_by_position(TupleDesc indesc, ...@@ -193,7 +193,7 @@ convert_tuples_by_position(TupleDesc indesc,
/* /*
* Set up for tuple conversion, matching input and output columns by name. * Set up for tuple conversion, matching input and output columns by name.
* (Dropped columns are ignored in both input and output.) This is intended * (Dropped columns are ignored in both input and output.) This is intended
* for use when the rowtypes are related by inheritance, so we expect an exact * for use when the rowtypes are related by inheritance, so we expect an exact
* match of both type and typmod. The error messages will be a bit unhelpful * match of both type and typmod. The error messages will be a bit unhelpful
* unless both rowtypes are named composite types. * unless both rowtypes are named composite types.
...@@ -221,7 +221,7 @@ convert_tuples_by_name(TupleDesc indesc, ...@@ -221,7 +221,7 @@ convert_tuples_by_name(TupleDesc indesc,
int j; int j;
if (att->attisdropped) if (att->attisdropped)
continue; /* attrMap[i] is already 0 */ continue; /* attrMap[i] is already 0 */
attname = NameStr(att->attname); attname = NameStr(att->attname);
atttypid = att->atttypid; atttypid = att->atttypid;
atttypmod = att->atttypmod; atttypmod = att->atttypmod;
...@@ -256,9 +256,9 @@ convert_tuples_by_name(TupleDesc indesc, ...@@ -256,9 +256,9 @@ convert_tuples_by_name(TupleDesc indesc,
} }
/* /*
* Check to see if the map is one-to-one and the tuple types are the * Check to see if the map is one-to-one and the tuple types are the same.
* same. (We check the latter because if they're not, we want to do * (We check the latter because if they're not, we want to do conversion
* conversion to inject the right OID into the tuple datum.) * to inject the right OID into the tuple datum.)
*/ */
if (indesc->natts == outdesc->natts && if (indesc->natts == outdesc->natts &&
indesc->tdtypeid == outdesc->tdtypeid) indesc->tdtypeid == outdesc->tdtypeid)
...@@ -266,13 +266,13 @@ convert_tuples_by_name(TupleDesc indesc, ...@@ -266,13 +266,13 @@ convert_tuples_by_name(TupleDesc indesc,
same = true; same = true;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
if (attrMap[i] == (i+1)) if (attrMap[i] == (i + 1))
continue; continue;
/* /*
* If it's a dropped column and the corresponding input * If it's a dropped column and the corresponding input column is
* column is also dropped, we needn't convert. However, * also dropped, we needn't convert. However, attlen and attalign
* attlen and attalign must agree. * must agree.
*/ */
if (attrMap[i] == 0 && if (attrMap[i] == 0 &&
indesc->attrs[i]->attisdropped && indesc->attrs[i]->attisdropped &&
...@@ -302,10 +302,10 @@ convert_tuples_by_name(TupleDesc indesc, ...@@ -302,10 +302,10 @@ convert_tuples_by_name(TupleDesc indesc,
/* preallocate workspace for Datum arrays */ /* preallocate workspace for Datum arrays */
map->outvalues = (Datum *) palloc(n * sizeof(Datum)); map->outvalues = (Datum *) palloc(n * sizeof(Datum));
map->outisnull = (bool *) palloc(n * sizeof(bool)); map->outisnull = (bool *) palloc(n * sizeof(bool));
n = indesc->natts + 1; /* +1 for NULL */ n = indesc->natts + 1; /* +1 for NULL */
map->invalues = (Datum *) palloc(n * sizeof(Datum)); map->invalues = (Datum *) palloc(n * sizeof(Datum));
map->inisnull = (bool *) palloc(n * sizeof(bool)); map->inisnull = (bool *) palloc(n * sizeof(bool));
map->invalues[0] = (Datum) 0; /* set up the NULL entry */ map->invalues[0] = (Datum) 0; /* set up the NULL entry */
map->inisnull[0] = true; map->inisnull[0] = true;
return map; return map;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gin/ginbulk.c,v 1.18 2010/02/11 14:29:50 teodor Exp $ * $PostgreSQL: pgsql/src/backend/access/gin/ginbulk.c,v 1.19 2010/02/26 02:00:33 momjian Exp $
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -22,20 +22,20 @@ ...@@ -22,20 +22,20 @@
#define DEF_NENTRY 2048 #define DEF_NENTRY 2048
#define DEF_NPTR 4 #define DEF_NPTR 4
static void* static void *
ginAppendData(void *old, void *new, void *arg) ginAppendData(void *old, void *new, void *arg)
{ {
EntryAccumulator *eo = (EntryAccumulator*)old, EntryAccumulator *eo = (EntryAccumulator *) old,
*en = (EntryAccumulator*)new; *en = (EntryAccumulator *) new;
BuildAccumulator *accum = (BuildAccumulator*)arg; BuildAccumulator *accum = (BuildAccumulator *) arg;
if (eo->number >= eo->length) if (eo->number >= eo->length)
{ {
accum->allocatedMemory -= GetMemoryChunkSpace(eo->list); accum->allocatedMemory -= GetMemoryChunkSpace(eo->list);
eo->length *= 2; eo->length *= 2;
eo->list = (ItemPointerData *) repalloc(eo->list, eo->list = (ItemPointerData *) repalloc(eo->list,
sizeof(ItemPointerData) * eo->length); sizeof(ItemPointerData) * eo->length);
accum->allocatedMemory += GetMemoryChunkSpace(eo->list); accum->allocatedMemory += GetMemoryChunkSpace(eo->list);
} }
...@@ -60,9 +60,9 @@ ginAppendData(void *old, void *new, void *arg) ...@@ -60,9 +60,9 @@ ginAppendData(void *old, void *new, void *arg)
static int static int
cmpEntryAccumulator(const void *a, const void *b, void *arg) cmpEntryAccumulator(const void *a, const void *b, void *arg)
{ {
EntryAccumulator *ea = (EntryAccumulator*)a; EntryAccumulator *ea = (EntryAccumulator *) a;
EntryAccumulator *eb = (EntryAccumulator*)b; EntryAccumulator *eb = (EntryAccumulator *) b;
BuildAccumulator *accum = (BuildAccumulator*)arg; BuildAccumulator *accum = (BuildAccumulator *) arg;
return compareAttEntries(accum->ginstate, ea->attnum, ea->value, return compareAttEntries(accum->ginstate, ea->attnum, ea->value,
eb->attnum, eb->value); eb->attnum, eb->value);
...@@ -104,13 +104,13 @@ getDatumCopy(BuildAccumulator *accum, OffsetNumber attnum, Datum value) ...@@ -104,13 +104,13 @@ getDatumCopy(BuildAccumulator *accum, OffsetNumber attnum, Datum value)
static void static void
ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum, Datum entry) ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum, Datum entry)
{ {
EntryAccumulator *key, EntryAccumulator *key,
*ea; *ea;
/* /*
* Allocate memory by rather big chunk to decrease overhead, we don't * Allocate memory by rather big chunk to decrease overhead, we don't keep
* keep pointer to previously allocated chunks because they will free * pointer to previously allocated chunks because they will free by
* by MemoryContextReset() call. * MemoryContextReset() call.
*/ */
if (accum->entryallocator == NULL || accum->length >= DEF_NENTRY) if (accum->entryallocator == NULL || accum->length >= DEF_NENTRY)
{ {
...@@ -125,7 +125,7 @@ ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum ...@@ -125,7 +125,7 @@ ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum
key->attnum = attnum; key->attnum = attnum;
key->value = entry; key->value = entry;
/* To prevent multiple palloc/pfree cycles, we reuse array */ /* To prevent multiple palloc/pfree cycles, we reuse array */
if (accum->tmpList == NULL) if (accum->tmpList == NULL)
accum->tmpList = accum->tmpList =
(ItemPointerData *) palloc(sizeof(ItemPointerData) * DEF_NPTR); (ItemPointerData *) palloc(sizeof(ItemPointerData) * DEF_NPTR);
...@@ -149,8 +149,8 @@ ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum ...@@ -149,8 +149,8 @@ ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum
else else
{ {
/* /*
* The key has been appended, so "free" allocated * The key has been appended, so "free" allocated key by decrementing
* key by decrementing chunk's counter. * chunk's counter.
*/ */
accum->length--; accum->length--;
} }
...@@ -162,7 +162,7 @@ ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum ...@@ -162,7 +162,7 @@ ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum
* Since the entries are being inserted into a balanced binary tree, you * Since the entries are being inserted into a balanced binary tree, you
* might think that the order of insertion wouldn't be critical, but it turns * might think that the order of insertion wouldn't be critical, but it turns
* out that inserting the entries in sorted order results in a lot of * out that inserting the entries in sorted order results in a lot of
* rebalancing operations and is slow. To prevent this, we attempt to insert * rebalancing operations and is slow. To prevent this, we attempt to insert
* the nodes in an order that will produce a nearly-balanced tree if the input * the nodes in an order that will produce a nearly-balanced tree if the input
* is in fact sorted. * is in fact sorted.
* *
...@@ -172,11 +172,11 @@ ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum ...@@ -172,11 +172,11 @@ ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum
* tree; then, we insert the middles of each half of out virtual array, then * tree; then, we insert the middles of each half of out virtual array, then
* middles of quarters, etc. * middles of quarters, etc.
*/ */
void void
ginInsertRecordBA(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum, ginInsertRecordBA(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum,
Datum *entries, int32 nentry) Datum *entries, int32 nentry)
{ {
uint32 step = nentry; uint32 step = nentry;
if (nentry <= 0) if (nentry <= 0)
return; return;
...@@ -186,21 +186,22 @@ ginInsertRecordBA(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber att ...@@ -186,21 +186,22 @@ ginInsertRecordBA(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber att
/* /*
* step will contain largest power of 2 and <= nentry * step will contain largest power of 2 and <= nentry
*/ */
step |= (step >> 1); step |= (step >> 1);
step |= (step >> 2); step |= (step >> 2);
step |= (step >> 4); step |= (step >> 4);
step |= (step >> 8); step |= (step >> 8);
step |= (step >> 16); step |= (step >> 16);
step >>= 1; step >>= 1;
step ++; step++;
while(step > 0) { while (step > 0)
int i; {
int i;
for (i = step - 1; i < nentry && i >= 0; i += step << 1 /* *2 */) for (i = step - 1; i < nentry && i >= 0; i += step << 1 /* *2 */ )
ginInsertEntry(accum, heapptr, attnum, entries[i]); ginInsertEntry(accum, heapptr, attnum, entries[i]);
step >>= 1; /* /2 */ step >>= 1; /* /2 */
} }
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gin/ginentrypage.c,v 1.23 2010/01/02 16:57:33 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/gin/ginentrypage.c,v 1.24 2010/02/26 02:00:33 momjian Exp $
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -104,7 +104,7 @@ GinFormTuple(Relation index, GinState *ginstate, ...@@ -104,7 +104,7 @@ GinFormTuple(Relation index, GinState *ginstate,
* Gin tuple without any ItemPointers should be large enough to keep * Gin tuple without any ItemPointers should be large enough to keep
* one ItemPointer, to prevent inconsistency between * one ItemPointer, to prevent inconsistency between
* ginHeapTupleFastCollect and ginEntryInsert called by * ginHeapTupleFastCollect and ginEntryInsert called by
* ginHeapTupleInsert. ginHeapTupleFastCollect forms tuple without * ginHeapTupleInsert. ginHeapTupleFastCollect forms tuple without
* extra pointer to heap, but ginEntryInsert (called for pending list * extra pointer to heap, but ginEntryInsert (called for pending list
* cleanup during vacuum) will form the same tuple with one * cleanup during vacuum) will form the same tuple with one
* ItemPointer. * ItemPointer.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gin/ginget.c,v 1.29 2010/01/02 16:57:33 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/gin/ginget.c,v 1.30 2010/02/26 02:00:33 momjian Exp $
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
typedef struct pendingPosition typedef struct pendingPosition
{ {
Buffer pendingBuffer; Buffer pendingBuffer;
OffsetNumber firstOffset; OffsetNumber firstOffset;
OffsetNumber lastOffset; OffsetNumber lastOffset;
ItemPointerData item; ItemPointerData item;
bool *hasMatchKey; bool *hasMatchKey;
} pendingPosition; } pendingPosition;
...@@ -877,7 +877,7 @@ matchPartialInPendingList(GinState *ginstate, Page page, ...@@ -877,7 +877,7 @@ matchPartialInPendingList(GinState *ginstate, Page page,
static bool static bool
hasAllMatchingKeys(GinScanOpaque so, pendingPosition *pos) hasAllMatchingKeys(GinScanOpaque so, pendingPosition *pos)
{ {
int i; int i;
for (i = 0; i < so->nkeys; i++) for (i = 0; i < so->nkeys; i++)
if (pos->hasMatchKey[i] == false) if (pos->hasMatchKey[i] == false)
...@@ -912,7 +912,7 @@ collectDatumForItem(IndexScanDesc scan, pendingPosition *pos) ...@@ -912,7 +912,7 @@ collectDatumForItem(IndexScanDesc scan, pendingPosition *pos)
memset(key->entryRes, FALSE, key->nentries); memset(key->entryRes, FALSE, key->nentries);
} }
memset(pos->hasMatchKey, FALSE, so->nkeys); memset(pos->hasMatchKey, FALSE, so->nkeys);
for (;;) for (;;)
{ {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.84 2010/01/02 16:57:34 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.85 2010/02/26 02:00:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -414,7 +414,8 @@ gistindex_keytest(IndexTuple tuple, ...@@ -414,7 +414,8 @@ gistindex_keytest(IndexTuple tuple,
/* /*
* On non-leaf page we can't conclude that child hasn't NULL * On non-leaf page we can't conclude that child hasn't NULL
* values because of assumption in GiST: union (VAL, NULL) is VAL. * values because of assumption in GiST: union (VAL, NULL) is VAL.
* But if on non-leaf page key IS NULL, then all children are NULL. * But if on non-leaf page key IS NULL, then all children are
* NULL.
*/ */
if (key->sk_flags & SK_SEARCHNULL) if (key->sk_flags & SK_SEARCHNULL)
{ {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gist/gistproc.c,v 1.20 2010/01/14 16:31:09 teodor Exp $ * $PostgreSQL: pgsql/src/backend/access/gist/gistproc.c,v 1.21 2010/02/26 02:00:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -889,8 +889,8 @@ gist_point_compress(PG_FUNCTION_ARGS) ...@@ -889,8 +889,8 @@ gist_point_compress(PG_FUNCTION_ARGS)
if (entry->leafkey) /* Point, actually */ if (entry->leafkey) /* Point, actually */
{ {
BOX *box = palloc(sizeof(BOX)); BOX *box = palloc(sizeof(BOX));
Point *point = DatumGetPointP(entry->key); Point *point = DatumGetPointP(entry->key);
GISTENTRY *retval = palloc(sizeof(GISTENTRY)); GISTENTRY *retval = palloc(sizeof(GISTENTRY));
box->high = box->low = *point; box->high = box->low = *point;
...@@ -906,9 +906,9 @@ gist_point_compress(PG_FUNCTION_ARGS) ...@@ -906,9 +906,9 @@ gist_point_compress(PG_FUNCTION_ARGS)
static bool static bool
gist_point_consistent_internal(StrategyNumber strategy, gist_point_consistent_internal(StrategyNumber strategy,
bool isLeaf, BOX *key, Point *query) bool isLeaf, BOX *key, Point *query)
{ {
bool result = false; bool result = false;
switch (strategy) switch (strategy)
{ {
...@@ -953,10 +953,10 @@ Datum ...@@ -953,10 +953,10 @@ Datum
gist_point_consistent(PG_FUNCTION_ARGS) gist_point_consistent(PG_FUNCTION_ARGS)
{ {
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
bool result; bool result;
bool *recheck = (bool *) PG_GETARG_POINTER(4); bool *recheck = (bool *) PG_GETARG_POINTER(4);
StrategyNumber strategyGroup = strategy / GeoStrategyNumberOffset; StrategyNumber strategyGroup = strategy / GeoStrategyNumberOffset;
switch (strategyGroup) switch (strategyGroup)
{ {
...@@ -969,22 +969,22 @@ gist_point_consistent(PG_FUNCTION_ARGS) ...@@ -969,22 +969,22 @@ gist_point_consistent(PG_FUNCTION_ARGS)
break; break;
case BoxStrategyNumberGroup: case BoxStrategyNumberGroup:
result = DatumGetBool(DirectFunctionCall5( result = DatumGetBool(DirectFunctionCall5(
gist_box_consistent, gist_box_consistent,
PointerGetDatum(entry), PointerGetDatum(entry),
PG_GETARG_DATUM(1), PG_GETARG_DATUM(1),
Int16GetDatum(RTOverlapStrategyNumber), Int16GetDatum(RTOverlapStrategyNumber),
0, PointerGetDatum(recheck))); 0, PointerGetDatum(recheck)));
break; break;
case PolygonStrategyNumberGroup: case PolygonStrategyNumberGroup:
{ {
POLYGON *query = PG_GETARG_POLYGON_P(1); POLYGON *query = PG_GETARG_POLYGON_P(1);
result = DatumGetBool(DirectFunctionCall5( result = DatumGetBool(DirectFunctionCall5(
gist_poly_consistent, gist_poly_consistent,
PointerGetDatum(entry), PointerGetDatum(entry),
PolygonPGetDatum(query), PolygonPGetDatum(query),
Int16GetDatum(RTOverlapStrategyNumber), Int16GetDatum(RTOverlapStrategyNumber),
0, PointerGetDatum(recheck))); 0, PointerGetDatum(recheck)));
if (GIST_LEAF(entry) && result) if (GIST_LEAF(entry) && result)
{ {
...@@ -992,13 +992,13 @@ gist_point_consistent(PG_FUNCTION_ARGS) ...@@ -992,13 +992,13 @@ gist_point_consistent(PG_FUNCTION_ARGS)
* We are on leaf page and quick check shows overlapping * We are on leaf page and quick check shows overlapping
* of polygon's bounding box and point * of polygon's bounding box and point
*/ */
BOX *box = DatumGetBoxP(entry->key); BOX *box = DatumGetBoxP(entry->key);
Assert(box->high.x == box->low.x Assert(box->high.x == box->low.x
&& box->high.y == box->low.y); && box->high.y == box->low.y);
result = DatumGetBool(DirectFunctionCall2( result = DatumGetBool(DirectFunctionCall2(
poly_contain_pt, poly_contain_pt,
PolygonPGetDatum(query), PolygonPGetDatum(query),
PointPGetDatum(&box->high))); PointPGetDatum(&box->high)));
*recheck = false; *recheck = false;
} }
...@@ -1006,14 +1006,14 @@ gist_point_consistent(PG_FUNCTION_ARGS) ...@@ -1006,14 +1006,14 @@ gist_point_consistent(PG_FUNCTION_ARGS)
break; break;
case CircleStrategyNumberGroup: case CircleStrategyNumberGroup:
{ {
CIRCLE *query = PG_GETARG_CIRCLE_P(1); CIRCLE *query = PG_GETARG_CIRCLE_P(1);
result = DatumGetBool(DirectFunctionCall5( result = DatumGetBool(DirectFunctionCall5(
gist_circle_consistent, gist_circle_consistent,
PointerGetDatum(entry), PointerGetDatum(entry),
CirclePGetDatum(query), CirclePGetDatum(query),
Int16GetDatum(RTOverlapStrategyNumber), Int16GetDatum(RTOverlapStrategyNumber),
0, PointerGetDatum(recheck))); 0, PointerGetDatum(recheck)));
if (GIST_LEAF(entry) && result) if (GIST_LEAF(entry) && result)
{ {
...@@ -1021,20 +1021,20 @@ gist_point_consistent(PG_FUNCTION_ARGS) ...@@ -1021,20 +1021,20 @@ gist_point_consistent(PG_FUNCTION_ARGS)
* We are on leaf page and quick check shows overlapping * We are on leaf page and quick check shows overlapping
* of polygon's bounding box and point * of polygon's bounding box and point
*/ */
BOX *box = DatumGetBoxP(entry->key); BOX *box = DatumGetBoxP(entry->key);
Assert(box->high.x == box->low.x Assert(box->high.x == box->low.x
&& box->high.y == box->low.y); && box->high.y == box->low.y);
result = DatumGetBool(DirectFunctionCall2( result = DatumGetBool(DirectFunctionCall2(
circle_contain_pt, circle_contain_pt,
CirclePGetDatum(query), CirclePGetDatum(query),
PointPGetDatum(&box->high))); PointPGetDatum(&box->high)));
*recheck = false; *recheck = false;
} }
} }
break; break;
default: default:
result = false; /* silence compiler warning */ result = false; /* silence compiler warning */
elog(ERROR, "unknown strategy number: %d", strategy); elog(ERROR, "unknown strategy number: %d", strategy);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.78 2010/01/02 16:57:34 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.79 2010/02/26 02:00:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -92,8 +92,8 @@ gistrescan(PG_FUNCTION_ARGS) ...@@ -92,8 +92,8 @@ gistrescan(PG_FUNCTION_ARGS)
* field. * field.
* *
* Next, if any of keys is a NULL and that key is not marked with * Next, if any of keys is a NULL and that key is not marked with
* SK_SEARCHNULL/SK_SEARCHNOTNULL then nothing can be found (ie, * SK_SEARCHNULL/SK_SEARCHNOTNULL then nothing can be found (ie, we
* we assume all indexable operators are strict). * assume all indexable operators are strict).
*/ */
for (i = 0; i < scan->numberOfKeys; i++) for (i = 0; i < scan->numberOfKeys; i++)
{ {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.116 2010/01/02 16:57:34 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.117 2010/02/26 02:00:33 momjian Exp $
* *
* NOTES * NOTES
* This file contains only the public interface routines. * This file contains only the public interface routines.
...@@ -233,7 +233,7 @@ hashgettuple(PG_FUNCTION_ARGS) ...@@ -233,7 +233,7 @@ hashgettuple(PG_FUNCTION_ARGS)
/* /*
* An insertion into the current index page could have happened while * An insertion into the current index page could have happened while
* we didn't have read lock on it. Re-find our position by looking * we didn't have read lock on it. Re-find our position by looking
* for the TID we previously returned. (Because we hold share lock on * for the TID we previously returned. (Because we hold share lock on
* the bucket, no deletions or splits could have occurred; therefore * the bucket, no deletions or splits could have occurred; therefore
* we can expect that the TID still exists in the current index page, * we can expect that the TID still exists in the current index page,
* at an offset >= where we were.) * at an offset >= where we were.)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/hash/hashovfl.c,v 1.68 2010/01/02 16:57:34 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/hash/hashovfl.c,v 1.69 2010/02/26 02:00:33 momjian Exp $
* *
* NOTES * NOTES
* Overflow pages look like ordinary relation pages. * Overflow pages look like ordinary relation pages.
...@@ -717,8 +717,8 @@ _hash_squeezebucket(Relation rel, ...@@ -717,8 +717,8 @@ _hash_squeezebucket(Relation rel,
/* /*
* If we reach here, there are no live tuples on the "read" page --- * If we reach here, there are no live tuples on the "read" page ---
* it was empty when we got to it, or we moved them all. So we * it was empty when we got to it, or we moved them all. So we can
* can just free the page without bothering with deleting tuples * just free the page without bothering with deleting tuples
* individually. Then advance to the previous "read" page. * individually. Then advance to the previous "read" page.
* *
* Tricky point here: if our read and write pages are adjacent in the * Tricky point here: if our read and write pages are adjacent in the
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/hash/hashpage.c,v 1.82 2010/01/02 16:57:34 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/hash/hashpage.c,v 1.83 2010/02/26 02:00:33 momjian Exp $
* *
* NOTES * NOTES
* Postgres hash pages look like ordinary relation pages. The opaque * Postgres hash pages look like ordinary relation pages. The opaque
...@@ -799,8 +799,8 @@ _hash_splitbucket(Relation rel, ...@@ -799,8 +799,8 @@ _hash_splitbucket(Relation rel,
/* /*
* Partition the tuples in the old bucket between the old bucket and the * Partition the tuples in the old bucket between the old bucket and the
* new bucket, advancing along the old bucket's overflow bucket chain and * new bucket, advancing along the old bucket's overflow bucket chain and
* adding overflow pages to the new bucket as needed. Outer loop * adding overflow pages to the new bucket as needed. Outer loop iterates
* iterates once per page in old bucket. * once per page in old bucket.
*/ */
for (;;) for (;;)
{ {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.287 2010/02/14 18:42:12 rhaas Exp $ * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.288 2010/02/26 02:00:33 momjian Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -79,8 +79,8 @@ static HeapScanDesc heap_beginscan_internal(Relation relation, ...@@ -79,8 +79,8 @@ static HeapScanDesc heap_beginscan_internal(Relation relation,
bool allow_strat, bool allow_sync, bool allow_strat, bool allow_sync,
bool is_bitmapscan); bool is_bitmapscan);
static XLogRecPtr log_heap_update(Relation reln, Buffer oldbuf, static XLogRecPtr log_heap_update(Relation reln, Buffer oldbuf,
ItemPointerData from, Buffer newbuf, HeapTuple newtup, ItemPointerData from, Buffer newbuf, HeapTuple newtup,
bool all_visible_cleared, bool new_all_visible_cleared); bool all_visible_cleared, bool new_all_visible_cleared);
static bool HeapSatisfiesHOTUpdate(Relation relation, Bitmapset *hot_attrs, static bool HeapSatisfiesHOTUpdate(Relation relation, Bitmapset *hot_attrs,
HeapTuple oldtup, HeapTuple newtup); HeapTuple oldtup, HeapTuple newtup);
...@@ -248,8 +248,8 @@ heapgetpage(HeapScanDesc scan, BlockNumber page) ...@@ -248,8 +248,8 @@ heapgetpage(HeapScanDesc scan, BlockNumber page)
/* /*
* If the all-visible flag indicates that all tuples on the page are * If the all-visible flag indicates that all tuples on the page are
* visible to everyone, we can skip the per-tuple visibility tests. * visible to everyone, we can skip the per-tuple visibility tests. But
* But not in hot standby mode. A tuple that's already visible to all * not in hot standby mode. A tuple that's already visible to all
* transactions in the master might still be invisible to a read-only * transactions in the master might still be invisible to a read-only
* transaction in the standby. * transaction in the standby.
*/ */
...@@ -3667,8 +3667,8 @@ recheck_xmax: ...@@ -3667,8 +3667,8 @@ recheck_xmax:
* someone setting xmax. Hence recheck after changing lock, same as for * someone setting xmax. Hence recheck after changing lock, same as for
* xmax itself. * xmax itself.
* *
* Old-style VACUUM FULL is gone, but we have to keep this code as long * Old-style VACUUM FULL is gone, but we have to keep this code as long as
* as we support having MOVED_OFF/MOVED_IN tuples in the database. * we support having MOVED_OFF/MOVED_IN tuples in the database.
*/ */
recheck_xvac: recheck_xvac:
if (tuple->t_infomask & HEAP_MOVED) if (tuple->t_infomask & HEAP_MOVED)
...@@ -4099,9 +4099,9 @@ heap_xlog_cleanup_info(XLogRecPtr lsn, XLogRecord *record) ...@@ -4099,9 +4099,9 @@ heap_xlog_cleanup_info(XLogRecPtr lsn, XLogRecord *record)
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, xlrec->node); ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, xlrec->node);
/* /*
* Actual operation is a no-op. Record type exists to provide a means * Actual operation is a no-op. Record type exists to provide a means for
* for conflict processing to occur before we begin index vacuum actions. * conflict processing to occur before we begin index vacuum actions. see
* see vacuumlazy.c and also comments in btvacuumpage() * vacuumlazy.c and also comments in btvacuumpage()
*/ */
} }
...@@ -4769,8 +4769,8 @@ heap_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -4769,8 +4769,8 @@ heap_redo(XLogRecPtr lsn, XLogRecord *record)
uint8 info = record->xl_info & ~XLR_INFO_MASK; uint8 info = record->xl_info & ~XLR_INFO_MASK;
/* /*
* These operations don't overwrite MVCC data so no conflict * These operations don't overwrite MVCC data so no conflict processing is
* processing is required. The ones in heap2 rmgr do. * required. The ones in heap2 rmgr do.
*/ */
RestoreBkpBlocks(lsn, record, false); RestoreBkpBlocks(lsn, record, false);
...@@ -4809,8 +4809,8 @@ heap2_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -4809,8 +4809,8 @@ heap2_redo(XLogRecPtr lsn, XLogRecord *record)
uint8 info = record->xl_info & ~XLR_INFO_MASK; uint8 info = record->xl_info & ~XLR_INFO_MASK;
/* /*
* Note that RestoreBkpBlocks() is called after conflict processing * Note that RestoreBkpBlocks() is called after conflict processing within
* within each record type handling function. * each record type handling function.
*/ */
switch (info & XLOG_HEAP_OPMASK) switch (info & XLOG_HEAP_OPMASK)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/pruneheap.c,v 1.21 2010/02/08 04:33:53 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/heap/pruneheap.c,v 1.22 2010/02/26 02:00:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -29,8 +29,9 @@ ...@@ -29,8 +29,9 @@
typedef struct typedef struct
{ {
TransactionId new_prune_xid; /* new prune hint value for page */ TransactionId new_prune_xid; /* new prune hint value for page */
TransactionId latestRemovedXid; /* latest xid to be removed by this prune */ TransactionId latestRemovedXid; /* latest xid to be removed by this
int nredirected; /* numbers of entries in arrays below */ * prune */
int nredirected; /* numbers of entries in arrays below */
int ndead; int ndead;
int nunused; int nunused;
/* arrays that accumulate indexes of items to be changed */ /* arrays that accumulate indexes of items to be changed */
...@@ -85,8 +86,8 @@ heap_page_prune_opt(Relation relation, Buffer buffer, TransactionId OldestXmin) ...@@ -85,8 +86,8 @@ heap_page_prune_opt(Relation relation, Buffer buffer, TransactionId OldestXmin)
/* /*
* We can't write WAL in recovery mode, so there's no point trying to * We can't write WAL in recovery mode, so there's no point trying to
* clean the page. The master will likely issue a cleaning WAL record * clean the page. The master will likely issue a cleaning WAL record soon
* soon anyway, so this is no particular loss. * anyway, so this is no particular loss.
*/ */
if (RecoveryInProgress()) if (RecoveryInProgress())
return; return;
...@@ -164,8 +165,8 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin, ...@@ -164,8 +165,8 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin,
* *
* First, initialize the new pd_prune_xid value to zero (indicating no * First, initialize the new pd_prune_xid value to zero (indicating no
* prunable tuples). If we find any tuples which may soon become * prunable tuples). If we find any tuples which may soon become
* prunable, we will save the lowest relevant XID in new_prune_xid. * prunable, we will save the lowest relevant XID in new_prune_xid. Also
* Also initialize the rest of our working state. * initialize the rest of our working state.
*/ */
prstate.new_prune_xid = InvalidTransactionId; prstate.new_prune_xid = InvalidTransactionId;
prstate.latestRemovedXid = InvalidTransactionId; prstate.latestRemovedXid = InvalidTransactionId;
...@@ -370,7 +371,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum, ...@@ -370,7 +371,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
{ {
heap_prune_record_unused(prstate, rootoffnum); heap_prune_record_unused(prstate, rootoffnum);
HeapTupleHeaderAdvanceLatestRemovedXid(htup, HeapTupleHeaderAdvanceLatestRemovedXid(htup,
&prstate->latestRemovedXid); &prstate->latestRemovedXid);
ndeleted++; ndeleted++;
} }
...@@ -499,7 +500,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum, ...@@ -499,7 +500,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
{ {
latestdead = offnum; latestdead = offnum;
HeapTupleHeaderAdvanceLatestRemovedXid(htup, HeapTupleHeaderAdvanceLatestRemovedXid(htup,
&prstate->latestRemovedXid); &prstate->latestRemovedXid);
} }
else if (!recent_dead) else if (!recent_dead)
break; break;
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
* Portions Copyright (c) 1994-5, Regents of the University of California * Portions Copyright (c) 1994-5, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/rewriteheap.c,v 1.20 2010/02/03 10:01:29 heikki Exp $ * $PostgreSQL: pgsql/src/backend/access/heap/rewriteheap.c,v 1.21 2010/02/26 02:00:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -281,7 +281,8 @@ end_heap_rewrite(RewriteState state) ...@@ -281,7 +281,8 @@ end_heap_rewrite(RewriteState state)
/* Write an XLOG UNLOGGED record if WAL-logging was skipped */ /* Write an XLOG UNLOGGED record if WAL-logging was skipped */
if (!state->rs_use_wal && !state->rs_new_rel->rd_istemp) if (!state->rs_use_wal && !state->rs_new_rel->rd_istemp)
{ {
char reason[NAMEDATALEN + 30]; char reason[NAMEDATALEN + 30];
snprintf(reason, sizeof(reason), "heap rewrite on \"%s\"", snprintf(reason, sizeof(reason), "heap rewrite on \"%s\"",
RelationGetRelationName(state->rs_new_rel)); RelationGetRelationName(state->rs_new_rel));
XLogReportUnloggedStatement(reason); XLogReportUnloggedStatement(reason);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.97 2010/02/04 00:09:13 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.98 2010/02/26 02:00:33 momjian Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -796,9 +796,9 @@ toast_insert_or_update(Relation rel, HeapTuple newtup, HeapTuple oldtup, ...@@ -796,9 +796,9 @@ toast_insert_or_update(Relation rel, HeapTuple newtup, HeapTuple oldtup,
} }
/* /*
* Finally we store attributes of type 'm' externally. At this point * Finally we store attributes of type 'm' externally. At this point we
* we increase the target tuple size, so that 'm' attributes aren't * increase the target tuple size, so that 'm' attributes aren't stored
* stored externally unless really necessary. * externally unless really necessary.
*/ */
maxDataLen = TOAST_TUPLE_TARGET_MAIN - hoff; maxDataLen = TOAST_TUPLE_TARGET_MAIN - hoff;
...@@ -1190,8 +1190,8 @@ toast_save_datum(Relation rel, Datum value, int options) ...@@ -1190,8 +1190,8 @@ toast_save_datum(Relation rel, Datum value, int options)
* *
* Normally this is the actual OID of the target toast table, but during * Normally this is the actual OID of the target toast table, but during
* table-rewriting operations such as CLUSTER, we have to insert the OID * table-rewriting operations such as CLUSTER, we have to insert the OID
* of the table's real permanent toast table instead. rd_toastoid is * of the table's real permanent toast table instead. rd_toastoid is set
* set if we have to substitute such an OID. * if we have to substitute such an OID.
*/ */
if (OidIsValid(rel->rd_toastoid)) if (OidIsValid(rel->rd_toastoid))
toast_pointer.va_toastrelid = rel->rd_toastoid; toast_pointer.va_toastrelid = rel->rd_toastoid;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/visibilitymap.c,v 1.8 2010/02/09 21:43:29 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/heap/visibilitymap.c,v 1.9 2010/02/26 02:00:33 momjian Exp $
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
* visibilitymap_clear - clear a bit in the visibility map * visibilitymap_clear - clear a bit in the visibility map
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* NOTES * NOTES
* *
* The visibility map is a bitmap with one bit per heap page. A set bit means * The visibility map is a bitmap with one bit per heap page. A set bit means
* that all tuples on the page are known visible to all transactions, and * that all tuples on the page are known visible to all transactions, and
* therefore the page doesn't need to be vacuumed. The map is conservative in * therefore the page doesn't need to be vacuumed. The map is conservative in
* the sense that we make sure that whenever a bit is set, we know the * the sense that we make sure that whenever a bit is set, we know the
* condition is true, but if a bit is not set, it might or might not be true. * condition is true, but if a bit is not set, it might or might not be true.
...@@ -377,11 +377,10 @@ visibilitymap_truncate(Relation rel, BlockNumber nheapblocks) ...@@ -377,11 +377,10 @@ visibilitymap_truncate(Relation rel, BlockNumber nheapblocks)
rel->rd_istemp); rel->rd_istemp);
/* /*
* We might as well update the local smgr_vm_nblocks setting. * We might as well update the local smgr_vm_nblocks setting. smgrtruncate
* smgrtruncate sent an smgr cache inval message, which will cause * sent an smgr cache inval message, which will cause other backends to
* other backends to invalidate their copy of smgr_vm_nblocks, and * invalidate their copy of smgr_vm_nblocks, and this one too at the next
* this one too at the next command boundary. But this ensures it * command boundary. But this ensures it isn't outright wrong until then.
* isn't outright wrong until then.
*/ */
if (rel->rd_smgr) if (rel->rd_smgr)
rel->rd_smgr->smgr_vm_nblocks = newnblocks; rel->rd_smgr->smgr_vm_nblocks = newnblocks;
...@@ -411,7 +410,7 @@ vm_readbuf(Relation rel, BlockNumber blkno, bool extend) ...@@ -411,7 +410,7 @@ vm_readbuf(Relation rel, BlockNumber blkno, bool extend)
{ {
if (smgrexists(rel->rd_smgr, VISIBILITYMAP_FORKNUM)) if (smgrexists(rel->rd_smgr, VISIBILITYMAP_FORKNUM))
rel->rd_smgr->smgr_vm_nblocks = smgrnblocks(rel->rd_smgr, rel->rd_smgr->smgr_vm_nblocks = smgrnblocks(rel->rd_smgr,
VISIBILITYMAP_FORKNUM); VISIBILITYMAP_FORKNUM);
else else
rel->rd_smgr->smgr_vm_nblocks = 0; rel->rd_smgr->smgr_vm_nblocks = 0;
} }
...@@ -466,8 +465,8 @@ vm_extend(Relation rel, BlockNumber vm_nblocks) ...@@ -466,8 +465,8 @@ vm_extend(Relation rel, BlockNumber vm_nblocks)
RelationOpenSmgr(rel); RelationOpenSmgr(rel);
/* /*
* Create the file first if it doesn't exist. If smgr_vm_nblocks * Create the file first if it doesn't exist. If smgr_vm_nblocks is
* is positive then it must exist, no need for an smgrexists call. * positive then it must exist, no need for an smgrexists call.
*/ */
if ((rel->rd_smgr->smgr_vm_nblocks == 0 || if ((rel->rd_smgr->smgr_vm_nblocks == 0 ||
rel->rd_smgr->smgr_vm_nblocks == InvalidBlockNumber) && rel->rd_smgr->smgr_vm_nblocks == InvalidBlockNumber) &&
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.80 2010/02/07 20:48:09 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.81 2010/02/26 02:00:33 momjian Exp $
* *
* NOTES * NOTES
* many of the old access method routines have been turned into * many of the old access method routines have been turned into
...@@ -94,13 +94,13 @@ RelationGetIndexScan(Relation indexRelation, ...@@ -94,13 +94,13 @@ RelationGetIndexScan(Relation indexRelation,
/* /*
* During recovery we ignore killed tuples and don't bother to kill them * During recovery we ignore killed tuples and don't bother to kill them
* either. We do this because the xmin on the primary node could easily * either. We do this because the xmin on the primary node could easily be
* be later than the xmin on the standby node, so that what the primary * later than the xmin on the standby node, so that what the primary
* thinks is killed is supposed to be visible on standby. So for correct * thinks is killed is supposed to be visible on standby. So for correct
* MVCC for queries during recovery we must ignore these hints and check * MVCC for queries during recovery we must ignore these hints and check
* all tuples. Do *not* set ignore_killed_tuples to true when running * all tuples. Do *not* set ignore_killed_tuples to true when running in a
* in a transaction that was started during recovery. * transaction that was started during recovery. xactStartedInRecovery
* xactStartedInRecovery should not be altered by index AMs. * should not be altered by index AMs.
*/ */
scan->kill_prior_tuple = false; scan->kill_prior_tuple = false;
scan->xactStartedInRecovery = TransactionStartedDuringRecovery(); scan->xactStartedInRecovery = TransactionStartedDuringRecovery();
...@@ -170,24 +170,24 @@ BuildIndexValueDescription(Relation indexRelation, ...@@ -170,24 +170,24 @@ BuildIndexValueDescription(Relation indexRelation,
for (i = 0; i < natts; i++) for (i = 0; i < natts; i++)
{ {
char *val; char *val;
if (isnull[i]) if (isnull[i])
val = "null"; val = "null";
else else
{ {
Oid foutoid; Oid foutoid;
bool typisvarlena; bool typisvarlena;
/* /*
* The provided data is not necessarily of the type stored in * The provided data is not necessarily of the type stored in the
* the index; rather it is of the index opclass's input type. * index; rather it is of the index opclass's input type. So look
* So look at rd_opcintype not the index tupdesc. * at rd_opcintype not the index tupdesc.
* *
* Note: this is a bit shaky for opclasses that have pseudotype * Note: this is a bit shaky for opclasses that have pseudotype
* input types such as ANYARRAY or RECORD. Currently, the * input types such as ANYARRAY or RECORD. Currently, the
* typoutput functions associated with the pseudotypes will * typoutput functions associated with the pseudotypes will work
* work okay, but we might have to try harder in future. * okay, but we might have to try harder in future.
*/ */
getTypeOutputInfo(indexRelation->rd_opcintype[i], getTypeOutputInfo(indexRelation->rd_opcintype[i],
&foutoid, &typisvarlena); &foutoid, &typisvarlena);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/index/indexam.c,v 1.117 2010/01/02 16:57:35 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/index/indexam.c,v 1.118 2010/02/26 02:00:34 momjian Exp $
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
* index_open - open an index relation by relation OID * index_open - open an index relation by relation OID
...@@ -455,9 +455,9 @@ index_getnext(IndexScanDesc scan, ScanDirection direction) ...@@ -455,9 +455,9 @@ index_getnext(IndexScanDesc scan, ScanDirection direction)
/* /*
* If we scanned a whole HOT chain and found only dead tuples, * If we scanned a whole HOT chain and found only dead tuples,
* tell index AM to kill its entry for that TID. We do not do * tell index AM to kill its entry for that TID. We do not do this
* this when in recovery because it may violate MVCC to do so. * when in recovery because it may violate MVCC to do so. see
* see comments in RelationGetIndexScan(). * comments in RelationGetIndexScan().
*/ */
if (!scan->xactStartedInRecovery) if (!scan->xactStartedInRecovery)
scan->kill_prior_tuple = scan->xs_hot_dead; scan->kill_prior_tuple = scan->xs_hot_dead;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.176 2010/01/02 16:57:35 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.177 2010/02/26 02:00:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -88,7 +88,7 @@ static void _bt_vacuum_one_page(Relation rel, Buffer buffer); ...@@ -88,7 +88,7 @@ static void _bt_vacuum_one_page(Relation rel, Buffer buffer);
* and btinsert. By here, itup is filled in, including the TID. * and btinsert. By here, itup is filled in, including the TID.
* *
* If checkUnique is UNIQUE_CHECK_NO or UNIQUE_CHECK_PARTIAL, this * If checkUnique is UNIQUE_CHECK_NO or UNIQUE_CHECK_PARTIAL, this
* will allow duplicates. Otherwise (UNIQUE_CHECK_YES or * will allow duplicates. Otherwise (UNIQUE_CHECK_YES or
* UNIQUE_CHECK_EXISTING) it will throw error for a duplicate. * UNIQUE_CHECK_EXISTING) it will throw error for a duplicate.
* For UNIQUE_CHECK_EXISTING we merely run the duplicate check, and * For UNIQUE_CHECK_EXISTING we merely run the duplicate check, and
* don't actually insert. * don't actually insert.
...@@ -149,9 +149,9 @@ top: ...@@ -149,9 +149,9 @@ top:
* If we must wait for another xact, we release the lock while waiting, * If we must wait for another xact, we release the lock while waiting,
* and then must start over completely. * and then must start over completely.
* *
* For a partial uniqueness check, we don't wait for the other xact. * For a partial uniqueness check, we don't wait for the other xact. Just
* Just let the tuple in and return false for possibly non-unique, * let the tuple in and return false for possibly non-unique, or true for
* or true for definitely unique. * definitely unique.
*/ */
if (checkUnique != UNIQUE_CHECK_NO) if (checkUnique != UNIQUE_CHECK_NO)
{ {
...@@ -281,7 +281,7 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel, ...@@ -281,7 +281,7 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel,
/* /*
* If we are doing a recheck, we expect to find the tuple we * If we are doing a recheck, we expect to find the tuple we
* are rechecking. It's not a duplicate, but we have to keep * are rechecking. It's not a duplicate, but we have to keep
* scanning. * scanning.
*/ */
if (checkUnique == UNIQUE_CHECK_EXISTING && if (checkUnique == UNIQUE_CHECK_EXISTING &&
...@@ -302,10 +302,10 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel, ...@@ -302,10 +302,10 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel,
/* /*
* It is a duplicate. If we are only doing a partial * It is a duplicate. If we are only doing a partial
* check, then don't bother checking if the tuple is * check, then don't bother checking if the tuple is being
* being updated in another transaction. Just return * updated in another transaction. Just return the fact
* the fact that it is a potential conflict and leave * that it is a potential conflict and leave the full
* the full check till later. * check till later.
*/ */
if (checkUnique == UNIQUE_CHECK_PARTIAL) if (checkUnique == UNIQUE_CHECK_PARTIAL)
{ {
...@@ -362,20 +362,20 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel, ...@@ -362,20 +362,20 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel,
} }
/* /*
* This is a definite conflict. Break the tuple down * This is a definite conflict. Break the tuple down into
* into datums and report the error. But first, make * datums and report the error. But first, make sure we
* sure we release the buffer locks we're holding --- * release the buffer locks we're holding ---
* BuildIndexValueDescription could make catalog accesses, * BuildIndexValueDescription could make catalog accesses,
* which in the worst case might touch this same index * which in the worst case might touch this same index and
* and cause deadlocks. * cause deadlocks.
*/ */
if (nbuf != InvalidBuffer) if (nbuf != InvalidBuffer)
_bt_relbuf(rel, nbuf); _bt_relbuf(rel, nbuf);
_bt_relbuf(rel, buf); _bt_relbuf(rel, buf);
{ {
Datum values[INDEX_MAX_KEYS]; Datum values[INDEX_MAX_KEYS];
bool isnull[INDEX_MAX_KEYS]; bool isnull[INDEX_MAX_KEYS];
index_deform_tuple(itup, RelationGetDescr(rel), index_deform_tuple(itup, RelationGetDescr(rel),
values, isnull); values, isnull);
...@@ -385,7 +385,7 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel, ...@@ -385,7 +385,7 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel,
RelationGetRelationName(rel)), RelationGetRelationName(rel)),
errdetail("Key %s already exists.", errdetail("Key %s already exists.",
BuildIndexValueDescription(rel, BuildIndexValueDescription(rel,
values, isnull)))); values, isnull))));
} }
} }
else if (all_dead) else if (all_dead)
...@@ -438,16 +438,16 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel, ...@@ -438,16 +438,16 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel,
} }
/* /*
* If we are doing a recheck then we should have found the tuple we * If we are doing a recheck then we should have found the tuple we are
* are checking. Otherwise there's something very wrong --- probably, * checking. Otherwise there's something very wrong --- probably, the
* the index is on a non-immutable expression. * index is on a non-immutable expression.
*/ */
if (checkUnique == UNIQUE_CHECK_EXISTING && !found) if (checkUnique == UNIQUE_CHECK_EXISTING && !found)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INTERNAL_ERROR), (errcode(ERRCODE_INTERNAL_ERROR),
errmsg("failed to re-find tuple within index \"%s\"", errmsg("failed to re-find tuple within index \"%s\"",
RelationGetRelationName(rel)), RelationGetRelationName(rel)),
errhint("This may be because of a non-immutable index expression."))); errhint("This may be because of a non-immutable index expression.")));
if (nbuf != InvalidBuffer) if (nbuf != InvalidBuffer)
_bt_relbuf(rel, nbuf); _bt_relbuf(rel, nbuf);
...@@ -518,10 +518,10 @@ _bt_findinsertloc(Relation rel, ...@@ -518,10 +518,10 @@ _bt_findinsertloc(Relation rel,
if (itemsz > BTMaxItemSize(page)) if (itemsz > BTMaxItemSize(page))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("index row size %lu exceeds maximum %lu for index \"%s\"", errmsg("index row size %lu exceeds maximum %lu for index \"%s\"",
(unsigned long) itemsz, (unsigned long) itemsz,
(unsigned long) BTMaxItemSize(page), (unsigned long) BTMaxItemSize(page),
RelationGetRelationName(rel)), RelationGetRelationName(rel)),
errhint("Values larger than 1/3 of a buffer page cannot be indexed.\n" errhint("Values larger than 1/3 of a buffer page cannot be indexed.\n"
"Consider a function index of an MD5 hash of the value, " "Consider a function index of an MD5 hash of the value, "
"or use full text indexing."))); "or use full text indexing.")));
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.119 2010/02/13 00:59:58 sriggs Exp $ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.120 2010/02/26 02:00:34 momjian Exp $
* *
* NOTES * NOTES
* Postgres btree pages look like ordinary relation pages. The opaque * Postgres btree pages look like ordinary relation pages. The opaque
...@@ -459,8 +459,8 @@ _bt_log_reuse_page(Relation rel, BlockNumber blkno, TransactionId latestRemovedX ...@@ -459,8 +459,8 @@ _bt_log_reuse_page(Relation rel, BlockNumber blkno, TransactionId latestRemovedX
START_CRIT_SECTION(); START_CRIT_SECTION();
/* /*
* We don't do MarkBufferDirty here because we're about initialise * We don't do MarkBufferDirty here because we're about initialise the
* the page, and nobody else can see it yet. * page, and nobody else can see it yet.
*/ */
/* XLOG stuff */ /* XLOG stuff */
...@@ -480,8 +480,8 @@ _bt_log_reuse_page(Relation rel, BlockNumber blkno, TransactionId latestRemovedX ...@@ -480,8 +480,8 @@ _bt_log_reuse_page(Relation rel, BlockNumber blkno, TransactionId latestRemovedX
recptr = XLogInsert(RM_BTREE_ID, XLOG_BTREE_REUSE_PAGE, rdata); recptr = XLogInsert(RM_BTREE_ID, XLOG_BTREE_REUSE_PAGE, rdata);
/* /*
* We don't do PageSetLSN or PageSetTLI here because * We don't do PageSetLSN or PageSetTLI here because we're about
* we're about initialise the page, so no need. * initialise the page, so no need.
*/ */
} }
...@@ -552,11 +552,11 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) ...@@ -552,11 +552,11 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access)
{ {
page = BufferGetPage(buf); page = BufferGetPage(buf);
if (_bt_page_recyclable(page)) if (_bt_page_recyclable(page))
{ {
/* /*
* If we are generating WAL for Hot Standby then create * If we are generating WAL for Hot Standby then create a
* a WAL record that will allow us to conflict with * WAL record that will allow us to conflict with queries
* queries running on standby. * running on standby.
*/ */
if (XLogStandbyInfoActive()) if (XLogStandbyInfoActive())
{ {
...@@ -762,6 +762,7 @@ _bt_delitems(Relation rel, Buffer buf, ...@@ -762,6 +762,7 @@ _bt_delitems(Relation rel, Buffer buf,
if (isVacuum) if (isVacuum)
{ {
xl_btree_vacuum xlrec_vacuum; xl_btree_vacuum xlrec_vacuum;
xlrec_vacuum.node = rel->rd_node; xlrec_vacuum.node = rel->rd_node;
xlrec_vacuum.block = BufferGetBlockNumber(buf); xlrec_vacuum.block = BufferGetBlockNumber(buf);
...@@ -772,6 +773,7 @@ _bt_delitems(Relation rel, Buffer buf, ...@@ -772,6 +773,7 @@ _bt_delitems(Relation rel, Buffer buf,
else else
{ {
xl_btree_delete xlrec_delete; xl_btree_delete xlrec_delete;
xlrec_delete.node = rel->rd_node; xlrec_delete.node = rel->rd_node;
xlrec_delete.block = BufferGetBlockNumber(buf); xlrec_delete.block = BufferGetBlockNumber(buf);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.175 2010/02/08 04:33:53 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.176 2010/02/26 02:00:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -57,8 +57,8 @@ typedef struct ...@@ -57,8 +57,8 @@ typedef struct
IndexBulkDeleteCallback callback; IndexBulkDeleteCallback callback;
void *callback_state; void *callback_state;
BTCycleId cycleid; BTCycleId cycleid;
BlockNumber lastBlockVacuumed; /* last blkno reached by Vacuum scan */ BlockNumber lastBlockVacuumed; /* last blkno reached by Vacuum scan */
BlockNumber lastUsedPage; /* blkno of last non-recyclable page */ BlockNumber lastUsedPage; /* blkno of last non-recyclable page */
BlockNumber totFreePages; /* true total # of free pages */ BlockNumber totFreePages; /* true total # of free pages */
MemoryContext pagedelcontext; MemoryContext pagedelcontext;
} BTVacState; } BTVacState;
...@@ -630,7 +630,7 @@ btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, ...@@ -630,7 +630,7 @@ btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
vstate.callback = callback; vstate.callback = callback;
vstate.callback_state = callback_state; vstate.callback_state = callback_state;
vstate.cycleid = cycleid; vstate.cycleid = cycleid;
vstate.lastBlockVacuumed = BTREE_METAPAGE; /* Initialise at first block */ vstate.lastBlockVacuumed = BTREE_METAPAGE; /* Initialise at first block */
vstate.lastUsedPage = BTREE_METAPAGE; vstate.lastUsedPage = BTREE_METAPAGE;
vstate.totFreePages = 0; vstate.totFreePages = 0;
...@@ -702,8 +702,8 @@ btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, ...@@ -702,8 +702,8 @@ btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
/* /*
* We can't use _bt_getbuf() here because it always applies * We can't use _bt_getbuf() here because it always applies
* _bt_checkpage(), which will barf on an all-zero page. We want to * _bt_checkpage(), which will barf on an all-zero page. We want to
* recycle all-zero pages, not fail. Also, we want to use a nondefault * recycle all-zero pages, not fail. Also, we want to use a
* buffer access strategy. * nondefault buffer access strategy.
*/ */
buf = ReadBufferExtended(rel, MAIN_FORKNUM, num_pages - 1, RBM_NORMAL, buf = ReadBufferExtended(rel, MAIN_FORKNUM, num_pages - 1, RBM_NORMAL,
info->strategy); info->strategy);
...@@ -856,23 +856,25 @@ restart: ...@@ -856,23 +856,25 @@ restart:
htup = &(itup->t_tid); htup = &(itup->t_tid);
/* /*
* During Hot Standby we currently assume that XLOG_BTREE_VACUUM * During Hot Standby we currently assume that
* records do not produce conflicts. That is only true as long * XLOG_BTREE_VACUUM records do not produce conflicts. That is
* as the callback function depends only upon whether the index * only true as long as the callback function depends only
* tuple refers to heap tuples removed in the initial heap scan. * upon whether the index tuple refers to heap tuples removed
* When vacuum starts it derives a value of OldestXmin. Backends * in the initial heap scan. When vacuum starts it derives a
* taking later snapshots could have a RecentGlobalXmin with a * value of OldestXmin. Backends taking later snapshots could
* later xid than the vacuum's OldestXmin, so it is possible that * have a RecentGlobalXmin with a later xid than the vacuum's
* row versions deleted after OldestXmin could be marked as killed * OldestXmin, so it is possible that row versions deleted
* by other backends. The callback function *could* look at the * after OldestXmin could be marked as killed by other
* index tuple state in isolation and decide to delete the index * backends. The callback function *could* look at the index
* tuple, though currently it does not. If it ever did, we would * tuple state in isolation and decide to delete the index
* need to reconsider whether XLOG_BTREE_VACUUM records should * tuple, though currently it does not. If it ever did, we
* cause conflicts. If they did cause conflicts they would be * would need to reconsider whether XLOG_BTREE_VACUUM records
* fairly harsh conflicts, since we haven't yet worked out a way * should cause conflicts. If they did cause conflicts they
* to pass a useful value for latestRemovedXid on the * would be fairly harsh conflicts, since we haven't yet
* XLOG_BTREE_VACUUM records. This applies to *any* type of index * worked out a way to pass a useful value for
* that marks index tuples as killed. * latestRemovedXid on the XLOG_BTREE_VACUUM records. This
* applies to *any* type of index that marks index tuples as
* killed.
*/ */
if (callback(htup, callback_state)) if (callback(htup, callback_state))
deletable[ndeletable++] = offnum; deletable[ndeletable++] = offnum;
...@@ -885,13 +887,13 @@ restart: ...@@ -885,13 +887,13 @@ restart:
*/ */
if (ndeletable > 0) if (ndeletable > 0)
{ {
BlockNumber lastBlockVacuumed = BufferGetBlockNumber(buf); BlockNumber lastBlockVacuumed = BufferGetBlockNumber(buf);
_bt_delitems(rel, buf, deletable, ndeletable, true, vstate->lastBlockVacuumed); _bt_delitems(rel, buf, deletable, ndeletable, true, vstate->lastBlockVacuumed);
/* /*
* Keep track of the block number of the lastBlockVacuumed, so * Keep track of the block number of the lastBlockVacuumed, so we
* we can scan those blocks as well during WAL replay. This then * can scan those blocks as well during WAL replay. This then
* provides concurrency protection and allows btrees to be used * provides concurrency protection and allows btrees to be used
* while in recovery. * while in recovery.
*/ */
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.123 2010/01/20 19:43:40 heikki Exp $ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.124 2010/02/26 02:00:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -216,12 +216,13 @@ _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2) ...@@ -216,12 +216,13 @@ _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2)
wstate.btws_use_wal = XLogIsNeeded() && !wstate.index->rd_istemp; wstate.btws_use_wal = XLogIsNeeded() && !wstate.index->rd_istemp;
/* /*
* Write an XLOG UNLOGGED record if WAL-logging was skipped because * Write an XLOG UNLOGGED record if WAL-logging was skipped because WAL
* WAL archiving is not enabled. * archiving is not enabled.
*/ */
if (!wstate.btws_use_wal && !wstate.index->rd_istemp) if (!wstate.btws_use_wal && !wstate.index->rd_istemp)
{ {
char reason[NAMEDATALEN + 20]; char reason[NAMEDATALEN + 20];
snprintf(reason, sizeof(reason), "b-tree build on \"%s\"", snprintf(reason, sizeof(reason), "b-tree build on \"%s\"",
RelationGetRelationName(wstate.index)); RelationGetRelationName(wstate.index));
XLogReportUnloggedStatement(reason); XLogReportUnloggedStatement(reason);
...@@ -492,10 +493,10 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup) ...@@ -492,10 +493,10 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup)
if (itupsz > BTMaxItemSize(npage)) if (itupsz > BTMaxItemSize(npage))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("index row size %lu exceeds maximum %lu for index \"%s\"", errmsg("index row size %lu exceeds maximum %lu for index \"%s\"",
(unsigned long) itupsz, (unsigned long) itupsz,
(unsigned long) BTMaxItemSize(npage), (unsigned long) BTMaxItemSize(npage),
RelationGetRelationName(wstate->index)), RelationGetRelationName(wstate->index)),
errhint("Values larger than 1/3 of a buffer page cannot be indexed.\n" errhint("Values larger than 1/3 of a buffer page cannot be indexed.\n"
"Consider a function index of an MD5 hash of the value, " "Consider a function index of an MD5 hash of the value, "
"or use full text indexing."))); "or use full text indexing.")));
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.97 2010/01/03 05:39:08 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.98 2010/02/26 02:00:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -515,7 +515,7 @@ _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op, ...@@ -515,7 +515,7 @@ _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op,
StrategyNumber strat; StrategyNumber strat;
/* /*
* First, deal with cases where one or both args are NULL. This should * First, deal with cases where one or both args are NULL. This should
* only happen when the scankeys represent IS NULL/NOT NULL conditions. * only happen when the scankeys represent IS NULL/NOT NULL conditions.
*/ */
if ((leftarg->sk_flags | rightarg->sk_flags) & SK_ISNULL) if ((leftarg->sk_flags | rightarg->sk_flags) & SK_ISNULL)
...@@ -566,7 +566,7 @@ _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op, ...@@ -566,7 +566,7 @@ _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op,
break; break;
default: default:
elog(ERROR, "unrecognized StrategyNumber: %d", (int) strat); elog(ERROR, "unrecognized StrategyNumber: %d", (int) strat);
*result = false; /* keep compiler quiet */ *result = false; /* keep compiler quiet */
break; break;
} }
return true; return true;
...@@ -612,8 +612,8 @@ _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op, ...@@ -612,8 +612,8 @@ _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op,
* indexscan initiated by syscache lookup will use cross-data-type * indexscan initiated by syscache lookup will use cross-data-type
* operators.) * operators.)
* *
* If the sk_strategy was flipped by _bt_fix_scankey_strategy, we * If the sk_strategy was flipped by _bt_fix_scankey_strategy, we have to
* have to un-flip it to get the correct opfamily member. * un-flip it to get the correct opfamily member.
*/ */
strat = op->sk_strategy; strat = op->sk_strategy;
if (op->sk_flags & SK_BT_DESC) if (op->sk_flags & SK_BT_DESC)
...@@ -653,7 +653,7 @@ _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op, ...@@ -653,7 +653,7 @@ _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op,
* *
* Lastly, for ordinary scankeys (not IS NULL/NOT NULL), we check for a * Lastly, for ordinary scankeys (not IS NULL/NOT NULL), we check for a
* NULL comparison value. Since all btree operators are assumed strict, * NULL comparison value. Since all btree operators are assumed strict,
* a NULL means that the qual cannot be satisfied. We return TRUE if the * a NULL means that the qual cannot be satisfied. We return TRUE if the
* comparison value isn't NULL, or FALSE if the scan should be abandoned. * comparison value isn't NULL, or FALSE if the scan should be abandoned.
* *
* This function is applied to the *input* scankey structure; therefore * This function is applied to the *input* scankey structure; therefore
...@@ -682,7 +682,7 @@ _bt_fix_scankey_strategy(ScanKey skey, int16 *indoption) ...@@ -682,7 +682,7 @@ _bt_fix_scankey_strategy(ScanKey skey, int16 *indoption)
* --- we can treat IS NULL as an equality operator for purposes of search * --- we can treat IS NULL as an equality operator for purposes of search
* strategy. * strategy.
* *
* Likewise, "x IS NOT NULL" is supported. We treat that as either "less * Likewise, "x IS NOT NULL" is supported. We treat that as either "less
* than NULL" in a NULLS LAST index, or "greater than NULL" in a NULLS * than NULL" in a NULLS LAST index, or "greater than NULL" in a NULLS
* FIRST index. * FIRST index.
*/ */
...@@ -910,13 +910,13 @@ _bt_checkkeys(IndexScanDesc scan, ...@@ -910,13 +910,13 @@ _bt_checkkeys(IndexScanDesc scan,
if (key->sk_flags & SK_SEARCHNULL) if (key->sk_flags & SK_SEARCHNULL)
{ {
if (isNull) if (isNull)
continue; /* tuple satisfies this qual */ continue; /* tuple satisfies this qual */
} }
else else
{ {
Assert(key->sk_flags & SK_SEARCHNOTNULL); Assert(key->sk_flags & SK_SEARCHNOTNULL);
if (!isNull) if (!isNull)
continue; /* tuple satisfies this qual */ continue; /* tuple satisfies this qual */
} }
/* /*
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.61 2010/02/13 00:59:58 sriggs Exp $ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.62 2010/02/26 02:00:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -473,10 +473,10 @@ btree_xlog_vacuum(XLogRecPtr lsn, XLogRecord *record) ...@@ -473,10 +473,10 @@ btree_xlog_vacuum(XLogRecPtr lsn, XLogRecord *record)
xlrec = (xl_btree_vacuum *) XLogRecGetData(record); xlrec = (xl_btree_vacuum *) XLogRecGetData(record);
/* /*
* If queries might be active then we need to ensure every block is unpinned * If queries might be active then we need to ensure every block is
* between the lastBlockVacuumed and the current block, if there are any. * unpinned between the lastBlockVacuumed and the current block, if there
* This ensures that every block in the index is touched during VACUUM as * are any. This ensures that every block in the index is touched during
* required to ensure scans work correctly. * VACUUM as required to ensure scans work correctly.
*/ */
if (standbyState == STANDBY_SNAPSHOT_READY && if (standbyState == STANDBY_SNAPSHOT_READY &&
(xlrec->lastBlockVacuumed + 1) != xlrec->block) (xlrec->lastBlockVacuumed + 1) != xlrec->block)
...@@ -486,10 +486,10 @@ btree_xlog_vacuum(XLogRecPtr lsn, XLogRecord *record) ...@@ -486,10 +486,10 @@ btree_xlog_vacuum(XLogRecPtr lsn, XLogRecord *record)
for (; blkno < xlrec->block; blkno++) for (; blkno < xlrec->block; blkno++)
{ {
/* /*
* XXX we don't actually need to read the block, we * XXX we don't actually need to read the block, we just need to
* just need to confirm it is unpinned. If we had a special call * confirm it is unpinned. If we had a special call into the
* into the buffer manager we could optimise this so that * buffer manager we could optimise this so that if the block is
* if the block is not in shared_buffers we confirm it as unpinned. * not in shared_buffers we confirm it as unpinned.
* *
* Another simple optimization would be to check if there's any * Another simple optimization would be to check if there's any
* backends running; if not, we could just skip this. * backends running; if not, we could just skip this.
...@@ -505,9 +505,9 @@ btree_xlog_vacuum(XLogRecPtr lsn, XLogRecord *record) ...@@ -505,9 +505,9 @@ btree_xlog_vacuum(XLogRecPtr lsn, XLogRecord *record)
/* /*
* If the block was restored from a full page image, nothing more to do. * If the block was restored from a full page image, nothing more to do.
* The RestoreBkpBlocks() call already pinned and took cleanup lock on * The RestoreBkpBlocks() call already pinned and took cleanup lock on it.
* it. XXX: Perhaps we should call RestoreBkpBlocks() *after* the loop * XXX: Perhaps we should call RestoreBkpBlocks() *after* the loop above,
* above, to make the disk access more sequential. * to make the disk access more sequential.
*/ */
if (record->xl_info & XLR_BKP_BLOCK_1) if (record->xl_info & XLR_BKP_BLOCK_1)
return; return;
...@@ -567,8 +567,8 @@ btree_xlog_delete(XLogRecPtr lsn, XLogRecord *record) ...@@ -567,8 +567,8 @@ btree_xlog_delete(XLogRecPtr lsn, XLogRecord *record)
xlrec = (xl_btree_delete *) XLogRecGetData(record); xlrec = (xl_btree_delete *) XLogRecGetData(record);
/* /*
* We don't need to take a cleanup lock to apply these changes. * We don't need to take a cleanup lock to apply these changes. See
* See nbtree/README for details. * nbtree/README for details.
*/ */
buffer = XLogReadBuffer(xlrec->node, xlrec->block, false); buffer = XLogReadBuffer(xlrec->node, xlrec->block, false);
if (!BufferIsValid(buffer)) if (!BufferIsValid(buffer))
...@@ -819,13 +819,15 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -819,13 +819,15 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
switch (info) switch (info)
{ {
case XLOG_BTREE_DELETE: case XLOG_BTREE_DELETE:
/* /*
* Btree delete records can conflict with standby queries. You might * Btree delete records can conflict with standby queries. You
* think that vacuum records would conflict as well, but we've handled * might think that vacuum records would conflict as well, but
* that already. XLOG_HEAP2_CLEANUP_INFO records provide the highest xid * we've handled that already. XLOG_HEAP2_CLEANUP_INFO records
* cleaned by the vacuum of the heap and so we can resolve any conflicts * provide the highest xid cleaned by the vacuum of the heap
* just once when that arrives. After that any we know that no conflicts * and so we can resolve any conflicts just once when that
* exist from individual btree vacuum records on that index. * arrives. After that any we know that no conflicts exist
* from individual btree vacuum records on that index.
*/ */
{ {
xl_btree_delete *xlrec = (xl_btree_delete *) XLogRecGetData(record); xl_btree_delete *xlrec = (xl_btree_delete *) XLogRecGetData(record);
...@@ -842,9 +844,11 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -842,9 +844,11 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
break; break;
case XLOG_BTREE_REUSE_PAGE: case XLOG_BTREE_REUSE_PAGE:
/* /*
* Btree reuse page records exist to provide a conflict point when we * Btree reuse page records exist to provide a conflict point
* reuse pages in the index via the FSM. That's all it does though. * when we reuse pages in the index via the FSM. That's all it
* does though.
*/ */
{ {
xl_btree_reuse_page *xlrec = (xl_btree_reuse_page *) XLogRecGetData(record); xl_btree_reuse_page *xlrec = (xl_btree_reuse_page *) XLogRecGetData(record);
...@@ -859,8 +863,8 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -859,8 +863,8 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
} }
/* /*
* Vacuum needs to pin and take cleanup lock on every leaf page, * Vacuum needs to pin and take cleanup lock on every leaf page, a regular
* a regular exclusive lock is enough for all other purposes. * exclusive lock is enough for all other purposes.
*/ */
RestoreBkpBlocks(lsn, record, (info == XLOG_BTREE_VACUUM)); RestoreBkpBlocks(lsn, record, (info == XLOG_BTREE_VACUUM));
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.34 2010/01/02 16:57:35 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.35 2010/02/26 02:00:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1298,11 +1298,11 @@ PostPrepare_MultiXact(TransactionId xid) ...@@ -1298,11 +1298,11 @@ PostPrepare_MultiXact(TransactionId xid)
myOldestMember = OldestMemberMXactId[MyBackendId]; myOldestMember = OldestMemberMXactId[MyBackendId];
if (MultiXactIdIsValid(myOldestMember)) if (MultiXactIdIsValid(myOldestMember))
{ {
BackendId dummyBackendId = TwoPhaseGetDummyBackendId(xid); BackendId dummyBackendId = TwoPhaseGetDummyBackendId(xid);
/* /*
* Even though storing MultiXactId is atomic, acquire lock to make sure * Even though storing MultiXactId is atomic, acquire lock to make
* others see both changes, not just the reset of the slot of the * sure others see both changes, not just the reset of the slot of the
* current backend. Using a volatile pointer might suffice, but this * current backend. Using a volatile pointer might suffice, but this
* isn't a hot spot. * isn't a hot spot.
*/ */
...@@ -1316,8 +1316,8 @@ PostPrepare_MultiXact(TransactionId xid) ...@@ -1316,8 +1316,8 @@ PostPrepare_MultiXact(TransactionId xid)
/* /*
* We don't need to transfer OldestVisibleMXactId value, because the * We don't need to transfer OldestVisibleMXactId value, because the
* transaction is not going to be looking at any more multixacts once * transaction is not going to be looking at any more multixacts once it's
* it's prepared. * prepared.
* *
* We assume that storing a MultiXactId is atomic and so we need not take * We assume that storing a MultiXactId is atomic and so we need not take
* MultiXactGenLock to do this. * MultiXactGenLock to do this.
...@@ -1340,14 +1340,14 @@ multixact_twophase_recover(TransactionId xid, uint16 info, ...@@ -1340,14 +1340,14 @@ multixact_twophase_recover(TransactionId xid, uint16 info,
void *recdata, uint32 len) void *recdata, uint32 len)
{ {
BackendId dummyBackendId = TwoPhaseGetDummyBackendId(xid); BackendId dummyBackendId = TwoPhaseGetDummyBackendId(xid);
MultiXactId oldestMember; MultiXactId oldestMember;
/* /*
* Get the oldest member XID from the state file record, and set it in * Get the oldest member XID from the state file record, and set it in the
* the OldestMemberMXactId slot reserved for this prepared transaction. * OldestMemberMXactId slot reserved for this prepared transaction.
*/ */
Assert(len == sizeof(MultiXactId)); Assert(len == sizeof(MultiXactId));
oldestMember = *((MultiXactId *)recdata); oldestMember = *((MultiXactId *) recdata);
OldestMemberMXactId[dummyBackendId] = oldestMember; OldestMemberMXactId[dummyBackendId] = oldestMember;
} }
...@@ -1373,7 +1373,7 @@ multixact_twophase_postcommit(TransactionId xid, uint16 info, ...@@ -1373,7 +1373,7 @@ multixact_twophase_postcommit(TransactionId xid, uint16 info,
*/ */
void void
multixact_twophase_postabort(TransactionId xid, uint16 info, multixact_twophase_postabort(TransactionId xid, uint16 info,
void *recdata, uint32 len) void *recdata, uint32 len)
{ {
multixact_twophase_postcommit(xid, info, recdata, len); multixact_twophase_postcommit(xid, info, recdata, len);
} }
...@@ -2031,9 +2031,10 @@ multixact_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -2031,9 +2031,10 @@ multixact_redo(XLogRecPtr lsn, XLogRecord *record)
max_xid = xids[i]; max_xid = xids[i];
} }
/* We don't expect anyone else to modify nextXid, hence startup process /*
* doesn't need to hold a lock while checking this. We still acquire * We don't expect anyone else to modify nextXid, hence startup
* the lock to modify it, though. * process doesn't need to hold a lock while checking this. We still
* acquire the lock to modify it, though.
*/ */
if (TransactionIdFollowsOrEquals(max_xid, if (TransactionIdFollowsOrEquals(max_xid,
ShmemVariableCache->nextXid)) ShmemVariableCache->nextXid))
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/access/transam/subtrans.c,v 1.26 2010/01/02 16:57:35 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/subtrans.c,v 1.27 2010/02/26 02:00:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -89,7 +89,7 @@ SubTransSetParent(TransactionId xid, TransactionId parent, bool overwriteOK) ...@@ -89,7 +89,7 @@ SubTransSetParent(TransactionId xid, TransactionId parent, bool overwriteOK)
/* Current state should be 0 */ /* Current state should be 0 */
Assert(*ptr == InvalidTransactionId || Assert(*ptr == InvalidTransactionId ||
(*ptr == parent && overwriteOK)); (*ptr == parent && overwriteOK));
*ptr = parent; *ptr = parent;
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/transam/twophase_rmgr.c,v 1.13 2010/02/16 22:34:43 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/twophase_rmgr.c,v 1.14 2010/02/26 02:00:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -32,8 +32,8 @@ const TwoPhaseCallback twophase_postcommit_callbacks[TWOPHASE_RM_MAX_ID + 1] = ...@@ -32,8 +32,8 @@ const TwoPhaseCallback twophase_postcommit_callbacks[TWOPHASE_RM_MAX_ID + 1] =
{ {
NULL, /* END ID */ NULL, /* END ID */
lock_twophase_postcommit, /* Lock */ lock_twophase_postcommit, /* Lock */
pgstat_twophase_postcommit, /* pgstat */ pgstat_twophase_postcommit, /* pgstat */
multixact_twophase_postcommit /* MultiXact */ multixact_twophase_postcommit /* MultiXact */
}; };
const TwoPhaseCallback twophase_postabort_callbacks[TWOPHASE_RM_MAX_ID + 1] = const TwoPhaseCallback twophase_postabort_callbacks[TWOPHASE_RM_MAX_ID + 1] =
...@@ -41,7 +41,7 @@ const TwoPhaseCallback twophase_postabort_callbacks[TWOPHASE_RM_MAX_ID + 1] = ...@@ -41,7 +41,7 @@ const TwoPhaseCallback twophase_postabort_callbacks[TWOPHASE_RM_MAX_ID + 1] =
NULL, /* END ID */ NULL, /* END ID */
lock_twophase_postabort, /* Lock */ lock_twophase_postabort, /* Lock */
pgstat_twophase_postabort, /* pgstat */ pgstat_twophase_postabort, /* pgstat */
multixact_twophase_postabort /* MultiXact */ multixact_twophase_postabort /* MultiXact */
}; };
const TwoPhaseCallback twophase_standby_recover_callbacks[TWOPHASE_RM_MAX_ID + 1] = const TwoPhaseCallback twophase_standby_recover_callbacks[TWOPHASE_RM_MAX_ID + 1] =
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.259 2010/02/07 20:48:09 tgl Exp $ * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.260 2010/02/26 02:00:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -370,7 +370,7 @@ AuxiliaryProcessMain(int argc, char *argv[]) ...@@ -370,7 +370,7 @@ AuxiliaryProcessMain(int argc, char *argv[])
#endif #endif
/* /*
* Assign the ProcSignalSlot for an auxiliary process. Since it * Assign the ProcSignalSlot for an auxiliary process. Since it
* doesn't have a BackendId, the slot is statically allocated based on * doesn't have a BackendId, the slot is statically allocated based on
* the auxiliary process type (auxType). Backends use slots indexed * the auxiliary process type (auxType). Backends use slots indexed
* in the range from 1 to MaxBackends (inclusive), so we use * in the range from 1 to MaxBackends (inclusive), so we use
...@@ -493,8 +493,8 @@ BootstrapModeMain(void) ...@@ -493,8 +493,8 @@ BootstrapModeMain(void)
boot_yyparse(); boot_yyparse();
/* /*
* We should now know about all mapped relations, so it's okay to * We should now know about all mapped relations, so it's okay to write
* write out the initial relation mapping files. * out the initial relation mapping files.
*/ */
RelationMapFinishBootstrap(); RelationMapFinishBootstrap();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment