optimizer.
|
!~*
Does not match (regex), case insensitive
- 'thomas' !~ '.*vadim.*'
+ 'thomas' !~* '.*vadim.*'
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.56 2000/01/10 16:13:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.57 2000/01/24 02:12:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
char *Name_pg_shadow_indices[Num_pg_shadow_indices] =
{ShadowNameIndex, ShadowSysidIndex};
char *Name_pg_statistic_indices[Num_pg_statistic_indices] =
- {StatisticRelidAttnumOpIndex};
+ {StatisticRelidAttnumIndex};
char *Name_pg_trigger_indices[Num_pg_trigger_indices] =
{TriggerRelidIndex, TriggerConstrNameIndex, TriggerConstrRelidIndex};
char *Name_pg_type_indices[Num_pg_type_indices] =
HeapTuple
-StatisticRelidAttnumOpIndexScan(Relation heapRelation,
+StatisticRelidAttnumIndexScan(Relation heapRelation,
Oid relId,
- AttrNumber attNum,
- Oid op)
+ AttrNumber attNum)
{
Relation idesc;
- ScanKeyData skey[3];
+ ScanKeyData skey[2];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(RegProcedure) F_INT2EQ,
Int16GetDatum(attNum));
- ScanKeyEntryInitialize(&skey[2],
- (bits16) 0x0,
- (AttrNumber) 3,
- (RegProcedure) F_OIDEQ,
- ObjectIdGetDatum(op));
-
- idesc = index_openr(StatisticRelidAttnumOpIndex);
- tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
+ idesc = index_openr(StatisticRelidAttnumIndex);
+ tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 2);
index_close(idesc);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.51 2000/01/23 03:43:23 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.52 2000/01/24 02:12:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
tuple = SearchSysCacheTuple(STATRELID,
ObjectIdGetDatum(relid),
Int16GetDatum((int16) attnum),
- opid,
+ 0,
0);
if (!HeapTupleIsValid(tuple))
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.45 2000/01/23 03:43:24 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.46 2000/01/24 02:12:56 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
Add your new cache to the list in include/utils/syscache.h. Keep
the list sorted alphabetically and adjust the cache numbers
accordingly.
-
+
Add your entry to the cacheinfo[] array below. All cache lists are
alphabetical, so add it in the proper place. Specify the relation
name, number of arguments, argument names, size of tuple, index lookup
Finally, any place your relation gets heap_insert() or
heap_update calls, include code to do a CatalogIndexInsert() to update
the system indexes. The heap_* calls do not update indexes.
-
+
bjm 1999/11/22
---------------------------------------------------------------------------
/* ShadowSysidIndex,
ShadowSysidIndexScan*/},
{StatisticRelationName, /* STATRELID */
- 3,
+ 2,
{
Anum_pg_statistic_starelid,
Anum_pg_statistic_staattnum,
- Anum_pg_statistic_staop,
+ 0,
0
},
offsetof(FormData_pg_statistic, stacommonval),
- StatisticRelidAttnumOpIndex,
- (ScanFunc) StatisticRelidAttnumOpIndexScan},
+ StatisticRelidAttnumIndex,
+ (ScanFunc) StatisticRelidAttnumIndexScan},
{TypeRelationName, /* TYPENAME */
1,
{
get_temp_rel_by_username(DatumGetPointer(key1))) != NULL)
key1 = PointerGetDatum(nontemp_relname);
}
-
+
tp = SearchSysCache(SysCache[cacheId], key1, key2, key3, key4);
if (!HeapTupleIsValid(tp))
{
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.9 2000/01/22 23:50:23 tgl Exp $
+ * $Id: catversion.h,v 1.10 2000/01/24 02:12:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200001221
+#define CATALOG_VERSION_NO 200001251
#endif
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: indexing.h,v 1.33 2000/01/10 16:13:20 momjian Exp $
+ * $Id: indexing.h,v 1.34 2000/01/24 02:12:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define RewriteRulenameIndex "pg_rewrite_rulename_index"
#define ShadowNameIndex "pg_shadow_name_index"
#define ShadowSysidIndex "pg_shadow_sysid_index"
-#define StatisticRelidAttnumOpIndex "pg_statistic_relid_att_op_index"
+#define StatisticRelidAttnumIndex "pg_statistic_relid_att_index"
#define TriggerConstrNameIndex "pg_trigger_tgconstrname_index"
#define TriggerConstrRelidIndex "pg_trigger_tgconstrrelid_index"
#define TriggerRelidIndex "pg_trigger_tgrelid_index"
char *ruleName);
extern HeapTuple ShadowNameIndexScan(Relation heapRelation, char *useName);
extern HeapTuple ShadowSysidIndexScan(Relation heapRelation, int4 sysId);
-extern HeapTuple StatisticRelidAttnumOpIndexScan(Relation heapRelation,
- Oid relId, AttrNumber attNum, Oid op);
+extern HeapTuple StatisticRelidAttnumIndexScan(Relation heapRelation,
+ Oid relId, AttrNumber attNum);
extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
xDECLARE_UNIQUE_INDEX(pg_shadow_name_index on pg_shadow using btree(usename name_ops));
xDECLARE_UNIQUE_INDEX(pg_shadow_sysid_index on pg_shadow using btree(usesysid int4_ops));
*/
-DECLARE_INDEX(pg_statistic_relid_att_op_index on pg_statistic using btree(starelid oid_ops, staattnum int2_ops, staop oid_ops));
+DECLARE_INDEX(pg_statistic_relid_att_op_index on pg_statistic using btree(starelid oid_ops, staattnum int2_ops));
DECLARE_INDEX(pg_trigger_tgconstrname_index on pg_trigger using btree(tgconstrname name_ops));
DECLARE_INDEX(pg_trigger_tgconstrrelid_index on pg_trigger using btree(tgconstrrelid oid_ops));
DECLARE_INDEX(pg_trigger_tgrelid_index on pg_trigger using btree(tgrelid oid_ops));
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.114 2000/01/23 01:27:39 petere Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.115 2000/01/24 02:12:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
PGconn *conn;
char *tmp; /* An error message from some service we call. */
bool error = FALSE; /* We encountered an error. */
- int i;
conn = makeEmptyPGconn();
if (conn == NULL)
return 0;
}
+/* ----------
+ * connectMakeNonblocking -
+ * Make a connection non-blocking.
+ * Returns 1 if successful, 0 if not.
+ * ----------
+ */
+static int
+connectMakeNonblocking(PGconn *conn)
+{
+#ifndef WIN32
+ if (fcntl(conn->sock, F_SETFL, O_NONBLOCK) < 0)
+#else
+ if (ioctlsocket(conn->sock, FIONBIO, &on) != 0)
+#endif
+ {
+ printfPQExpBuffer(&conn->errorMessage,
+ "connectMakeNonblocking -- fcntl() failed: errno=%d\n%s\n",
+ errno, strerror(errno));
+ return 0;
+ }
+
+ return 1;
+}
+
/* ----------
* connectNoDelay -
* Sets the TCP_NODELAY socket option.
* Ewan Mellor .
* ---------- */
#if (!defined(WIN32) || defined(WIN32_NON_BLOCKING_CONNECTIONS)) && !defined(USE_SSL)
- if (PQsetnonblocking(conn, TRUE) != 0)
+ if (connectMakeNonblocking(conn) == 0)
goto connect_errReturn;
#endif
/* This makes the connection non-blocking, for all those cases which forced us
not to do it above. */
#if (defined(WIN32) && !defined(WIN32_NON_BLOCKING_CONNECTIONS)) || defined(USE_SSL)
- if (PQsetnonblocking(conn, TRUE) != 0)
+ if (connectMakeNonblocking(conn) == 0)
goto connect_errReturn;
#endif
(void) pqFlush(conn);
}
+ /*
+ * must reset the blocking status so a possible reconnect will work
+ * don't call PQsetnonblocking() because it will fail if it's unable
+ * to flush the connection.
+ */
+ conn->nonblocking = FALSE;
+
/*
* Close the connection, reset all transient state, flush I/O buffers.
*/
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.87 2000/01/18 06:09:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.88 2000/01/24 02:12:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int
PQsetnonblocking(PGconn *conn, int arg)
{
- int fcntlarg;
arg = (arg == TRUE) ? 1 : 0;
/* early out if the socket is already in the state requested */
* _from_ or _to_ blocking mode, either way we can block them.
*/
/* if we are going from blocking to non-blocking flush here */
- if (!pqIsnonblocking(conn) && pqFlush(conn))
- return (-1);
-
-
-#ifdef USE_SSL
- if (conn->ssl)
- {
- printfPQExpBuffer(&conn->errorMessage,
- "PQsetnonblocking() -- not supported when using SSL\n");
- return (-1);
- }
-#endif /* USE_SSL */
-
-#ifndef WIN32
- fcntlarg = fcntl(conn->sock, F_GETFL, 0);
- if (fcntlarg == -1)
- return (-1);
-
- if ((arg == TRUE &&
- fcntl(conn->sock, F_SETFL, fcntlarg | O_NONBLOCK) == -1) ||
- (arg == FALSE &&
- fcntl(conn->sock, F_SETFL, fcntlarg & ~O_NONBLOCK) == -1))
-#else
- fcntlarg = arg;
- if (ioctlsocket(conn->sock, FIONBIO, &fcntlarg) != 0)
-#endif
- {
- printfPQExpBuffer(&conn->errorMessage,
- "PQsetblocking() -- unable to set nonblocking status to %s\n",
- arg == TRUE ? "TRUE" : "FALSE");
+ if (pqFlush(conn))
return (-1);
- }
conn->nonblocking = arg;
- /* if we are going from non-blocking to blocking flush here */
- if (pqIsnonblocking(conn) && pqFlush(conn))
- return (-1);
-
return (0);
}