Created
June 19, 2020 13:34
-
-
Save artyom-smirnov/9f7f3d873f34fc12dcd721cab92818e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -f repro.fdb f | |
ISQL=bin/isql | |
GFIX=bin/gfix | |
cat << EOF > create.sql | |
create database 'repro.fdb'; | |
create table test(test varchar(255)); | |
EOF | |
cat << EOF > connect.sql | |
connect 'repro.fdb' user 'sysdba' password 'masterkey'; | |
exit; | |
EOF | |
cat << EOF > gdbinit | |
set \$_exitcode = -1 | |
run | |
if \$_exitcode != -1 | |
quit | |
end | |
EOF | |
$ISQL -u sysdba -p masterkey -i create.sql | |
$GFIX -user sysdba -pass masterkey -h 0 repro.fdb | |
mkfifo f | |
cat f | $ISQL -u sysdba -p masterkey repro.fdb& | |
ISQL_PID=$! | |
exec 3>f | |
for i in `seq 1 1000`; do | |
cat << EOF > f | |
insert into test values('text'); | |
EOF | |
done | |
kill -KILL $ISQL_PID | |
$GFIX -user sysdba -pass masterkey -h 1 repro.fdb | |
while true; do gdb -x gdbinit --args $ISQL -u sysdba -p masterkey -i connect.sql; done | |
#while true; do $ISQL -u sysdba -p masterkey -i connect.sql; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment