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
c86acb53
Commit
c86acb53
authored
Jul 07, 2006
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/bar/mysql-5.0.b10979
parents
73064141
1579af95
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
19 deletions
+38
-19
client/mysql.cc
client/mysql.cc
+38
-19
No files found.
client/mysql.cc
View file @
c86acb53
...
@@ -2970,6 +2970,7 @@ static int
...
@@ -2970,6 +2970,7 @@ static int
com_use
(
String
*
buffer
__attribute__
((
unused
)),
char
*
line
)
com_use
(
String
*
buffer
__attribute__
((
unused
)),
char
*
line
)
{
{
char
*
tmp
,
buff
[
FN_REFLEN
+
1
];
char
*
tmp
,
buff
[
FN_REFLEN
+
1
];
int
select_db
;
bzero
(
buff
,
sizeof
(
buff
));
bzero
(
buff
,
sizeof
(
buff
));
strmov
(
buff
,
line
);
strmov
(
buff
,
line
);
...
@@ -2989,8 +2990,27 @@ com_use(String *buffer __attribute__((unused)), char *line)
...
@@ -2989,8 +2990,27 @@ com_use(String *buffer __attribute__((unused)), char *line)
if
(
!
current_db
||
cmp_database
(
charset_info
,
current_db
,
tmp
))
if
(
!
current_db
||
cmp_database
(
charset_info
,
current_db
,
tmp
))
{
{
if
(
one_database
)
if
(
one_database
)
{
skip_updates
=
1
;
skip_updates
=
1
;
select_db
=
0
;
// don't do mysql_select_db()
}
else
select_db
=
2
;
// do mysql_select_db() and build_completion_hash()
}
else
else
{
/*
USE to the current db specified.
We do need to send mysql_select_db() to make server
update database level privileges, which might
change since last USE (see bug#10979).
For performance purposes, we'll skip rebuilding of completion hash.
*/
skip_updates
=
0
;
select_db
=
1
;
// do only mysql_select_db(), without completion
}
if
(
select_db
)
{
{
/*
/*
reconnect once if connection is down or if connection was found to
reconnect once if connection is down or if connection was found to
...
@@ -3011,12 +3031,11 @@ com_use(String *buffer __attribute__((unused)), char *line)
...
@@ -3011,12 +3031,11 @@ com_use(String *buffer __attribute__((unused)), char *line)
my_free
(
current_db
,
MYF
(
MY_ALLOW_ZERO_PTR
));
my_free
(
current_db
,
MYF
(
MY_ALLOW_ZERO_PTR
));
current_db
=
my_strdup
(
tmp
,
MYF
(
MY_WME
));
current_db
=
my_strdup
(
tmp
,
MYF
(
MY_WME
));
#ifdef HAVE_READLINE
#ifdef HAVE_READLINE
if
(
select_db
>
1
)
build_completion_hash
(
rehash
,
1
);
build_completion_hash
(
rehash
,
1
);
#endif
#endif
}
}
}
else
skip_updates
=
0
;
put_info
(
"Database changed"
,
INFO_INFO
);
put_info
(
"Database changed"
,
INFO_INFO
);
return
0
;
return
0
;
}
}
...
...
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