@@ -412,12 +412,19 @@ class { 'mysql::server': }
412
412
describe 'adding procedure privileges' do
413
413
it 'should work without errors' do
414
414
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
+ }
415
422
mysql_user { 'test2@tester':
416
423
ensure => present,
417
424
}
418
- mysql_grant { 'test2@tester/PROCEDURE test .simpleproc':
425
+ mysql_grant { 'test2@tester/PROCEDURE mysql .simpleproc':
419
426
ensure => 'present',
420
- table => 'PROCEDURE test .simpleproc',
427
+ table => 'PROCEDURE mysql .simpleproc',
421
428
user => 'test2@tester',
422
429
privileges => ['EXECUTE'],
423
430
require => Mysql_user['test2@tester'],
@@ -429,7 +436,7 @@ class { 'mysql::server': }
429
436
430
437
it 'should find the user' do
431
438
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'/ )
433
440
expect ( r . stderr ) . to be_empty
434
441
end
435
442
end
0 commit comments