Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numeric field allow insert values larger than specified [CORE2782] #3173

Open
firebird-automations opened this issue Dec 1, 2009 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Paweł (chosenone)

Is duplicated by CORE5894

Votes: 2

I have field numeric (10,0) and database allows to insert into this field values larger than specified.
Fo example:
Field numeric(10,0) allow to insert value : 1234567890123456789
max value which I can insert in this field numeric(19).

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

This is not really a bug, more like a design pitfall. In Firebird, both numerics and decimals implement what the SQL specification declares for decimals, i.e. they may have a precision equal or bigger than what's specified in the declaration.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

priority: Critical [ 2 ] => Major [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Ann Harrison (awharrison)

Firebird and InterBase before it have had this behavior from the beginning,
so it's hardly a major bug. It is non-standard behavior, so it qualifies as a
bug. On the other hand, the workaround is trivial: add a check constraint
that explicitly limits the range of the value.

@firebird-automations
Copy link
Collaborator Author

Modified by: Ann Harrison (awharrison)

priority: Major [ 3 ] => Minor [ 4 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is duplicated by CORE5894 [ CORE5894 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

Will be good if that check will be added automatically by the engine in the future version of Firebird
or something like RESTRICT should be implemented like

FIELD_NAME NUMERIC(X,Y) RESTRICT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant