Insert too-large double produces wrong exception via Postgres

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

Bug Description

Using the Postgres server to insert a too-large value produces a parse
exception rather than an overflow exception (error code 42000
vs. 55004).

Note that it is also unclear why this overflow should produce an
exception when integer overflows are truncated.

SQL:

  CREATE TABLE t (double_field double)
  INSERT INTO t VALUES (1.7976931348623157E309)

Result:

  org.postgresql.util.PSQLException: ERROR: [] Floating point exponent overflow: INSERT INTO t VALUES (1.7976931348623157E309)
 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)
 ... 44 more

To reproduce:

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

Reproduced in trunk revision 1239

Revision history for this message
Mike McMahon (mmcm) wrote :

Since it is not possible to store a Double literal of this value, this probably requires a more specific Exception from the parser itself.

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

Other bug subscribers