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

Insert with large decimal fails #2975

Closed
2 tasks done
Jens-H opened this issue Jan 22, 2022 · 0 comments · Fixed by #2983
Closed
2 tasks done

Insert with large decimal fails #2975

Jens-H opened this issue Jan 22, 2022 · 0 comments · Fixed by #2983
Assignees

Comments

@Jens-H
Copy link
Contributor

Jens-H commented Jan 22, 2022

What happens?

An insert statement with a decimal close to the minimum fails.

To Reproduce

v0.3.2-dev1136 0a65256
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D create table q (big decimal (38,10));
D insert into q (big ) values (-9999999999999999899999999999.9999999999);
Error: Conversion Error: Could not cast value -99999999999999997748809823456034029568.000000 to DECIMAL(38,10)

Before you start counting: Yes these are 38 numbers in the insert statement.

It appears that the number was cast to a double as the error message comes from cast_operators.cpp line 1971.

Environment (please complete the following information):

  • OS: Linux
  • DuckDB Client: CLI, Java, WASM

Before Submitting

  • Have you tried this on the latest master branch?
  • Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
@Mytherin Mytherin self-assigned this Jan 24, 2022
Mytherin added a commit to Mytherin/duckdb that referenced this issue Jan 25, 2022
Mytherin added a commit that referenced this issue Jan 25, 2022
Fix #2975: fix off-by-one in transform of string constant to decimal in case of large negative numbers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants