mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
This commit is contained in:
@ -126,6 +126,11 @@ static bool end_active_trans(THD *thd)
|
||||
{
|
||||
int error=0;
|
||||
DBUG_ENTER("end_active_trans");
|
||||
if (unlikely(thd->transaction.in_sub_stmt))
|
||||
{
|
||||
my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN |
|
||||
OPTION_TABLE_LOCK))
|
||||
{
|
||||
@ -144,6 +149,15 @@ static bool end_active_trans(THD *thd)
|
||||
static bool begin_trans(THD *thd)
|
||||
{
|
||||
int error=0;
|
||||
/*
|
||||
QQ: May be it is better to simply prohibit COMMIT and ROLLBACK in
|
||||
stored routines as SQL2003 suggests?
|
||||
*/
|
||||
if (unlikely(thd->transaction.in_sub_stmt))
|
||||
{
|
||||
my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
|
||||
return 1;
|
||||
}
|
||||
if (thd->locked_tables)
|
||||
{
|
||||
thd->lock=thd->locked_tables;
|
||||
@ -1341,6 +1355,15 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion)
|
||||
int res= 0;
|
||||
DBUG_ENTER("end_trans");
|
||||
|
||||
/*
|
||||
QQ: May be it is better to simply prohibit COMMIT and ROLLBACK in
|
||||
stored routines as SQL2003 suggests?
|
||||
*/
|
||||
if (unlikely(thd->transaction.in_sub_stmt))
|
||||
{
|
||||
my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
switch (completion) {
|
||||
case COMMIT:
|
||||
/*
|
||||
|
Reference in New Issue
Block a user