Skip to content

Commit 86a8e7b

Browse files
authored
Merge pull request #978 from dr-itz/pg-bind-params-length
[postgres] fix bind params length
2 parents 415e9bd + a762706 commit 86a8e7b

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

lib/arjdbc/postgresql/adapter.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,10 @@ def local_tz
690690
@local_tz ||= execute('SHOW TIME ZONE', 'SCHEMA').first["TimeZone"]
691691
end
692692

693+
def bind_params_length
694+
32767
695+
end
696+
693697
end
694698
end
695699

test/bind_params_length_test.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'test_helper'
2+
require 'models/topic'
3+
4+
class BindParamsLengthTest < Test::Unit::TestCase
5+
def setup
6+
TopicMigration.up
7+
Topic.create!(title: 'blub')
8+
end
9+
10+
def teardown
11+
TopicMigration.down
12+
end
13+
14+
def test_bind_param_length
15+
assert Topic.where(id: [1] * 75000).first
16+
end
17+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'db/mysql'
2+
require 'bind_params_length_test'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'db/postgres'
2+
require 'bind_params_length_test'

0 commit comments

Comments
 (0)