You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/puppet/provider/database_grant/mysql.rb
+5-5
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,7 @@ def row_exists?
96
96
ifname[:type] == :db
97
97
fields << :db
98
98
end
99
-
not mysql([defaults_file,"mysql",'-NBe','SELECT "1" FROM %s WHERE %s' % [name[:type],fields.mapdo |f| "%s=\"%s\"" % [f,name[f]]end.join(' AND ')]].compact).empty?
99
+
not mysql([defaults_file,"mysql",'-NBe',"SELECT '1' FROM %s WHERE %s" % [name[:type],fields.mapdo |f| "%s='%s'" % [f,name[f]]end.join(' AND ')]].compact).empty?
100
100
end
101
101
102
102
defall_privs_set?
@@ -118,9 +118,9 @@ def privileges
118
118
119
119
casename[:type]
120
120
when:user
121
-
privs=mysql([defaults_file,"mysql","-Be",'select * from mysql.user where user="%s" and host="%s"' % [name[:user],name[:host]]].compact)
121
+
privs=mysql([defaults_file,"mysql","-Be","select * from mysql.user where user='%s' and host='%s'" % [name[:user],name[:host]]].compact)
122
122
when:db
123
-
privs=mysql([defaults_file,"mysql","-Be",'select * from mysql.db where user="%s" and host="%s" and db="%s"' % [name[:user],name[:host],name[:db]]].compact)
123
+
privs=mysql([defaults_file,"mysql","-Be","select * from mysql.db where user='%s' and host='%s' and db='%s'" % [name[:user],name[:host],name[:db]]].compact)
124
124
end
125
125
126
126
ifprivs.match(/^$/)
@@ -149,11 +149,11 @@ def privileges=(privs)
149
149
casename[:type]
150
150
when:user
151
151
stmt='update user set '
152
-
where=' where user="%s" and host="%s"' % [name[:user],name[:host]]
152
+
where=" where user='%s' and host='%s'" % [name[:user],name[:host]]
153
153
all_privs=user_privs
154
154
when:db
155
155
stmt='update db set '
156
-
where=' where user="%s" and host="%s" and db="%s"' % [name[:user],name[:host],name[:db]]
156
+
where=" where user='%s' and host='%s' and db='%s'" % [name[:user],name[:host],name[:db]]
0 commit comments