on 2017 Sep 19 12:11 AM
Hi
I have no data in a table,
$ dbisql -c "uid=sadb;pwd=sadb;eng=ftnode_sa;links=tcpip(host=10.11.12.17;port=49153);LOG=conn.log;dbn=ftnode_sa" "select * from test1"
x y
(0 rows)
yet when I run a hash query over the results, I get a hash value:
$ dbisql -c "uid=sadb;pwd=sadb;eng=ftnode_sa;links=tcpip(host=10.11.12.17;port=49153);LOG=conn.log;dbn=ftnode_sa" "select hash(list(hash_val,'' ORDER BY hash_val), 'MD5') as hash_val from (select hash( x||y, 'MD5') as hash_val from (select x,y from test1) as ht) as ht"
hash_val
--------------------------------
d41d8cd98f00b204e9800998ecf8427e
When I perform the same test in PostgreSQL and Oracle then no hash value is returned, which is as expected. Note, when a table does have row data then the hash value matches to Oracle and PostgreSQL, but not so with empty tables.
Could somebody suggest why ?
Thanks
It has to do with the LIST aggregate you are using as argument for the HASH function.
SELECT LIST(null) by definition returns an empty string, and that prevents HASH from returning null.
(The hash value in your sample is that of an empty string.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
11 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.