提交 c3b2d711 编写于 作者: Y yuuji.yaginuma

Fix `can't modify frozen String` error in `DBConsole`

Without this, `dbconsole` raises an error as follwing:

```
RuntimeError: can't modify frozen String
    railties/lib/rails/commands/dbconsole/dbconsole_command.rb:79:in `start'
```
上级 ca941da4
......@@ -75,7 +75,7 @@ def start
args += ["-P", "#{config['password']}"] if config["password"]
if config["host"]
host_arg = "#{config['host']}"
host_arg = "#{config['host']}".dup
host_arg << ":#{config['port']}" if config["port"]
args += ["-S", host_arg]
end
......
......@@ -206,6 +206,12 @@ def test_oracle_include_password
assert_equal ["sqlplus", "user/secret@db"], dbconsole.find_cmd_and_exec_args
end
def test_sqlserver
start(adapter: "sqlserver", database: "db", username: "user", password: "secret", host: "localhost", port: 1433)
assert_not aborted
assert_equal ["sqsh", "-D", "db", "-U", "user", "-P", "secret", "-S", "localhost:1433"], dbconsole.find_cmd_and_exec_args
end
def test_unknown_command_line_client
start(adapter: "unknown", database: "db")
assert aborted
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册