{"action":"closed","issue":{"url":"https://api.github.com/repos/pg-strom/devel/issues/93","labels_url":"https://api.github.com/repos/pg-strom/devel/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/pg-strom/devel/issues/93/comments","events_url":"https://api.github.com/repos/pg-strom/devel/issues/93/events","html_url":"https://github.com/pg-strom/devel/issues/93","id":50799349,"number":93,"title":"(JP) データがnullの場合に、sum()の結果が0となる。","user":{"login":"ahase","id":7367747,"avatar_url":"https://avatars.githubusercontent.com/u/7367747?v=3","gravatar_id":"","url":"https://api.github.com/users/ahase","html_url":"https://github.com/ahase","followers_url":"https://api.github.com/users/ahase/followers","following_url":"https://api.github.com/users/ahase/following{/other_user}","gists_url":"https://api.github.com/users/ahase/gists{/gist_id}","starred_url":"https://api.github.com/users/ahase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahase/subscriptions","organizations_url":"https://api.github.com/users/ahase/orgs","repos_url":"https://api.github.com/users/ahase/repos","events_url":"https://api.github.com/users/ahase/events{/privacy}","received_events_url":"https://api.github.com/users/ahase/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-12-03T08:07:52Z","updated_at":"2015-02-07T01:04:53Z","closed_at":"2015-02-07T01:04:53Z","body":"値が存在しないデータに対して、「select sum(x) from test;」を実行すると、nullが出力されるべき結果に0が出力される。smallintとinteger, smallserial, serial型のデータ型で問題が発生する。\r\n\r\n----------------------------------------------------------------------------------------------------------\r\n<pre>\r\npostgres=# \\d test\r\n     Table \"public.test\"\r\n Column |  Type   | Modifiers\r\n--------+---------+-----------\r\n key    | integer |\r\n x      | integer |\r\n\r\n\r\npostgres=# select * from test;\r\n key | x\r\n-----+---\r\n   1 |\r\n(1 row)\r\n\r\n\r\n(reverse-i-search)`sum': select ^Cm(x) from test;\r\npostgres=# set pg_strom.enabled=on;\r\nSET\r\npostgres=# select sum(x) from test;\r\n sum\r\n-----\r\n   0\r\n(1 row)\r\n\r\n\r\npostgres=# set pg_strom.enabled=off;\r\nSET\r\npostgres=# select sum(x) from test;\r\n sum\r\n-----\r\n\r\n(1 row)\r\n</pre>\r\n"}}