Here's what happens on the 32-bit version of SQL Anywhere Network Server Version 12.0.1.3298
SELECT COUNT_BIG(*)
FROM SYSCOLUMN AS A
CROSS JOIN SYSCOLUMN AS B
CROSS JOIN SYSCOLUMN AS C;
There was an error reading the results of the SQL statement.
The displayed results may be incorrect or incomplete.
Value SUM() out of range for destination
SQLCODE=-158, ODBC 3 State="22003"
Request clarification before answering.
Hm, can't tell, that query really takes loooong for one of my test databases (too many columns?).
However, the following simpler query returns no error but a wrong result in dbisqlc and DBISQL 12.0.1.3769:
SELECT COUNT_BIG(*) FROM sa_rowgenerator(1, 2048) AS A CROSS JOIN sa_rowgenerator(1, 2048) AS B CROSS JOIN sa_rowgenerator(1, 2048) AS C;
It should return 2^11 * 2^11 * 2^11 = 2^33 = 8,589,934,592 but returns (after quite a while...) 0, which seems to be the result of an 2^32 overflow.
However, that query seems to be running one one thread, whereas your COUNT_BIG() query over SYSCOLUMN seems to be running parallel, which might make a difference as to the underlying query execution...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
which seems to be the result of an 2^32 overflow.
That seems fitting to Breck's current observation, as the return type of COUNT_BIG() is still an int (checked with the freshest 12.0.1.3942 EBF):
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.