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
dee22632
Commit
dee22632
authored
Feb 25, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/home/ram/work/4.1.b4802
parents
54af1b8f
8cf2b82f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
18 deletions
+24
-18
client/mysql.cc
client/mysql.cc
+21
-18
include/mysql_com.h
include/mysql_com.h
+1
-0
sql/sql_db.cc
sql/sql_db.cc
+2
-0
No files found.
client/mysql.cc
View file @
dee22632
...
@@ -1581,6 +1581,22 @@ static int reconnect(void)
...
@@ -1581,6 +1581,22 @@ static int reconnect(void)
return
0
;
return
0
;
}
}
static
void
get_current_db
()
{
MYSQL_RES
*
res
;
my_free
(
current_db
,
MYF
(
MY_ALLOW_ZERO_PTR
));
current_db
=
NULL
;
/* In case of error below current_db will be NULL */
if
(
!
mysql_query
(
&
mysql
,
"SELECT DATABASE()"
)
&&
(
res
=
mysql_use_result
(
&
mysql
)))
{
MYSQL_ROW
row
=
mysql_fetch_row
(
res
);
if
(
row
[
0
])
current_db
=
my_strdup
(
row
[
0
],
MYF
(
MY_WME
));
mysql_free_result
(
res
);
}
}
/***************************************************************************
/***************************************************************************
The different commands
The different commands
...
@@ -1905,6 +1921,10 @@ com_go(String *buffer,char *line __attribute__((unused)))
...
@@ -1905,6 +1921,10 @@ com_go(String *buffer,char *line __attribute__((unused)))
if
(
err
>=
1
)
if
(
err
>=
1
)
error
=
put_error
(
&
mysql
);
error
=
put_error
(
&
mysql
);
if
(
!
error
&&
!
status
.
batch
&&
(
mysql
.
server_status
&
SERVER_STATUS_DB_DROPPED
))
get_current_db
();
return
error
;
/* New command follows */
return
error
;
/* New command follows */
}
}
...
@@ -2621,24 +2641,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
...
@@ -2621,24 +2641,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
under our feet, for example if DROP DATABASE or RENAME DATABASE
under our feet, for example if DROP DATABASE or RENAME DATABASE
(latter one not yet available by the time the comment was written)
(latter one not yet available by the time the comment was written)
*/
*/
/* Let's reset current_db, assume it's gone */
get_current_db
();
my_free
(
current_db
,
MYF
(
MY_ALLOW_ZERO_PTR
));
current_db
=
0
;
/*
We don't care about in case of an error below because current_db
was just set to 0.
*/
if
(
!
mysql_query
(
&
mysql
,
"SELECT DATABASE()"
)
&&
(
res
=
mysql_use_result
(
&
mysql
)))
{
row
=
mysql_fetch_row
(
res
);
if
(
row
[
0
])
{
current_db
=
my_strdup
(
row
[
0
],
MYF
(
MY_WME
));
}
(
void
)
mysql_fetch_row
(
res
);
// Read eof
mysql_free_result
(
res
);
}
if
(
!
current_db
||
cmp_database
(
charset_info
,
current_db
,
tmp
))
if
(
!
current_db
||
cmp_database
(
charset_info
,
current_db
,
tmp
))
{
{
...
...
include/mysql_com.h
View file @
dee22632
...
@@ -130,6 +130,7 @@ enum enum_server_command
...
@@ -130,6 +130,7 @@ enum enum_server_command
#define SERVER_MORE_RESULTS_EXISTS 8
/* Multi query - next query exists */
#define SERVER_MORE_RESULTS_EXISTS 8
/* Multi query - next query exists */
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
#define SERVER_QUERY_NO_INDEX_USED 32
#define SERVER_QUERY_NO_INDEX_USED 32
#define SERVER_STATUS_DB_DROPPED 256
/* A database was dropped */
#define MYSQL_ERRMSG_SIZE 512
#define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30
/* Timeout on read */
#define NET_READ_TIMEOUT 30
/* Timeout on read */
...
...
sql/sql_db.cc
View file @
dee22632
...
@@ -668,7 +668,9 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
...
@@ -668,7 +668,9 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
thd
->
clear_error
();
thd
->
clear_error
();
mysql_bin_log
.
write
(
&
qinfo
);
mysql_bin_log
.
write
(
&
qinfo
);
}
}
thd
->
server_status
|=
SERVER_STATUS_DB_DROPPED
;
send_ok
(
thd
,
(
ulong
)
deleted
);
send_ok
(
thd
,
(
ulong
)
deleted
);
thd
->
server_status
&=
~
SERVER_STATUS_DB_DROPPED
;
}
}
exit:
exit:
...
...
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