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

SQL INSERT allows NULL on non-nullable SHORT column #4419

Open
1 task done
amunra opened this issue Apr 18, 2024 · 3 comments
Open
1 task done

SQL INSERT allows NULL on non-nullable SHORT column #4419

amunra opened this issue Apr 18, 2024 · 3 comments

Comments

@amunra
Copy link
Contributor

amunra commented Apr 18, 2024

To reproduce

  1. CREATE TABLE with a SHORT datatype.
  2. INSERT INTO a NULL into the SHORT column.
  3. Query back.

Expected:

  • The SQL Insert statement (step 2) should have failed.

Actual:

  • All statements pass, the actual value returned is 0 instead instead of NULL.

QuestDB version:

7.4.0

OS, in case of Docker specify Docker and the Host OS:

MacOS

File System, in case of Docker specify Host File System:

APFS

Full Name:

Adam Cimarosti

Affiliation:

QuestDB

Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?

  • Yes, I have

Additional context

No response

@ideoma
Copy link
Collaborator

ideoma commented Apr 26, 2024

There are no non-nullable types in QuestDB. You cannot specify NOT NULL when you create table.

@Rushichaudhari2003
Copy link

Based on the information provided, it appears that you are using QuestDB, which might have different behavior compared to traditional SQL databases. QuestDB version 7.4.0 seems to be automatically converting NULL values to 0 for SHORT columns, even if they are defined as non-nullable.

Regarding the kernel configuration, increasing the maximum open files and maximum virtual memory areas limits is generally recommended for running databases on Linux and MacOS systems. However, this issue seems to be specific to QuestDB's handling of NULL values in non-nullable SHORT columns, and it is not directly related to the kernel configuration.

@nwoolmer
Copy link
Contributor

It's just an implicit cast, I think.

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

No branches or pull requests

4 participants