Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

System does not prevent INSERTS with reserved NULL values for BIGINT columns #849

Open
@apavlo

Description

@apavlo

We reserve certain values for the different types to represent NULL values. These are defined in 'limits.h':

https://github.com/cmu-db/peloton/blob/master/src/include/type/limits.h#L42-L50

I added a new test case that creates a table with each type and then tries to insert a value with the reserved value. The front-end throws a proper error to tell you that you are out of range for most types. It fails on BIGINT. It also fails on DECIMAL but I think it's an IEEE-754 issue.


Steps to recreate:

postgres=# \pset null '[NULL]' 
Null display is "[NULL]".
postgres=# CREATE TABLE tblBIGINT(id INT PRIMARY KEY, b BIGINT);
CREATE TABLE
postgres=# INSERT INTO tblBIGINT VALUES (1, -9223372036854775808);
INSERT 0 1
postgres=# SELECT * FROM tblBIGINT;
 id |   b
----+--------
  1 | [NULL]
(1 row)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions