Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix can't modify frozen String error in DBConsole #30451

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion railties/lib/rails/commands/dbconsole/dbconsole_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions railties/test/commands/dbconsole_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down