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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
118826d1
Commit
118826d1
authored
Mar 17, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gcc-12 -O2 -Warray-bounds
parent
75e39f3c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
26 deletions
+25
-26
sql/handler.h
sql/handler.h
+2
-2
sql/sql_table.cc
sql/sql_table.cc
+22
-21
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+1
-3
No files found.
sql/handler.h
View file @
118826d1
...
...
@@ -2,7 +2,7 @@
#define HANDLER_INCLUDED
/*
Copyright (c) 2000, 2019, Oracle and/or its affiliates.
Copyright (c) 2009, 202
1
, MariaDB
Copyright (c) 2009, 202
2
, MariaDB
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
...
...
@@ -4275,7 +4275,7 @@ static inline const char *ha_resolve_storage_engine_name(const handlerton *db_ty
static
inline
bool
ha_check_storage_engine_flag
(
const
handlerton
*
db_type
,
uint32
flag
)
{
return
db_type
==
NULL
?
FALSE
:
MY_TEST
(
db_type
->
flags
&
flag
);
return
db_type
&&
(
db_type
->
flags
&
flag
);
}
static
inline
bool
ha_storage_engine_is_enabled
(
const
handlerton
*
db_type
)
...
...
sql/sql_table.cc
View file @
118826d1
...
...
@@ -9191,22 +9191,24 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
create_info
->
used_fields
|=
HA_CREATE_USED_ROW_FORMAT
;
}
handlerton
*
const
old_db_type
=
table
->
s
->
db_type
();
handlerton
*
new_db_type
=
create_info
->
db_type
;
DBUG_PRINT
(
"info"
,
(
"old type: %s new type: %s"
,
ha_resolve_storage_engine_name
(
table
->
s
->
db_type
()
),
ha_resolve_storage_engine_name
(
create_info
->
db_type
)));
if
(
ha_check_storage_engine_flag
(
table
->
s
->
db_type
()
,
HTON_ALTER_NOT_SUPPORTED
))
ha_resolve_storage_engine_name
(
old_db_type
),
ha_resolve_storage_engine_name
(
new_
db_type
)));
if
(
ha_check_storage_engine_flag
(
old_db_type
,
HTON_ALTER_NOT_SUPPORTED
))
{
DBUG_PRINT
(
"info"
,
(
"doesn't support alter"
));
my_error
(
ER_ILLEGAL_HA
,
MYF
(
0
),
hton_name
(
table
->
s
->
db_type
()
)
->
str
,
my_error
(
ER_ILLEGAL_HA
,
MYF
(
0
),
hton_name
(
old_db_type
)
->
str
,
alter_ctx
.
db
,
alter_ctx
.
table_name
);
DBUG_RETURN
(
true
);
}
if
(
ha_check_storage_engine_flag
(
create_info
->
db_type
,
HTON_ALTER_NOT_SUPPORTED
))
if
(
ha_check_storage_engine_flag
(
new_db_type
,
HTON_ALTER_NOT_SUPPORTED
))
{
DBUG_PRINT
(
"info"
,
(
"doesn't support alter"
));
my_error
(
ER_ILLEGAL_HA
,
MYF
(
0
),
hton_name
(
create_info
->
db_type
)
->
str
,
my_error
(
ER_ILLEGAL_HA
,
MYF
(
0
),
hton_name
(
new_
db_type
)
->
str
,
alter_ctx
.
new_db
,
alter_ctx
.
new_name
);
DBUG_RETURN
(
true
);
}
...
...
@@ -9349,6 +9351,17 @@ do_continue:;
DBUG_RETURN
(
true
);
}
}
/*
If the old table had partitions and we are doing ALTER TABLE ...
engine= <new_engine>, the new table must preserve the original
partitioning. This means that the new engine is still the
partitioning engine, not the engine specified in the parser.
This is discovered in prep_alter_part_table, which in such case
updates create_info->db_type.
It's therefore important that the assignment below is done
after prep_alter_part_table.
*/
new_db_type
=
create_info
->
db_type
;
#endif
if
(
mysql_prepare_alter_table
(
thd
,
table
,
create_info
,
alter_info
,
...
...
@@ -9424,7 +9437,7 @@ do_continue:;
Alter_info
::
ALTER_TABLE_ALGORITHM_INPLACE
)
||
is_inplace_alter_impossible
(
table
,
create_info
,
alter_info
)
||
IF_PARTITIONING
((
partition_changed
&&
!
(
table
->
s
->
db_type
()
->
partition_flags
()
&
HA_USE_AUTO_PARTITION
)),
0
))
!
(
old_db_type
->
partition_flags
()
&
HA_USE_AUTO_PARTITION
)),
0
))
{
if
(
alter_info
->
requested_algorithm
==
Alter_info
::
ALTER_TABLE_ALGORITHM_INPLACE
)
...
...
@@ -9441,22 +9454,10 @@ do_continue:;
request table rebuild. Set ALTER_RECREATE flag to force table
rebuild.
*/
if
(
create_info
->
db_type
==
table
->
s
->
db_type
()
&&
if
(
new_db_type
==
old_db_type
&&
create_info
->
used_fields
&
HA_CREATE_USED_ENGINE
)
alter_info
->
flags
|=
Alter_info
::
ALTER_RECREATE
;
/*
If the old table had partitions and we are doing ALTER TABLE ...
engine= <new_engine>, the new table must preserve the original
partitioning. This means that the new engine is still the
partitioning engine, not the engine specified in the parser.
This is discovered in prep_alter_part_table, which in such case
updates create_info->db_type.
It's therefore important that the assignment below is done
after prep_alter_part_table.
*/
handlerton
*
new_db_type
=
create_info
->
db_type
;
handlerton
*
old_db_type
=
table
->
s
->
db_type
();
TABLE
*
new_table
=
NULL
;
ha_rows
copied
=
0
,
deleted
=
0
;
...
...
storage/innobase/fts/fts0fts.cc
View file @
118826d1
...
...
@@ -2313,9 +2313,7 @@ fts_trx_table_create(
fts_trx_table_t
*
ftt
;
ftt
=
static_cast
<
fts_trx_table_t
*>
(
mem_heap_alloc
(
fts_trx
->
heap
,
sizeof
(
*
ftt
)));
memset
(
ftt
,
0x0
,
sizeof
(
*
ftt
));
mem_heap_zalloc
(
fts_trx
->
heap
,
sizeof
*
ftt
));
ftt
->
table
=
table
;
ftt
->
fts_trx
=
fts_trx
;
...
...
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