Bruce Momjian [Thu, 8 Jul 1999 03:32:57 +0000 (03:32 +0000)]
Test Case:
----------
exec sql begin declare section;
short s ;
unsigned short us;
exec sql end declare section;
exec sql create table test(s smallint, us smallint);
exec sql commit;
s = 1; us =32000;
exec sql insert into test values( :s, :us ) ; <== error
Bruce Momjian [Thu, 8 Jul 1999 03:22:46 +0000 (03:22 +0000)]
> In both datetime_trunc() and timespan_trunc() in dt.c,
> the DTK_MICROSEC case is just like the DTK_MILLISEC case.
> I think this is wrong and it ought to look like
> fsec = rint(fsec * 1000000) / 1000000;
> no?
Bruce Momjian [Thu, 8 Jul 1999 00:27:01 +0000 (00:27 +0000)]
pg_atoi() does range check on int4 data only if
"HAS_LONG_LONG" is defined based on the assumption that
strtol() would return ERANGE if a platform does not support
64-bit integers. In current PostgreSQL 6.5 (and 6.4.2)
distribution, "HAS_LONG_LONG" is defined only if platform
is "alpha". (See include/port/alpha.h) I think the int4
range check should apply to linux_alpha as well. (I have
not tested yet but I guess this might be applicable to
newer Linux/i386 distributions which includes new GCC which
implements long int as 64-bit int.)
Fix markup for docbook2man man page generation.
No big deal; fixed lots of other markup at the same time.
Bigest change: make sure there is no whitespace
in front of <term> contents.
This will probably help the other output types too.
Tom Lane [Mon, 21 Jun 1999 01:26:56 +0000 (01:26 +0000)]
Replace rewriter's checkQueryHasAggs and checkQueryHasSubLink
with expression_tree_walker-based code. The former failed to cope with
expressions containing SubLinks, and the latter returned TRUE for both
SubLinks and Aggrefs (cut-and-paste bug?). There is a lot more scope for
using expression_tree_walker in this module, but I'll restrain myself
until the 6.6 split occurs from touching not-demonstrably-broken code.
Tom Lane [Mon, 21 Jun 1999 01:20:57 +0000 (01:20 +0000)]
Clean up problems with sublinks + grouping in planner. Not
sure if they are all fixed, because rewriter is now the stumbling block,
but at least some cases work that did not work before.
Tom Lane [Sat, 19 Jun 1999 03:48:31 +0000 (03:48 +0000)]
My first chosen victim for expression_tree_walker conversion
is parse_aggs.c. This fixes its failure to cope with (at least) CaseExpr
and ArrayRef nodes, which is the reason why both of these fail in 6.5:
select coalesce(f1,0) from int4_tbl group by f1;
ERROR: Illegal use of aggregates or non-group column in target list
select sentence.words[0] from sentence group by sentence.words[0];
ERROR: Illegal use of aggregates or non-group column in target list
The array case still fails, but at least it's not parse_agg's fault
anymore ... considering that we now support CASE officially, I think
it's important to fix the first example ...
Tom Lane [Sat, 19 Jun 1999 03:41:45 +0000 (03:41 +0000)]
Create a generic expression-tree-walker subroutine, which
will gradually replace all of the boilerplate tree-walk-recursion code that
currently exists in O(N) slightly different forms in N subroutines.
I've had it with adding missing cases to these subroutines...
Tom Lane [Sat, 19 Jun 1999 00:44:44 +0000 (00:44 +0000)]
Temporarily disable error checks for missing selectivity
functions, in order to work around oversight in 6.5 release: rtree
index functions haven't got any. Mea culpa ...
Incorporate fixes from Date and Darwen, 1997.
Did not check the function declarations as carefully as the other parts,
though all of the function names *do* match up with D&D.
Tom Lane [Thu, 17 Jun 1999 22:21:41 +0000 (22:21 +0000)]
Defend against function calls with more than 8 arguments (code
used to overrun its fixed-size arrays before detecting error; not cool).
Also, replace uses of magic constant '8' with 'MAXFARGS'.
Add CLI required header and examples from SQL3/SQL98
August 1994 draft standard.
Use the ecpg support libraries to write the CLI interface?
Date and Darwen claim that CLI is a more modern and flexible approach...
Release notes from sgml.
Came out with max 79 columns from Applix by defining the page width at
10 inches and the right margin at 9.5 inches, then exporting
as "ASCII Layout".
Tom Lane [Sat, 12 Jun 1999 22:17:24 +0000 (22:17 +0000)]
Move default NBuffers setting into config.h, and rename it
to DEF_NBUFFERS for readability. Make sure the default value is OK
according to postmaster.c's new sanity check for -B values.
Tom Lane [Sat, 12 Jun 1999 20:41:25 +0000 (20:41 +0000)]
Fix critical error noticed by Massimo: copy.c used to have a
special hack to ensure it would close its output file even after failure
due to elog(ERROR) partway through the copy. This is now unnecessary
because fd.c takes care of cleaning up open files at transaction abort;
worse, after fd.c closed the file copy.c would try to do so *again* at
the start of the next COPY command. This would result in havoc in most
implementations of stdio library.
Tom Lane [Sat, 12 Jun 1999 19:38:30 +0000 (19:38 +0000)]
Remove query_planner's overhasty rejection of cases where
tlist and qual are NULL. It ought to handle these the same as the cases
where tlist contains only constant expressions, ie, be willing to generate
a Result-node plan. This did not use to matter, but it does now because
union_planner will flatten the tlist when aggregates are present. Thus,
'select count(1) from table' now causes query_planner to be given a null
tlist, and to duplicate 6.4's behavior we need it to give back a Result
plan rather than refusing the query. 6.4 was arguably doing the Wrong
Thing for this query, but I'm not going to open a semantics issue right
before 6.5 release ... can revisit that problem later.