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
ad8f2810
Commit
ad8f2810
authored
Mar 12, 2001
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql
into mysql.sashanet.com:/home/sasha/src/bk/mysql
parents
80b7f100
2505d667
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
270 additions
and
61 deletions
+270
-61
.bzrignore
.bzrignore
+1
-0
BUILD/compile-pentium
BUILD/compile-pentium
+1
-6
BUILD/compile-pentium-debug
BUILD/compile-pentium-debug
+1
-6
Docs/manual.texi
Docs/manual.texi
+36
-9
client/mysql.cc
client/mysql.cc
+22
-1
client/mysqladmin.c
client/mysqladmin.c
+7
-4
configure.in
configure.in
+1
-1
innobase/mem/Makefile.am
innobase/mem/Makefile.am
+2
-0
innobase/pars/Makefile.am
innobase/pars/Makefile.am
+2
-0
mysql-test/README
mysql-test/README
+4
-1
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+4
-4
mysql-test/r/bdb.result
mysql-test/r/bdb.result
+2
-0
mysql-test/r/innobase.result
mysql-test/r/innobase.result
+2
-0
mysql-test/t/bdb.test
mysql-test/t/bdb.test
+14
-0
mysql-test/t/innobase.test
mysql-test/t/innobase.test
+14
-0
sql-bench/TODO
sql-bench/TODO
+21
-0
sql-bench/bench-init.pl.sh
sql-bench/bench-init.pl.sh
+1
-1
sql-bench/run-all-tests.sh
sql-bench/run-all-tests.sh
+14
-5
sql-bench/server-cfg.sh
sql-bench/server-cfg.sh
+5
-0
sql-bench/test-select.sh
sql-bench/test-select.sh
+59
-1
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+6
-1
sql/ha_innobase.h
sql/ha_innobase.h
+12
-10
sql/ha_isam.h
sql/ha_isam.h
+2
-1
sql/ha_myisam.cc
sql/ha_myisam.cc
+2
-1
sql/handler.h
sql/handler.h
+2
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+18
-3
sql/opt_sum.cc
sql/opt_sum.cc
+5
-0
sql/records.cc
sql/records.cc
+5
-3
sql/sql_delete.cc
sql/sql_delete.cc
+1
-1
sql/sql_lex.cc
sql/sql_lex.cc
+2
-1
sql/sql_table.cc
sql/sql_table.cc
+1
-0
No files found.
.bzrignore
View file @
ad8f2810
...
...
@@ -197,3 +197,4 @@ bdb/build_win32/db.h
bdb/dist/configure
bdb/dist/tags
bdb/build_unix/*
sql/.gdbinit
BUILD/compile-pentium
View file @
ad8f2810
...
...
@@ -7,11 +7,6 @@ extra_flags="$pentium_cflags $fast_cflags"
extra_configs
=
"
$pentium_configs
"
strip
=
yes
# Use the optimized version if it exists
if
test
-d
/usr/local/BerkeleyDB-opt/
then
extra_configs
=
"
$extra_configs
--with-berkeley-db=/usr/local/BerkeleyDB-opt/"
fi
extra_configs
=
"
$extra_configs
--with-innobase"
extra_configs
=
"
$extra_configs
--with-berkeley-db --with-innobase"
.
"
$path
/FINISH.sh"
BUILD/compile-pentium-debug
View file @
ad8f2810
...
...
@@ -8,11 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings
=
"
$cxx_warnings
$debug_extra_warnings
"
extra_configs
=
"
$pentium_configs
$debug_configs
"
# Use the debug version if it exists
if
test
-d
/usr/local/BerkeleyDB-dbug/
then
extra_configs
=
"
$extra_configs
--with-berkeley-db=/usr/local/BerkeleyDB-dbug/"
fi
extra_configs
=
"
$extra_configs
--with-innobase"
extra_configs
=
"
$extra_configs
--with-berkeley-db --with-innobase"
.
"
$path
/FINISH.sh"
Docs/manual.texi
View file @
ad8f2810
...
...
@@ -595,7 +595,7 @@ Replication in MySQL
* Replication Options:: Replication Options in my.cnf
* Replication SQL:: SQL Commands related to replication
* Replication FAQ:: Frequently Asked Questions about replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication
. Troubleshooting Replication
Getting Maximum Performance from MySQL
...
...
@@ -895,6 +895,7 @@ Changes in release 4.0.x (Development; Alpha)
Changes in release 3.23.x (Stable)
* News-3.23.34a::
* News-3.23.34:: Changes in release 3.23.34
* News-3.23.33:: Changes in release 3.23.33
* News-3.23.32:: Changes in release 3.23.32
...
...
@@ -5679,7 +5680,7 @@ To install the HP-UX tar.gz distribution, you must have a copy of GNU
@cindex installing, source distribution
@cindex source distrib
tu
ion, installing
@cindex source distrib
ut
ion, installing
@cindex installation overview
@node Installing source, Installing source tree, Installing binary, Installing
@section Installing a MySQL Source Distribution
...
...
@@ -23596,7 +23597,7 @@ The @code{GEMINI} table type is developed and supported by NuSphere Corporation
(@uref{http://www.nusphere.com}). It features row-level locking, transaction
support (@code{COMMIT} and @code{ROLLBACK}), and automatic crash recovery.
@code{GEMINI} tables will be included in the @strong{MySQL}
4.0
source
@code{GEMINI} tables will be included in the @strong{MySQL}
3.23.35
source
distribution.
@node GEMINI start, GEMINI features, GEMINI overview, GEMINI
...
...
@@ -23674,10 +23675,10 @@ NuSphere is working on removing these limitations.
@subsection INNOBASE Tables overview
Innobase is included in the @strong{MySQL} source distribution starting
from 3.23.34 and will be activated in the @strong{MySQL}-max binary.
from 3.23.34
a
and will be activated in the @strong{MySQL}-max binary.
If you have downloaded a binary version of @strong{MySQL} that includes
support for
Berkeley DB
, simply follow the instructions for
support for
Innobase
, simply follow the instructions for
installing a binary version of @strong{MySQL}. @xref{Installing binary}.
To compile @strong{MySQL} with Innobase support, download @strong{MySQL}
...
...
@@ -23686,7 +23687,7 @@ To compile @strong{MySQL} with Innobase support, download @strong{MySQL}
@example
cd /path/to/source/of/mysql-3.23.34
./configure --with-
berkeley-db
./configure --with-
innobase
@end example
Innobase provides MySQL with a transaction safe table handler with
...
...
@@ -26624,7 +26625,7 @@ tables}.
* Replication Options:: Replication Options in my.cnf
* Replication SQL:: SQL Commands related to replication
* Replication FAQ:: Frequently Asked Questions about replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication
. Troubleshooting Replication
@end menu
@node Replication Intro, Replication Implementation, Replication, Replication
...
...
@@ -40254,6 +40255,12 @@ If a test fails totally, you should check the logs file in the
@item
If you have compiled @strong{MySQL} with debugging you can try to debug this
with the @code{--gdb} and @code{--debug} options to @code{mysql-test-run}.
@xref{Making trace files}.
If you have not compiled @strong{MySQL} for debugging you should probably
do that. Just specify the @code{--with-debug} options to @code{configure}!
@xref{Installing source}.
@end itemize
@page
...
...
@@ -42049,6 +42056,7 @@ users uses this code as the rest of the code and because of this we are
not yet 100 % confident in this code.
@menu
* News-3.23.34a::
* News-3.23.34:: Changes in release 3.23.34
* News-3.23.33:: Changes in release 3.23.33
* News-3.23.32:: Changes in release 3.23.32
...
...
@@ -42086,7 +42094,13 @@ not yet 100 % confident in this code.
* News-3.23.0:: Changes in release 3.23.0
@end menu
@node News-3.23.34, News-3.23.33, News-3.23.x, News-3.23.x
@node News-3.23.34a, News-3.23.34, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.34a
@itemize @bullet
Add extra files to distribution to allow one to compile Innobase.
@end itemize
@node News-3.23.34, News-3.23.33, News-3.23.34a, News-3.23.x
@appendixsubsec Changes in release 3.23.34
@itemize @bullet
@item
...
...
@@ -42133,6 +42147,8 @@ Fixed bug in bi-directonal replication.
Fixed bug in @code{BDB} tables when using index on multi-part key where a
key part may be @code{NULL}.
@item
Fixed @code{MAX()} optimization on sub-key for @code{BDB} tables.
@item
Fixed problem with 'garbage results' when using @code{BDB} tables and
@code{BLOB} or @code{TEXT} fields when joining many tables.
@item
...
...
@@ -47046,6 +47062,12 @@ in some cases the @code{PROCEDURE} will not transform the columns.
@item
Creation of a table of type @code{MERGE} doesn't check if the underlying
tables are of compatible types.
@item
@strong{MySQL} can't yet handle @code{NaN}, @code{-Inf} and @code{Inf}
values in double. Using these will cause problems when trying to export
and import data. We should as a intermediate solution change @code{NaN} to
@code{NULL} (if possible) and @code{-Inf} and @code{Inf} to the
Minimum respective maximum possible @code{double} value.
@end itemize
The following are known bugs in earlier versions of @strong{MySQL}:
...
...
@@ -47186,6 +47208,11 @@ characters in database, table and column names.
@item
Add a portable interface over @code{gethostbyaddr_r()} so that we can change
@code{ip_to_hostname()} to not block other threads while doing DNS lookups.
@item
Add @code{record_in_range()} method to @code{MERGE} tables to be
able to choose the right index when there is many to choose from. We should
also extend the info interface to get the key distribution for each index,
of @code{analyze} is run on all sub tables.
@end itemize
@node TODO future, TODO sometime, TODO MySQL 4.0, TODO
...
...
@@ -47677,7 +47704,7 @@ send mail to @email{mysql@@lists.mysql.com} and ask for help. Please use the
If you can cause the @code{mysqld} server to crash quickly, you can try to
create a trace file of this:
Start the @code{mysqld} server with a trace log in @file{/tmp/mysql.trace}.
Start the @code{mysqld} server with a trace log in @file{/tmp/mysql
d
.trace}.
The log file will get very @emph{BIG}.
@code{mysqld --debug --log}
client/mysql.cc
View file @
ad8f2810
...
...
@@ -39,7 +39,7 @@
#include "my_readline.h"
#include <signal.h>
const
char
*
VER
=
"11.1
2
"
;
const
char
*
VER
=
"11.1
3
"
;
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
...
...
@@ -1518,6 +1518,22 @@ com_ego(String *buffer,char *line)
return
result
;
}
static
void
print_field_types
(
MYSQL_RES
*
result
)
{
MYSQL_FIELD
*
field
;
while
((
field
=
mysql_fetch_field
(
result
)))
{
tee_fprintf
(
PAGER
,
"%s '%s' %d %d %d %d %d
\n
"
,
field
->
name
,
field
->
table
?
""
:
field
->
table
,
(
int
)
field
->
type
,
field
->
length
,
field
->
max_length
,
field
->
flags
,
field
->
decimals
);
}
tee_puts
(
""
,
PAGER
);
}
static
void
print_table_data
(
MYSQL_RES
*
result
)
...
...
@@ -1528,6 +1544,11 @@ print_table_data(MYSQL_RES *result)
bool
*
num_flag
;
num_flag
=
(
bool
*
)
my_alloca
(
sizeof
(
bool
)
*
mysql_num_fields
(
result
));
if
(
info_flag
)
{
print_field_types
(
result
);
mysql_field_seek
(
result
,
0
);
}
separator
.
copy
(
"+"
,
1
);
while
((
field
=
mysql_fetch_field
(
result
)))
{
...
...
client/mysqladmin.c
View file @
ad8f2810
...
...
@@ -28,9 +28,9 @@
#include <my_pthread.h>
/* because of signal() */
#endif
#define ADMIN_VERSION "8.1
7
"
#define ADMIN_VERSION "8.1
8
"
#define MAX_MYSQL_VAR 64
#define
MAX_TIME_TO_WAIT 3600
/* Wait for shutdown */
#define
SHUTDOWN_DEF_TIMEOUT 3600
/* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
char
truncated_var_names
[
MAX_MYSQL_VAR
][
MAX_TRUNC_LENGTH
];
...
...
@@ -40,7 +40,7 @@ static int interval=0;
static
my_bool
option_force
=
0
,
interrupted
=
0
,
new_line
=
0
,
opt_compress
=
0
,
opt_relative
=
0
,
opt_verbose
=
0
,
opt_vertical
=
0
;
static
uint
tcp_port
=
0
,
option_wait
=
0
,
option_silent
=
0
;
static
ulong
opt_connect_timeout
;
static
ulong
opt_connect_timeout
,
opt_shutdown_timeout
;
static
my_string
unix_port
=
0
;
/* When using extended-status relatively, ex_val_max_len is the estimated
...
...
@@ -134,6 +134,8 @@ static struct option long_options[] = {
CHANGEABLE_VAR
changeable_vars
[]
=
{
{
"connect_timeout"
,
(
long
*
)
&
opt_connect_timeout
,
0
,
0
,
3600
*
12
,
0
,
1
},
{
"shutdown_timeout"
,
(
long
*
)
&
opt_shutdown_timeout
,
SHUTDOWN_DEF_TIMEOUT
,
0
,
3600
*
12
,
0
,
1
},
{
0
,
0
,
0
,
0
,
0
,
0
,
0
}
};
...
...
@@ -148,6 +150,7 @@ int main(int argc,char *argv[])
MY_INIT
(
argv
[
0
]);
mysql_init
(
&
mysql
);
load_defaults
(
"my"
,
load_default_groups
,
&
argc
,
&
argv
);
set_all_changeable_vars
(
changeable_vars
);
while
((
c
=
getopt_long
(
argc
,
argv
,
"h:i:p::u:#::P:sS:Ct:fq?vVw::WrEO:"
,
long_options
,
&
option_index
))
!=
EOF
)
...
...
@@ -1125,7 +1128,7 @@ static void wait_pidfile(char *pidfile)
uint
count
=
0
;
system_filename
(
buff
,
pidfile
);
while
((
fd
=
open
(
buff
,
O_RDONLY
))
>=
0
&&
count
++
<
MAX_TIME_TO_WAIT
)
while
((
fd
=
open
(
buff
,
O_RDONLY
))
>=
0
&&
count
++
<
opt_shutdown_timeout
)
{
close
(
fd
);
sleep
(
1
);
...
...
configure.in
View file @
ad8f2810
...
...
@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT
(
sql/mysqld.cc
)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE
(
mysql, 3.23.34
)
AM_INIT_AUTOMAKE
(
mysql, 3.23.34
a
)
AM_CONFIG_HEADER
(
config.h
)
PROTOCOL_VERSION
=
10
...
...
innobase/mem/Makefile.am
View file @
ad8f2810
...
...
@@ -21,4 +21,6 @@ libs_LIBRARIES = libmem.a
libmem_a_SOURCES
=
mem0mem.c mem0pool.c
EXTRA_DIST
=
mem0dbg.c
EXTRA_PROGRAMS
=
innobase/pars/Makefile.am
View file @
ad8f2810
...
...
@@ -19,6 +19,8 @@ include ../include/Makefile.i
libs_LIBRARIES
=
libpars.a
noinst_HEADERS
=
pars0grm.h
libpars_a_SOURCES
=
pars0grm.c lexyy.c pars0opt.c pars0pars.c pars0sym.c
EXTRA_PROGRAMS
=
mysql-test/README
View file @
ad8f2810
...
...
@@ -6,7 +6,10 @@ actually have a co-existing MySQL installation - the tests will not
conflict with it.
All tests must pass. If one or more of them fail on your system, please
report the details to bugs@lists.mysql.com
read the following manual section of how to report the problem:
http://www.mysql.com/doc/M/y/MySQL_test_suite.html
You can create your own test cases. To create a test case:
...
...
mysql-test/mysql-test-run.sh
View file @
ad8f2810
...
...
@@ -450,14 +450,14 @@ stop_slave ()
{
if
[
x
$SLAVE_RUNNING
=
x1
]
then
$MYSQLADMIN
--no-defaults
--socket
=
$SLAVE_MYSOCK
-u
root shutdown
$MYSQLADMIN
--no-defaults
--socket
=
$SLAVE_MYSOCK
-u
root
-O
shutdown_timeout
=
10
shutdown
if
[
$?
!=
0
]
&&
[
-f
$SLAVE_MYPID
]
then
# try harder!
$ECHO
"slave not cooperating with mysqladmin, will try manual kill"
kill
`
$CAT
$SLAVE_MYPID
`
sleep
$SLEEP_TIME
if
[
-f
$SLAVE_MYPID
]
;
then
$ECHO
"slave refused to die
, resorting to SIGKILL murder
"
$ECHO
"slave refused to die
. Sending SIGKILL
"
kill
-9
`
$CAT
$SLAVE_MYPID
`
$RM
-f
$SLAVE_MYPID
else
...
...
@@ -472,14 +472,14 @@ stop_master ()
{
if
[
x
$MASTER_RUNNING
=
x1
]
then
$MYSQLADMIN
--no-defaults
--socket
=
$MASTER_MYSOCK
-u
root shutdown
$MYSQLADMIN
--no-defaults
--socket
=
$MASTER_MYSOCK
-u
root
-O
shutdown_timeout
=
10
shutdown
if
[
$?
!=
0
]
&&
[
-f
$MASTER_MYPID
]
then
# try harder!
$ECHO
"master not cooperating with mysqladmin, will try manual kill"
kill
`
$CAT
$MASTER_MYPID
`
sleep
$SLEEP_TIME
if
[
-f
$MASTER_MYPID
]
;
then
$ECHO
"master refused to die
, resorting to SIGKILL murder
"
$ECHO
"master refused to die
. Sending SIGKILL
"
kill
-9
`
$CAT
$MASTER_MYPID
`
$RM
-f
$MASTER_MYPID
else
...
...
mysql-test/r/bdb.result
View file @
ad8f2810
...
...
@@ -490,3 +490,5 @@ a 2
a b
a 1
a 2
MIN(B) MAX(b)
1 1
mysql-test/r/innobase.result
View file @
ad8f2810
...
...
@@ -443,3 +443,5 @@ i j
1 2
i j
1 2
MIN(B) MAX(b)
1 1
mysql-test/t/bdb.test
View file @
ad8f2810
...
...
@@ -664,3 +664,17 @@ SELECT * FROM t1 WHERE a='a' AND b=2;
SELECT
*
FROM
t1
WHERE
a
=
'a'
AND
b
in
(
2
);
SELECT
*
FROM
t1
WHERE
a
=
'a'
AND
b
in
(
1
,
2
);
drop
table
t1
;
#
# Test min-max optimization
#
CREATE
TABLE
t1
(
a
int3
unsigned
NOT
NULL
,
b
int1
unsigned
NOT
NULL
,
UNIQUE
(
a
,
b
)
)
TYPE
=
BDB
;
INSERT
INTO
t1
VALUES
(
1
,
1
);
SELECT
MIN
(
B
),
MAX
(
b
)
FROM
t1
WHERE
t1
.
a
=
1
;
drop
table
t1
;
mysql-test/t/innobase.test
View file @
ad8f2810
...
...
@@ -394,3 +394,17 @@ select * from t1 where i=1 and j=2;
create
index
ax1
on
t1
(
i
,
j
);
select
*
from
t1
where
i
=
1
and
j
=
2
;
drop
table
t1
;
#
# Test min-max optimization
#
CREATE
TABLE
t1
(
a
int3
unsigned
NOT
NULL
,
b
int1
unsigned
NOT
NULL
,
UNIQUE
(
a
,
b
)
)
TYPE
=
innobase
;
INSERT
INTO
t1
VALUES
(
1
,
1
);
SELECT
MIN
(
B
),
MAX
(
b
)
FROM
t1
WHERE
t1
.
a
=
1
;
drop
table
t1
;
sql-bench/TODO
0 → 100644
View file @
ad8f2810
When comparing with ms-sql:
Check how to get MySQL faster mysql ms-sql
count_distinct (2000) | 89.00| 39.00|
count_distinct_big (120) | 324.00| 121.00|
count_distinct_group (1000) | 158.00| 107.00|
count_distinct_group_on_key (1000) | 49.00| 17.00|
count_distinct_group_on_key_parts (1| 157.00| 108.00|
order_by_big (10) | 197.00| 89.00|
order_by_big_key (10) | 170.00| 82.00|
order_by_big_key2 (10) | 163.00| 73.00|
order_by_big_key_desc (10) | 172.00| 84.00|
order_by_big_key_diff (10) | 193.00| 89.00|
order_by_big_key_prefix (10) | 165.00| 72.00|
Why is the following slow on NT:
NT Linux
update_of_primary_key_many_keys (256| 560.00| 65.00|
sql-bench/bench-init.pl.sh
View file @
ad8f2810
...
...
@@ -31,7 +31,7 @@
# $server Object for current server
# $limits Hash reference to limits for benchmark
$benchmark_version
=
"2.1
1a
"
;
$benchmark_version
=
"2.1
2
"
;
use Getopt::Long
;
require
"
$pwd
/server-cfg"
||
die
"Can't read Configuration file:
$!
\n
"
;
...
...
sql-bench/run-all-tests.sh
View file @
ad8f2810
...
...
@@ -36,11 +36,6 @@
use DBI
;
$opt_silent
=
1
;
# Don't write header
$prog_args
=
""
;
foreach
$arg
(
@ARGV
)
{
$prog_args
.
=
"'"
.
$arg
.
"' "
;
}
chomp
(
$pwd
=
`
pwd
`
)
;
$pwd
=
"."
if
(
$pwd
eq
''
)
;
require
"
$pwd
/bench-init.pl"
||
die
"Can't read Configuration file:
$!
\n
"
;
...
...
@@ -50,6 +45,20 @@ $machine=machine();
$redirect
=
!(
$machine
=
~ /windows/i
||
$machine
=
~
"^NT
\s
"
)
?
"2>&1"
:
""
;
$dir
=
(
$pwd
=
~ /
\\
/
)
?
'\\'
:
'/'
;
# directory symbol for shell
$prog_args
=
""
;
foreach
$arg
(
@ARGV
)
{
if
(
$redirect
)
{
$prog_args
.
=
"'"
.
$arg
.
"' "
;
}
else
{
# Windows/NT can't handle ' around arguments
$prog_args
.
=
$arg
.
" "
;
}
}
$prog_count
=
$errors
=
0
;
if
(
$opt_cmp
)
{
...
...
sql-bench/server-cfg.sh
View file @
ad8f2810
...
...
@@ -194,6 +194,11 @@ sub new
{
$limits
{
'working_blobs'
}
=
0
;
# HEAP tables can't handle BLOB's
}
if
(
defined
(
$main
::opt_create_options
)
&&
$main
::opt_create_options
=
~ /type
=
innobase/i
)
{
$limits
{
'max_text_size'
}
=
8000
;
# Limit in Innobase
}
return
$self
;
}
...
...
sql-bench/test-select.sh
View file @
ad8f2810
...
...
@@ -130,6 +130,37 @@ if ($opt_lock_tables)
select_test:
if
(
$limits
->
{
'group_functions'
})
{
my
(
$tmp
)
;
$tmp
=
1000
;
print
"Test if the database has a query cache
\n
"
;
# First ensure that the table is read into memory
fetch_all_rows
(
$dbh
,
"select sum(idn+
$tmp
),sum(rev_idn+
$tmp
) from bench1"
)
;
$loop_time
=
new Benchmark
;
for
(
$tests
=
0
;
$tests
<
$opt_loop_count
;
$tests
++
)
{
fetch_all_rows
(
$dbh
,
"select sum(idn+
$tests
),sum(rev_idn+
$tests
) from bench1"
)
;
}
$end_time
=
new Benchmark
;
print
"Time for select_query_cache (
$opt_loop_count
): "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n\n
"
;
# If the database has a query cache, the following loop should be much
# slower than the previous loop
$loop_time
=
new Benchmark
;
for
(
$tests
=
0
;
$tests
<
$opt_loop_count
;
$tests
++
)
{
fetch_all_rows
(
$dbh
,
"select sum(idn+
$tests
),sum(rev_idn+
$tests
) from bench1"
)
;
}
$end_time
=
new Benchmark
;
print
"Time for select_query_cache2 (
$opt_loop_count
): "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n\n
"
;
}
print
"Testing big selects on the table
\n
"
;
$loop_time
=
new Benchmark
;
$rows
=
0
;
...
...
@@ -288,8 +319,21 @@ if ($limits->{'group_distinct_functions'})
$rows
=
$estimated
=
$count
=
0
;
for
(
$i
=
0
;
$i
<
$opt_medium_loop_count
;
$i
++
)
{
$count
+
=
2
;
$count
+
+
;
$rows
+
=
fetch_all_rows
(
$dbh
,
"select count(distinct region) from bench1"
)
;
$end_time
=
new Benchmark
;
last
if
(
$estimated
=
predict_query_time
(
$loop_time
,
$end_time
,
\$
count,
$i
+1,
$opt_medium_loop_count
))
;
}
print_time
(
$estimated
)
;
print
" for count_distinct_key_prefix (
$count
:
$rows
): "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n
"
;
$loop_time
=
new Benchmark
;
$rows
=
$estimated
=
$count
=
0
;
for
(
$i
=
0
;
$i
<
$opt_medium_loop_count
;
$i
++
)
{
$count
++
;
$rows
+
=
fetch_all_rows
(
$dbh
,
"select count(distinct grp) from bench1"
)
;
$end_time
=
new Benchmark
;
last
if
(
$estimated
=
predict_query_time
(
$loop_time
,
$end_time
,
\$
count,
$i
+1,
...
...
@@ -299,6 +343,20 @@ if ($limits->{'group_distinct_functions'})
print
" for count_distinct (
$count
:
$rows
): "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n
"
;
$loop_time
=
new Benchmark
;
$rows
=
$estimated
=
$count
=
0
;
for
(
$i
=
0
;
$i
<
$opt_medium_loop_count
;
$i
++
)
{
$count
++
;
$rows
+
=
fetch_all_rows
(
$dbh
,
"select count(distinct grp),count(distinct rev_idn) from bench1"
)
;
$end_time
=
new Benchmark
;
last
if
(
$estimated
=
predict_query_time
(
$loop_time
,
$end_time
,
\$
count,
$i
+1,
$opt_medium_loop_count
))
;
}
print_time
(
$estimated
)
;
print
" for count_distinct_2 (
$count
:
$rows
): "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n
"
;
$loop_time
=
new Benchmark
;
$rows
=
$estimated
=
$count
=
0
;
for
(
$i
=
0
;
$i
<
$opt_medium_loop_count
;
$i
++
)
...
...
sql/ha_berkeley.cc
View file @
ad8f2810
...
...
@@ -1429,7 +1429,12 @@ int ha_berkeley::index_read(byte * buf, const byte * key,
pack_key
(
&
last_key
,
active_index
,
key_buff
,
key
,
key_len
);
/* Store for compare */
memcpy
(
key_buff2
,
key_buff
,
(
key_len
=
last_key
.
size
));
key_info
->
handler
.
bdb_return_if_eq
=
-
1
;
/*
If HA_READ_AFTER_KEY is set, return next key, else return first
matching key.
*/
key_info
->
handler
.
bdb_return_if_eq
=
(
find_flag
==
HA_READ_AFTER_KEY
?
1
:
-
1
);
error
=
read_row
(
cursor
->
c_get
(
cursor
,
&
last_key
,
&
row
,
DB_SET_RANGE
),
(
char
*
)
buf
,
active_index
,
&
row
,
(
DBT
*
)
0
,
0
);
key_info
->
handler
.
bdb_return_if_eq
=
0
;
...
...
sql/ha_innobase.h
View file @
ad8f2810
...
...
@@ -72,16 +72,18 @@ class ha_innobase: public handler
/* Init values for the class: */
public:
ha_innobase
(
TABLE
*
table
)
:
handler
(
table
),
int_option_flag
(
HA_READ_NEXT
|
HA_READ_PREV
|
HA_READ_ORDER
|
HA_REC_NOT_IN_SEQ
|
HA_KEYPOS_TO_RNDPOS
|
HA_LASTKEY_ORDER
|
HA_HAVE_KEY_READ_ONLY
|
HA_READ_NOT_EXACT_KEY
|
HA_LONGLONG_KEYS
|
HA_NULL_KEY
|
HA_NOT_EXACT_COUNT
|
HA_NO_WRITE_DELAYED
|
HA_PRIMARY_KEY_IN_READ_INDEX
|
HA_DROP_BEFORE_CREATE
),
last_dup_key
((
uint
)
-
1
),
start_of_scan
(
0
)
int_option_flag
(
HA_READ_NEXT
|
HA_READ_PREV
|
HA_READ_ORDER
|
HA_REC_NOT_IN_SEQ
|
HA_KEYPOS_TO_RNDPOS
|
HA_LASTKEY_ORDER
|
HA_HAVE_KEY_READ_ONLY
|
HA_READ_NOT_EXACT_KEY
|
HA_LONGLONG_KEYS
|
HA_NULL_KEY
|
HA_NOT_EXACT_COUNT
|
HA_NO_WRITE_DELAYED
|
HA_PRIMARY_KEY_IN_READ_INDEX
|
HA_DROP_BEFORE_CREATE
|
HA_NOT_READ_AFTER_KEY
),
last_dup_key
((
uint
)
-
1
),
start_of_scan
(
0
)
{
}
~
ha_innobase
()
{}
...
...
sql/ha_isam.h
View file @
ad8f2810
...
...
@@ -33,7 +33,8 @@ class ha_isam: public handler
int_option_flag
(
HA_READ_NEXT
+
HA_READ_PREV
+
HA_READ_RND_SAME
+
HA_KEYPOS_TO_RNDPOS
+
HA_READ_ORDER
+
HA_LASTKEY_ORDER
+
HA_HAVE_KEY_READ_ONLY
+
HA_READ_NOT_EXACT_KEY
+
HA_LONGLONG_KEYS
+
HA_KEY_READ_WRONG_STR
+
HA_DUPP_POS
)
HA_LONGLONG_KEYS
+
HA_KEY_READ_WRONG_STR
+
HA_DUPP_POS
+
HA_NOT_DELETE_WITH_CACHE
)
{}
~
ha_isam
()
{}
const
char
*
table_type
()
const
{
return
"ISAM"
;
}
...
...
sql/ha_myisam.cc
View file @
ad8f2810
...
...
@@ -484,7 +484,8 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
}
break
;
}
if
(
!
error
&&
start_records
!=
file
->
state
->
records
)
if
(
!
error
&&
start_records
!=
file
->
state
->
records
&&
!
(
check_opt
->
flags
&
T_VERY_SILENT
))
{
char
llbuff
[
22
],
llbuff2
[
22
];
sql_print_error
(
"Warning: Found %s of %s rows when repairing '%s'"
,
...
...
sql/handler.h
View file @
ad8f2810
...
...
@@ -70,6 +70,8 @@
#define HA_NO_WRITE_DELAYED (HA_NOT_EXACT_COUNT*2)
#define HA_PRIMARY_KEY_IN_READ_INDEX (HA_NO_WRITE_DELAYED*2)
#define HA_DROP_BEFORE_CREATE (HA_PRIMARY_KEY_IN_READ_INDEX*2)
#define HA_NOT_READ_AFTER_KEY (HA_DROP_BEFORE_CREATE*2)
#define HA_NOT_DELETE_WITH_CACHE (HA_NOT_READ_AFTER_KEY*2)
/* Parameters for open() (in register form->filestat) */
/* HA_GET_INFO does a implicit HA_ABORT_IF_LOCKED */
...
...
sql/mysql_priv.h
View file @
ad8f2810
...
...
@@ -595,7 +595,7 @@ void change_byte(byte *,uint,char,char);
void
unireg_abort
(
int
exit_code
);
void
init_read_record
(
READ_RECORD
*
info
,
THD
*
thd
,
TABLE
*
reg_form
,
SQL_SELECT
*
select
,
bool
use_record_cache
,
bool
print_errors
);
int
use_record_cache
,
bool
print_errors
);
void
end_read_record
(
READ_RECORD
*
info
);
ha_rows
filesort
(
TABLE
**
form
,
struct
st_sort_field
*
sortorder
,
uint
s_length
,
SQL_SELECT
*
select
,
ha_rows
special
,
ha_rows
max_rows
);
...
...
sql/mysqld.cc
View file @
ad8f2810
...
...
@@ -2716,6 +2716,14 @@ struct show_var_st init_vars[]= {
{
"have_raid"
,
(
char
*
)
&
have_raid
,
SHOW_HAVE
},
{
"have_ssl"
,
(
char
*
)
&
have_ssl
,
SHOW_HAVE
},
{
"init_file"
,
(
char
*
)
&
opt_init_file
,
SHOW_CHAR_PTR
},
#ifdef HAVE_INNOBASE_DB
{
"innobase_data_file_path"
,
innobase_data_file_path
,
SHOW_CHAR
},
{
"innobase_data_home_dir"
,
innobase_data_home_dir
,
SHOW_CHAR
},
{
"innobase_flush_log_at_trx_commit"
,
(
char
*
)
&
innobase_flush_log_at_trx_commit
,
SHOW_MY_BOOL
},
{
"innobase_log_arch_dir"
,
innobase_log_arch_dir
,
SHOW_CHAR
},
{
"innobase_log_archive"
,
(
char
*
)
&
innobase_log_archive
,
SHOW_MY_BOOL
},
{
"innobase_log_group_home_dir"
,
innobase_log_group_home_dir
,
SHOW_CHAR
},
#endif
{
"interactive_timeout"
,
(
char
*
)
&
net_interactive_timeout
,
SHOW_LONG
},
{
"join_buffer_size"
,
(
char
*
)
&
join_buff_size
,
SHOW_LONG
},
{
"key_buffer_size"
,
(
char
*
)
&
keybuff_size
,
SHOW_LONG
},
...
...
@@ -2961,12 +2969,19 @@ static void usage(void)
--bdb-tmpdir=directory Berkeley DB tempfile name
\n
\
--skip-bdb Don't use berkeley db (will save memory)
\n
\
"
);
#endif
#endif
/* HAVE_BERKELEY_DB */
#ifdef HAVE_INNOBASE_DB
puts
(
"\
--skip-innobase Don't use innobase (will save memory)
\n
\
--innobase_data_home_dir=dir The common part for innobase table spaces
\n
--innobase_data_file_path=dir Path to individual files and their sizes
\n
--innobase_flush_log_at_trx_commit[=#]
Set to 0 if you don't want to flush logs
\n
\
--innobase_log_arch_dir=dir Where full logs should be archived
\n
\
--innobase_log_archive[=#] Set to 1 if you want to have logs archived
\n
\
--innobase_log_group_home_dir=dir Path to Innobase log files.
--skip-innobase Don't use innobase (will save memory)
\n
\
"
);
#endif
#endif
/* HAVE_INNOBASE_DB */
print_defaults
(
"my"
,
load_default_groups
);
puts
(
""
);
...
...
sql/opt_sum.cc
View file @
ad8f2810
...
...
@@ -141,6 +141,11 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
break
;
}
TABLE
*
table
=
((
Item_field
*
)
expr
)
->
field
->
table
;
if
((
table
->
file
->
option_flag
()
&
HA_NOT_READ_AFTER_KEY
))
{
const_result
=
0
;
break
;
}
bool
error
=
table
->
file
->
index_init
((
uint
)
ref
.
key
);
if
(
!
ref
.
key_length
)
...
...
sql/records.cc
View file @
ad8f2810
...
...
@@ -31,7 +31,7 @@ static int rr_cmp(uchar *a,uchar *b);
void
init_read_record
(
READ_RECORD
*
info
,
THD
*
thd
,
TABLE
*
table
,
SQL_SELECT
*
select
,
bool
use_record_cache
,
bool
print_error
)
int
use_record_cache
,
bool
print_error
)
{
IO_CACHE
*
tempfile
;
DBUG_ENTER
(
"init_read_record"
);
...
...
@@ -97,9 +97,11 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
info
->
read_record
=
rr_sequential
;
table
->
file
->
rnd_init
();
/* We can use record cache if we don't update dynamic length tables */
if
(
use_record_cache
||
if
(
use_record_cache
>
0
||
(
int
)
table
->
reginfo
.
lock_type
<=
(
int
)
TL_READ_HIGH_PRIORITY
||
!
(
table
->
db_options_in_use
&
HA_OPTION_PACK_RECORD
))
!
(
table
->
db_options_in_use
&
HA_OPTION_PACK_RECORD
)
||
(
use_record_cache
<
0
&&
!
(
table
->
file
->
option_flag
()
&
HA_NOT_DELETE_WITH_CACHE
)))
VOID
(
table
->
file
->
extra
(
HA_EXTRA_CACHE
));
// Cache reads
}
DBUG_VOID_RETURN
;
...
...
sql/sql_delete.cc
View file @
ad8f2810
...
...
@@ -192,7 +192,7 @@ int mysql_delete(THD *thd,TABLE_LIST *table_list,COND *conds,ha_rows limit,
(
void
)
table
->
file
->
extra
(
HA_EXTRA_NO_READCHECK
);
if
(
options
&
OPTION_QUICK
)
(
void
)
table
->
file
->
extra
(
HA_EXTRA_QUICK
);
init_read_record
(
&
info
,
thd
,
table
,
select
,
0
,
1
);
init_read_record
(
&
info
,
thd
,
table
,
select
,
-
1
,
1
);
ulong
deleted
=
0L
;
thd
->
proc_info
=
"updating"
;
while
(
!
(
error
=
info
.
read_record
(
&
info
))
&&
!
thd
->
killed
)
...
...
sql/sql_lex.cc
View file @
ad8f2810
...
...
@@ -250,7 +250,8 @@ static char *get_text(LEX *lex)
str
=
lex
->
tok_start
+
1
;
end
=
lex
->
ptr
-
1
;
start
=
(
uchar
*
)
sql_alloc
((
uint
)
(
end
-
str
)
+
1
);
if
(
!
(
start
=
(
uchar
*
)
sql_alloc
((
uint
)
(
end
-
str
)
+
1
)))
return
(
char
*
)
""
;
// Sql_alloc has set error flag
if
(
!
found_escape
)
{
lex
->
yytoklen
=
(
uint
)
(
end
-
str
);
...
...
sql/sql_table.cc
View file @
ad8f2810
...
...
@@ -1027,6 +1027,7 @@ int mysql_backup_table(THD* thd, TABLE_LIST* table_list)
"backup"
,
TL_READ
,
0
,
0
,
0
,
&
handler
::
backup
));
}
int
mysql_restore_table
(
THD
*
thd
,
TABLE_LIST
*
table_list
)
{
DBUG_ENTER
(
"mysql_restore_table"
);
...
...
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