on 2013 Feb 09 5:29 PM
When using SQL Anywhere 12 ISQL with "Text" checked in Tools - Options - SQL Anywhere - Style, BINARY values can be truncated according to the length of the column name.
At first I thought this was expected behavior, but after being misled about a value, I no longer hold that opinion; 'tis a bug, not a feature 🙂
Rather than try to describe the rather funky "rules", the following example will demonstrate:
SELECT 0x30313233343536373839 AS a, a AS bbbbbbbbbbbbb, a AS cccccccccccccc, a AS ddddddddddddddddddddd, a AS eeeeeeeeeeeeeeeeeeeeee, a AS fffffffffffffffffffffffffff a bbbbbbbbbbbbb cccccccccccccc ddddddddddddddddddddd eeeeeeeeeeeeeeeeeeeeee fffffffffffffffffffffffffff ------------ ------------- -------------- --------------------- ---------------------- --------------------------- 0x3031323334 0x30313233343 0x303132333435 0x3031323334353637383 0x30313233343536373839 0x30313233343536373839 (1 rows) Execution time: 0.083 seconds
Request clarification before answering.
Thanks for the bug report - I have opened this issue internally for investigation as CR #731939. We will update this thread when we have a response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like the algorithm for the output width is 2 for the 0x + sizeof(item). The size of the binary value is 10 bytes.
A work-around is to cast the hexadecimal string to a type twice as long (20 instead of default 10). Here's an example.
SELECT CAST( 0x30313233343536373839 as BINARY(20) ) AS a, a AS bbbbbbbbbbbbb, a AS cccccccccccccc, a AS ddddddddddddddddddddd, a AS eeeeeeeeeeeeeeeeeeeeee, a AS fffffffffffffffffffffffffff;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
60 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.