mirror of
https://github.com/MariaDB/server.git
synced 2025-08-27 13:04:36 +03:00
Review of new pushed code (XA & other)
Portability fixes and cleanups Fixed setting of 'res' in mysql_execute_command()
This commit is contained in:
@@ -1775,8 +1775,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
break;
|
||||
}
|
||||
mysql_log.write(thd,command,db);
|
||||
mysql_rm_db(thd, (lower_case_table_names == 2 ? alias : db),
|
||||
0, 0);
|
||||
mysql_rm_db(thd, db, 0, 0);
|
||||
break;
|
||||
}
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
@@ -3223,8 +3222,6 @@ unsent_create_error:
|
||||
/* revert changes for SP */
|
||||
lex->select_lex.table_list.first= (byte*) first_table;
|
||||
}
|
||||
else
|
||||
res= TRUE;
|
||||
|
||||
if (first_table->view && !first_table->contain_auto_increment)
|
||||
thd->last_insert_id= 0; // do not show last insert ID if VIEW have not it
|
||||
@@ -3309,7 +3306,7 @@ unsent_create_error:
|
||||
delete result;
|
||||
}
|
||||
else
|
||||
res= TRUE;
|
||||
res= TRUE; // Error
|
||||
break;
|
||||
}
|
||||
case SQLCOM_DROP_TABLE:
|
||||
@@ -3535,8 +3532,7 @@ unsent_create_error:
|
||||
ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
|
||||
goto error;
|
||||
}
|
||||
res=mysql_rm_db(thd, (lower_case_table_names == 2 ? alias : lex->name),
|
||||
lex->drop_if_exists, 0);
|
||||
res= mysql_rm_db(thd, lex->name, lex->drop_if_exists, 0);
|
||||
break;
|
||||
}
|
||||
case SQLCOM_ALTER_DB:
|
||||
@@ -3873,10 +3869,7 @@ unsent_create_error:
|
||||
*sv=(*sv)->prev;
|
||||
}
|
||||
else
|
||||
{
|
||||
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "SAVEPOINT", lex->ident.str);
|
||||
res= TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SQLCOM_ROLLBACK_TO_SAVEPOINT:
|
||||
@@ -3905,10 +3898,7 @@ unsent_create_error:
|
||||
*sv=(*sv)->prev;
|
||||
}
|
||||
else
|
||||
{
|
||||
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "SAVEPOINT", lex->ident.str);
|
||||
res= TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SQLCOM_SAVEPOINT:
|
||||
@@ -3935,7 +3925,6 @@ unsent_create_error:
|
||||
savepoint_alloc_size)) == 0)
|
||||
{
|
||||
my_error(ER_OUT_OF_RESOURCES, MYF(0));
|
||||
res= TRUE;
|
||||
break;
|
||||
}
|
||||
newsv->name=strmake_root(&thd->transaction.mem_root,
|
||||
@@ -4341,7 +4330,6 @@ unsent_create_error:
|
||||
}
|
||||
thd->transaction.xa_state=XA_ACTIVE;
|
||||
send_ok(thd);
|
||||
res=TRUE;
|
||||
break;
|
||||
}
|
||||
if (thd->lex->ident.length > MAXGTRIDSIZE || thd->lex->xa_opt != XA_NONE)
|
||||
@@ -4367,7 +4355,6 @@ unsent_create_error:
|
||||
OPTION_BEGIN);
|
||||
thd->server_status|= SERVER_STATUS_IN_TRANS;
|
||||
send_ok(thd);
|
||||
res=TRUE;
|
||||
break;
|
||||
case SQLCOM_XA_END:
|
||||
/* fake it */
|
||||
@@ -4389,7 +4376,6 @@ unsent_create_error:
|
||||
}
|
||||
thd->transaction.xa_state=XA_IDLE;
|
||||
send_ok(thd);
|
||||
res=TRUE;
|
||||
break;
|
||||
case SQLCOM_XA_PREPARE:
|
||||
if (thd->transaction.xa_state != XA_IDLE)
|
||||
@@ -4409,7 +4395,6 @@ unsent_create_error:
|
||||
thd->transaction.xa_state=XA_NOTR;
|
||||
break;
|
||||
}
|
||||
res=TRUE;
|
||||
thd->transaction.xa_state=XA_PREPARED;
|
||||
send_ok(thd);
|
||||
break;
|
||||
@@ -4428,7 +4413,6 @@ unsent_create_error:
|
||||
else
|
||||
{
|
||||
send_ok(thd);
|
||||
res= TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4439,7 +4423,6 @@ unsent_create_error:
|
||||
else
|
||||
{
|
||||
send_ok(thd);
|
||||
res= TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4469,16 +4452,13 @@ unsent_create_error:
|
||||
if (ha_rollback(thd))
|
||||
my_error(ER_XAER_RMERR, MYF(0));
|
||||
else
|
||||
{
|
||||
send_ok(thd);
|
||||
res= TRUE;
|
||||
}
|
||||
thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE);
|
||||
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
|
||||
thd->transaction.xa_state=XA_NOTR;
|
||||
break;
|
||||
case SQLCOM_XA_RECOVER:
|
||||
res= !mysql_xa_recover(thd);
|
||||
res= mysql_xa_recover(thd);
|
||||
break;
|
||||
default:
|
||||
DBUG_ASSERT(0); /* Impossible */
|
||||
|
Reference in New Issue
Block a user