1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00
Commit Graph

16898 Commits

Author SHA1 Message Date
f490dbe594 > Now I'm testing connectby() in the /contrib/tablefunc in 7.3b1, which would
> be a useful function for many users.   However, I found the fact that
> if connectby_tree has the following data, connectby() tries to search the end
> of roots without knowing that the relations are infinite(-5-9-10-11-9-10-11-)
.
> I hope connectby() supports a check routine to find infinite relations.
>
>
> CREATE TABLE connectby_tree(keyid int, parent_keyid int);
> INSERT INTO connectby_tree VALUES(1,NULL);
> INSERT INTO connectby_tree VALUES(2,1);
> INSERT INTO connectby_tree VALUES(3,1);
> INSERT INTO connectby_tree VALUES(4,2);
> INSERT INTO connectby_tree VALUES(5,2);
> INSERT INTO connectby_tree VALUES(6,4);
> INSERT INTO connectby_tree VALUES(7,3);
> INSERT INTO connectby_tree VALUES(8,6);
> INSERT INTO connectby_tree VALUES(9,5);
>
> INSERT INTO connectby_tree VALUES(10,9);
> INSERT INTO connectby_tree VALUES(11,10);
> INSERT INTO connectby_tree VALUES(9,11);    <-- infinite
>

The attached patch fixes the infinite recursion bug in
contrib/tablefunc/tablefunc.c:connectby found by Masaru Sugawara.

test=# SELECT * FROM connectby('connectby_tree', 'keyid',
'parent_keyid', '2', 4, '~') AS t(keyid int, parent_keyid int, level
int, branch text);
  keyid | parent_keyid | level |   branch
-------+--------------+-------+-------------
      2 |              |     0 | 2
      4 |            2 |     1 | 2~4
      6 |            4 |     2 | 2~4~6
      8 |            6 |     3 | 2~4~6~8
      5 |            2 |     1 | 2~5
      9 |            5 |     2 | 2~5~9
     10 |            9 |     3 | 2~5~9~10
     11 |           10 |     4 | 2~5~9~10~11
(8 rows)

test=# SELECT * FROM connectby('connectby_tree', 'keyid',
'parent_keyid', '2', 5, '~') AS t(keyid int, parent_keyid int, level
int, branch text);
ERROR:  infinite recursion detected

I implemented it by checking the branch string for repeated keys
(whether or not the branch is returned). The performance hit was pretty
minimal -- about 1% for a moderately complex test case (220000 record
table, 9 level tree with 3800 members).

Joe Conway
2002-09-12 00:19:44 +00:00
b2711a0aee > BTW, clusterdb is not schema-aware and will surely fail in any database
> where more than one schema is in use, because it doesn't trouble to
> schema-qualify table names.

Ok, the following patch should solve this concern.  It also tries to
connect as little times as possible (the previous one would connect one
time per table plus one per database; this one connects two times per
database).

Alvaro Herrera
2002-09-12 00:18:14 +00:00
5dd74c0f21 The attached small patch fixes the cause of the regression test failure
for contrib/intarray.

The cause was that the library uses its own function to construct a new
array, new_intArrayType, and that function did not set the new array
struct attribute elemtype.

Joe Conway
2002-09-12 00:15:33 +00:00
6fff9a7475 The attached removes the current non-standard file
"contrib/tablefunc/tablefunc-test.sql", and adds a standard regression
test suite to contrib/tablefunc.

Joe Conway
2002-09-12 00:14:40 +00:00
6309033b16 Add sprompt.obj to Win32 makefiles. 2002-09-11 17:36:13 +00:00
68ba17d406 Add comment about sharing of sprompt.c file. 2002-09-11 17:32:37 +00:00
6fdc44be71 Tweak querytree-dependency-extraction code so that columns of tables
that are explicitly JOINed are not considered dependencies unless they
are actually used in the query: mere presence in the joinaliasvars
list of a JOIN RTE doesn't count as being used.  The patch touches
a number of files because I needed to generalize the API of
query_tree_walker to support an additional flag bit, but the changes
are otherwise quite small.
2002-09-11 14:48:55 +00:00
d634a5903f Patches submitted by Kris Jurka (jurka@ejurka.com) for the following bugs:
- Properly drop tables in jdbc regression tests with cascade for 7.3
  - problem with Statement.execute() and executeUpdate() not clearing binds
  - problem with ResultSet not correctly handling default encoding
  - changes to correctly support show transaction isolation level in 7.3
  - changed DatabaseMetaDataTest to handle differences in FK names in 7.3
  - better fix for dynamically checking server NAME data length
  (With the fixes above the jdbc regression tests pass on jdbc2 and jdbc3
   against both a 7.2 and 7.3 server)
Patchs submitted by David Wall (d.wall@computer.org):
  - problem with getBlob when largeobject oid is null
  - improvements to BlobOutputStream
Patch submitted by Haris Peco (snpe@snpe.co.yu):
  - problem with callable statement not supporting prepared statement methods

 Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java
 	jdbc/org/postgresql/largeobject/BlobOutputStream.java
 	jdbc/org/postgresql/largeobject/LargeObject.java
 	jdbc/org/postgresql/test/TestUtil.java
 	jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
 	jdbc/org/postgresql/test/jdbc2/UpdateableResultTest.java
 	jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java
 	jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
 	jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java
