Exposed: Fix Long instead of Int

Created on 21 Dec 2018  路  4Comments  路  Source: JetBrains/Exposed

limit method has n and offset parameters value as Int but should be in Long.
Also count method return result as Int but should be in Long.

Most helpful comment

Because we can have more then Int max results?

All 4 comments

Why it should?

Because we can have more then Int max results?

Changing the return type of count() from Int to Long and the type offset in limit() from Int to Long can be feasible, because it is possible to have more values in a DB than you can count with an Int. However, changing the type of n in limit() makes no sense because in Java lists you can only access values in positions lower than Int.MAX_VALUE

See:

PD: I tried to create a list as big as possible just for fun and I was only able to create one of size 2147483645 (Int.MAX_VALUE = 2147483647) in my laptop with 16GB of RAM before getting an java.lang.OutOfMemoryError: Requested array size exceeds VM limit, so there you go.

@Tapac Offset of Table.deleteWhere and DeleteStatement shouldnt beLong too?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BugsBunnyBR picture BugsBunnyBR  路  3Comments

hannesstruss picture hannesstruss  路  5Comments

power721 picture power721  路  3Comments

gcscaglia picture gcscaglia  路  3Comments

barry-m picture barry-m  路  3Comments