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
5bb11a96
Commit
5bb11a96
authored
Jan 18, 2002
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generalizing mysql_admin_table()
parent
01d6d4ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
sql/sql_table.cc
sql/sql_table.cc
+17
-15
No files found.
sql/sql_table.cc
View file @
5bb11a96
...
@@ -911,6 +911,11 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table)
...
@@ -911,6 +911,11 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table)
"Failed generating table from .frm file"
));
"Failed generating table from .frm file"
));
}
}
}
}
// now we should be able to open the partially restored table
// to finish the restore in the handler later on
if
(
!
(
table
->
table
=
reopen_name_locked_table
(
thd
,
table
)))
unlock_table_name
(
thd
,
table
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
...
@@ -919,8 +924,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
...
@@ -919,8 +924,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
HA_CHECK_OPT
*
check_opt
,
HA_CHECK_OPT
*
check_opt
,
const
char
*
operator_name
,
const
char
*
operator_name
,
thr_lock_type
lock_type
,
thr_lock_type
lock_type
,
bool
open_for_modify
,
bool
restore
,
bool
open_for_modify
,
uint
extra_open_options
,
uint
extra_open_options
,
int
(
*
prepare_func
)(
THD
*
,
TABLE_LIST
*
),
int
(
handler
::*
operator_func
)
int
(
handler
::*
operator_func
)
(
THD
*
,
HA_CHECK_OPT
*
))
(
THD
*
,
HA_CHECK_OPT
*
))
{
{
...
@@ -952,18 +958,13 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
...
@@ -952,18 +958,13 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
table
->
table
=
open_ltable
(
thd
,
table
,
lock_type
);
table
->
table
=
open_ltable
(
thd
,
table
,
lock_type
);
thd
->
open_options
&=
~
extra_open_options
;
thd
->
open_options
&=
~
extra_open_options
;
packet
->
length
(
0
);
packet
->
length
(
0
);
if
(
restore
)
if
(
prepare_func
)
{
{
switch
(
prepare_for_restore
(
thd
,
table
))
{
switch
(
(
*
prepare_func
)
(
thd
,
table
))
{
case
1
:
continue
;
// error, message written to net
case
1
:
continue
;
// error, message written to net
case
-
1
:
goto
err
;
// error, message could be written to net
case
-
1
:
goto
err
;
// error, message could be written to net
default:
;
// should be 0 otherwise
default:
;
// should be 0 otherwise
}
}
// now we should be able to open the partially restored table
// to finish the restore in the handler later on
if
(
!
(
table
->
table
=
reopen_name_locked_table
(
thd
,
table
)))
unlock_table_name
(
thd
,
table
);
}
}
if
(
!
table
->
table
)
if
(
!
table
->
table
)
...
@@ -1096,7 +1097,8 @@ int mysql_restore_table(THD* thd, TABLE_LIST* table_list)
...
@@ -1096,7 +1097,8 @@ int mysql_restore_table(THD* thd, TABLE_LIST* table_list)
{
{
DBUG_ENTER
(
"mysql_restore_table"
);
DBUG_ENTER
(
"mysql_restore_table"
);
DBUG_RETURN
(
mysql_admin_table
(
thd
,
table_list
,
0
,
DBUG_RETURN
(
mysql_admin_table
(
thd
,
table_list
,
0
,
"restore"
,
TL_WRITE
,
1
,
1
,
0
,
"restore"
,
TL_WRITE
,
1
,
0
,
&
prepare_for_restore
,
&
handler
::
restore
));
&
handler
::
restore
));
}
}
...
@@ -1104,7 +1106,7 @@ int mysql_repair_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
...
@@ -1104,7 +1106,7 @@ int mysql_repair_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
{
{
DBUG_ENTER
(
"mysql_repair_table"
);
DBUG_ENTER
(
"mysql_repair_table"
);
DBUG_RETURN
(
mysql_admin_table
(
thd
,
tables
,
check_opt
,
DBUG_RETURN
(
mysql_admin_table
(
thd
,
tables
,
check_opt
,
"repair"
,
TL_WRITE
,
1
,
0
,
HA_OPEN_FOR_REPAIR
,
"repair"
,
TL_WRITE
,
1
,
HA_OPEN_FOR_REPAIR
,
0
,
&
handler
::
repair
));
&
handler
::
repair
));
}
}
...
@@ -1143,7 +1145,7 @@ int mysql_check_table(THD* thd, TABLE_LIST* tables,HA_CHECK_OPT* check_opt)
...
@@ -1143,7 +1145,7 @@ int mysql_check_table(THD* thd, TABLE_LIST* tables,HA_CHECK_OPT* check_opt)
DBUG_ENTER
(
"mysql_check_table"
);
DBUG_ENTER
(
"mysql_check_table"
);
DBUG_RETURN
(
mysql_admin_table
(
thd
,
tables
,
check_opt
,
DBUG_RETURN
(
mysql_admin_table
(
thd
,
tables
,
check_opt
,
"check"
,
lock_type
,
"check"
,
lock_type
,
0
,
0
,
HA_OPEN_FOR_REPAIR
,
0
,
HA_OPEN_FOR_REPAIR
,
0
,
&
handler
::
check
));
&
handler
::
check
));
}
}
...
...
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