Marc G. Fournier [Wed, 30 Oct 1996 06:06:50 +0000 (06:06 +0000)]
More btree fixes from Massimo Dal Zotto <dz@cs.unitn.it>
Fixes:
I found another bug in btree index. Looking at the code it seems that NULL
keys are never used to build or scan a btree index (see the explain commands
in the example). However this is not the case when a null key is retrieved
in an outer loop of a join select and used in an index scan of an inner loop.
This bug causes at least three kinds of problems:
1) the backend crashes when it tries to compare a text string with a null.
2) it is not possible to find tuples with null keys in a join.
3) null is considered equal to 0 when the datum is passed by value, see
the last query.
Marc G. Fournier [Fri, 25 Oct 1996 09:42:47 +0000 (09:42 +0000)]
One thing we said before should go into 1.09 is the fix to the master
make file so it doesn't say "Postgres made - ready to install" when you
do a make install or make clean.
- your query has not only aggregates but also 'group by-ed' fields and so
null_array should contain tupType->natts elements (tupType->natts > nagg in
your case).
Marc G. Fournier [Fri, 11 Oct 1996 03:28:14 +0000 (03:28 +0000)]
The second patch adds aliases for "ISNULL" to "IS NULL" and likewise for
"NOTNULL" to "IS NOT NULL". I have not removed the postgres specific
ISNULL and NOTNULL. I noticed this on the TODO list, and figured it would
be easy to remove.
The full semantics are:
[ expression IS NULL ]
[ expression IS NOT NULL ]
Marc G. Fournier [Fri, 11 Oct 1996 03:26:18 +0000 (03:26 +0000)]
This change should have no practical effect but it is the more
correct way to do this. Theoretically you could have a NULL
pointer that isn't represented internally as all 0 bits. This
guarantees that it convert correctly.
Oops, wrong message with the other patch...this was the patch for the other
comment, so here is the comment for the other patch *grin*
> > You are right. I checked the gramar and saw the ability to use the
> > parameter. I looked at the manual pages, and saw no reference to it. I
> > tried running it, and found vacuum does nothing when you give it a table
> > name.
> >
> > I checked a debug version of postgres, and the table name is passed to
> > vacuum() in the variable (char *vacrel). The problem is that the vacuum
> > spans transactions, and the vacrel name gets changed to '<vacuum>',
> > which is the name of the portal that gets created in
> > vacuum.c::_vc_vacuum(). vacuum.c::_vc_init() does a
> > CommitTransactionCommand() which frees the memory allocated to vacrel.
> >
> > Should I change vacuum.c to copy the relation name to a local string
> > variable of vacuum(), or do you recommend we allocate the table name in
> > a different fashion? You are the man who knows the most about this.
>
> static NameData VacRel;
Done. Attached is the patch. I have already applied it to the 2.0
tree. (Marc!)
I tested it and it works. I also applied documentation patches to go
with it.
So now vacuum can be run for only one table if you wish.
Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
> - it excludes system-relation too (relkind == 's'). (Note: Vacuum updates
pg_class
> by overwriting existing tuple for vacrel, so there are no many reasons to
vacuum pg_class).
>
> It can be done somewhere in _vc_getrels - near to checks against archive
relations
> and relations on the write-once storage managers...
>
> Excuse me - I forgot to say about this.
>
Attached is the recently posted fix for this. Thanks.
Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
Here the fix for the first assertion failure I had which killed
my postmaster 1.07.
It's really simple, the loop dealing with all sockets
can't handle more than one ready socket :-)
A simple logic error dealing with lists.
OR IS THERE ANY REASON FOR SETTING curr TO 0?
Marc G. Fournier [Mon, 26 Aug 1996 20:35:29 +0000 (20:35 +0000)]
The following patch makes postmaster -D work. -D specifies a different PGDATA
directory. The code that looks for the pg_hba file doesn't use it, though,
so the postmaster uses the wrong pg_hba file. Also, when the postmaster
looks in one directory and the user thinks it is looking in another
directory, the error messages don't give enough information to solve the
problem. I extended the error message for this.
Marc G. Fournier [Mon, 26 Aug 1996 20:27:46 +0000 (20:27 +0000)]
|The patch that is applied at the end of the email makes sure that these
|conditions are always met. The patch can be applied to any version
|of Postgres95 from 1.02 to 1.05. After applying the patch, queries
|using indices on bpchar and varchar fields should (hopefully ;-) )
|always return the same tuple set regardless to the fact whether
|indices are used or not.
|
Marc G. Fournier [Sat, 24 Aug 1996 20:56:42 +0000 (20:56 +0000)]
This patch for Versions 1 and 2 corrects the following bug:
In a catalog class that has a "name" type attribute, UPDATEing of an
instance of that class may destroy all of the attributes of that
instance that are stored as or after the "name" attribute.
This is caused by the alignment value of the "name" type being set to
"double" in Class pg_type, but "integer" in Class pg_attribute.
Postgres constructs a tuple using double alignment, but interprets it
using integer alignment.
The fix is to change the alignment to integer in pg_type.
Note that this corrects the problem for new Postgres systems. Existing
databases already contain the error and it can't easily be repaired because
this very bug prevents updating the class that contains it.
--
Bryan Henderson Phone 408-227-6803
San Jose, California
Marc G. Fournier [Sat, 24 Aug 1996 20:54:52 +0000 (20:54 +0000)]
The patch does several things:
It adds a WITH OIDS option to the copy command, which allows
dumping and loading of oids.
If a copy command tried to load in an oid that is greater than
its current system max oid, the system max oid is incremented. No
checking is done to see if other backends are running and have cached
oids.
pg_dump as its first step when using the -o (oid) option, will
copy in a dummy row to set the system max oid value so as rows are
loaded in, they are certain to be lower than the system oid.
pg_dump now creates indexes at the end to speed loading
Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
Marc G. Fournier [Wed, 21 Aug 1996 04:31:14 +0000 (04:31 +0000)]
|May I suggest to add access to the oid of an inserted
|record, by a small patch to libpq++? At least until the
|feature that will allow dumped oid's to be re-loaded into
|a database becomes available, I need access to the oids
|of newly created records... To this end, I have written a
|three-line wrapper for the PQoidStatus function in libpq and
|named this wrapper OidStatus() (I'd appreciate suggestions for
|a name that would better fit into the general naming scheme).
|
|Regards,
|
|Ernst
|
Marc G. Fournier [Wed, 21 Aug 1996 04:23:34 +0000 (04:23 +0000)]
Here's a patch for Versions 1 and 2 that fixes the following bug:
When you try to do any UPDATE of the catalog class pg_class, such as
to change ownership of a class, the backend crashes.
This is really two serial bugs: 1) there is a hardcoded copy of the
schema of pg_class in the postgres program, and it doesn't match the
actual class that initdb creates in the database; 2) Parts of postgres
determine whether to pass an attribute value by value or by reference
based on the attbyval attribute of the attribute in class
pg_attribute. Other parts of postgres have it hardcoded. For the
relacl[] attribute in class pg_class, attbyval does not match the
hardcoded expectation.
The fix is to correct the hardcoded schema for pg_attribute and to
change the fetchatt macro so it ignores attbyval for all variable
length attributes. The fix also adds a bunch of logic documentation and
extends genbki.sh so it allows source files to contain such documentation.
--
Bryan Henderson Phone 408-227-6803
San Jose, California
Marc G. Fournier [Mon, 19 Aug 1996 13:50:44 +0000 (13:50 +0000)]
Added a SVR4 port
---
below my signature, there are a coupls of diffs and files in a shell
archive, which were needed to build postgres95 1.02 on Siemens Nixdorfs
MIPS based SINIX systems. Except for the compiler switches "-W0" and
"-LD-Blargedynsym" these diffs should also apply for other SVR4 based
systems. The changes in "Makefile.global" and "genbki.sh" can probably
be ignored (I needed gawk, to make the script run).
There is one bugfix thou. In "src/backend/parser/sysfunc.c" the
function in this file didn't honor the EUROPEAN_DATES ifdef.
---
Submitted by: Frank Ridderbusch <ridderbusch.pad@sni.de>
Marc G. Fournier [Mon, 19 Aug 1996 13:34:49 +0000 (13:34 +0000)]
Fixes:
Here's a couple more small fixes that I've made to make my runtime
checker happy with the code. More along the lines of those that
I sent in the past, ie, a pointer to an array != the name of
an array. The last patch is that I mailed about yesterday -- I got
two replies of "do it", so it's done. As far as I can tell, however,
the function in question is never called by pg95, so either way
it can't hurt...
Marc G. Fournier [Mon, 19 Aug 1996 13:23:19 +0000 (13:23 +0000)]
Fixes for PQsetdb():
When you connect to a database with PQsetdb, as with psql, depending on
how your uninitialized variables are set, you can get a failure with a
"There is no connection to the backend" message.
The fix is to move a call to PQexec() from inside connectDB() to
PQsetdb() after connectDB() returns to PQsetdb(). That way a connection
doesn't have to be already established in order to establish it!
Marc G. Fournier [Mon, 19 Aug 1996 01:07:43 +0000 (01:07 +0000)]
|This patch fixes a backend crash that happens sometimes when you try to
|join on a field that contains NULL in some rows. Postgres tries to
|compute a hash value of the field you're joining on, but when the field
|is NULL, the pointer it thinks is pointing to the data is really just
|pointing to random memory. This forces the hash value of NULL to be 0.
|
|It seems that nothing matches NULL on joins, even other NULL's (with or
|without this patch). Is that what's supposed to happen?
|
Originally, I thought the problem was caused by a function that gets
called as a normal function where we want to return a value, and as a
signal handler where we need to have it accept a parameter (the signal
number) and it returns nothing, I was going to case the function name in
the signal call as (void (*)(int)).
Looking at all the source, it turns out this function only gets used as
a signal handler, so I set an int parameter and return void.
I have removed the Linux defines because they are not needed. BSD let
this sloppiness slide. Linux gave a compile error.
Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>