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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
bea33049
Commit
bea33049
authored
Jul 26, 2006
by
kostja@bodhi.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
parents
598653ce
0b875d00
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletion
+51
-1
mysql-test/r/create_not_windows.result
mysql-test/r/create_not_windows.result
+17
-0
mysql-test/t/create_not_windows.test
mysql-test/t/create_not_windows.test
+21
-0
sql/sql_table.cc
sql/sql_table.cc
+13
-1
No files found.
mysql-test/r/create_not_windows.result
View file @
bea33049
...
...
@@ -12,3 +12,20 @@ about:text CREATE TABLE `about:text` (
PRIMARY KEY (`_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table `about:text`;
use test;
drop table if exists t1;
create table t1(a int) engine=myisam;
insert into t1 values(1);
"We get an error because the table is in the definition cache"
create table t1(a int, b int);
ERROR 42S01: Table 't1' already exists
"Flush the cache and recreate the table anew to be able to drop it"
flush tables;
show open tables like "t%";
Database Table In_use Name_locked
create table t1(a int, b int, c int);
"Try to select from the table. This should not crash the server"
select count(a) from t1;
count(a)
0
drop table t1;
mysql-test/t/create_not_windows.test
View file @
bea33049
...
...
@@ -18,3 +18,24 @@ show create table `about:text`;
drop
table
`about:text`
;
# End of 5.0 tests
#
# Bug#16532:mysql server assert in debug if table det is removed
#
use
test
;
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
create
table
t1
(
a
int
)
engine
=
myisam
;
insert
into
t1
values
(
1
);
--
system
rm
-
f
$MYSQLTEST_VARDIR
/
master
-
data
/
test
/
t1
.
frm
--
echo
"We get an error because the table is in the definition cache"
--
error
ER_TABLE_EXISTS_ERROR
create
table
t1
(
a
int
,
b
int
);
--
echo
"Flush the cache and recreate the table anew to be able to drop it"
flush
tables
;
show
open
tables
like
"t%"
;
create
table
t1
(
a
int
,
b
int
,
c
int
);
--
echo
"Try to select from the table. This should not crash the server"
select
count
(
a
)
from
t1
;
drop
table
t1
;
sql/sql_table.cc
View file @
bea33049
...
...
@@ -3321,7 +3321,19 @@ bool mysql_create_table_internal(THD *thd,
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
table_name
);
goto
unlock_and_end
;
}
DBUG_ASSERT
(
get_cached_table_share
(
db
,
alias
)
==
0
);
/*
We don't assert here, but check the result, because the table could be
in the table definition cache and in the same time the .frm could be
missing from the disk, in case of manual intervention which deletes
the .frm file. The user has to use FLUSH TABLES; to clear the cache.
Then she could create the table. This case is pretty obscure and
therefore we don't introduce a new error message only for it.
*/
if
(
get_cached_table_share
(
db
,
alias
))
{
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
table_name
);
goto
unlock_and_end
;
}
}
/*
...
...
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