Skip to content

Commit 05c4baf

Browse files
authored
Merge pull request #874 from bmjen/fix-grants
Fixes procedure grant tests for 5.7.12
2 parents a183846 + 561ad9a commit 05c4baf

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

spec/acceptance/types/mysql_grant_spec.rb

+10-3
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,19 @@ class { 'mysql::server': }
412412
describe 'adding procedure privileges' do
413413
it 'should work without errors' do
414414
pp = <<-EOS
415+
if $::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemmajrelease, '16.00') > 0 {
416+
exec { 'simpleproc-create':
417+
command => 'mysql --database=mysql --delimiter="//" -NBe "CREATE PROCEDURE simpleproc (OUT param1 INT) BEGIN SELECT COUNT(*) INTO param1 FROM t; end//"',
418+
path => '/usr/bin/',
419+
before => Mysql_user['test2@tester'],
420+
}
421+
}
415422
mysql_user { 'test2@tester':
416423
ensure => present,
417424
}
418-
mysql_grant { 'test2@tester/PROCEDURE test.simpleproc':
425+
mysql_grant { 'test2@tester/PROCEDURE mysql.simpleproc':
419426
ensure => 'present',
420-
table => 'PROCEDURE test.simpleproc',
427+
table => 'PROCEDURE mysql.simpleproc',
421428
user => 'test2@tester',
422429
privileges => ['EXECUTE'],
423430
require => Mysql_user['test2@tester'],
@@ -429,7 +436,7 @@ class { 'mysql::server': }
429436

430437
it 'should find the user' do
431438
shell("mysql -NBe \"SHOW GRANTS FOR test2@tester\"") do |r|
432-
expect(r.stdout).to match(/GRANT EXECUTE ON PROCEDURE `test`.`simpleproc` TO 'test2'@'tester'/)
439+
expect(r.stdout).to match(/GRANT EXECUTE ON PROCEDURE `mysql`.`simpleproc` TO 'test2'@'tester'/)
433440
expect(r.stderr).to be_empty
434441
end
435442
end

0 commit comments

Comments
 (0)