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
825ad1f8
Commit
825ad1f8
authored
Sep 02, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added testing of IN(value-list)
Portability fixes
parent
d42e4d27
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
125 additions
and
8 deletions
+125
-8
Build-tools/Do-compile
Build-tools/Do-compile
+11
-5
sql-bench/bench-init.pl.sh
sql-bench/bench-init.pl.sh
+30
-1
sql-bench/test-insert.sh
sql-bench/test-insert.sh
+76
-1
sql/item_func.cc
sql/item_func.cc
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+6
-0
sql/stacktrace.c
sql/stacktrace.c
+1
-0
No files found.
Build-tools/Do-compile
View file @
825ad1f8
...
...
@@ -4,10 +4,10 @@ use Getopt::Long;
$opt_distribution
=
$opt_user
=
$opt_result
=
$opt_config_options
=
$opt_config_env
=
"";
$opt_dbd_options
=
$opt_perl_options
=
$opt_suffix
=
"";
$opt_tmp
=
$version_suffix
=
"";
$opt_help
=
$opt_Information
=
$opt_no_delete
=
$opt_debug
=
$opt_stage
=
$opt_rsh_mail
=
$opt_no_test
=
$opt_no_perl
=
$opt_with_low_memory
=
$opt_fast_benchmark
=
$opt_static_client
=
$opt_static_server
=
$opt_static_perl
=
$opt_sur
=
$opt_with_small_disk
=
$opt_local_perl
=
$opt_tcpip
=
$opt_build_thread
=
$opt_no_mysqltest
=
$opt_use_old_distribution
=
$opt_enable_shared
=
$opt_no_crash_me
=
$opt_no_strip
=
0
;
$opt_help
=
$opt_Information
=
$opt_no_delete
=
$opt_de
lete
=
$opt_de
bug
=
$opt_stage
=
$opt_rsh_mail
=
$opt_no_test
=
$opt_no_perl
=
$opt_with_low_memory
=
$opt_fast_benchmark
=
$opt_static_client
=
$opt_static_server
=
$opt_static_perl
=
$opt_sur
=
$opt_with_small_disk
=
$opt_local_perl
=
$opt_tcpip
=
$opt_build_thread
=
$opt_no_mysqltest
=
$opt_use_old_distribution
=
$opt_enable_shared
=
$opt_no_crash_me
=
$opt_no_strip
=
0
;
$opt_innodb
=
$opt_bdb
=
0
;
GetOptions
("
Information
","
help
","
distribution=s
","
user=s
","
result=s
","
no-delete
","
no-test
","
no-mysqltest
","
perl-files=s
","
debug
","
config-options=s
","
config-env=s
","
stage=i
","
rsh-mail
","
with-low-memory
","
fast-benchmark
","
tmp=s
","
static-client
","
static-server
","
static-perl
","
no-perl
","
local-perl
","
perl-options=s
","
sur
","
with-small-disk
","
dbd-options=s
","
tcpip
","
suffix=s
","
build-thread=i
","
innodb
","
bdb
","
use-old-distribution
","
enable-shared
","
no-crash-me
","
no-strip
")
||
usage
();
GetOptions
("
Information
","
help
","
distribution=s
","
user=s
","
result=s
","
no-delete
","
delete
","
no-test
","
no-mysqltest
","
perl-files=s
","
debug
","
config-options=s
","
config-env=s
","
stage=i
","
rsh-mail
","
with-low-memory
","
fast-benchmark
","
tmp=s
","
static-client
","
static-server
","
static-perl
","
no-perl
","
local-perl
","
perl-options=s
","
sur
","
with-small-disk
","
dbd-options=s
","
tcpip
","
suffix=s
","
build-thread=i
","
innodb
","
bdb
","
use-old-distribution
","
enable-shared
","
no-crash-me
","
no-strip
")
||
usage
();
usage
()
if
(
$opt_help
||
$opt_Information
);
usage
()
if
(
!
$opt_distribution
);
...
...
@@ -112,7 +112,6 @@ if ($opt_stage <= 1)
{
$opt_config_options
.=
"
--with-low-memory
"
if
(
$opt_with_low_memory
);
# Fix files if this is in another timezone than work.mysql.com
log_system
("
touch *
");
unlink
("
config.cache
");
log_system
("
$make
clean
")
if
(
$opt_use_old_distribution
);
if
(
$opt_static_server
)
...
...
@@ -144,7 +143,7 @@ if ($opt_stage <= 1)
if
(
$opt_stage
<=
2
)
{
unlink
(
$opt_distribution
)
if
(
!
$opt_
no_
delete
&&
!
$opt_use_old_distribution
);
unlink
(
$opt_distribution
)
if
(
!
$opt_delete
&&
!
$opt_use_old_distribution
);
safe_system
("
$make
");
}
...
...
@@ -161,7 +160,14 @@ if ($opt_stage <= 3)
$flags
.=
"
--no-strip
"
if
(
$opt_no_strip
);
check_system
("
scripts/make_binary_distribution --tmp=
$opt_tmp
--suffix=
$opt_suffix
$flags
","
.tar.gz created
");
safe_system
("
mv mysql*.tar.gz
$pwd
/
$host
");
safe_system
("
cp client/mysqladmin
$pwd
/
$host
/bin
");
if
(
-
f
"
client/.libs/mysqladmin
")
{
safe_system
("
cp client/.libs/mysqladmin
$pwd
/
$host
/bin
");
}
else
{
safe_system
("
cp client/mysqladmin
$pwd
/
$host
/bin
");
}
safe_system
("
$make
clean
")
if
(
$opt_with_small_disk
);
}
...
...
sql-bench/bench-init.pl.sh
View file @
825ad1f8
...
...
@@ -31,7 +31,7 @@
# $server Object for current server
# $limits Hash reference to limits for benchmark
$benchmark_version
=
"2.1
3
"
;
$benchmark_version
=
"2.1
4
"
;
use Getopt::Long
;
require
"
$pwd
/server-cfg"
||
die
"Can't read Configuration file:
$!
\n
"
;
...
...
@@ -294,6 +294,35 @@ sub do_query
die
"
\n
Error executing '
$query
':
\n
$DBI
::errstr
\n
"
;
}
#
# Run a query X times
#
sub time_fetch_all_rows
{
my
(
$test_text
,
$result_text
,
$query
,
$dbh
,
$test_count
)=
@_
;
my
(
$i
,
$loop_time
,
$end_time
,
$count
,
$rows
,
$estimated
)
;
print
$test_text
.
"
\n
"
if
(
defined
(
$test_text
))
;
$count
=
$rows
=
0
;
$loop_time
=
new Benchmark
;
for
(
$i
=
1
;
$i
<
=
$test_count
;
$i
++
)
{
$count
++
;
$rows
+
=
fetch_all_rows
(
$dbh
,
$query
)
or die
$DBI
::errstr
;
$end_time
=
new Benchmark
;
last
if
(
$estimated
=
predict_query_time
(
$loop_time
,
$end_time
,
\$
count,
$i
,
$test_count
))
;
}
$end_time
=
new Benchmark
;
if
(
$estimated
)
{
print
"Estimated time"
;
}
else
{
print
"Time"
;
}
print
" for
$result_text
(
$count
:
$rows
) "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n\n
"
;
}
#
# Handle estimated time of the server is too slow
...
...
sql-bench/test-insert.sh
View file @
825ad1f8
...
...
@@ -1007,6 +1007,47 @@ if ($server->small_rollback_segment())
$dbh
=
$server
->connect
()
;
}
###
### Test speed of IN( value list)
###
if
(
$limits
->
{
'functions'
})
{
if
(
$opt_lock_tables
)
{
$sth
=
$dbh
->do
(
"UNLOCK TABLES"
)
||
die
$DBI
::errstr
;
}
do_many
(
$dbh
,
$server
->create
(
"bench2"
,
[
"id int NOT NULL"
]
,
[
"primary key (id)"
]))
;
$max_tests
=
min
((
$limits
->
{
'query_size'
}
-50
)
/6,
$opt_loop_count
)
;
if
(
$opt_lock_tables
)
{
$sth
=
$dbh
->do
(
"LOCK TABLES bench1 READ, bench2 WRITE"
)
||
die
$DBI
::errstr
;
}
test_where_in
(
"bench1"
,
"bench2"
,
"id"
,1,10
)
;
test_where_in
(
"bench1"
,
"bench2"
,
"id"
,11,100
)
;
test_where_in
(
"bench1"
,
"bench2"
,
"id"
,101,min
(
1000,
$max_tests
))
;
test_where_in
(
"bench1"
,
"bench2"
,
"id"
,1000,
$max_tests
/2
)
;
if
(
$max_tests
>
1000
)
{
test_where_in
(
"bench1"
,
"bench2"
,
"id"
,
$max_tests
/2+1,
$max_tests
)
;
}
if
(
$opt_lock_tables
)
{
$sth
=
$dbh
->do
(
"UNLOCK TABLES"
)
||
die
$DBI
::errstr
;
}
$sth
=
$dbh
->do
(
"DROP TABLE bench2"
.
$server
->
{
'drop_attr'
})
||
die
$DBI
::errstr
;
if
(
$opt_lock_tables
)
{
$sth
=
$dbh
->do
(
"LOCK TABLES bench1 WRITE"
)
||
die
$DBI
::errstr
;
}
}
####
#### Test INSERT INTO ... SELECT
####
...
...
@@ -1067,7 +1108,6 @@ if ($limits->{'insert_select'})
}
}
####
#### Do some deletes on the table
####
...
...
@@ -1605,3 +1645,38 @@ sub check_or_range
print
" for
$check
(
$count
:
$found
): "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n
"
;
}
#
# Test if SELECT ... WHERE id in(value-list)
#
sub test_where_in
{
my
(
$t1
,
$t2
,
$id
,
$from
,
$to
)=
@_
;
return if
(
$from
>=
$to
)
;
$query
=
"SELECT
$t1
.* FROM
$t1
WHERE
$id
IN ("
;
for
(
$i
=
1
;
$i
<
=
$to
;
$i
++
)
{
$query
.
=
"
$i
,"
;
}
$query
=
substr
(
$query
,0,length
(
$query
)
-1
)
.
")"
;
# Fill join table to have the same id's as 'query'
for
(
$i
=
$from
;
$i
<
=
$to
;
$i
++
)
{
$dbh
->do
(
"insert into
$t2
values(
$i
)"
)
or die
$DBI
::errstr
;
}
if
(
$opt_fast
&&
defined
(
$server
->
{
vacuum
}))
{
$server
->vacuum
(
1,
\$
dbh,
"bench1"
)
;
}
time_fetch_all_rows
(
"
\n
Testing SELECT ... WHERE id in (
$to
values)"
,
"select_in"
,
$query
,
$dbh
,
$range_loop_count
)
;
time_fetch_all_rows
(
undef,
"select_join_in"
,
"SELECT
$t1
.* FROM
$t1
,
$t2
WHERE
$t1
.
$id
=
$t2
.
$id
"
,
$dbh
,
$range_loop_count
)
;
}
sql/item_func.cc
View file @
825ad1f8
...
...
@@ -1462,7 +1462,7 @@ longlong Item_func_get_lock::val_int()
struct
timespec
abstime
;
THD
*
thd
=
current_thd
;
ULL
*
ull
;
int
error
;
int
error
=
0
;
pthread_mutex_lock
(
&
LOCK_user_locks
);
...
...
sql/mysqld.cc
View file @
825ad1f8
...
...
@@ -1241,6 +1241,12 @@ information that should help you find out what is causing the crash\n");
exit
(
1
);
}
#ifndef SA_RESETHAND
#define SA_RESETHAND 0
#endif
#ifndef SA_NODEFER
#define SA_NODEFER 0
#endif
static
void
init_signals
(
void
)
{
...
...
sql/stacktrace.c
View file @
825ad1f8
...
...
@@ -17,6 +17,7 @@
#include <global.h>
#include "stacktrace.h"
#include <signal.h>
#include <my_pthread.h>
#ifdef HAVE_STACKTRACE
#include <unistd.h>
...
...
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