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
f01df1fd
Commit
f01df1fd
authored
Oct 25, 2006
by
petr/cps@mysql.com/owlet.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test failures in the runtime tree
parent
eda71e24
Changes
2
Show 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 @
f01df1fd
...
...
@@ -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 @
f01df1fd
...
...
@@ -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,17 +4794,29 @@ 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
.
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
(
!
(
table_ptr
=
open_ltable
(
thd
,
table
,
TL_READ_NO_INSERT
)
))
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
);
DBUG_ASSERT
(
result
==
0
);
// store_create_info() always return 0
...
...
@@ -4837,6 +4849,12 @@ table_exists:
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