Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8934594

Browse files
committed
Remove old, broken code for query_limit(), assert_enable(),
assert_test() functions --- these weren't accomplishing much except torender the whole module un-loadable ...
1 parentdc3fb8b commit8934594

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
#defineMIN(x,y)((x)<=(y) ? (x) : (y))
3738

38-
externintExecutorLimit(intlimit);
39-
externvoidAsync_Unlisten(char*relname,intpid);
40-
externintassertTest(intval);
41-
42-
#ifdefASSERT_CHECKING_TEST
43-
externintassertEnable(intval);
44-
45-
#endif
46-
47-
int
48-
query_limit(intlimit)
49-
{
50-
returnExecutorLimit(limit);
51-
}
5239

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

131-
#ifdefUSE_ASSERT_CHECKING
132-
int
133-
assert_enable(intval)
134-
{
135-
returnassertEnable(val);
136-
}
137-
138-
#ifdefASSERT_CHECKING_TEST
139-
int
140-
assert_test(intval)
141-
{
142-
returnassertTest(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
#ifndefMISC_UTILS_H
22
#defineMISC_UTILS_H
33

4-
intquery_limit(intlimit);
54
intbackend_pid(void);
65
intunlisten(char*relname);
76
intmax(intx,inty);
87
intmin(intx,inty);
98
intactive_listeners(text*relname);
109

11-
#ifdefUSE_ASSERT_CHECKING
12-
intassert_enable(intval);
13-
14-
#ifdefASSERT_CHECKING_TEST
15-
intassert_test(intval);
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)

[8]ページ先頭

©2009-2025 Movatter.jp