Skip to content

Instantly share code, notes, and snippets.

@artyom-smirnov
Created June 19, 2020 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artyom-smirnov/9f7f3d873f34fc12dcd721cab92818e3 to your computer and use it in GitHub Desktop.
Save artyom-smirnov/9f7f3d873f34fc12dcd721cab92818e3 to your computer and use it in GitHub Desktop.
#!/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