Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
da5aba10
Commit
da5aba10
authored
Jan 24, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Ops parameter from STATRELID cache lookup, for Tom Lane and
optimizer.
parent
4d564c5b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
73 deletions
+61
-73
doc/src/sgml/oper.sgml
doc/src/sgml/oper.sgml
+1
-1
src/backend/catalog/indexing.c
src/backend/catalog/indexing.c
+7
-14
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+2
-2
src/backend/utils/cache/syscache.c
src/backend/utils/cache/syscache.c
+8
-8
src/include/catalog/catversion.h
src/include/catalog/catversion.h
+2
-2
src/include/catalog/indexing.h
src/include/catalog/indexing.h
+5
-5
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+34
-4
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-exec.c
+2
-37
No files found.
doc/src/sgml/oper.sgml
View file @
da5aba10
...
@@ -411,7 +411,7 @@ logical union
...
@@ -411,7 +411,7 @@ logical union
<ROW>
<ROW>
<ENTRY> !~* </ENTRY>
<ENTRY> !~* </ENTRY>
<ENTRY>Does not match (regex), case insensitive</ENTRY>
<ENTRY>Does not match (regex), case insensitive</ENTRY>
<ENTRY>'thomas' !~ '.*vadim.*'</ENTRY>
<ENTRY>'thomas' !~
*
'.*vadim.*'</ENTRY>
</ROW>
</ROW>
</TBODY>
</TBODY>
</TGROUP>
</TGROUP>
...
...
src/backend/catalog/indexing.c
View file @
da5aba10
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.5
6 2000/01/10 16:13:12
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.5
7 2000/01/24 02:12:54
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -64,7 +64,7 @@ char *Name_pg_rewrite_indices[Num_pg_rewrite_indices] =
...
@@ -64,7 +64,7 @@ char *Name_pg_rewrite_indices[Num_pg_rewrite_indices] =
char
*
Name_pg_shadow_indices
[
Num_pg_shadow_indices
]
=
char
*
Name_pg_shadow_indices
[
Num_pg_shadow_indices
]
=
{
ShadowNameIndex
,
ShadowSysidIndex
};
{
ShadowNameIndex
,
ShadowSysidIndex
};
char
*
Name_pg_statistic_indices
[
Num_pg_statistic_indices
]
=
char
*
Name_pg_statistic_indices
[
Num_pg_statistic_indices
]
=
{
StatisticRelidAttnum
Op
Index
};
{
StatisticRelidAttnumIndex
};
char
*
Name_pg_trigger_indices
[
Num_pg_trigger_indices
]
=
char
*
Name_pg_trigger_indices
[
Num_pg_trigger_indices
]
=
{
TriggerRelidIndex
,
TriggerConstrNameIndex
,
TriggerConstrRelidIndex
};
{
TriggerRelidIndex
,
TriggerConstrNameIndex
,
TriggerConstrRelidIndex
};
char
*
Name_pg_type_indices
[
Num_pg_type_indices
]
=
char
*
Name_pg_type_indices
[
Num_pg_type_indices
]
=
...
@@ -926,13 +926,12 @@ ShadowSysidIndexScan(Relation heapRelation, int4 sysId)
...
@@ -926,13 +926,12 @@ ShadowSysidIndexScan(Relation heapRelation, int4 sysId)
HeapTuple
HeapTuple
StatisticRelidAttnum
Op
IndexScan
(
Relation
heapRelation
,
StatisticRelidAttnumIndexScan
(
Relation
heapRelation
,
Oid
relId
,
Oid
relId
,
AttrNumber
attNum
,
AttrNumber
attNum
)
Oid
op
)
{
{
Relation
idesc
;
Relation
idesc
;
ScanKeyData
skey
[
3
];
ScanKeyData
skey
[
2
];
HeapTuple
tuple
;
HeapTuple
tuple
;
ScanKeyEntryInitialize
(
&
skey
[
0
],
ScanKeyEntryInitialize
(
&
skey
[
0
],
...
@@ -947,14 +946,8 @@ StatisticRelidAttnumOpIndexScan(Relation heapRelation,
...
@@ -947,14 +946,8 @@ StatisticRelidAttnumOpIndexScan(Relation heapRelation,
(
RegProcedure
)
F_INT2EQ
,
(
RegProcedure
)
F_INT2EQ
,
Int16GetDatum
(
attNum
));
Int16GetDatum
(
attNum
));
ScanKeyEntryInitialize
(
&
skey
[
2
],
idesc
=
index_openr
(
StatisticRelidAttnumIndex
);
(
bits16
)
0x0
,
tuple
=
CatalogIndexFetchTuple
(
heapRelation
,
idesc
,
skey
,
2
);
(
AttrNumber
)
3
,
(
RegProcedure
)
F_OIDEQ
,
ObjectIdGetDatum
(
op
));
idesc
=
index_openr
(
StatisticRelidAttnumOpIndex
);
tuple
=
CatalogIndexFetchTuple
(
heapRelation
,
idesc
,
skey
,
3
);
index_close
(
idesc
);
index_close
(
idesc
);
...
...
src/backend/utils/adt/selfuncs.c
View file @
da5aba10
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.5
1 2000/01/23 03:43:23 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.5
2 2000/01/24 02:12:55 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -609,7 +609,7 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid opid, Oid typid,
...
@@ -609,7 +609,7 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid opid, Oid typid,
tuple
=
SearchSysCacheTuple
(
STATRELID
,
tuple
=
SearchSysCacheTuple
(
STATRELID
,
ObjectIdGetDatum
(
relid
),
ObjectIdGetDatum
(
relid
),
Int16GetDatum
((
int16
)
attnum
),
Int16GetDatum
((
int16
)
attnum
),
opid
,
0
,
0
);
0
);
if
(
!
HeapTupleIsValid
(
tuple
))
if
(
!
HeapTupleIsValid
(
tuple
))
{
{
...
...
src/backend/utils/cache/syscache.c
View file @
da5aba10
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.4
5 2000/01/23 03:43:24 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.4
6 2000/01/24 02:12:56 momjian
Exp $
*
*
* NOTES
* NOTES
* These routines allow the parser/planner/executor to perform
* These routines allow the parser/planner/executor to perform
...
@@ -54,7 +54,7 @@ typedef HeapTuple (*ScanFunc) ();
...
@@ -54,7 +54,7 @@ typedef HeapTuple (*ScanFunc) ();
Add your new cache to the list in include/utils/syscache.h. Keep
Add your new cache to the list in include/utils/syscache.h. Keep
the list sorted alphabetically and adjust the cache numbers
the list sorted alphabetically and adjust the cache numbers
accordingly.
accordingly.
Add your entry to the cacheinfo[] array below. All cache lists are
Add your entry to the cacheinfo[] array below. All cache lists are
alphabetical, so add it in the proper place. Specify the relation
alphabetical, so add it in the proper place. Specify the relation
name, number of arguments, argument names, size of tuple, index lookup
name, number of arguments, argument names, size of tuple, index lookup
...
@@ -75,7 +75,7 @@ typedef HeapTuple (*ScanFunc) ();
...
@@ -75,7 +75,7 @@ typedef HeapTuple (*ScanFunc) ();
Finally, any place your relation gets heap_insert() or
Finally, any place your relation gets heap_insert() or
heap_update calls, include code to do a CatalogIndexInsert() to update
heap_update calls, include code to do a CatalogIndexInsert() to update
the system indexes. The heap_* calls do not update indexes.
the system indexes. The heap_* calls do not update indexes.
bjm 1999/11/22
bjm 1999/11/22
---------------------------------------------------------------------------
---------------------------------------------------------------------------
...
@@ -360,16 +360,16 @@ NULL,NULL
...
@@ -360,16 +360,16 @@ NULL,NULL
/* ShadowSysidIndex,
/* ShadowSysidIndex,
ShadowSysidIndexScan*/
},
ShadowSysidIndexScan*/
},
{
StatisticRelationName
,
/* STATRELID */
{
StatisticRelationName
,
/* STATRELID */
3
,
2
,
{
{
Anum_pg_statistic_starelid
,
Anum_pg_statistic_starelid
,
Anum_pg_statistic_staattnum
,
Anum_pg_statistic_staattnum
,
Anum_pg_statistic_staop
,
0
,
0
0
},
},
offsetof
(
FormData_pg_statistic
,
stacommonval
),
offsetof
(
FormData_pg_statistic
,
stacommonval
),
StatisticRelidAttnum
Op
Index
,
StatisticRelidAttnumIndex
,
(
ScanFunc
)
StatisticRelidAttnum
Op
IndexScan
},
(
ScanFunc
)
StatisticRelidAttnumIndexScan
},
{
TypeRelationName
,
/* TYPENAME */
{
TypeRelationName
,
/* TYPENAME */
1
,
1
,
{
{
...
@@ -520,7 +520,7 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
...
@@ -520,7 +520,7 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
get_temp_rel_by_username
(
DatumGetPointer
(
key1
)))
!=
NULL
)
get_temp_rel_by_username
(
DatumGetPointer
(
key1
)))
!=
NULL
)
key1
=
PointerGetDatum
(
nontemp_relname
);
key1
=
PointerGetDatum
(
nontemp_relname
);
}
}
tp
=
SearchSysCache
(
SysCache
[
cacheId
],
key1
,
key2
,
key3
,
key4
);
tp
=
SearchSysCache
(
SysCache
[
cacheId
],
key1
,
key2
,
key3
,
key4
);
if
(
!
HeapTupleIsValid
(
tp
))
if
(
!
HeapTupleIsValid
(
tp
))
{
{
...
...
src/include/catalog/catversion.h
View file @
da5aba10
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* 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 $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -52,6 +52,6 @@
...
@@ -52,6 +52,6 @@
*/
*/
/* yyyymmddN */
/* yyyymmddN */
#define CATALOG_VERSION_NO 2000012
2
1
#define CATALOG_VERSION_NO 2000012
5
1
#endif
#endif
src/include/catalog/indexing.h
View file @
da5aba10
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: indexing.h,v 1.3
3 2000/01/10 16:13:20
momjian Exp $
* $Id: indexing.h,v 1.3
4 2000/01/24 02:12:57
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
#define RewriteRulenameIndex "pg_rewrite_rulename_index"
#define RewriteRulenameIndex "pg_rewrite_rulename_index"
#define ShadowNameIndex "pg_shadow_name_index"
#define ShadowNameIndex "pg_shadow_name_index"
#define ShadowSysidIndex "pg_shadow_sysid_index"
#define ShadowSysidIndex "pg_shadow_sysid_index"
#define StatisticRelidAttnum
OpIndex "pg_statistic_relid_att_op
_index"
#define StatisticRelidAttnum
Index "pg_statistic_relid_att
_index"
#define TriggerConstrNameIndex "pg_trigger_tgconstrname_index"
#define TriggerConstrNameIndex "pg_trigger_tgconstrname_index"
#define TriggerConstrRelidIndex "pg_trigger_tgconstrrelid_index"
#define TriggerConstrRelidIndex "pg_trigger_tgconstrrelid_index"
#define TriggerRelidIndex "pg_trigger_tgrelid_index"
#define TriggerRelidIndex "pg_trigger_tgrelid_index"
...
@@ -153,8 +153,8 @@ extern HeapTuple RewriteRulenameIndexScan(Relation heapRelation,
...
@@ -153,8 +153,8 @@ extern HeapTuple RewriteRulenameIndexScan(Relation heapRelation,
char
*
ruleName
);
char
*
ruleName
);
extern
HeapTuple
ShadowNameIndexScan
(
Relation
heapRelation
,
char
*
useName
);
extern
HeapTuple
ShadowNameIndexScan
(
Relation
heapRelation
,
char
*
useName
);
extern
HeapTuple
ShadowSysidIndexScan
(
Relation
heapRelation
,
int4
sysId
);
extern
HeapTuple
ShadowSysidIndexScan
(
Relation
heapRelation
,
int4
sysId
);
extern
HeapTuple
StatisticRelidAttnum
Op
IndexScan
(
Relation
heapRelation
,
extern
HeapTuple
StatisticRelidAttnumIndexScan
(
Relation
heapRelation
,
Oid
relId
,
AttrNumber
attNum
,
Oid
op
);
Oid
relId
,
AttrNumber
attNum
);
extern
HeapTuple
TypeNameIndexScan
(
Relation
heapRelation
,
char
*
typeName
);
extern
HeapTuple
TypeNameIndexScan
(
Relation
heapRelation
,
char
*
typeName
);
extern
HeapTuple
TypeOidIndexScan
(
Relation
heapRelation
,
Oid
typeId
);
extern
HeapTuple
TypeOidIndexScan
(
Relation
heapRelation
,
Oid
typeId
);
...
@@ -202,7 +202,7 @@ DECLARE_UNIQUE_INDEX(pg_rewrite_rulename_index on pg_rewrite using btree(rulenam
...
@@ -202,7 +202,7 @@ DECLARE_UNIQUE_INDEX(pg_rewrite_rulename_index on pg_rewrite using btree(rulenam
xDECLARE_UNIQUE_INDEX(pg_shadow_name_index on pg_shadow using btree(usename name_ops));
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));
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_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_tgconstrrelid_index
on
pg_trigger
using
btree
(
tgconstrrelid
oid_ops
));
DECLARE_INDEX
(
pg_trigger_tgrelid_index
on
pg_trigger
using
btree
(
tgrelid
oid_ops
));
DECLARE_INDEX
(
pg_trigger_tgrelid_index
on
pg_trigger
using
btree
(
tgrelid
oid_ops
));
...
...
src/interfaces/libpq/fe-connect.c
View file @
da5aba10
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.11
4 2000/01/23 01:27:39 petere
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.11
5 2000/01/24 02:12:58 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -391,7 +391,6 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
...
@@ -391,7 +391,6 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
PGconn
*
conn
;
PGconn
*
conn
;
char
*
tmp
;
/* An error message from some service we call. */
char
*
tmp
;
/* An error message from some service we call. */
bool
error
=
FALSE
;
/* We encountered an error. */
bool
error
=
FALSE
;
/* We encountered an error. */
int
i
;
conn
=
makeEmptyPGconn
();
conn
=
makeEmptyPGconn
();
if
(
conn
==
NULL
)
if
(
conn
==
NULL
)
...
@@ -585,6 +584,30 @@ update_db_info(PGconn *conn)
...
@@ -585,6 +584,30 @@ update_db_info(PGconn *conn)
return
0
;
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 -
* connectNoDelay -
* Sets the TCP_NODELAY socket option.
* Sets the TCP_NODELAY socket option.
...
@@ -755,7 +778,7 @@ connectDBStart(PGconn *conn)
...
@@ -755,7 +778,7 @@ connectDBStart(PGconn *conn)
* Ewan Mellor <eem21@cam.ac.uk>.
* Ewan Mellor <eem21@cam.ac.uk>.
* ---------- */
* ---------- */
#if (!defined(WIN32) || defined(WIN32_NON_BLOCKING_CONNECTIONS)) && !defined(USE_SSL)
#if (!defined(WIN32) || defined(WIN32_NON_BLOCKING_CONNECTIONS)) && !defined(USE_SSL)
if
(
PQsetnonblocking
(
conn
,
TRUE
)
!
=
0
)
if
(
connectMakeNonblocking
(
conn
)
=
=
0
)
goto
connect_errReturn
;
goto
connect_errReturn
;
#endif
#endif
...
@@ -868,7 +891,7 @@ connectDBStart(PGconn *conn)
...
@@ -868,7 +891,7 @@ connectDBStart(PGconn *conn)
/* This makes the connection non-blocking, for all those cases which forced us
/* This makes the connection non-blocking, for all those cases which forced us
not to do it above. */
not to do it above. */
#if (defined(WIN32) && !defined(WIN32_NON_BLOCKING_CONNECTIONS)) || defined(USE_SSL)
#if (defined(WIN32) && !defined(WIN32_NON_BLOCKING_CONNECTIONS)) || defined(USE_SSL)
if
(
PQsetnonblocking
(
conn
,
TRUE
)
!
=
0
)
if
(
connectMakeNonblocking
(
conn
)
=
=
0
)
goto
connect_errReturn
;
goto
connect_errReturn
;
#endif
#endif
...
@@ -1786,6 +1809,13 @@ closePGconn(PGconn *conn)
...
@@ -1786,6 +1809,13 @@ closePGconn(PGconn *conn)
(
void
)
pqFlush
(
conn
);
(
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.
* Close the connection, reset all transient state, flush I/O buffers.
*/
*/
...
...
src/interfaces/libpq/fe-exec.c
View file @
da5aba10
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.8
7 2000/01/18 06:09:24
momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.8
8 2000/01/24 02:12:58
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -2116,7 +2116,6 @@ PQgetisnull(const PGresult *res, int tup_num, int field_num)
...
@@ -2116,7 +2116,6 @@ PQgetisnull(const PGresult *res, int tup_num, int field_num)
int
int
PQsetnonblocking
(
PGconn
*
conn
,
int
arg
)
PQsetnonblocking
(
PGconn
*
conn
,
int
arg
)
{
{
int
fcntlarg
;
arg
=
(
arg
==
TRUE
)
?
1
:
0
;
arg
=
(
arg
==
TRUE
)
?
1
:
0
;
/* early out if the socket is already in the state requested */
/* early out if the socket is already in the state requested */
...
@@ -2131,45 +2130,11 @@ PQsetnonblocking(PGconn *conn, int arg)
...
@@ -2131,45 +2130,11 @@ PQsetnonblocking(PGconn *conn, int arg)
* _from_ or _to_ blocking mode, either way we can block them.
* _from_ or _to_ blocking mode, either way we can block them.
*/
*/
/* if we are going from blocking to non-blocking flush here */
/* if we are going from blocking to non-blocking flush here */
if
(
!
pqIsnonblocking
(
conn
)
&&
pqFlush
(
conn
))
if
(
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"
);
return
(
-
1
);
return
(
-
1
);
}
conn
->
nonblocking
=
arg
;
conn
->
nonblocking
=
arg
;
/* if we are going from non-blocking to blocking flush here */
if
(
pqIsnonblocking
(
conn
)
&&
pqFlush
(
conn
))
return
(
-
1
);
return
(
0
);
return
(
0
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment