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) numeric型に対する比較演算を行うSQL文でコンパイルエラーとなることがある #26

Closed
taiki-k opened this issue May 30, 2014 · 2 comments
Labels
feature developer considers it is the feature to be supported on the future version

Comments

@taiki-k
Copy link
Contributor

taiki-k commented May 30, 2014

最新版のコードで、WHERE句にnumeric型のカラムに対する比較演算を記述すると、コンパイルエラーとなることがあります。

  • 実行したSQL文
SELECT * FROM stock_6701t WHERE turnover = 10000000::numeric
SELECT * FROM stock_6701t WHERE turnover < 10000000::numeric
SELECT * FROM stock_6701t WHERE turnover > 10000000::numeric
SELECT * FROM stock_6701t WHERE turnover <= 10000000::numeric
SELECT * FROM stock_6701t WHERE turnover >= 10000000::numeric
  • 対象のテーブル
   Table "public.stock_6701t"
  Column  |  Type   | Modifiers
----------+---------+-----------
 date     | date    | not null
 startp   | money   | not null
 highp    | money   | not null
 lowp     | money   | not null
 endp     | money   | not null
 turnover | numeric |
 totalp   | money   |
Indexes:
    "stock_6701t_pkey" PRIMARY KEY, btree (date)
  • エラーメッセージ ("="の場合)
ERROR:  PG-Strom: OpenCL execution error (build program failure)
#ifndef PG_BYTEA_TYPE_DEFINED
STROMCL_VARLENA_TYPE_TEMPLATE(bytea)
#endif
#ifndef PG_BOOL_TYPE_DEFINED
STROMCL_SIMPLE_TYPE_TEMPLATE(bool,cl_bool)
#endif
#ifndef PG_NUMERIC_TYPE_DEFINED
STROMCL_VARLENA_TYPE_TEMPLATE(numeric)
#endif

#define KPARAM_0        pg_bytea_param(kparams,errcode,0)
#define KPARAM_1        pg_numeric_param(kparams,errcode,1)
#define KVAR_0  pg_numeric_vref(kcs,toast,errcode,0,kcs_index)

static pg_bool_t
gpuscan_qual_eval(__private cl_int *errcode,
                  __global kern_gpuscan *kgscan,
                  __global kern_column_store *kcs,
                  __global kern_toastbuf *toast,
                  size_t kcs_index)
{
  __global kern_parambuf *kparams
      = KERN_GPUSCAN_PARAMBUF(kgscan);

  return pgfn_numeric_eq(errcode, KVAR_0, KPARAM_1);
}

DETAIL:  Compilation started
5:1890:10: error: implicit declaration of function 'pgfn_numeric_eq' is invalid in OpenCL
5:1890:10: note: did you mean 'pg_numeric_vref'?
5:1873:1: note: 'pg_numeric_vref' declared here
5:918:2: note: expanded from macro 'STROMCL_VARLENA_TYPE_TEMPLATE'
5:884:2: note: expanded from macro 'STROMCL_VARLENA_VARREF_TEMPLATE'
<scratch space>:79:1: note: expanded from macro 'pg_'
5:1890:10: error: returning 'int' from a function with incompatible result type 'pg_bool_t'
Compilation failed

以下のSQL文では、正しい結果が表示されます。

SELECT * FROM stock_6701t WHERE turnover - 10000000::numeric > 0::numeric
@taiki-k
Copy link
Contributor Author

taiki-k commented May 30, 2014

「未実装で、6末以降に実装する方向」とのことです。

@kaigai
Copy link
Contributor

kaigai commented Oct 27, 2014

コードベースが非常に古いので、一旦クローズ扱いとします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature developer considers it is the feature to be supported on the future version
Projects
None yet
Development

No branches or pull requests

2 participants