未验证 提交 1d0ea1ce 编写于 作者: R Rafael França 提交者: Rafael Mendonça França

Merge pull request #34561 from gmcgibbon/allow_spaces_in_table_names

Allow spaces in postgres table names
上级 01f076e6
* Allow spaces in postgres table names.
Fixes issue where "user post" is misinterpreted as "\"user\".\"post\"" when quoting table names with the postgres adapter.
*Gannon McGibbon*
* Cached columns_hash fields should be excluded from ResultSet#column_types
PR #34528 addresses the inconsistent behaviour when attribute is defined for an ignored column. The following test
......
......@@ -68,7 +68,7 @@ module Utils # :nodoc:
# * <tt>"schema_name".table_name</tt>
# * <tt>"schema.name"."table name"</tt>
def extract_schema_qualified_name(string)
schema, table = string.scan(/[^".\s]+|"[^"]*"/)
schema, table = string.scan(/[^".]+|"[^"]*"/)
if table.nil?
table = schema
schema = nil
......
......@@ -39,6 +39,11 @@ def test_quote_bit_string
type = OID::Bit.new
assert_nil @conn.quote(type.serialize(value))
end
def test_quote_table_name_with_spaces
value = "user posts"
assert_equal "\"user posts\"", @conn.quote_table_name(value)
end
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册