============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================
Your name : Adriaan Joubert
Your email address : a.joubert@albourne.com
System Configuration
---------------------
Architecture (example: Intel Pentium) : DEC Alpha
Operating System (example: Linux 2.0.26 ELF) : DU 4.0 D
PostgreSQL version (example: PostgreSQL-6.4.2) : PostgreSQL-6.4.2
Compiler used (example: gcc 2.8.0) : DEC C V5.6-071
Please enter a FULL description of your problem:
------------------------------------------------
When doing a select with multiple OR's or an IN statement where this
involves a primary key, causes a floating point exception.
Creating two tables A and B as follows:
CREATE TABLE A (
PRIMARY KEY (a),
a int4 NOT NULL,
b int4 NOT NULL
);
INSERT INTO A values (73,2);
INSERT INTO A values (74,2);
CREATE TABLE B (
a int4 NOT NULL,
b int4 NOT NULL
);
INSERT INTO B values (73,2);
INSERT INTO B values (74,2);
we get the following behaviour
tt=> select * from B where a in (73,74);
a|b
--+-
73|2
74|2
(2 rows)
tt=> select * from A where a in (73,74);
ERROR: floating point exception! The last floating point operation
either exceeded legal ranges or was a divide by zero
tt=> select * from A where a=73 or a=74;
ERROR: floating point exception! The last floating point operation
either exceeded legal ranges or was a divide by zero
Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
See above.
If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
I know it crashed in create_or_index_paths: following stack-trace
0 0x1200c83b4 in create_or_index_paths(0x0, 0x140201e80, 0x1f5, 0x1,
0x4, 0x0) in ./postgres
#1 0x1200c2924 in UnknownProcedure1FromFile134(0x0, 0x140201e80, 0x1f5,
0x1, 0x4, 0x0) in ./postgres
#2 0x1200c281c in find_paths(0x0, 0x140201e80, 0x1f5, 0x1, 0x4, 0x0) in
./postgres
#3 0x1200cb074 in UnknownProcedure1FromFile147(0x0, 0x140201e80, 0x1f5,
0x1, 0x4, 0x0) in ./postgres
#4 0x1200caedc in query_planner(0x0, 0x140201e80, 0x1f5, 0x1, 0x4, 0x0)
in ./postgres
#5 0x1200cb9bc in union_planner(0x0, 0x140201e80, 0x1f5, 0x1, 0x4, 0x0)
in ./postgres
#6 0x1200cb75c in planner(0x0, 0x140201e80, 0x1f5, 0x1, 0x4, 0x0) in
./postgres
#7 0x12011e3b0 in pg_parse_and_plan(0x0, 0x140201e80, 0x1f5, 0x1, 0x4,
0x0) in ./postgres
#8 0x12011e654 in pg_exec_query_dest(0x0, 0x140201e80, 0x1f5, 0x1, 0x4,
0x0) in ./postgres
#9 0x12011fffc in PostgresMain(0x0, 0x140201e80, 0x1f5, 0x1, 0x4, 0x0)
in ./postgres
#10 0x1200b029c in main(0x0, 0x140201e80, 0x1f5, 0x1, 0x4, 0x0) in
./postgres
#11 0x12003b1a8 in __start(0x0, 0x140201e80, 0x1f5, 0x1, 0x4, 0x0) in
./postgres
I'm going to have to recompile with debugging switched on to have a
better
look at it. Anybody have any idea which source file this is in?
--
--------------------------------------+-------------------------------
Dr Adriaan Joubert | Phone: +357-2-750 652
APL Financial Services (Overseas) Ltd| Fax: +357-2-750 654
3 D. Vikella St | e-mail: a.joubert@albourne.com
1061 Nicosia, CYPRUS |
--------------------------------------+-------------------------------