Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(JP) timestamp型の比較を行うSQL文の実行結果が正しくないことがある #22

Closed
taiki-k opened this issue May 28, 2014 · 3 comments
Labels
bug developer confirmed the steps to reproduce the problem, and does not work as expected

Comments

@taiki-k
Copy link
Contributor

taiki-k commented May 28, 2014

最新のコードで以下のSQL文を実行したところと、結果が0 rowsとなりました。
SeqScanで行うと、5 rowsが表示されます。

  • 実行したSQL文
SELECT * FROM temperature_tokyo WHERE high - low >= 15 AND high_time < low_time;
  • 結果(GPU)
pgstrom_test=#  explain select * from temperature_tokyo where high - low >= 15 and high_time < low_time;
                                      QUERY PLAN
--------------------------------------------------------------------------------------
 Custom (GpuScan) on temperature_tokyo  (cost=10000.00..10048.05 rows=609 width=28)
   Host References: date, high, high_time, low, low_time
   Device References: high, high_time, low, low_time
   Device Filter: ((high_time < low_time) AND ((high - low) >= 15::double precision))
 Planning time: 0.335 ms
(5 rows)

pgstrom_test=# select * from temperature_tokyo where high - low >= 15 and high_time < low_time;
INFO:  now building tcache...
INFO:  tcache build done...
 date | high | high_time | low | low_time
------+------+-----------+-----+----------
(0 rows)
  • 結果(SeqScan)
pgstrom_test=#  explain select * from temperature_tokyo where high - low >= 15 and high_time < low_time;
                                  QUERY PLAN
-------------------------------------------------------------------------------
 Seq Scan on temperature_tokyo  (cost=0.00..136.88 rows=609 width=28)
   Filter: ((high_time < low_time) AND ((high - low) >= 15::double precision))
 Planning time: 0.242 ms
(3 rows)

pgstrom_test=# select * from temperature_tokyo where high - low >= 15 and high_time < low_time;
    date    | high |      high_time      | low  |      low_time
------------+------+---------------------+------+---------------------
 2001-04-03 | 22.5 | 2001-04-03 13:38:00 |  7.3 | 2001-04-03 23:47:00
 2003-05-08 | 26.9 | 2003-05-08 11:11:00 | 11.3 | 2003-05-09 00:00:00
 2008-02-23 |   17 | 2008-02-23 13:06:00 |  0.7 | 2008-02-24 00:00:00
 2008-12-22 | 19.9 | 2008-12-22 10:17:00 |  4.2 | 2008-12-22 20:20:00
 2013-03-10 | 25.3 | 2013-03-10 13:10:00 |  5.7 | 2013-03-10 23:58:00
(5 rows)
  • 対象のテーブル
          Table "public.temperature_tokyo"
  Column   |            Type             | Modifiers
-----------+-----------------------------+-----------
 date      | date                        |
 high      | real                        |
 high_time | timestamp without time zone |
 low       | real                        |
 low_time  | timestamp without time zone |

WHERE句の "high - low >= 15" の条件がない場合は、正しい結果が出力されるように見えます。

@taiki-k
Copy link
Contributor Author

taiki-k commented May 28, 2014

nVidiaのほうで試したところ、こちらはAssertion Failedとなりました。

  • バックトレース
#0  0x0000003cdbc32925 in raise () from /lib64/libc.so.6
#1  0x0000003cdbc3408d in abort () from /lib64/libc.so.6
#2  0x0000000000949085 in ExceptionalCondition (conditionName=0x7fab3123c2c1 "!(rc == 0)",
    errorType=0x7fab3123b884 "FailedAssertion", fileName=0x7fab3123b8ad "gpuscan.c", lineNumber=2269) at assert.c:54
#3  0x00007fab31224138 in clserv_respond_gpuscan_column (event=0x7faa84bc0e80, ev_status=0, private=0x7faa84845930) at gpuscan.c:2269
#4  0x00007faaa6eeb283 in ?? () from /usr/lib64/libnvidia-opencl.so.1
#5  0x00007faaa6eefa73 in ?? () from /usr/lib64/libnvidia-opencl.so.1
#6  0x00007faaa6ef01e4 in ?? () from /usr/lib64/libnvidia-opencl.so.1
#7  0x00007faaa767bf89 in ?? () from /usr/lib64/libnvidia-opencl.so.1
#8  0x0000003cdc0079d1 in start_thread () from /lib64/libpthread.so.0
#9  0x0000003cdbce8b6d in clone () from /lib64/libc.so.6

@kaigai
Copy link
Contributor

kaigai commented May 29, 2014

#23と同根かと思います。こちらも最新版をpullして再現確認をお願いします。

@taiki-k
Copy link
Contributor Author

taiki-k commented May 29, 2014

最新版で再現確認を行ったところ、再現しなくなりました。
修正されたものと判断します。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug developer confirmed the steps to reproduce the problem, and does not work as expected
Projects
None yet
Development

No branches or pull requests

2 participants