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
Can assign null to a small integer not-null column [CORE1252] #1676
Comments
Commented by: Sean Leyne (seanleyne) What is the value of CHECKED in the database? |
Commented by: Hashim Kubba (hkubba) valur in database is null |
Modified by: Hashim Kubba (hkubba)Attachment: screenshot-1.jpg [ 10360 ] |
Commented by: @asfernandes Is this the exact sequence of commands to reproduce? |
Commented by: @dyemanov I cannot reproduce it either. Tried 1.5.3, 2.0.0 and 2.0.1. By the way, column POSTALCODE should be at least 10 characters long to make your INSERT workable. |
Commented by: Hashim Kubba (hkubba) OK here is the sequence: CREATE DOMAIN D_BOOLEAN CREATE TABLE ADDRESS GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE CREATE TABLE PROPERTY ALTER TABLE PROPERTY ADD CONSTRAINT FKF373CDD58C0439D3 If I use the insert now it will not work as expected Will give an error : SQL Message : -625 Engine Code : 335544347 This is correct, What I did then is tried to use hibernate and jaybird to connect to my java program, yet I did not set any thing in the checked field thinking it will use 0 by default, and I used the java.lang.Short object which can be null, Inserting from there showed a value of NULL And afterwards, when I run my insert it will be accepted: INSERT INTO ADDRESS (POSTALCODE, STREET, CITY, CHECKED) Will result Executing... Attached also is the database I used |
Modified by: Hashim Kubba (hkubba)Attachment: data.fdb [ 10370 ] |
Commented by: @asfernandes The database you attached is not as the one you described. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pcisarWorkflow: jira [ 12061 ] => Firebird [ 15563 ] |
Submitted by: Hashim Kubba (hkubba)
Attachments:
screenshot-1.jpg
data.fdb
Say I have this in my database:
CREATE DOMAIN D_BOOLEAN
AS SMALLINT
DEFAULT 0
NOT NULL
CHECK (VALUE IN (1, 0));
CREATE TABLE ADDRESS
(
POSTALCODE Varchar(7) NOT NULL,
STREET Varchar(100),
CITY Varchar(100),
CHECKED D_Boolean NOT NULL,
PRIMARY KEY (POSTALCODE)
);
Theatrically; I can not assign null to the checked column, yet running:
INSERT INTO ADDRESS (POSTALCODE, STREET, CITY, CHECKED)
VALUES (
'POSTALCODE',
'STREET',
'CITY',
NULL
)
Returns no error, and the record is added to the database
Regards,
The text was updated successfully, but these errors were encountered: