1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge b6883-mysql-4.1 -> 5.0

This commit is contained in:
lars@mysql.com
2005-06-07 12:30:32 +02:00
13 changed files with 2281 additions and 21 deletions

View File

@ -2740,6 +2740,20 @@ mysql_execute_command(THD *thd)
case SQLCOM_CREATE_TABLE:
{
/* If CREATE TABLE of non-temporary table, do implicit commit */
if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
{
if (end_active_trans(thd))
{
res= -1;
break;
}
}
else
{
/* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */
thd->options|= OPTION_STATUS_NO_TRANS_UPDATE;
}
DBUG_ASSERT(first_table == all_tables && first_table != 0);
bool link_to_local;
// Skip first table, which is the table we are creating
@ -3232,6 +3246,11 @@ end_with_restore_list:
break;
}
case SQLCOM_TRUNCATE:
if (end_active_trans(thd))
{
res= -1;
break;
}
DBUG_ASSERT(first_table == all_tables && first_table != 0);
if (check_one_table_access(thd, DELETE_ACL, all_tables))
goto error;
@ -3324,6 +3343,9 @@ end_with_restore_list:
*/
if (thd->slave_thread)
lex->drop_if_exists= 1;
/* So that DROP TEMPORARY TABLE gets to binlog at commit/rollback */
thd->options|= OPTION_STATUS_NO_TRANS_UPDATE;
}
res= mysql_rm_table(thd, first_table, lex->drop_if_exists,
lex->drop_temporary);
@ -3462,6 +3484,11 @@ end_with_restore_list:
break;
case SQLCOM_CREATE_DB:
{
if (end_active_trans(thd))
{
res= -1;
break;
}
char *alias;
if (!(alias=thd->strdup(lex->name)) || check_db_name(lex->name))
{
@ -3492,6 +3519,11 @@ end_with_restore_list:
}
case SQLCOM_DROP_DB:
{
if (end_active_trans(thd))
{
res= -1;
break;
}
if (check_db_name(lex->name))
{
my_error(ER_WRONG_DB_NAME, MYF(0), lex->name);