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
144d0efa
Commit
144d0efa
authored
Aug 29, 2003
by
gluh@gluh.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-4.1
into gluh.mysql.r18.ru:/home/gluh/mysql-4.1.fix
parents
6cad8977
e4951147
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
4 deletions
+57
-4
mysql-test/r/drop.result
mysql-test/r/drop.result
+10
-0
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+12
-0
mysql-test/t/drop.test
mysql-test/t/drop.test
+10
-0
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+15
-0
sql/handler.cc
sql/handler.cc
+3
-0
sql/sql_table.cc
sql/sql_table.cc
+7
-4
No files found.
mysql-test/r/drop.result
View file @
144d0efa
...
@@ -44,3 +44,13 @@ mysql
...
@@ -44,3 +44,13 @@ mysql
test
test
drop database mysqltest;
drop database mysqltest;
ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist
ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist
drop table t1;
flush tables with read lock;
create table t1(n int);
ERROR HY000: Can't execute the query because you have a conflicting read lock
unlock tables;
create table t1(n int);
show tables;
Tables_in_test
t1
drop table t1;
mysql-test/r/innodb.result
View file @
144d0efa
...
@@ -251,6 +251,18 @@ n
...
@@ -251,6 +251,18 @@ n
6
6
rollback;
rollback;
drop table t1;
drop table t1;
create table t1 (n int not null primary key) type=innodb;
start transaction;
insert into t1 values (4);
flush tables with read lock;
commit;
ERROR HY000: Can't execute the query because you have a conflicting read lock
unlock tables;
commit;
select * from t1;
n
4
drop table t1;
create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) type=innodb;
create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) type=innodb;
begin;
begin;
insert into t1 values(1,'hamdouni');
insert into t1 values(1,'hamdouni');
...
...
mysql-test/t/drop.test
View file @
144d0efa
...
@@ -43,3 +43,13 @@ drop database mysqltest;
...
@@ -43,3 +43,13 @@ drop database mysqltest;
show
databases
;
show
databases
;
--
error
1008
--
error
1008
drop
database
mysqltest
;
drop
database
mysqltest
;
# test create table and FLUSH TABLES WITH READ LOCK
drop
table
t1
;
flush
tables
with
read
lock
;
--
error
1223
;
create
table
t1
(
n
int
);
unlock
tables
;
create
table
t1
(
n
int
);
show
tables
;
drop
table
t1
;
mysql-test/t/innodb.test
View file @
144d0efa
...
@@ -133,6 +133,21 @@ select n from t1;
...
@@ -133,6 +133,21 @@ select n from t1;
rollback
;
rollback
;
drop
table
t1
;
drop
table
t1
;
#
# Test for commit and FLUSH TABLES WITH READ LOCK
#
create
table
t1
(
n
int
not
null
primary
key
)
type
=
innodb
;
start
transaction
;
insert
into
t1
values
(
4
);
flush
tables
with
read
lock
;
--
error
1223
;
commit
;
unlock
tables
;
commit
;
select
*
from
t1
;
drop
table
t1
;
#
#
# Testing transactions
# Testing transactions
#
#
...
...
sql/handler.cc
View file @
144d0efa
...
@@ -359,7 +359,10 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
...
@@ -359,7 +359,10 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
if
(
trans
==
&
thd
->
transaction
.
all
&&
mysql_bin_log
.
is_open
()
&&
if
(
trans
==
&
thd
->
transaction
.
all
&&
mysql_bin_log
.
is_open
()
&&
my_b_tell
(
&
thd
->
transaction
.
trans_log
))
my_b_tell
(
&
thd
->
transaction
.
trans_log
))
{
{
if
(
wait_if_global_read_lock
(
thd
,
0
))
DBUG_RETURN
(
1
);
mysql_bin_log
.
write
(
thd
,
&
thd
->
transaction
.
trans_log
);
mysql_bin_log
.
write
(
thd
,
&
thd
->
transaction
.
trans_log
);
start_waiting_global_read_lock
(
thd
);
reinit_io_cache
(
&
thd
->
transaction
.
trans_log
,
reinit_io_cache
(
&
thd
->
transaction
.
trans_log
,
WRITE_CACHE
,
(
my_off_t
)
0
,
0
,
1
);
WRITE_CACHE
,
(
my_off_t
)
0
,
0
,
1
);
thd
->
transaction
.
trans_log
.
end_of_file
=
max_binlog_cache_size
;
thd
->
transaction
.
trans_log
.
end_of_file
=
max_binlog_cache_size
;
...
...
sql/sql_table.cc
View file @
144d0efa
...
@@ -899,16 +899,18 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
...
@@ -899,16 +899,18 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
table_name
);
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
table_name
);
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
if
(
wait_if_global_read_lock
(
thd
,
0
))
DBUG_RETURN
(
error
);
VOID
(
pthread_mutex_lock
(
&
LOCK_open
));
VOID
(
pthread_mutex_lock
(
&
LOCK_open
));
if
(
!
tmp_table
&&
!
(
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
))
if
(
!
tmp_table
&&
!
(
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
))
{
{
if
(
!
access
(
path
,
F_OK
))
if
(
!
access
(
path
,
F_OK
))
{
{
VOID
(
pthread_mutex_unlock
(
&
LOCK_open
));
if
(
create_info
->
options
&
HA_LEX_CREATE_IF_NOT_EXISTS
)
if
(
create_info
->
options
&
HA_LEX_CREATE_IF_NOT_EXISTS
)
DBUG_RETURN
(
0
);
error
=
0
;
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
table_name
);
else
DBUG_RETURN
(
-
1
);
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
table_name
);
goto
end
;
}
}
}
}
...
@@ -946,6 +948,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
...
@@ -946,6 +948,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
error
=
0
;
error
=
0
;
end:
end:
VOID
(
pthread_mutex_unlock
(
&
LOCK_open
));
VOID
(
pthread_mutex_unlock
(
&
LOCK_open
));
start_waiting_global_read_lock
(
thd
);
thd
->
proc_info
=
"After create"
;
thd
->
proc_info
=
"After create"
;
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
...
...
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