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
d94cf5fb
Commit
d94cf5fb
authored
Apr 07, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
parents
095d6463
726917a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
sql/log_event.cc
sql/log_event.cc
+13
-6
No files found.
sql/log_event.cc
View file @
d94cf5fb
...
...
@@ -891,15 +891,15 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db)
(
ulong
)
thread_id
,
(
ulong
)
exec_time
,
error_code
);
}
bool
same_db
=
0
;
bool
different_db
=
1
;
if
(
db
&&
last_db
)
{
if
(
!
(
same_db
=
!
memcmp
(
last_db
,
db
,
db_len
+
1
)
))
if
(
different_db
=
memcmp
(
last_db
,
db
,
db_len
+
1
))
memcpy
(
last_db
,
db
,
db_len
+
1
);
}
if
(
db
&&
db
[
0
]
&&
!
same
_db
)
if
(
db
&&
db
[
0
]
&&
different
_db
)
fprintf
(
file
,
"use %s;
\n
"
,
db
);
end
=
int10_to_str
((
long
)
when
,
strmov
(
buff
,
"SET TIMESTAMP="
),
10
);
*
end
++=
';'
;
...
...
@@ -1324,14 +1324,21 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db,
thread_id
,
exec_time
);
}
bool
same_db
=
0
;
bool
different_db
=
1
;
if
(
db
&&
last_db
)
{
if
(
!
(
same_db
=
!
memcmp
(
last_db
,
db
,
db_len
+
1
)))
/*
If the database is different from the one of the previous statement, we
need to print the "use" command, and we update the last_db.
But if commented, the "use" is going to be commented so we should not
update the last_db.
*/
if
((
different_db
=
memcmp
(
last_db
,
db
,
db_len
+
1
))
&&
!
commented
)
memcpy
(
last_db
,
db
,
db_len
+
1
);
}
if
(
db
&&
db
[
0
]
&&
!
same
_db
)
if
(
db
&&
db
[
0
]
&&
different
_db
)
fprintf
(
file
,
"%suse %s;
\n
"
,
commented
?
"# "
:
""
,
db
);
...
...
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