Remove old, broken code for query_limit(), assert_enable(),

assert_test() functions --- these weren't accomplishing much except to
render the whole module un-loadable ...
This commit is contained in:
Tom Lane 2000-11-22 19:34:49 +00:00
parent dc3fb8b152
commit 89345945d9
4 changed files with 4 additions and 86 deletions

View File

@ -4,13 +4,6 @@ Copyright (C) 1999, Massimo Dal Zotto <dz@cs.unitn.it>
This software is distributed under the GNU General Public License This software is distributed under the GNU General Public License
either version 2, or (at your option) any later version. either version 2, or (at your option) any later version.
query_limit(n)
sets a limit on the maximum numbers of query returned from
a backend. It can be used to limit the result size retrieved
by the application for poor input data or to avoid accidental
table product while playying with sql.
backend_pid() backend_pid()
return the pid of our corresponding backend. return the pid of our corresponding backend.
@ -27,17 +20,7 @@ unlisten(relname)
min(x,y) min(x,y)
max(x,y) max(x,y)
return the min or max bteween two integers. return the min or max of two integers.
assert_enable(bool)
enable/disable assert checkings in the backend, if it has been
compiled with USE_ASSERT_CHECKING.
assert_test(bool)
test the assert enable/disable code, if the backend has been
compiled with ASSERT_CHECKING_TEST.
-- --
Massimo Dal Zotto <dz@cs.unitn.it> Massimo Dal Zotto <dz@cs.unitn.it>

View File

@ -9,13 +9,13 @@
* either version 2, or (at your option) any later version. * either version 2, or (at your option) any later version.
*/ */
#include "postgres.h"
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include "postgres.h"
#include "access/heapam.h" #include "access/heapam.h"
#include "access/htup.h" #include "access/htup.h"
#include "access/relscan.h" #include "access/relscan.h"
@ -23,6 +23,7 @@
#include "access/tupdesc.h" #include "access/tupdesc.h"
#include "catalog/catname.h" #include "catalog/catname.h"
#include "catalog/pg_listener.h" #include "catalog/pg_listener.h"
#include "commands/async.h"
#include "fmgr.h" #include "fmgr.h"
#include "storage/lmgr.h" #include "storage/lmgr.h"
#include "utils/fmgroids.h" #include "utils/fmgroids.h"
@ -35,20 +36,6 @@
#undef MIN #undef MIN
#define MIN(x,y) ((x)<=(y) ? (x) : (y)) #define MIN(x,y) ((x)<=(y) ? (x) : (y))
extern int ExecutorLimit(int limit);
extern void Async_Unlisten(char *relname, int pid);
extern int assertTest(int val);
#ifdef ASSERT_CHECKING_TEST
extern int assertEnable(int val);
#endif
int
query_limit(int limit)
{
return ExecutorLimit(limit);
}
int int
backend_pid() backend_pid()
@ -128,22 +115,6 @@ active_listeners(text *relname)
return count; return count;
} }
#ifdef USE_ASSERT_CHECKING
int
assert_enable(int val)
{
return assertEnable(val);
}
#ifdef ASSERT_CHECKING_TEST
int
assert_test(int val)
{
return assertTest(val);
}
#endif
#endif
/* end of file */ /* end of file */

View File

@ -1,28 +1,10 @@
#ifndef MISC_UTILS_H #ifndef MISC_UTILS_H
#define MISC_UTILS_H #define MISC_UTILS_H
int query_limit(int limit);
int backend_pid(void); int backend_pid(void);
int unlisten(char *relname); int unlisten(char *relname);
int max(int x, int y); int max(int x, int y);
int min(int x, int y); int min(int x, int y);
int active_listeners(text *relname); int active_listeners(text *relname);
#ifdef USE_ASSERT_CHECKING
int assert_enable(int val);
#ifdef ASSERT_CHECKING_TEST
int assert_test(int val);
#endif #endif
#endif
#endif
/*
* Local Variables:
* tab-width: 4
* c-indent-level: 4
* c-basic-offset: 4
* End:
*/

View File

@ -7,12 +7,6 @@
-- This file is distributed under the GNU General Public License -- This file is distributed under the GNU General Public License
-- either version 2, or (at your option) any later version. -- either version 2, or (at your option) any later version.
-- Set the maximum number of tuples returned by a single query.
--
create function query_limit(int4) returns int4
as 'MODULE_PATHNAME'
language 'C';
-- Return the pid of the backend. -- Return the pid of the backend.
-- --
create function backend_pid() returns int4 create function backend_pid() returns int4
@ -49,16 +43,4 @@ create function active_listeners(text) returns int4
as 'MODULE_PATHNAME' as 'MODULE_PATHNAME'
language 'C'; language 'C';
-- Enable/disable Postgres assert checking.
--
create function assert_enable(int4) returns int4
as 'MODULE_PATHNAME'
language 'C';
-- Test Postgres assert checking.
--
-- create function assert_test(int4) returns int4
-- as 'MODULE_PATHNAME'
-- language 'C';
-- end of file -- end of file