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
11dc5c45
Commit
11dc5c45
authored
Jan 27, 2024
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
open frm for DROP TABLE
needed to get partitioning and information about secondary objects
parent
a41093a3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
12 deletions
+52
-12
mysql-test/main/features.result
mysql-test/main/features.result
+1
-1
mysql-test/main/invisible_field.result
mysql-test/main/invisible_field.result
+1
-1
mysql-test/suite/archive/discover.result
mysql-test/suite/archive/discover.result
+1
-1
sql/sql_class.h
sql/sql_class.h
+7
-0
sql/sql_table.cc
sql/sql_table.cc
+42
-9
No files found.
mysql-test/main/features.result
View file @
11dc5c45
...
...
@@ -176,7 +176,7 @@ create table t2 (b int, constraint foo check (b < 10));
drop table t1, t2;
show status like "feature_check_constraint";
Variable_name Value
Feature_check_constraint
2
Feature_check_constraint
4
#
# Feature insert...returning
#
...
...
mysql-test/main/invisible_field.result
View file @
11dc5c45
...
...
@@ -444,7 +444,7 @@ d int(11) YES UNI NULL
drop table t1;
SHOW STATUS LIKE 'Feature_invisible_columns';
Variable_name Value
Feature_invisible_columns 5
2
Feature_invisible_columns 5
4
#invisible is non reserved
create table t1(a int unique , invisible int invisible, c int );
desc t1;
...
...
mysql-test/suite/archive/discover.result
View file @
11dc5c45
...
...
@@ -93,7 +93,7 @@ drop table t0;
db.opt
show status like 'Handler_discover';
Variable_name Value
Handler_discover
6
Handler_discover
7
#
# Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE
#
...
...
sql/sql_class.h
View file @
11dc5c45
...
...
@@ -1324,6 +1324,13 @@ class Query_arena
{
return
strmake_lex_cstring
(
from
.
str
,
from
.
length
);
}
LEX_CUSTRING
strmake_lex_custring
(
const
LEX_CUSTRING
&
from
)
const
{
const
void
*
tmp
=
memdup
(
from
.
str
,
from
.
length
);
if
(
!
tmp
)
return
{
0
,
0
};
return
{(
const
uchar
*
)
tmp
,
from
.
length
};
}
LEX_CSTRING
strmake_lex_cstring_trim_whitespace
(
const
LEX_CSTRING
&
from
,
CHARSET_INFO
*
cs
)
{
...
...
sql/sql_table.cc
View file @
11dc5c45
...
...
@@ -1265,6 +1265,7 @@ static uint32 get_comment(THD *thd, uint32 comment_pos,
return
0
;
}
/**
Execute the drop of a sequence, view or table (normal or temporary).
...
...
@@ -1535,20 +1536,52 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables,
cpath
=
{
path
,
(
size_t
)(
path_end
-
path
)
};
Dummy_error_handler
err_handler
;
thd
->
push_internal_handler
(
&
err_handler
);
if
(
TABLE_SHARE
*
share
=
tdc_acquire_share
(
thd
,
table
,
GTS_TABLE
))
{
table_type
=
share
->
table_type
;
hton
=
plugin_hton
(
plugin_lock
(
thd
,
share
->
db_plugin
));
version
=
thd
->
strmake_lex_custring
(
share
->
tabledef_version
);
if
(
share
->
default_part_plugin
)
partition_engine_name
=
thd
->
strmake_lex_cstring
(
*
plugin_name
(
share
->
default_part_plugin
));
tdc_release_share
(
share
);
}
else
{
switch
(
err_handler
.
got_error
())
{
case
ER_WRONG_OBJECT
:
table_type
=
TABLE_TYPE_VIEW
;
break
;
case
ER_NO_SUCH_TABLE
:
/* no .frm */
table_type
=
TABLE_TYPE_UNKNOWN
;
break
;
case
ER_NOT_FORM_FILE
:
{
/*
cannot open the frm, let's at least get the engine
see main.partition_not_blackhole and connect.drop-open-error
*/
char
engine_buf
[
NAME_CHAR_LEN
+
1
];
LEX_CSTRING
engine
=
{
engine_buf
,
0
};
table_type
=
dd_frm_type
(
thd
,
path
,
&
engine
,
&
partition_engine_name
,
&
version
);
table_type
=
dd_frm_type
(
thd
,
path
,
&
engine
,
NULL
,
&
version
);
if
(
table_type
==
TABLE_TYPE_NORMAL
||
table_type
==
TABLE_TYPE_SEQUENCE
)
{
plugin_ref
p
=
plugin_lock_by_name
(
thd
,
&
engine
,
MYSQL_STORAGE_ENGINE_PLUGIN
);
hton
=
p
?
plugin_hton
(
p
)
:
NULL
;
}
// note that for TABLE_TYPE_VIEW and TABLE_TYPE_UNKNOWN hton == NULL
break
;
}
case
ER_FAILED_READ_FROM_PAR_FILE
:
/* no .par file */
hton
=
partition_hton
;
/* fall through */
default:
/* unreadable (corrupted?) .frm, still need to DROP it */
table_type
=
TABLE_TYPE_NORMAL
;
}
}
thd
->
pop_internal_handler
();
thd
->
replication_flags
=
0
;
const
bool
was_view
=
table_type
==
TABLE_TYPE_VIEW
;
...
...
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