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

Default values are ignored in FILESTORAGE and LOCALSTORAGE #1848

Open
arximboldi opened this issue Dec 15, 2023 · 2 comments
Open

Default values are ignored in FILESTORAGE and LOCALSTORAGE #1848

arximboldi opened this issue Dec 15, 2023 · 2 comments

Comments

@arximboldi
Copy link

I have the following tables:

CREATE TABLE IF NOT EXISTS banks (
       name STRING PRIMARY KEY,
       is_open BOOLEAN DEFAULT true,
       [key] STRING
);

CREATE TABLE IF NOT EXISTS pigs (
       id STRING PRIMARY KEY,
       bank STRING DEFAULT null,
       ready BOOLEAN DEFAULT false,
       dream STRING,
       notes STRING,
       kind STRING,
       timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
       FOREIGN KEY (bank) REFERENCES bank(name)
);

I have noticed that when I do an INSERT, all unspecified values are left as undefined instead of using any of the DEFAULT specifications.

This has been tested for both FILESTORAGE and LOCALSTORAGE.

@jigarBorde
Copy link

jigarBorde commented Dec 30, 2023

Hii @mathiasrw

Noticing default values set during INSERT operations in tables (banks, pigs) where specified defaults exist, they are correctly applied. However, columns without explicitly provided values during retrieval display as 'undefined', which aligns with expectations as no default values were specified for those columns.

Additionally, updated the FOREIGN KEY reference from bank(name) to banks(name) for accuracy.

let me know, if i missed something.

@mathiasrw
Copy link
Member

@arximboldi Can you confirm what @jigarBorde said?

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

3 participants