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

Generated sequences shouldn't be typed BIGINT by default, if MAXVALUE is larger than Long.MAX_VALUE #16650

Open
1 task done
lukaseder opened this issue May 6, 2024 · 0 comments

Comments

@lukaseder
Copy link
Member

lukaseder commented May 6, 2024

Some RDBMS don't support typed sequences. They're all DECIMAL(x, 0) typed and the value range depends on the MINVALUE and MAXVALUE flags. For example, in HANA, this range is -9999999999999999999999999999 to 9999999999999999999999999999 (28 digits, i.e. DECIMAL(28, 0).

The code generator should produce the appropriate type for the respective range, e.g. (in HANA):

  • TINYINT for (0, 255)
  • SMALLINT for (Short.MIN_VALUE, Short.MAX_VALUE)
  • INTEGER for (Integer.MIN_VALUE, Integer.MAX_VALUE)
  • BIGINT for (Long.MIN_VALUE, Long.MAX_VALUE)
  • DECIMAL(x, 0) for the rest

This affects these dialects:

  • HANA

List to be amended

@lukaseder lukaseder added this to the Version 3.20.0 milestone May 6, 2024
lukaseder added a commit that referenced this issue May 6, 2024
…ain objects via DSLContext.meta()

This includes:

- [#16650] Generated sequences shouldn't be typed BIGINT by default, if MAXVALUE is larger than Long.MAX_VALUE: For HANA
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