| 1 |
# |
| 2 |
# This file initiate connections to run XA transactions up to |
| 3 |
# their prepare. |
| 4 |
# Connection name, transaction name and its content depends on |
| 5 |
# supplied parameters. |
| 6 |
# |
| 7 |
# param $type type of transaction |
| 8 |
# param $index index identifies the connection with those of type $type |
| 9 |
# param $sql_init1 a query to execute once connection is established |
| 10 |
# param $sql_init2 a query to execute once connection is established |
| 11 |
# param $sql_doit a query to execute inside transaction |
| 12 |
# Note, the query may depend on tables created by caller |
| 13 |
# |
| 14 |
|
| 15 |
--connect (conn$index$type, 127.0.0.1,root,,test,$MASTER_MYPORT,) |
| 16 |
if ($sql_init1) |
| 17 |
{ |
| 18 |
--eval $sql_init1 |
| 19 |
} |
| 20 |
if ($sql_init2) |
| 21 |
{ |
| 22 |
--eval $sql_init2 |
| 23 |
} |
| 24 |
|
| 25 |
--eval XA START 'trx$index$type' |
| 26 |
if ($sql_doit) |
| 27 |
{ |
| 28 |
--eval $sql_doit |
| 29 |
} |
| 30 |
--eval XA END 'trx$index$type' |
| 31 |
--eval XA PREPARE 'trx$index$type' |