The edge version of do_postgres with JRuby causes misterious error like this.

   1   ~ (1) SELECT "id", "digest", "fetched_at", "created_at", "site_id" FROM "pages" WHERE ("site_id" IN (1)) ORDER BY "id"
   2   ~ ERROR: syntax error at or near "("merb : worker (port 4000) ~ ERROR: syntax error at or near "(" - (PostgresError)

The SQL that had been performed is here.

   1  SELECT "id", "digest", "fetched_at", "created_at", "site_id" FROM "pages" WHERE ("site_id" IN (1)) ORDER BY "id"

This is able to be performed successfully at the psql console. So I wonder what the error message means.

Updates

I found the bug.

For example, this code

   1  Page.repository.adapter.execute('SELECT * FROM "pages" WHERE ("id" IN ?) AND ("site_id" = ?)', [1], nil)

generates this sql

   1  SELECT * FROM "pages" WHERE ("id" IN (1)) AND ("site_id" = (NULL))

(NULL) causes parsing error.

This issue happens if the first value is an Array and the succeeding values are not Arrays.

posted by Png takiuchi on Sun 7 Jun 2009 at 20:12
Contents
A Trouble Caused by Using do_postgres with JRuby
Comments
Spencer: You don't have to re-compile it, this version w... '14-4
staiano: Any chance we can get a recompile for 10.9? '14-1
falsefalse: @tiancongxin try using this one https://github.... '12-2
tiancongxin: TerminalCopyOnSelect not work on OS X 'Lion' , ... '11-7
staiano: Roderick you rock for recompiling it. Thanks. '11-3
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