Allow port numbers 32k - 64k.
authorBruce Momjian <bruce@momjian.us>
Wed, 7 Jul 1999 17:17:50 +0000 (17:17 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 7 Jul 1999 17:17:50 +0000 (17:17 +0000)
doc/TODO
src/backend/libpq/pqcomm.c
src/backend/postmaster/postmaster.c
src/include/libpq/libpq.h

index 2866f14c8e37f5cc14d919439a405d9b9428deda..20f7330f4d658ecd70f0b4ebc434743336f1c3c4 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -30,6 +30,7 @@ PARSER
 * Array index references without table name cause problems
 * Update table SET table.value = 3 fails
 * Creating index of timestamp fails
+* SELECT foo UNION SELECT foo is incorrectly simplified to SELECT foo
 
 VIEWS
 
@@ -207,8 +208,8 @@ MISC
   places, like GROUP BY, UNIQUE, index processing, etc.
 * improve dynamic memory allocation by introducing tuple-context memory
   allocation
-* add pooled memory allocation where allocations are freed only as a group
-
+* fix indexscan() so it does leak memory by not requiring caller to free
+* fix memory leak in cache code when non-existant table is refer
 
 SOURCE CODE
 -----------
index a1f3b58a57fd5c9b3410c32670a623621ad630db..945da3cb60db8beea834e880d1a31532607cf1bd 100644 (file)
@@ -181,7 +181,7 @@ StreamDoUnlink()
  */
 
 int
-StreamServerPort(char *hostName, short portName, int *fdP)
+StreamServerPort(char *hostName, unsigned short portName, int *fdP)
 {
        SockAddr        saddr;
        int                     fd,
index 34a26a2ea8d32ac7f5033ff2314efbb9e729dff3..33917f09b818c0b1264c24560a5fee7ba53d571d 100644 (file)
@@ -130,7 +130,7 @@ static Dllist *BackendList;
 /* list of ports associated with still open, but incomplete connections */
 static Dllist *PortList;
 
-static short PostPortName = -1;
+static unsigned short PostPortName = 0;
 static short ActiveBackends = FALSE;
 
  /*
@@ -240,7 +240,7 @@ extern int  optind,
  */
 static void pmdaemonize(void);
 static Port *ConnCreate(int serverFd);
-static void reset_shared(short port);
+static void reset_shared(unsigned short port);
 static void pmdie(SIGNAL_ARGS);
 static void reaper(SIGNAL_ARGS);
 static void dumpstatus(SIGNAL_ARGS);
@@ -502,7 +502,7 @@ PostmasterMain(int argc, char *argv[])
                                break;
                        case 'p':
                                /* Set PGPORT by hand. */
-                               PostPortName = (short) atoi(optarg);
+                               PostPortName = (unsigned short) atoi(optarg);
                                break;
                        case 'S':
 
@@ -534,8 +534,8 @@ PostmasterMain(int argc, char *argv[])
        /*
         * Select default values for switches where needed
         */
-       if (PostPortName == -1)
-               PostPortName = pq_getport();
+       if (PostPortName == 0)
+               PostPortName = (unsigned short)pq_getport();
 
        /*
         * Check for invalid combinations of switches
@@ -1050,7 +1050,7 @@ ConnCreate(int serverFd)
  * reset_shared -- reset shared memory and semaphores
  */
 static void
-reset_shared(short port)
+reset_shared(unsigned short port)
 {
        ipc_key = port * 1000 + shmem_seq * 100;
        CreateSharedMemoryAndSemaphores(ipc_key, MaxBackends);
index 0dba22897a71517e9319368a95e590da38c3faf9..449e2f8b13ed8eba147d6401cfa8694189859111 100644 (file)
@@ -234,7 +234,7 @@ extern int32 pqtest(struct varlena * vlena);
 /*
  * prototypes for functions in pqcomm.c
  */
-extern int     StreamServerPort(char *hostName, short portName, int *fdP);
+extern int     StreamServerPort(char *hostName, unsigned short portName, int *fdP);
 extern int     StreamConnection(int server_fd, Port *port);
 extern void StreamClose(int sock);
 extern void pq_init(void);