diff options
author | unknown <acurtis@pcgem.rdg.cyberkinetica.com> | 2005-02-01 19:48:05 +0000 |
---|---|---|
committer | unknown <acurtis@pcgem.rdg.cyberkinetica.com> | 2005-02-01 19:48:05 +0000 |
commit | 0e50e32480920c29f2efacfcbfa35c9c93838840 (patch) | |
tree | bbf0adb98417062aa825a294e28389e8eed0ec43 /innobase/trx | |
parent | f7606a335e44841e2cac79cc7256b6eb489c7b82 (diff) | |
download | mariadb-git-0e50e32480920c29f2efacfcbfa35c9c93838840.tar.gz |
WL#1967
Support for COMMIT/ROLLBACK optional arguments
innobase/include/trx0roll.h:
WL#1967
trx_release_savepoint_for_mysql()
innobase/trx/trx0roll.c:
WL#1967
trx_release_savepoint_for_mysql()
mysql-test/r/innodb.result:
WL#1967
Test for savepoint release
mysql-test/t/innodb.test:
WL#1967
Test for savepoint release
sql/ha_innodb.cc:
WL#1967
innobase_release_savepoint_name()
sql/ha_innodb.h:
WL#1967
innobase_release_savepoint_name()
sql/handler.cc:
WL#1967
ha_release_savepoint_name()
sql/handler.h:
WL#1967
ha_release_savepoint_name()
sql/lex.h:
WL#1967
New tokens: CHAIN, RELEASE
sql/mysqld.cc:
WL#1967
new option: completion-type
sql/set_var.cc:
WL#1967
new option: completion-type
sql/sql_class.h:
WL#1967
new option: completion-type
sql/sql_lex.h:
WL#1967
Support RELEASE SAVEPOINT
additional flags to support COMMIT/ROLLBACK options
sql/sql_parse.cc:
WL#1967
Transaction operations in mysql_endtrans(), begin_trans()
sql/sql_yacc.yy:
WL#1967
Support COMMIT/ROLLBACK optional args
Diffstat (limited to 'innobase/trx')
-rw-r--r-- | innobase/trx/trx0roll.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c index e5cffd2a4f3..cba3040fd0e 100644 --- a/innobase/trx/trx0roll.c +++ b/innobase/trx/trx0roll.c @@ -317,6 +317,51 @@ trx_savepoint_for_mysql( } /*********************************************************************** +Releases a named savepoint. Savepoints which +were set after this savepoint are deleted. */ + +ulint +trx_release_savepoint_for_mysql( +/*================================*/ + /* out: if no savepoint + of the name found then + DB_NO_SAVEPOINT, + otherwise DB_SUCCESS */ + trx_t* trx, /* in: transaction handle */ + const char* savepoint_name) /* in: savepoint name */ +{ + trx_named_savept_t* savep; + + savep = UT_LIST_GET_FIRST(trx->trx_savepoints); + + while (savep != NULL) { + if (0 == ut_strcmp(savep->name, savepoint_name)) { + /* Found */ + break; + } + savep = UT_LIST_GET_NEXT(trx_savepoints, savep); + } + + if (savep == NULL) { + + return(DB_NO_SAVEPOINT); + } + + /* We can now free all savepoints strictly later than this one */ + + trx_roll_savepoints_free(trx, savep); + + /* Now we can free this savepoint too */ + + UT_LIST_REMOVE(trx_savepoints, trx->trx_savepoints, savep); + + mem_free(savep->name); + mem_free(savep); + + return(DB_SUCCESS); +} + +/*********************************************************************** Returns a transaction savepoint taken at this point in time. */ trx_savept_t |