2002-09-11 05:38:45 +00:00
8aa966e4b8 Add mention of config.log for configure failure debugging. 2002-09-11 04:27:48 +00:00
6a5733a1ea Fix atan() description.
Bruno Wolff III
2002-09-11 02:56:46 +00:00
87e76d0d4a Fix portability problem (size_t != int). 2002-09-10 18:25:13 +00:00
94d8a798fa Powerup defaults for LC_foo GUC variables should match what main.c does. 2002-09-10 16:09:02 +00:00
6555177f24 Use different sed separator for configure arguments. 2002-09-09 18:35:04 +00:00
fe80b5ed8a Remove more references to pgaccess as a build target in docs. 2002-09-08 02:33:08 +00:00
62da2fa0e1 Fixed DatabaseMetaData to correctly handle NAME size of 64
Fixed Statement to correctly DEALLOCATE any prepared statements

 Modified Files:
 	jdbc/org/postgresql/PGStatement.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2002-09-08 00:15:29 +00:00
24507acc0b Changes to documentation and the regression tests for the default
NAMEDATALEN of 64.

Kris Jurka
2002-09-07 18:39:05 +00:00
86e8a43f9b Done as far as possible:
< * Add documentation to lock shared memory into RAM for each OS, if possible
2002-09-07 18:37:15 +00:00
fba5c7b944 Remove pgaccess from docs; not shipping it anymore. 2002-09-07 16:49:50 +00:00
40853dd445 Allow pg_dumpall to work with previous releases again. Don't pass the -c
option down to pg_dump, where it's useless, and clarify the meaning of -c
in the documentation.
2002-09-07 16:14:33 +00:00
123baf8310 Fix help output. 2002-09-07 16:12:27 +00:00
38e444aae6 Make sure the pg_dump tar archiver can handle members larger than 2 GB, but
does not create members larger than allowed by the tar format.  Also, fix
the generation of the tar header to conform to POSIX.
2002-09-06 21:58:36 +00:00
172f9a49e0 Adjust the tarball splitting scheme to the new reality. 2002-09-06 21:57:11 +00:00
f37c1c486a Run pgjindent for Java folks. 2002-09-06 21:23:06 +00:00
b4295d052e Fix another typo. 2002-09-06 20:26:00 +00:00
022eb280af Fix typo. 2002-09-06 20:08:06 +00:00
c813d03ff9 Update for new IP. 2002-09-06 18:46:23 +00:00
f3b211841e Add JAVA_HOME test for Ant. 2002-09-06 14:31:16 +00:00
847f8b39d7 Fix printf() quote handling and improper exit(), per Tom. 2002-09-06 02:33:47 +00:00
9a9825f96a Remove heap_mark4update from AlterTableCreateToastTable. This has
never been the correct procedure for locking a relation, and the
recently-found ALTER TABLE bug with adding a constraint and a toast
table in the same command shows why it's a bad idea.
2002-09-06 00:01:53 +00:00
6fe27ca2fb Fix some operator-precedence problems. New constructs IS DISTINCT FRM
and IS [NOT] OF were not being parsed consistently with other IS forms.
Also, make the world a little safer for functions named LEFT, RIGHT, etc.
2002-09-05 22:52:48 +00:00
e06f4c65b4 Fix compile error. 2002-09-05 22:24:23 +00:00
cd06c70d9a Missed mention of PGPASSWORDFILE. 2002-09-05 22:09:42 +00:00
6e9b41b3f2 Update HISTORY for PGPASSWORDFILE change. 2002-09-05 22:08:55 +00:00
5fc10c3d17 Remove PGPASSWORDFILE and default to always trying $HOME/.pgpass.
Cleanup up memory allocation for $HOME in related psql places.

Update mention of $HOME/.pgpass in the docs;  add mention in pg_dumpall.
2002-09-05 22:05:50 +00:00
f4aecac468 Update:
> * -Add ~/.pgpass to store passwords with user/host/password combinations
2002-09-05 22:03:02 +00:00
04604fd1a4 Fill in section on table modification. 2002-09-05 21:32:23 +00:00
497baca6b5 Fix compile warning. 2002-09-05 21:19:13 +00:00
8d7904f526 Fix bit-rotted reference to GetUserName() ...
it's GetUserNameFromId() now.
2002-09-05 21:13:03 +00:00
bed4f65499 Fix breakage introduced by careless snprintf patching. 2002-09-05 21:09:54 +00:00
fb473bc6fa Fix unsafe macro definitions (which were producing incorrect code,
leading to compile warnings).
2002-09-05 21:08:26 +00:00
da2e0ddeb4 Remove compile warnings, ensure consistent build environment for
largefile usage.
2002-09-05 21:01:16 +00:00
f2a242f988 Fix compile warning. 2002-09-05 20:57:00 +00:00
fcbe62ee51 findoidjoins and tsearch are not broken anymore. 2002-09-05 20:53:45 +00:00
5d1c8a3b07 Fix compile errors. 2002-09-05 20:51:39 +00:00
b73d8d22f7 Improve opr_sanity regression test to check oprltcmpop and opgtcmpop
mergejoin links.
2002-09-05 20:23:19 +00:00
f4003816f5 Update oidjoins regression test for 7.3 catalogs. 2002-09-05 19:58:14 +00:00
d7e654ff79 findoidjoins is updated for schemas, does not use libpgeasy.
From Joe Conway.
2002-09-05 19:57:32 +00:00
5b69f695ac Seems like a good idea for template1 to contain ANALYZE stats for the
system tables.
2002-09-05 19:56:57 +00:00
012288d565 Commenting out doesn't work, so move the broken modules out of the list. 2002-09-05 18:40:33 +00:00
b9d5620a14 autoconf 2002-09-05 18:39:11 +00:00