lib/og/adapters/mysql.rb in og-0.12.0 vs lib/og/adapters/mysql.rb in og-0.13.0
- old
+ new
@@ -1,8 +1,8 @@
# * George Moschovitis <gm@navel.gr>
# (c) 2004-2005 Navel, all rights reserved.
-# $Id: mysql.rb 270 2005-03-07 17:52:16Z gmosx $
+# $Id: mysql.rb 281 2005-03-10 12:24:14Z gmosx $
require 'mysql'
require 'og/adapter'
require 'og/connection'
@@ -73,15 +73,16 @@
return "YAML::load(res[#{idx}])"
end
end
def create_db(database, user = nil, password = nil)
- `mysqladmin -f --user=#{user} --password=#{password} create #{database}`
+ # gmosx: system is used to avoid shell expansion.
+ system 'mysqladmin', '-f', "--user=#{user}", "--password=#{password}", 'create', database
super
end
def drop_db(database, user = nil, password = nil)
- `mysqladmin -f --user=#{user} --password=#{password} drop #{database}`
+ system 'mysqladmin', '-f', "--user=#{user}", "--password=#{password}", 'drop', database
super
end
def props_for_insert(klass)
klass.__props.reject { |p| :oid == p.symbol }