Skip to content

Commit 8934594

Browse files
committed
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 ...
1 parent dc3fb8b commit 8934594

File tree

4 files changed

+4
-86
lines changed

4 files changed

+4
-86
lines changed

contrib/miscutil/README.misc_utils

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ Copyright (C) 1999, Massimo Dal Zotto <dz@cs.unitn.it>
44
This software is distributed under the GNU General Public License
55
either version 2, or (at your option) any later version.
66

7-
query_limit(n)
8-
9-
sets a limit on the maximum numbers of query returned from
10-
a backend. It can be used to limit the result size retrieved
11-
by the application for poor input data or to avoid accidental
12-
table product while playying with sql.
13-
147
backend_pid()
158

169
return the pid of our corresponding backend.
@@ -27,17 +20,7 @@ unlisten(relname)
2720
min(x,y)
2821
max(x,y)
2922

30-
return the min or max bteween two integers.
31-
32-
assert_enable(bool)
33-
34-
enable/disable assert checkings in the backend, if it has been
35-
compiled with USE_ASSERT_CHECKING.
36-
37-
assert_test(bool)
38-
39-
test the assert enable/disable code, if the backend has been
40-
compiled with ASSERT_CHECKING_TEST.
23+
return the min or max of two integers.
4124

4225
--
4326
Massimo Dal Zotto <dz@cs.unitn.it>

contrib/miscutil/misc_utils.c

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,21 @@
99
* either version 2, or (at your option) any later version.
1010
*/
1111

12+
#include "postgres.h"
13+
1214
#include <unistd.h>
1315
#include <signal.h>
1416
#include <string.h>
1517
#include <errno.h>
1618

17-
#include "postgres.h"
18-
1919
#include "access/heapam.h"
2020
#include "access/htup.h"
2121
#include "access/relscan.h"
2222
#include "access/skey.h"
2323
#include "access/tupdesc.h"
2424
#include "catalog/catname.h"
2525
#include "catalog/pg_listener.h"
26+
#include "commands/async.h"
2627
#include "fmgr.h"
2728
#include "storage/lmgr.h"
2829
#include "utils/fmgroids.h"
@@ -35,20 +36,6 @@
3536
#undef MIN
3637
#define MIN(x,y) ((x)<=(y) ? (x) : (y))
3738

38-
extern int ExecutorLimit(int limit);
39-
extern void Async_Unlisten(char *relname, int pid);
40-
extern int assertTest(int val);
41-
42-
#ifdef ASSERT_CHECKING_TEST
43-
extern int assertEnable(int val);
44-
45-
#endif
46-
47-
int
48-
query_limit(int limit)
49-
{
50-
return ExecutorLimit(limit);
51-
}
5239

5340
int
5441
backend_pid()
@@ -128,22 +115,6 @@ active_listeners(text *relname)
128115
return count;
129116
}
130117

131-
#ifdef USE_ASSERT_CHECKING
132-
int
133-
assert_enable(int val)
134-
{
135-
return assertEnable(val);
136-
}
137-
138-
#ifdef ASSERT_CHECKING_TEST
139-
int
140-
assert_test(int val)
141-
{
142-
return assertTest(val);
143-
}
144-
145-
#endif
146-
#endif
147118

148119
/* end of file */
149120

contrib/miscutil/misc_utils.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
#ifndef MISC_UTILS_H
22
#define MISC_UTILS_H
33

4-
int query_limit(int limit);
54
int backend_pid(void);
65
int unlisten(char *relname);
76
int max(int x, int y);
87
int min(int x, int y);
98
int active_listeners(text *relname);
109

11-
#ifdef USE_ASSERT_CHECKING
12-
int assert_enable(int val);
13-
14-
#ifdef ASSERT_CHECKING_TEST
15-
int assert_test(int val);
16-
17-
#endif
1810
#endif
19-
20-
#endif
21-
22-
/*
23-
* Local Variables:
24-
* tab-width: 4
25-
* c-indent-level: 4
26-
* c-basic-offset: 4
27-
* End:
28-
*/

contrib/miscutil/misc_utils.sql.in

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
-- This file is distributed under the GNU General Public License
88
-- either version 2, or (at your option) any later version.
99

10-
-- Set the maximum number of tuples returned by a single query.
11-
--
12-
create function query_limit(int4) returns int4
13-
as 'MODULE_PATHNAME'
14-
language 'C';
15-
1610
-- Return the pid of the backend.
1711
--
1812
create function backend_pid() returns int4
@@ -49,16 +43,4 @@ create function active_listeners(text) returns int4
4943
as 'MODULE_PATHNAME'
5044
language 'C';
5145

52-
-- Enable/disable Postgres assert checking.
53-
--
54-
create function assert_enable(int4) returns int4
55-
as 'MODULE_PATHNAME'
56-
language 'C';
57-
58-
-- Test Postgres assert checking.
59-
--
60-
-- create function assert_test(int4) returns int4
61-
-- as 'MODULE_PATHNAME'
62-
-- language 'C';
63-
6446
-- end of file

0 commit comments

Comments
 (0)