diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-12-19 05:22:28 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-12-19 05:22:28 -0800 |
commit | cc1f0b4c2df0fa12ad6f3fd3b496e72e6f428e9c (patch) | |
tree | 5e2053e941b5c7ec610c8f337c56ec1f10b66cbb /activerecord/test | |
parent | d54bc032c90517fc1e57db9fca75e3297acc86fb (diff) | |
parent | b082bece5ed99a1bb1ff9d4af5f9d97a3dcaf6c1 (diff) | |
download | rails-cc1f0b4c2df0fa12ad6f3fd3b496e72e6f428e9c.tar.gz rails-cc1f0b4c2df0fa12ad6f3fd3b496e72e6f428e9c.tar.bz2 rails-cc1f0b4c2df0fa12ad6f3fd3b496e72e6f428e9c.zip |
Merge pull request #13395 from kuldeepaggarwal/postgres-table-ref-regex
modified regex for finding table_name from a multiline sql query in postgresql
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb index 8b017760b1..5372f8821f 100644 --- a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb +++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb @@ -62,6 +62,18 @@ module ActiveRecord assert_equal expect, id end + def test_multiline_insert_sql + id = @connection.insert_sql(<<-SQL) + insert into ex( + number) + values( + 5152 + ) + SQL + expect = @connection.query('select max(id) from ex').first.first + assert_equal expect, id + end + def test_insert_sql_with_returning_disabled connection = connection_without_insert_returning id = connection.insert_sql("insert into postgresql_partitioned_table_parent (number) VALUES (1)") |