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
d591705e
Commit
d591705e
authored
Aug 26, 2005
by
serg@sergbook.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
4da4a66b
714b27c7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
53 deletions
+57
-53
mysql-test/r/rpl_drop_db.result
mysql-test/r/rpl_drop_db.result
+17
-17
mysql-test/t/rpl_drop_db.test
mysql-test/t/rpl_drop_db.test
+18
-19
mysys/my_alloc.c
mysys/my_alloc.c
+14
-1
sql/sql_db.cc
sql/sql_db.cc
+8
-10
sql/sql_table.cc
sql/sql_table.cc
+0
-3
sql/table.h
sql/table.h
+0
-3
No files found.
mysql-test/r/rpl_drop_db.result
View file @
d591705e
...
...
@@ -4,29 +4,29 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists mysqltest;
create database mysqltest;
create table mysqltest.t1 (n int);
insert into mysqltest.t1 values (1);
select * from mysqltest
.t1 into outfile 'mysqltest
/f1.txt';
create table mysqltest.t2 (n int);
create table mysqltest.t3 (n int);
drop database mysqltest;
ERROR HY000: Error dropping database (can't rmdir './mysqltest/', errno: 17)
use mysqltest;
drop database if exists mysqltest
1
;
create database mysqltest
1
;
create table mysqltest
1
.t1 (n int);
insert into mysqltest
1
.t1 values (1);
select * from mysqltest
1.t1 into outfile 'mysqltest1
/f1.txt';
create table mysqltest
1
.t2 (n int);
create table mysqltest
1
.t3 (n int);
drop database mysqltest
1
;
ERROR HY000: Error dropping database (can't rmdir './mysqltest
1
/', errno: 17)
use mysqltest
1
;
show tables;
Tables_in_mysqltest
drop database mysqltest;
ERROR HY000: Error dropping database (can't rmdir './mysqltest/', errno: 17)
use mysqltest;
Tables_in_mysqltest
1
drop database mysqltest
1
;
ERROR HY000: Error dropping database (can't rmdir './mysqltest
1
/', errno: 17)
use mysqltest
1
;
show tables;
Tables_in_mysqltest
Tables_in_mysqltest
1
use test;
create table t1 (n int);
insert into t1 values (1234);
use mysqltest;
use mysqltest
1
;
show tables;
Tables_in_mysqltest
Tables_in_mysqltest
1
use test;
select * from t1;
n
...
...
mysql-test/t/rpl_drop_db.test
View file @
d591705e
...
...
@@ -5,32 +5,33 @@
connection
master
;
--
disable_warnings
drop
database
if
exists
mysqltest
;
drop
database
if
exists
mysqltest
1
;
--
enable_warnings
create
database
mysqltest
;
create
table
mysqltest
.
t1
(
n
int
);
insert
into
mysqltest
.
t1
values
(
1
);
select
*
from
mysqltest
.
t1
into
outfile
'mysqltest
/f1.txt'
;
create
table
mysqltest
.
t2
(
n
int
);
create
table
mysqltest
.
t3
(
n
int
);
create
database
mysqltest
1
;
create
table
mysqltest
1
.
t1
(
n
int
);
insert
into
mysqltest
1
.
t1
values
(
1
);
select
*
from
mysqltest
1
.
t1
into
outfile
'mysqltest1
/f1.txt'
;
create
table
mysqltest
1
.
t2
(
n
int
);
create
table
mysqltest
1
.
t3
(
n
int
);
--
error
1010
drop
database
mysqltest
;
use
mysqltest
;
drop
database
mysqltest
1
;
use
mysqltest
1
;
show
tables
;
# test the branch of the code that deals with the query buffer overflow
disable_query_log
;
let
$
1
=
5
0
;
--
disable_query_log
let
$
1
=
100
0
;
while
(
$
1
)
{
eval
create
table
mysqltest
.
mysql_test_long_table_name
$
1
(
n
int
);
eval
create
table
mysqltest
1
.
t
$
1
(
n
int
);
dec
$
1
;
}
enable_query_log
;
--
enable_query_log
--
error
1010
drop
database
mysqltest
;
use
mysqltest
;
drop
database
mysqltest
1
;
use
mysqltest
1
;
show
tables
;
use
test
;
create
table
t1
(
n
int
);
...
...
@@ -38,7 +39,7 @@ insert into t1 values (1234);
sync_slave_with_master
;
connection
slave
;
use
mysqltest
;
use
mysqltest
1
;
show
tables
;
use
test
;
select
*
from
t1
;
...
...
@@ -50,7 +51,5 @@ sync_slave_with_master;
#cleanup
connection
slave
;
stop
slave
;
system
rm
-
rf
var
/
master
-
data
/
mysqltest
;
# End of 4.1 tests
system
rm
-
rf
var
/
master
-
data
/
mysqltest1
;
mysys/my_alloc.c
View file @
d591705e
...
...
@@ -206,7 +206,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
next
->
left
=
get_size
-
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
*
prev
=
next
;
}
point
=
(
gptr
)
((
char
*
)
next
+
(
next
->
size
-
next
->
left
));
/*TODO: next part may be unneded due to mem_root->first_block_usage counter*/
if
((
next
->
left
-=
Size
)
<
mem_root
->
min_malloc
)
...
...
@@ -221,6 +221,12 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
#endif
}
#ifdef SAFEMALLOC
#define TRASH(X) bfill(((char*)(X) + ((X)->size-(X)->left)), (X)->left, 0xa5)
#else
#define TRASH
/* no-op */
#endif
/* Mark all data in blocks free for reusage */
static
inline
void
mark_blocks_free
(
MEM_ROOT
*
root
)
...
...
@@ -231,14 +237,20 @@ static inline void mark_blocks_free(MEM_ROOT* root)
/* iterate through (partially) free blocks, mark them free */
last
=
&
root
->
free
;
for
(
next
=
root
->
free
;
next
;
next
=
*
(
last
=
&
next
->
next
))
{
next
->
left
=
next
->
size
-
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
TRASH
(
next
);
}
/* Combine the free and the used list */
*
last
=
next
=
root
->
used
;
/* now go through the used blocks and mark them free */
for
(;
next
;
next
=
next
->
next
)
{
next
->
left
=
next
->
size
-
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
TRASH
(
next
);
}
/* Now everything is set; Indicate that nothing is used anymore */
root
->
used
=
0
;
...
...
@@ -298,6 +310,7 @@ void free_root(MEM_ROOT *root, myf MyFlags)
{
root
->
free
=
root
->
pre_alloc
;
root
->
free
->
left
=
root
->
pre_alloc
->
size
-
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
TRASH
(
root
->
pre_alloc
);
root
->
free
->
next
=
0
;
}
root
->
block_num
=
4
;
...
...
sql/sql_db.cc
View file @
d591705e
...
...
@@ -702,30 +702,28 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
if
(
!
(
query
=
thd
->
alloc
(
MAX_DROP_TABLE_Q_LEN
)))
goto
exit
;
/* not much else we can do */
query_pos
=
query_data_start
=
strmov
(
query
,
"drop table "
);
query_pos
=
query_data_start
=
strmov
(
query
,
"drop table "
);
query_end
=
query
+
MAX_DROP_TABLE_Q_LEN
;
db_len
=
strlen
(
db
);
for
(
tbl
=
dropped_tables
;
tbl
;
tbl
=
tbl
->
next_local
)
{
uint
tbl_name_len
;
if
(
!
tbl
->
was_dropped
)
continue
;
/* 3 for the quotes and the comma*/
tbl_name_len
=
strlen
(
tbl
->
table_name
)
+
3
;
/* 3 for the quotes and the comma*/
tbl_name_len
=
strlen
(
tbl
->
real_name
)
+
3
;
if
(
query_pos
+
tbl_name_len
+
1
>=
query_end
)
{
write_to_binlog
(
thd
,
query
,
query_pos
-
1
-
query
,
db
,
db_len
);
query_pos
=
query_data_start
;
}
}
*
query_pos
++
=
'`'
;
query_pos
=
strmov
(
query_pos
,
tbl
->
table_name
);
*
query_pos
++
=
'`'
;
*
query_pos
++
=
','
;
}
if
(
query_pos
!=
query_data_start
)
{
write_to_binlog
(
thd
,
query
,
query_pos
-
1
-
query
,
db
,
db_len
);
...
...
sql/sql_table.cc
View file @
d591705e
...
...
@@ -229,7 +229,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
for
(
table
=
tables
;
table
;
table
=
table
->
next_local
)
{
char
*
db
=
table
->
db
;
table
->
was_dropped
=
0
;
mysql_ha_flush
(
thd
,
table
,
MYSQL_HA_CLOSE_FINAL
);
if
(
!
close_temporary_table
(
thd
,
db
,
table
->
table_name
))
{
...
...
@@ -301,8 +300,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
wrong_tables
.
append
(
','
);
wrong_tables
.
append
(
String
(
table
->
table_name
,
system_charset_info
));
}
else
table
->
was_dropped
=
1
;
}
thd
->
tmp_table_used
=
tmp_table_deleted
;
error
=
0
;
...
...
sql/table.h
View file @
d591705e
...
...
@@ -570,9 +570,6 @@ typedef struct st_table_list
st_table_list
*
embedding
;
/* nested join containing the table */
List
<
struct
st_table_list
>
*
join_list
;
/* join list the table belongs to */
bool
cacheable_table
;
/* stop PS caching */
/* used for proper partially successful DROP DATABASE binlogging */
bool
was_dropped
;
/* used in multi-upd/views privilege check */
bool
table_in_first_from_clause
;
bool
skip_temporary
;
/* this table shouldn't be temporary */
...
...
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