Mercurial > hg > monetdb-java
comparison src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java @ 817:93b256bf29a7
Fix arithmetic overflow
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Wed, 13 Dec 2023 13:29:39 +0100 (16 months ago) |
parents | 71d32f1a4d60 |
children | 4117aa40a6b9 |
comparison
equal
deleted
inserted
replaced
816:9188263368cc | 817:93b256bf29a7 |
---|---|
1315 * | 1315 * |
1316 * @return the max literal length | 1316 * @return the max literal length |
1317 */ | 1317 */ |
1318 @Override | 1318 @Override |
1319 public int getMaxBinaryLiteralLength() { | 1319 public int getMaxBinaryLiteralLength() { |
1320 return 2*1024*1024*1024 - 2; // MonetDB supports null terminated strings of max 2GB, see function: int UTF8_strlen() | 1320 return 0x7ffffffe; // MonetDB supports null terminated strings of max 2GB, see function: int UTF8_strlen() |
1321 } | 1321 } |
1322 | 1322 |
1323 /** | 1323 /** |
1324 * What is the maximum length for a character literal | 1324 * What is the maximum length for a character literal |
1325 * | 1325 * |
1326 * @return the max literal length | 1326 * @return the max literal length |
1327 */ | 1327 */ |
1328 @Override | 1328 @Override |
1329 public int getMaxCharLiteralLength() { | 1329 public int getMaxCharLiteralLength() { |
1330 return 2*1024*1024*1024 - 2; // MonetDB supports null terminated strings of max 2GB, see function: int UTF8_strlen() | 1330 return 0x7ffffffe; // MonetDB supports null terminated strings of max 2GB, see function: int UTF8_strlen() |
1331 } | 1331 } |
1332 | 1332 |
1333 /** | 1333 /** |
1334 * Whats the limit on column name length. | 1334 * Whats the limit on column name length. |
1335 * I take some safety here, but it's just a varchar in MonetDB | 1335 * I take some safety here, but it's just a varchar in MonetDB |
1490 * | 1490 * |
1491 * @return max length in bytes | 1491 * @return max length in bytes |
1492 */ | 1492 */ |
1493 @Override | 1493 @Override |
1494 public int getMaxStatementLength() { | 1494 public int getMaxStatementLength() { |
1495 return 2*1024*1024*1024 - 2; // MonetDB supports null terminated strings of max 2GB, see function: int UTF8_strlen() | 1495 return 0x7ffffffe; // MonetDB supports null terminated strings of max 2GB, see function: int UTF8_strlen() |
1496 } | 1496 } |
1497 | 1497 |
1498 /** | 1498 /** |
1499 * How many active statements can we have open at one time to | 1499 * How many active statements can we have open at one time to |
1500 * this database? Basically, since each Statement downloads | 1500 * this database? Basically, since each Statement downloads |