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

pre>>
~ (1) SELECT "id", "digest", "fetched_at", "created_at", "site_id" FROM "pages" WHERE ("site_id" IN (1)) ORDER BY "id"
~ 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.

sql>>
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

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

generates this sql

sql>>
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 takiuchi takiuchi on Sun 7 Jun 2009 at 20:06 with 0 comments
Contents rssrss
Google +1 button causes trouble with Amazon ELB
How to build collada-dom on Linux
cmakeをhomeの下にインストールする手順のメモ
原子レベルのレンダリングに関するメモ
gluLookAtの等価表現
Where the Fl_Gl_Box is / Fl_Gl_Boxのありか
How to display the list of options for CMake
How to install collada-dom to MacOS X
積分方程式の分類について
Terminology of parallel computing needs recomposition
Tags
memocmakecolladaopengl3Damazonatomiccgcomputingdnselbfltkgoogleissuemacmathparallelreportthoughtsメモ
Comments rssrss
Spencer Spencer: You don't have to re-compile it, this version work... 04/08 07:15
staiano staiano: Any chance we can get a recompile for 10.9? 01/10 01:47
falsefalse falsefalse: @tiancongxin try using this one https://github.com... 02/14 08:04
tiancongxin tiancongxin: TerminalCopyOnSelect not work on OS X 'Lion' , cou... 07/21 17:21
staiano staiano: Roderick you rock for recompiling it. Thanks. 03/25 02:42
瀧内元気 瀧内元気: The merbi.st domain has been expired. So now it is... 01/03 17:25
Roderick Roderick: I've compiled the current version from github, thi... 08/24 15:57
swissarmychainsaw swissarmychainsaw: How do I get around this error message? Error Term... 08/20 20:43
Services from s21g
YOMU Web小説リーダー
Web小説を音声で楽しむ読み上げリーダー
補助探
公開されている補助金・助成金情報を集約し、条件に合う制度を探しやすくするサービスです。
jotter.me
個人開発者のためのホスティング一体型ノートサービス
ハンドミラー
iPhone向けの手鏡アプリ
ツイプロ(twpro)
Twitterプロフィールの高速検索エンジン