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
83d5beec
Commit
83d5beec
authored
Oct 25, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into mysql.com:/home/cps/mysql/devel/5.1-rename-bug
parents
7d7acda2
e4bacda5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
9 deletions
+29
-9
sql/log.cc
sql/log.cc
+2
-0
sql/sql_table.cc
sql/sql_table.cc
+27
-9
No files found.
sql/log.cc
View file @
83d5beec
...
...
@@ -317,11 +317,13 @@ Log_to_csv_event_handler::Log_to_csv_event_handler()
/* logger thread always works with mysql database */
general_log_thd
->
db
=
my_strdup
(
"mysql"
,
MYF
(
0
));
general_log_thd
->
db_length
=
5
;
general_log
.
table
=
0
;
slow_log_thd
=
new
THD
;
/* logger thread always works with mysql database */
slow_log_thd
->
db
=
my_strdup
(
"mysql"
,
MYF
(
0
));;
slow_log_thd
->
db_length
=
5
;
slow_log
.
table
=
0
;
/* no privileged thread exists at the moment */
privileged_thread
=
0
;
}
...
...
sql/sql_table.cc
View file @
83d5beec
...
...
@@ -4607,11 +4607,11 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
char
*
src_db
;
char
*
src_table
=
table_ident
->
table
.
str
;
int
err
;
bool
res
=
TRUE
;
bool
res
=
TRUE
,
unlock_dst_table
=
FALSE
;
enum
legacy_db_type
not_used
;
HA_CREATE_INFO
*
create_info
;
TABLE_LIST
src_tables_list
;
TABLE_LIST
src_tables_list
,
dst_tables_list
;
DBUG_ENTER
(
"mysql_create_like_table"
);
if
(
!
(
create_info
=
copy_create_info
(
lex_create_info
)))
...
...
@@ -4794,16 +4794,28 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
char
buf
[
2048
];
String
query
(
buf
,
sizeof
(
buf
),
system_charset_info
);
query
.
length
(
0
);
// Have to zero it since constructor doesn't
TABLE
*
table_ptr
;
int
error
;
uint
counter
;
/*
Let's open and lock the table: it will be closed (and
unlocked) by close_thread_tables() at the end of the
statement anyway.
*/
if
(
!
(
table_ptr
=
open_ltable
(
thd
,
table
,
TL_READ_NO_INSERT
)))
Here we open the destination table. This is needed for
store_create_info() to work. The table will be closed
by close_thread_tables() at the end of the statement.
*/
if
(
open_tables
(
thd
,
&
table
,
&
counter
,
0
))
goto
err
;
bzero
((
gptr
)
&
dst_tables_list
,
sizeof
(
dst_tables_list
));
dst_tables_list
.
db
=
table
->
db
;
dst_tables_list
.
table_name
=
table
->
table_name
;
/*
lock destination table name, to make sure that nobody
can drop/alter the table while we execute store_create_info()
*/
if
(
lock_and_wait_for_table_name
(
thd
,
&
dst_tables_list
))
goto
err
;
else
unlock_dst_table
=
TRUE
;
int
result
=
store_create_info
(
thd
,
table
,
&
query
,
create_info
);
...
...
@@ -4837,6 +4849,12 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
table_name
);
err:
if
(
unlock_dst_table
)
{
pthread_mutex_lock
(
&
LOCK_open
);
unlock_table_name
(
thd
,
&
dst_tables_list
);
pthread_mutex_unlock
(
&
LOCK_open
);
}
DBUG_RETURN
(
res
);
}
...
...
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