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
baeb8790
Commit
baeb8790
authored
Nov 10, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix case issues with quotes.
parent
0f367cf8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
72 deletions
+106
-72
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+42
-39
src/include/c.h
src/include/c.h
+4
-4
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+39
-26
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-exec.c
+21
-3
No files found.
src/backend/postmaster/postmaster.c
View file @
baeb8790
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.6
0 1997/11/07 20:51:47
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.6
1 1997/11/10 05:10:21
momjian Exp $
*
* NOTES
*
...
...
@@ -150,7 +150,7 @@ static int Reinit = 1;
static
int
SendStop
=
0
;
static
int
NetServer
=
0
;
/* if not zero, postmaster listen for
non-local connections */
*
non-local connections */
static
int
MultiplexedBackends
=
0
;
static
int
MultiplexedBackendPort
;
...
...
@@ -487,11 +487,13 @@ usage(const char *progname)
static
int
ServerLoop
(
void
)
{
fd_set
rmask
,
basemask
;
fd_set
rmask
,
basemask
;
int
nSockets
,
nSelected
,
status
,
oldFd
,
newFd
;
oldFd
,
newFd
;
Dlelem
*
next
,
*
curr
;
...
...
@@ -1299,8 +1301,10 @@ ExitPostmaster(int status)
* Not sure of the semantics here. When the Postmaster dies, should
* the backends all be killed? probably not.
*/
if
(
ServerSock_INET
!=
INVALID_SOCK
)
close
(
ServerSock_INET
);
if
(
ServerSock_UNIX
!=
INVALID_SOCK
)
close
(
ServerSock_UNIX
);
if
(
ServerSock_INET
!=
INVALID_SOCK
)
close
(
ServerSock_INET
);
if
(
ServerSock_UNIX
!=
INVALID_SOCK
)
close
(
ServerSock_UNIX
);
exitpg
(
status
);
}
...
...
@@ -1321,4 +1325,3 @@ dumpstatus(SIGNAL_ARGS)
curr
=
DLGetSucc
(
curr
);
}
}
src/include/c.h
View file @
baeb8790
...
...
@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: c.h,v 1.2
6 1997/10/30 23:36:56
momjian Exp $
* $Id: c.h,v 1.2
7 1997/11/10 05:10:34
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
src/interfaces/libpq/fe-connect.c
View file @
baeb8790
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.4
3 1997/11/07 20:52:1
5 momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.4
4 1997/11/10 05:10:4
5 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -341,7 +341,8 @@ PQsetdb(const char *pghost, const char *pgport, const char *pgoptions, const cha
if
(
!
pghost
||
pghost
[
0
]
==
'\0'
)
{
conn
->
pghost
=
NULL
;
if
(
tmp
=
getenv
(
"PGHOST"
))
conn
->
pghost
=
strdup
(
tmp
);
if
(
tmp
=
getenv
(
"PGHOST"
))
conn
->
pghost
=
strdup
(
tmp
);
}
else
conn
->
pghost
=
strdup
(
pghost
);
...
...
@@ -413,11 +414,20 @@ PQsetdb(const char *pghost, const char *pgport, const char *pgoptions, const cha
{
if
(((
tmp
=
(
char
*
)
dbName
)
&&
(
dbName
[
0
]
!=
'\0'
))
||
((
tmp
=
getenv
(
"PGDATABASE"
))))
{
conn
->
dbName
=
strdup
(
tmp
);
}
else
conn
->
dbName
=
strdup
(
conn
->
pguser
);
/*
* if the table name is surrounded by double-quotes, then
* don't convert case
*/
if
(
*
conn
->
dbName
==
'"'
)
{
strcpy
(
conn
->
dbName
,
conn
->
dbName
+
1
);
*
(
conn
->
dbName
+
strlen
(
conn
->
dbName
)
-
1
)
=
'\0'
;
}
else
for
(
i
=
0
;
conn
->
dbName
[
i
];
i
++
)
if
(
isupper
(
conn
->
dbName
[
i
]))
conn
->
dbName
[
i
]
=
tolower
(
conn
->
dbName
[
i
]);
...
...
@@ -470,7 +480,9 @@ connectDB(PGconn *conn)
MsgType
msgtype
;
int
laddrlen
=
sizeof
(
struct
sockaddr
);
Port
*
port
=
conn
->
port
;
int
portno
,
family
,
len
;
int
portno
,
family
,
len
;
/*
* Initialize the startup packet.
...
...
@@ -519,7 +531,7 @@ connectDB(PGconn *conn)
}
else
{
len
=
UNIXSOCK_PATH
(
port
->
raddr
.
un
,
portno
);
len
=
UNIXSOCK_PATH
(
port
->
raddr
.
un
,
portno
);
}
/* connect to the server */
if
((
port
->
sock
=
socket
(
family
,
SOCK_STREAM
,
0
))
<
0
)
...
...
@@ -529,7 +541,7 @@ connectDB(PGconn *conn)
errno
,
strerror
(
errno
));
goto
connect_errReturn
;
}
if
(
connect
(
port
->
sock
,
(
struct
sockaddr
*
)
&
port
->
raddr
,
len
)
<
0
)
if
(
connect
(
port
->
sock
,
(
struct
sockaddr
*
)
&
port
->
raddr
,
len
)
<
0
)
{
(
void
)
sprintf
(
conn
->
errorMessage
,
"connectDB() failed: Is the postmaster running at '%s' on port '%s'?
\n
"
,
...
...
@@ -780,6 +792,7 @@ packetSend(Port *port,
bool
nonBlocking
)
{
PacketLen
doneLen
=
write
(
port
->
sock
,
buf
,
len
);
if
(
doneLen
<
len
)
{
return
(
STATUS_ERROR
);
...
...
src/interfaces/libpq/fe-exec.c
View file @
baeb8790
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.
39 1997/11/03 04:21:49
momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.
40 1997/11/10 05:10:50
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -17,6 +17,7 @@
#include <signal.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include "postgres.h"
#include "libpq/pqcomm.h"
#include "libpq/pqsignal.h"
...
...
@@ -31,12 +32,14 @@
#ifdef TIOCGWINSZ
struct
winsize
screen_size
;
#else
struct
winsize
{
int
ws_row
;
int
ws_col
;
}
screen_size
;
#endif
/* the rows array in a PGresGroup has to grow to accommodate the rows */
...
...
@@ -1674,6 +1677,7 @@ int
PQfnumber
(
PGresult
*
res
,
const
char
*
field_name
)
{
int
i
;
char
*
field_case
;
if
(
!
res
)
{
...
...
@@ -1686,13 +1690,27 @@ PQfnumber(PGresult *res, const char *field_name)
res
->
attDescs
==
NULL
)
return
-
1
;
field_case
=
strdup
(
field_name
);
if
(
*
field_case
==
'"'
)
{
strcpy
(
field_case
,
field_case
+
1
);
*
(
field_case
+
strlen
(
field_case
)
-
1
)
=
'\0'
;
}
else
for
(
i
=
0
;
field_case
;
i
++
)
if
(
isupper
(
field_case
[
i
]))
field_case
[
i
]
=
tolower
(
field_case
[
i
]);
for
(
i
=
0
;
i
<
res
->
numAttributes
;
i
++
)
{
if
(
strcasecmp
(
field_name
,
res
->
attDescs
[
i
].
name
)
==
0
)
if
(
strcmp
(
field_name
,
res
->
attDescs
[
i
].
name
)
==
0
)
{
free
(
field_case
);
return
i
;
}
}
free
(
field_case
);
return
-
1
;
}
Oid
...
...
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