This is a code patch for the following TODO items list under the "Types"
* SELECT col FROM tab WHERE numeric_col = 10.1 fails
* Allow better handling of numeric constants, type conversion [typeconv]
Description of this change:
Currently when the parsers finds more than one candidate to resolve an
expression, it returns no solution. This patch tells the parse to return
the first solution when more than one solution exists. This may fix many
small issues with expressions in where clauses.
This patch is needed for Access 97 to proper work with numeric data types.
How to duplicate the problem:
create table tst (id int, amount numeric(9,2));
insert into tst values (1, 1.10);
insert into tst values (2, 1.00);
insert into tst values (2, 2.00);
select * from tst where amount = 1; -- should work
select * from tst where amount = 1.1; -- should fail (before this
select * from tst where amount = 1.10; -- should fail (before this
select * from tst where amount = 1.0; -- should fail (before this
select * from tst where amount = 1.00; -- should fail (before this
Here is the result of a cvs diff:
retrieving revision 1.45
diff -r1.45 parse_oper.c
< if (ncandidates == 1)
> /* Michael J Davis, 12/15/2000, since there is more than one canidate,
> lets return the first canidate rather than returning no canidate
> if (ncandidates >= 1)
Database Architect and Senior Software Engineer, Seva Inc.
Office: 303-460-7360 Fax: 303-460-7362
pgsql-patches by date
|Next:||From: Max Khon||Date: 2000-12-16 09:10:04|
|Subject: Re: Re: more odbc patches|
|Previous:||From: Tom Lane||Date: 2000-12-15 19:46:34|
|Subject: Planner speedup diffs|