mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 18:20:07 +01:00
Replace non portable system commmands in trigger-grant
This commit is contained in:
parent
d1351a6dd8
commit
f80babd617
1 changed files with 13 additions and 3 deletions
|
@ -232,9 +232,19 @@ CREATE TRIGGER trg5 BEFORE DELETE ON t1
|
|||
FOR EACH ROW
|
||||
SET @a = 5;
|
||||
|
||||
--system grep -v '^definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
|
||||
--system echo "definers='' '@' '@abc@def@@' '@hostname' '@abcdef@@@hostname'" >> $MYSQLTEST_VARDIR/tmp/t1.TRG
|
||||
--system mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
|
||||
# Replace definers with the "weird" definers
|
||||
perl;
|
||||
use strict;
|
||||
use warnings;
|
||||
my $fname= "$ENV{'MYSQLTEST_VARDIR'}/master-data/mysqltest_db1/t1.TRG";
|
||||
open(FILE, "<", $fname) or die;
|
||||
my @content= grep($_ !~ /^definers=/, <FILE>);
|
||||
close FILE;
|
||||
open(FILE, ">", $fname) or die;
|
||||
print FILE @content;
|
||||
print FILE "definers='' '\@' '\@abc\@def\@\@' '\@hostname' '\@abcdef\@\@\@hostname'\n";
|
||||
close FILE;
|
||||
EOF
|
||||
|
||||
--echo
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue