mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Updated/added copyright headers
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -2453,7 +2453,8 @@ int prepare_create_field(Create_field *sql_field,
|
||||
MAX_FIELD_CHARLENGTH)
|
||||
{
|
||||
my_printf_error(ER_TOO_BIG_FIELDLENGTH, ER(ER_TOO_BIG_FIELDLENGTH),
|
||||
MYF(0), sql_field->field_name, MAX_FIELD_CHARLENGTH);
|
||||
MYF(0), sql_field->field_name,
|
||||
static_cast<ulong>(MAX_FIELD_CHARLENGTH));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
@@ -3186,11 +3187,20 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
{
|
||||
column->length*= sql_field->charset->mbmaxlen;
|
||||
|
||||
if (key->type == Key::SPATIAL && column->length)
|
||||
if (key->type == Key::SPATIAL)
|
||||
{
|
||||
my_error(ER_WRONG_SUB_KEY, MYF(0));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
if (column->length)
|
||||
{
|
||||
my_error(ER_WRONG_SUB_KEY, MYF(0));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
if (!f_is_geom(sql_field->pack_flag))
|
||||
{
|
||||
my_error(ER_WRONG_ARGUMENTS, MYF(0), "SPATIAL INDEX");
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
if (f_is_blob(sql_field->pack_flag) ||
|
||||
(f_is_geom(sql_field->pack_flag) && key->type != Key::SPATIAL))
|
||||
@@ -3496,7 +3506,8 @@ static bool prepare_blob_field(THD *thd, Create_field *sql_field)
|
||||
MODE_STRICT_ALL_TABLES)))
|
||||
{
|
||||
my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), sql_field->field_name,
|
||||
MAX_FIELD_VARCHARLENGTH / sql_field->charset->mbmaxlen);
|
||||
static_cast<ulong>(MAX_FIELD_VARCHARLENGTH /
|
||||
sql_field->charset->mbmaxlen));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
sql_field->sql_type= MYSQL_TYPE_BLOB;
|
||||
@@ -6160,6 +6171,12 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
||||
if (drop)
|
||||
{
|
||||
drop_it.remove();
|
||||
/*
|
||||
ALTER TABLE DROP COLUMN always changes table data even in cases
|
||||
when new version of the table has the same structure as the old
|
||||
one.
|
||||
*/
|
||||
alter_info->change_level= ALTER_TABLE_DATA_CHANGED;
|
||||
continue;
|
||||
}
|
||||
/* Check if field is changed */
|
||||
@@ -6237,7 +6254,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
||||
if (!def->after)
|
||||
new_create_list.push_back(def);
|
||||
else if (def->after == first_keyword)
|
||||
{
|
||||
new_create_list.push_front(def);
|
||||
/*
|
||||
Re-ordering columns in table can't be done using in-place algorithm
|
||||
as it always changes table data.
|
||||
*/
|
||||
alter_info->change_level= ALTER_TABLE_DATA_CHANGED;
|
||||
}
|
||||
else
|
||||
{
|
||||
Create_field *find;
|
||||
@@ -6253,6 +6277,10 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
||||
goto err;
|
||||
}
|
||||
find_it.after(def); // Put element after this
|
||||
/*
|
||||
Re-ordering columns in table can't be done using in-place algorithm
|
||||
as it always changes table data.
|
||||
*/
|
||||
alter_info->change_level= ALTER_TABLE_DATA_CHANGED;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user