Insert too-small double produces wrong exception via Postgres

Bug #889298 reported by Tim Blackman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Akiban SQL Parser
Confirmed
Low
Unassigned

Bug Description

Using the Postres server to insert a too-small value produces a parse
exception. There is no underflow exception defined, so it is not clear
what exception this should produce.

It is also unclear why this underflow should produce an exception rather
than resulting in truncation.

SQL:

  CREATE TABLE t (double_field double)
  INSERT INTO t VALUES (4.9E-325)

Result:

  org.postgresql.util.PSQLException: ERROR: [] Floating point exponent underflow: INSERT INTO t VALUES (4.9E-325)
 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
 at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
 at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)
 at com.akiban.sql.pg.YamlTester$StatementCommand.execute(YamlTester.java:436)

To reproduce:

  mvn test -Dtest=PostgresServerMiscYamlIT -Dcom.akiban.sql.pg.PostgresServerMiscYamlIT.CASE_NAME_REGEXP=bug-insert-double-underflow

Reproduced in trunk revision 1239

Tags: types
Revision history for this message
Mike McMahon (mmcm) wrote :
affects: akiban-server → akiban-sql-parser
Changed in akiban-sql-parser:
status: New → Confirmed
Revision history for this message
Timothy Wegner (timmwegner) wrote :

This error is specific to literal floats. We should probably have a separate handling of computed floats.

Changed in akiban-sql-parser:
milestone: none → samba
importance: Undecided → Low
tags: added: types
Changed in akiban-sql-parser:
milestone: samba → future
information type: Private → Public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.