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
228de3b0
Commit
228de3b0
authored
Sep 08, 2001
by
monty@tik.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/my/mysql into tik.mysql.fi:/home/my/mysql
parents
599eee3e
e508ad16
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
178 additions
and
74 deletions
+178
-74
Docs/manual.texi
Docs/manual.texi
+145
-66
sql-bench/test-create.sh
sql-bench/test-create.sh
+10
-2
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+9
-4
sql/mysql_priv.h
sql/mysql_priv.h
+2
-1
sql/sql_base.cc
sql/sql_base.cc
+3
-0
sql/sql_parse.cc
sql/sql_parse.cc
+9
-1
No files found.
Docs/manual.texi
View file @
228de3b0
This diff is collapsed.
Click to expand it.
sql-bench/test-create.sh
View file @
228de3b0
...
...
@@ -39,13 +39,21 @@ $opt_loop_count=10000; # Change this to make test harder/easier
chomp
(
$pwd
=
`
pwd
`
)
;
$pwd
=
"."
if
(
$pwd
eq
''
)
;
require
"
$pwd
/bench-init.pl"
||
die
"Can't read Configuration file:
$!
\n
"
;
$create_loop_count
=
$opt_loop_count
;
if
(
$opt_small_test
)
{
$opt_loop_count
/
=
100
;
$create_loop_count
/
=
1000
;
}
$max_tables
=
min
(
$limits
->
{
'max_tables'
}
,
$opt_loop_count
)
;
if
(
$opt_small_test
)
{
$max_tables
=
10
;
}
print
"Testing the speed of creating and droping tables
\n
"
;
print
"Testing with
$max_tables
tables and
$opt_loop_count
loop count
\n\n
"
;
...
...
@@ -177,7 +185,7 @@ print "Testing create+drop\n";
$loop_time
=
new Benchmark
;
for
(
$i
=
1
;
$i
<
=
$
opt
_loop_count
;
$i
++
)
for
(
$i
=
1
;
$i
<
=
$
create
_loop_count
;
$i
++
)
{
do_many
(
$dbh
,
$server
->create
(
"bench_
$i
"
,
[
"i int NOT NULL"
,
...
...
@@ -190,7 +198,7 @@ for ($i=1 ; $i <= $opt_loop_count ; $i++)
}
$end_time
=
new Benchmark
;
print
"Time for create+drop (
$
opt
_loop_count
): "
.
print
"Time for create+drop (
$
create
_loop_count
): "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n
"
;
if
(
$opt_fast
&&
defined
(
$server
->
{
vacuum
}))
...
...
sql/ha_berkeley.cc
View file @
228de3b0
...
...
@@ -1658,12 +1658,15 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
{
if
(
!
thd
->
transaction
.
bdb_lock_count
++
)
{
changed_rows
=
0
;
/* First table lock, start transaction */
if
((
thd
->
options
&
(
OPTION_NOT_AUTO_COMMIT
|
OPTION_BEGIN
))
&&
if
((
thd
->
options
&
(
OPTION_NOT_AUTO_COMMIT
|
OPTION_BEGIN
|
OPTION_TABLE_LOCK
))
&&
!
thd
->
transaction
.
all
.
bdb_tid
)
{
DBUG_ASSERT
(
thd
->
transaction
.
stmt
.
bdb_tid
!=
0
);
/* We have to start a master transaction */
DBUG_PRINT
(
"trans"
,(
"starting transaction"
));
DBUG_PRINT
(
"trans"
,(
"starting transaction
all
"
));
if
((
error
=
txn_begin
(
db_env
,
0
,
(
DB_TXN
**
)
&
thd
->
transaction
.
all
.
bdb_tid
,
0
)))
...
...
@@ -1671,8 +1674,10 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
thd
->
transaction
.
bdb_lock_count
--
;
// We didn't get the lock /* purecov: inspected */
DBUG_RETURN
(
error
);
/* purecov: inspected */
}
if
(
thd
->
in_lock_tables
)
DBUG_RETURN
(
0
);
// Don't create stmt trans
}
DBUG_PRINT
(
"trans"
,(
"starting transaction
for statemen
t"
));
DBUG_PRINT
(
"trans"
,(
"starting transaction
stm
t"
));
if
((
error
=
txn_begin
(
db_env
,
(
DB_TXN
*
)
thd
->
transaction
.
all
.
bdb_tid
,
(
DB_TXN
**
)
&
thd
->
transaction
.
stmt
.
bdb_tid
,
...
...
@@ -1684,7 +1689,6 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
}
}
transaction
=
(
DB_TXN
*
)
thd
->
transaction
.
stmt
.
bdb_tid
;
changed_rows
=
0
;
}
else
{
...
...
@@ -1722,6 +1726,7 @@ int ha_berkeley::start_stmt(THD *thd)
DBUG_ENTER
(
"ha_berkeley::start_stmt"
);
if
(
!
thd
->
transaction
.
stmt
.
bdb_tid
)
{
DBUG_PRINT
(
"trans"
,(
"starting transaction stmt"
));
error
=
txn_begin
(
db_env
,
(
DB_TXN
*
)
thd
->
transaction
.
all
.
bdb_tid
,
(
DB_TXN
**
)
&
thd
->
transaction
.
stmt
.
bdb_tid
,
0
);
...
...
sql/mysql_priv.h
View file @
228de3b0
...
...
@@ -163,7 +163,8 @@ void kill_one_thread(THD *thd, ulong id);
#define OPTION_BIN_LOG OPTION_BUFFER_RESULT*2
#define OPTION_NOT_AUTO_COMMIT OPTION_BIN_LOG*2
#define OPTION_BEGIN OPTION_NOT_AUTO_COMMIT*2
#define OPTION_QUICK OPTION_BEGIN*2
#define OPTION_TABLE_LOCK OPTION_BEGIN*2
#define OPTION_QUICK OPTION_TABLE_LOCK*2
#define OPTION_QUOTE_SHOW_CREATE OPTION_QUICK*2
#define OPTION_INTERNAL_SUBTRANSACTIONS OPTION_QUOTE_SHOW_CREATE*2
...
...
sql/sql_base.cc
View file @
228de3b0
...
...
@@ -413,7 +413,10 @@ void close_thread_tables(THD *thd, bool locked)
DBUG_ENTER
(
"close_thread_tables"
);
if
(
thd
->
locked_tables
)
{
ha_commit_stmt
(
thd
);
// If select statement
DBUG_VOID_RETURN
;
// LOCK TABLES in use
}
TABLE
*
table
,
*
next
;
bool
found_old_table
=
0
;
...
...
sql/sql_parse.cc
View file @
228de3b0
...
...
@@ -81,7 +81,8 @@ static void init_signals(void)
inline
bool
end_active_trans
(
THD
*
thd
)
{
int
error
=
0
;
if
(
thd
->
options
&
(
OPTION_NOT_AUTO_COMMIT
|
OPTION_BEGIN
))
if
(
thd
->
options
&
(
OPTION_NOT_AUTO_COMMIT
|
OPTION_BEGIN
|
OPTION_TABLE_LOCK
))
{
thd
->
options
&=
~
(
ulong
)
(
OPTION_BEGIN
|
OPTION_STATUS_NO_TRANS_UPDATE
);
thd
->
server_status
&=
~
SERVER_STATUS_IN_TRANS
;
...
...
@@ -1825,7 +1826,11 @@ mysql_execute_command(void)
{
thd
->
lock
=
thd
->
locked_tables
;
thd
->
locked_tables
=
0
;
// Will be automaticly closed
}
if
(
thd
->
options
&
OPTION_TABLE_LOCK
)
{
end_active_trans
(
thd
);
thd
->
options
&=
~
(
ulong
)
(
OPTION_TABLE_LOCK
);
}
if
(
thd
->
global_read_lock
)
{
...
...
@@ -1847,12 +1852,15 @@ mysql_execute_command(void)
if
(
check_db_used
(
thd
,
tables
)
||
end_active_trans
(
thd
))
goto
error
;
thd
->
in_lock_tables
=
1
;
thd
->
options
|=
OPTION_TABLE_LOCK
;
if
(
!
(
res
=
open_and_lock_tables
(
thd
,
tables
)))
{
thd
->
locked_tables
=
thd
->
lock
;
thd
->
lock
=
0
;
send_ok
(
&
thd
->
net
);
}
else
thd
->
options
&=
~
(
ulong
)
(
OPTION_TABLE_LOCK
);
thd
->
in_lock_tables
=
0
;
break
;
case
SQLCOM_CREATE_DB
:
...
...
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