Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7e29f2d6
Commit
7e29f2d6
authored
Oct 15, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
parent
19937802
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
429 additions
and
17 deletions
+429
-17
mysql-test/r/alter_table_online.result
mysql-test/r/alter_table_online.result
+114
-0
mysql-test/r/gis-alter_table_online.result
mysql-test/r/gis-alter_table_online.result
+51
-0
mysql-test/t/alter_table_online.test
mysql-test/t/alter_table_online.test
+167
-0
mysql-test/t/gis-alter_table_online.test
mysql-test/t/gis-alter_table_online.test
+82
-0
sql/field.cc
sql/field.cc
+14
-8
sql/field.h
sql/field.h
+1
-9
No files found.
mysql-test/r/alter_table_online.result
View file @
7e29f2d6
...
...
@@ -65,3 +65,117 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge
alter online table t3 union=(t1,t2);
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
drop table t1,t2,t3;
#
# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
#
CREATE TABLE t1 (a BINARY(10));
ALTER TABLE t1 MODIFY a BINARY(10), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a VARBINARY(10));
ALTER TABLE t1 MODIFY a VARBINARY(10), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a TINYBLOB);
ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMBLOB);
ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a LONGBLOB);
ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10));
ALTER TABLE t1 MODIFY a CHAR(10), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10));
ALTER TABLE t1 MODIFY a VARCHAR(10), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a TINYTEXT);
ALTER TABLE t1 MODIFY a TINYTEXT, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMTEXT);
ALTER TABLE t1 MODIFY a MEDIUMTEXT, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a TEXT);
ALTER TABLE t1 MODIFY a TEXT, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a LONGTEXT);
ALTER TABLE t1 MODIFY a LONGTEXT, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10));
ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10));
ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TINYTEXT);
ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMTEXT);
ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TEXT);
ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a LONGTEXT);
ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10) COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TINYTEXT COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TEXT COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a LONGTEXT COLLATE latin1_bin);
ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10) COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TINYTEXT COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a TEXT COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci);
ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
#
# End of MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
#
mysql-test/r/gis-alter_table_online.result
0 → 100644
View file @
7e29f2d6
#
# Start of 10.1 tests
#
#
# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
#
CREATE TABLE t1 (a TINYBLOB);
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a MEDIUMBLOB);
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a LONGBLOB);
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY);
ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY);
ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY);
ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY);
ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY);
ALTER TABLE t1 MODIFY a POLYGON, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
CREATE TABLE t1 (a POLYGON);
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (a POLYGON);
ALTER TABLE t1 MODIFY a POLYGON, ALGORITHM=INPLACE;
DROP TABLE t1;
#
# End of 10.1 tests
#
mysql-test/t/alter_table_online.test
View file @
7e29f2d6
...
...
@@ -104,3 +104,170 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t3
union
=
(
t1
,
t2
);
drop
table
t1
,
t2
,
t3
;
--
echo
#
--
echo
# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
--
echo
#
#
# ALTER to the same [VAR]BINARY type
#
CREATE
TABLE
t1
(
a
BINARY
(
10
));
ALTER
TABLE
t1
MODIFY
a
BINARY
(
10
),
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
VARBINARY
(
10
));
ALTER
TABLE
t1
MODIFY
a
VARBINARY
(
10
),
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
#
# ALTER to the same BLOB variant
#
CREATE
TABLE
t1
(
a
TINYBLOB
);
ALTER
TABLE
t1
MODIFY
a
TINYBLOB
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
MEDIUMBLOB
);
ALTER
TABLE
t1
MODIFY
a
MEDIUMBLOB
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
BLOB
);
ALTER
TABLE
t1
MODIFY
a
BLOB
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
LONGBLOB
);
ALTER
TABLE
t1
MODIFY
a
LONGBLOB
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
#
# ALTER to the same [VAR]CHAR type
#
CREATE
TABLE
t1
(
a
CHAR
(
10
));
ALTER
TABLE
t1
MODIFY
a
CHAR
(
10
),
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
VARCHAR
(
10
));
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
10
),
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
#
# ALTER to the same TEXT variant
#
CREATE
TABLE
t1
(
a
TINYTEXT
);
ALTER
TABLE
t1
MODIFY
a
TINYTEXT
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
MEDIUMTEXT
);
ALTER
TABLE
t1
MODIFY
a
MEDIUMTEXT
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TEXT
);
ALTER
TABLE
t1
MODIFY
a
TEXT
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
LONGTEXT
);
ALTER
TABLE
t1
MODIFY
a
LONGTEXT
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
#
# ALTER from a non-binary to a binary collation
#
CREATE
TABLE
t1
(
a
CHAR
(
10
));
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
CHAR
(
10
)
COLLATE
latin1_bin
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
VARCHAR
(
10
));
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
10
)
COLLATE
latin1_bin
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TINYTEXT
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
TINYTEXT
COLLATE
latin1_bin
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
MEDIUMTEXT
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
MEDIUMTEXT
COLLATE
latin1_bin
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TEXT
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
TEXT
COLLATE
latin1_bin
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
LONGTEXT
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
LONGTEXT
COLLATE
latin1_bin
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
#
# ALTER from a binary to a non-binary collation
#
CREATE
TABLE
t1
(
a
CHAR
(
10
)
COLLATE
latin1_bin
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
CHAR
(
10
)
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
VARCHAR
(
10
)
COLLATE
latin1_bin
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
10
)
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TINYTEXT
COLLATE
latin1_bin
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
TINYTEXT
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
MEDIUMTEXT
COLLATE
latin1_bin
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
MEDIUMTEXT
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TEXT
COLLATE
latin1_bin
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
TEXT
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
LONGTEXT
COLLATE
latin1_bin
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
LONGTEXT
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
#
# ALTER from a non-binary collation to another non-binary collation
#
CREATE
TABLE
t1
(
a
CHAR
(
10
)
COLLATE
latin1_general_ci
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
CHAR
(
10
)
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
VARCHAR
(
10
)
COLLATE
latin1_general_ci
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
10
)
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TINYTEXT
COLLATE
latin1_general_ci
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
TINYTEXT
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
MEDIUMTEXT
COLLATE
latin1_general_ci
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
MEDIUMTEXT
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TEXT
COLLATE
latin1_general_ci
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
TEXT
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
LONGTEXT
COLLATE
latin1_general_ci
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
LONGTEXT
COLLATE
latin1_swedish_ci
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
--
echo
#
mysql-test/t/gis-alter_table_online.test
0 → 100644
View file @
7e29f2d6
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_geometry
.
inc
--
echo
#
--
echo
# Start of 10.1 tests
--
echo
#
--
echo
#
--
echo
# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
--
echo
#
#
# Blob variants to GEOMETRY
#
CREATE
TABLE
t1
(
a
TINYBLOB
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
GEOMETRY
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
MEDIUMBLOB
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
GEOMETRY
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
BLOB
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
GEOMETRY
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
LONGBLOB
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
GEOMETRY
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
#
# GEOMETRY to BLOB variants
#
CREATE
TABLE
t1
(
a
GEOMETRY
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
TINYBLOB
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
MEDIUMBLOB
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
BLOB
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
LONGBLOB
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
#
# Different GEOMETRY types
#
# Can't do INPLACE from a supertype to a subtype
CREATE
TABLE
t1
(
a
GEOMETRY
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER
TABLE
t1
MODIFY
a
POLYGON
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
# Ok to do INPLACE from a subtype to a supertype
CREATE
TABLE
t1
(
a
POLYGON
);
ALTER
TABLE
t1
MODIFY
a
GEOMETRY
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
# Ok to do INPLACE for two equal geometry subtypes
CREATE
TABLE
t1
(
a
POLYGON
);
ALTER
TABLE
t1
MODIFY
a
POLYGON
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.1 tests
--
echo
#
sql/field.cc
View file @
7e29f2d6
...
...
@@ -6887,9 +6887,6 @@ uint Field::is_equal(Create_field *new_field)
uint
Field_str
::
is_equal
(
Create_field
*
new_field
)
{
if
(
field_flags_are_binary
()
!=
new_field
->
field_flags_are_binary
())
return
0
;
return
((
new_field
->
sql_type
==
real_type
())
&&
new_field
->
charset
==
field_charset
&&
new_field
->
length
==
max_display_length
());
...
...
@@ -8263,9 +8260,6 @@ uint Field_blob::max_packed_col_length(uint max_length)
uint
Field_blob
::
is_equal
(
Create_field
*
new_field
)
{
if
(
field_flags_are_binary
()
!=
new_field
->
field_flags_are_binary
())
return
0
;
return
((
new_field
->
sql_type
==
get_blob_type_from_length
(
max_data_length
()))
&&
new_field
->
charset
==
field_charset
&&
new_field
->
pack_length
==
pack_length
());
...
...
@@ -8485,6 +8479,19 @@ Field::geometry_type Field_geom::geometry_type_merge(geometry_type a,
}
uint
Field_geom
::
is_equal
(
Create_field
*
new_field
)
{
return
new_field
->
sql_type
==
MYSQL_TYPE_GEOMETRY
&&
/*
- Allow ALTER..INPLACE to supertype (GEOMETRY),
e.g. POINT to GEOMETRY or POLYGON to GEOMETRY.
- Allow ALTER..INPLACE to the same geometry type: POINT -> POINT
*/
(
new_field
->
geom_type
==
geom_type
||
new_field
->
geom_type
==
GEOM_GEOMETRY
);
}
bool
Field_geom
::
can_optimize_range
(
const
Item_bool_func
*
cond
,
const
Item
*
item
,
bool
is_eq_func
)
const
...
...
@@ -8896,8 +8903,7 @@ uint Field_enum::is_equal(Create_field *new_field)
The fields are compatible if they have the same flags,
type, charset and have the same underlying length.
*/
if
(
new_field
->
field_flags_are_binary
()
!=
field_flags_are_binary
()
||
new_field
->
sql_type
!=
real_type
()
||
if
(
new_field
->
sql_type
!=
real_type
()
||
new_field
->
charset
!=
field_charset
||
new_field
->
pack_length
!=
pack_length
())
return
IS_EQUAL_NO
;
...
...
sql/field.h
View file @
7e29f2d6
...
...
@@ -1448,10 +1448,6 @@ protected:
const
uchar
*
unpack_int64
(
uchar
*
to
,
const
uchar
*
from
,
const
uchar
*
from_end
)
{
return
unpack_int
(
to
,
from
,
from_end
,
8
);
}
bool
field_flags_are_binary
()
{
return
(
flags
&
(
BINCMP_FLAG
|
BINARY_FLAG
))
!=
0
;
}
double
pos_in_interval_val_real
(
Field
*
min
,
Field
*
max
);
double
pos_in_interval_val_str
(
Field
*
min
,
Field
*
max
,
uint
data_offset
);
};
...
...
@@ -3130,6 +3126,7 @@ public:
const
Item
*
item
,
bool
is_eq_func
)
const
;
void
sql_type
(
String
&
str
)
const
;
uint
is_equal
(
Create_field
*
new_field
);
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
charset
);
int
store
(
double
nr
);
int
store
(
longlong
nr
,
bool
unsigned_val
);
...
...
@@ -3503,11 +3500,6 @@ public:
bool
check
(
THD
*
thd
);
bool
field_flags_are_binary
()
{
return
(
flags
&
(
BINCMP_FLAG
|
BINARY_FLAG
))
!=
0
;
}
ha_storage_media
field_storage_type
()
const
{
return
(
ha_storage_media
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment