This project is archived and is in readonly mode.
PostgreSQL: name in CREATE DATABASE is not properly escaped
-
Jeremy Kemper
- Milestone set to 2.1.1
- State changed from new to incomplete
Please extract to quote_database_name and add a test case.
-
Roel van der Hoorn
I'm unable to find existing tests relating to this functionality, but the following should test it I guess.
def test_should_create_database_with_dot assert_nothing_raised do create_database("r.vanderhoorn") end end -
Irene
- Tag set to 2.1, postgresql, quoting
Same with the drop database:
def drop_database(name) #:nodoc: execute "DROP DATABASE IF EXISTS #{name}" endShould be:
def drop_database(name) #:nodoc: execute "DROP DATABASE IF EXISTS \"#{name}\"" end -
Roel van der Hoorn
Looks like both issues were fixed in 2.1.1.
-
Jeremy Kemper
- State changed from incomplete to duplicate