cockroachdb / cockroachdb/activerecord-cockroachdb-adapter

Prepared statement error on varchar array columns

オープン
#371 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Ruby
スター
105
フォーク
56
平均マージ
9時間 5分
マージ済み PR(30日)
3

説明

Version 7.2 of the adapter seems to reject `? = ANY(array_column)` queries.

### Steps to Reproduce:

Install and run CockroachDB v25.1.2 locally.
Create a Rails application using the following packages.
```ruby
gem 'activerecord-cockroachdb-adapter', '~> 7.2'
gem 'rails', '~> 7.2.2'
```

Create a table containing a column containing a string array using the following script:
```ruby
class AddUsers < ActiveRecord::Migration[7.2]
def change
create_table :users do |t|
t.string :languages, array: true
end
end
end
```

Complete the migration. Open Rails console and run: `User.where('? = ANY(languages)', 'en')`.

This error is raised:
`#`

I am able to run `select * from users where 'en' = ANY (languages)` directly in CockroachDB, so I think that the error is caused by the driver.

The same statement runs without issues on Postgres 12.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。