mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.2 into bb-10.2-ext
This commit is contained in:
@ -2091,6 +2091,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, bool if_exists,
|
||||
DBUG_RETURN(TRUE);
|
||||
my_ok(thd);
|
||||
DBUG_RETURN(FALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2137,7 +2138,6 @@ static uint32 comment_length(THD *thd, uint32 comment_pos,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute the drop of a normal or temporary table.
|
||||
|
||||
@ -2573,6 +2573,9 @@ err:
|
||||
/* Chop of the last comma */
|
||||
built_non_trans_tmp_query.chop();
|
||||
built_non_trans_tmp_query.append(" /* generated by server */");
|
||||
#ifdef WITH_WSREP
|
||||
thd->wsrep_skip_wsrep_GTID = true;
|
||||
#endif /* WITH_WSREP */
|
||||
error |= thd->binlog_query(THD::STMT_QUERY_TYPE,
|
||||
built_non_trans_tmp_query.ptr(),
|
||||
built_non_trans_tmp_query.length(),
|
||||
@ -2585,6 +2588,9 @@ err:
|
||||
/* Chop of the last comma */
|
||||
built_trans_tmp_query.chop();
|
||||
built_trans_tmp_query.append(" /* generated by server */");
|
||||
#ifdef WITH_WSREP
|
||||
thd->wsrep_skip_wsrep_GTID = true;
|
||||
#endif /* WITH_WSREP */
|
||||
error |= thd->binlog_query(THD::STMT_QUERY_TYPE,
|
||||
built_trans_tmp_query.ptr(),
|
||||
built_trans_tmp_query.length(),
|
||||
@ -2599,6 +2605,9 @@ err:
|
||||
built_query.append(" /* generated by server */");
|
||||
int error_code = non_tmp_error ? thd->get_stmt_da()->sql_errno()
|
||||
: 0;
|
||||
#ifdef WITH_WSREP
|
||||
thd->wsrep_skip_wsrep_GTID = false;
|
||||
#endif /* WITH_WSREP */
|
||||
error |= thd->binlog_query(THD::STMT_QUERY_TYPE,
|
||||
built_query.ptr(),
|
||||
built_query.length(),
|
||||
@ -2647,6 +2656,9 @@ err:
|
||||
}
|
||||
|
||||
end:
|
||||
#ifdef WITH_WSREP
|
||||
thd->wsrep_skip_wsrep_GTID = false;
|
||||
#endif /* WITH_WSREP */
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
@ -7566,9 +7578,26 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
||||
{
|
||||
if (def->change.str && ! def->field)
|
||||
{
|
||||
my_error(ER_BAD_FIELD_ERROR, MYF(0), def->change.str,
|
||||
table->s->table_name.str);
|
||||
goto err;
|
||||
/*
|
||||
Check if there is modify for newly added field.
|
||||
*/
|
||||
Create_field *find;
|
||||
find_it.rewind();
|
||||
while((find=find_it++))
|
||||
{
|
||||
if (!my_strcasecmp(system_charset_info,find->field_name.str,
|
||||
def->field_name.str))
|
||||
break;
|
||||
}
|
||||
|
||||
if (find && !find->field)
|
||||
find_it.remove();
|
||||
else
|
||||
{
|
||||
my_error(ER_BAD_FIELD_ERROR, MYF(0), def->change.str,
|
||||
table->s->table_name.str);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
/*
|
||||
Check that the DATE/DATETIME not null field we are going to add is
|
||||
@ -7636,6 +7665,30 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
||||
find_it.after(def); // Put column after this
|
||||
}
|
||||
}
|
||||
/*
|
||||
Check if there is alter for newly added field.
|
||||
*/
|
||||
alter_it.rewind();
|
||||
Alter_column *alter;
|
||||
while ((alter=alter_it++))
|
||||
{
|
||||
if (!my_strcasecmp(system_charset_info,def->field_name.str,
|
||||
alter->name))
|
||||
break;
|
||||
}
|
||||
if (alter)
|
||||
{
|
||||
if (def->real_field_type() == MYSQL_TYPE_BLOB)
|
||||
{
|
||||
my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change);
|
||||
goto err;
|
||||
}
|
||||
if ((def->default_value= alter->default_value)) // Use new default
|
||||
def->flags&= ~NO_DEFAULT_VALUE_FLAG;
|
||||
else
|
||||
def->flags|= NO_DEFAULT_VALUE_FLAG;
|
||||
alter_it.remove();
|
||||
}
|
||||
}
|
||||
if (alter_info->alter_list.elements)
|
||||
{
|
||||
|
Reference in New Issue
Block a user