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
5c94a164
Commit
5c94a164
authored
Dec 06, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
merge with 3.23.47
parents
4c17825a
0f71e337
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
257 additions
and
31 deletions
+257
-31
Docs/manual.texi
Docs/manual.texi
+14
-1
build-tags
build-tags
+11
-0
innobase/include/buf0buf.ic
innobase/include/buf0buf.ic
+8
-2
innobase/include/mtr0log.ic
innobase/include/mtr0log.ic
+7
-0
innobase/log/log0recv.c
innobase/log/log0recv.c
+3
-1
mysql-test/r/gcc296.result
mysql-test/r/gcc296.result
+5
-0
mysql-test/t/gcc296.test
mysql-test/t/gcc296.test
+17
-0
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+16
-0
mysql-test/t/join_outer.test
mysql-test/t/join_outer.test
+12
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+16
-0
scripts/mysql_config.sh
scripts/mysql_config.sh
+51
-0
scripts/mysqlhotcopy.sh
scripts/mysqlhotcopy.sh
+75
-21
sql/ha_berkeley.h
sql/ha_berkeley.h
+1
-0
sql/sql_select.cc
sql/sql_select.cc
+21
-6
No files found.
Docs/manual.texi
View file @
5c94a164
...
...
@@ -46442,6 +46442,7 @@ users use 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.47:: Changes in release 3.23.47
* News-3.23.46:: Changes in release 3.23.46
* News-3.23.45:: Changes in release 3.23.45
* News-3.23.44:: Changes in release 3.23.44
...
...
@@ -46492,10 +46493,22 @@ not yet 100% confident in this code.
* News-3.23.0:: Changes in release 3.23.0
@end menu
@node News-3.23.46, News-3.23.45, News-3.23.x, News-3.23.x
@node News-3.23.47, News-3.23.46, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.47
@itemize @bullet
@item
Fixed bug when using @code{t1 LEFT JOIN t2 ON t2.key=constant}.
@item
@code{mysqlconfig} now also work with binary (relocated) distributions.
@end itemize
@node News-3.23.46, News-3.23.45, News-3.23.47, News-3.23.x
@appendixsubsec Changes in release 3.23.46
@itemize @bullet
@item
InnoDB and BDB tables will now use index when doing an @code{ORDER BY}
on the whole table.
@item
Fixed bug where one got an empty set instead of a DEADLOCK error when using
BDB tables.
@item
build-tags
0 → 100755
View file @
5c94a164
#! /bin/sh
if
[
!
-f
configure.in
]
;
then
echo
"
$0
must be run from MySQL source root"
exit
1
fi
rm
-f
TAGS
find
-not
-path
\*
SCCS
\*
-and
\
\(
-name
\*
.cc
-or
-name
\*
.h
-or
-name
\*
.yy
-or
-name
\*
.c
\)
\
-print
-exec
etags
-o
TAGS
--append
{}
\;
innobase/include/buf0buf.ic
View file @
5c94a164
...
...
@@ -211,6 +211,9 @@ buf_block_align(
block = buf_pool_get_nth_block(buf_pool, (ptr - frame_zero)
>> UNIV_PAGE_SIZE_SHIFT);
ut_a(block >= buf_pool->blocks);
ut_a(block < buf_pool->blocks + buf_pool->max_size);
return(block);
}
...
...
@@ -235,6 +238,9 @@ buf_block_align_low(
block = buf_pool_get_nth_block(buf_pool, (ptr - frame_zero)
>> UNIV_PAGE_SIZE_SHIFT);
ut_a(block >= buf_pool->blocks);
ut_a(block < buf_pool->blocks + buf_pool->max_size);
return(block);
}
...
...
@@ -253,9 +259,9 @@ buf_frame_align(
frame = ut_align_down(ptr, UNIV_PAGE_SIZE);
ut_a
d
((ulint)frame
ut_a((ulint)frame
>= (ulint)(buf_pool_get_nth_block(buf_pool, 0)->frame));
ut_a
d
((ulint)frame <= (ulint)(buf_pool_get_nth_block(buf_pool,
ut_a((ulint)frame <= (ulint)(buf_pool_get_nth_block(buf_pool,
buf_pool->max_size - 1)->frame));
return(frame);
}
...
...
innobase/include/mtr0log.ic
View file @
5c94a164
...
...
@@ -163,6 +163,13 @@ mlog_write_initial_log_record_fast(
space = buf_block_get_space(block);
offset = buf_block_get_page_no(block);
if (space != 0 || offset > 0x8FFFFFFF) {
fprintf(stderr,
"InnoDB: error: buffer page pointer %lx has nonsensical space id %lu\n"
"InnoDB: or page no %lu\n", (ulint)ptr, space, offset);
ut_a(0);
}
mach_write_to_1(log_ptr, type);
log_ptr++;
log_ptr += mach_write_compressed(log_ptr, space);
...
...
innobase/log/log0recv.c
View file @
5c94a164
...
...
@@ -1316,7 +1316,9 @@ recv_parse_log_rec(
new_ptr
=
mlog_parse_initial_log_record
(
ptr
,
end_ptr
,
type
,
space
,
page_no
);
if
(
!
new_ptr
)
{
/* Check that space id and page_no are sensible */
if
(
!
new_ptr
||
*
space
!=
0
||
*
page_no
>
0x8FFFFFFF
)
{
return
(
0
);
}
...
...
mysql-test/r/gcc296.result
0 → 100644
View file @
5c94a164
kodoboru obor aobor
0101000000 aaa AAA
0102000000 bbb BBB
0103000000 ccc CCC
0104000000 xxx XXX
mysql-test/t/gcc296.test
0 → 100644
View file @
5c94a164
#try to crash gcc 2.96
drop
table
if
exists
obory
;
CREATE
TABLE
obory
(
kodoboru
varchar
(
10
)
default
NULL
,
obor
tinytext
,
aobor
tinytext
,
UNIQUE
INDEX
kodoboru
(
kodoboru
),
FULLTEXT
KEY
obor
(
obor
),
FULLTEXT
KEY
aobor
(
aobor
)
);
INSERT
INTO
obory
VALUES
(
'0101000000'
,
'aaa'
,
'AAA'
);
INSERT
INTO
obory
VALUES
(
'0102000000'
,
'bbb'
,
'BBB'
);
INSERT
INTO
obory
VALUES
(
'0103000000'
,
'ccc'
,
'CCC'
);
INSERT
INTO
obory
VALUES
(
'0104000000'
,
'xxx'
,
'XXX'
);
select
*
from
obory
;
drop
table
obory
;
mysql-test/t/innodb.test
View file @
5c94a164
...
...
@@ -547,3 +547,19 @@ delete from t1;
select
*
from
t1
;
commit
;
drop
table
t1
;
#
# Test of how ORDER BY works when doing it on the whole table
#
create
table
t1
(
a
int
not
null
,
b
int
not
null
,
c
int
not
null
,
primary
key
(
a
),
key
(
b
))
type
=
innodb
;
insert
into
t1
values
(
3
,
3
,
3
),(
1
,
1
,
1
),(
2
,
2
,
2
),(
4
,
4
,
4
);
explain
select
*
from
t1
order
by
a
;
explain
select
*
from
t1
order
by
b
;
explain
select
*
from
t1
order
by
c
;
explain
select
a
from
t1
order
by
a
;
explain
select
b
from
t1
order
by
b
;
explain
select
a
,
b
from
t1
order
by
b
;
explain
select
a
,
b
from
t1
;
explain
select
a
,
b
,
c
from
t1
;
drop
table
t1
;
mysql-test/t/join_outer.test
View file @
5c94a164
...
...
@@ -404,3 +404,15 @@ insert into t2 values (1,1),(1,2);
insert
into
t1
values
(
1
,
1
),(
2
,
1
);
SELECT
*
FROM
t1
LEFT
JOIN
t2
ON
(
t1
.
bug_id
=
t2
.
bug_id
AND
t2
.
who
=
2
)
WHERE
(
t1
.
reporter
=
2
OR
t2
.
who
=
2
);
drop
table
t1
,
t2
;
#
# Test problem with LEFT JOIN
create
table
t1
(
fooID
smallint
unsigned
auto_increment
,
primary
key
(
fooID
));
create
table
t2
(
fooID
smallint
unsigned
not
null
,
barID
smallint
unsigned
not
null
,
primary
key
(
fooID
,
barID
));
insert
into
t1
(
fooID
)
values
(
10
),(
20
),(
30
);
insert
into
t2
values
(
10
,
1
),(
20
,
2
),(
30
,
3
);
explain
select
*
from
t2
left
join
t1
on
t1
.
fooID
=
t2
.
fooID
and
t1
.
fooID
=
30
;
select
*
from
t2
left
join
t1
on
t1
.
fooID
=
t2
.
fooID
and
t1
.
fooID
=
30
;
select
*
from
t2
left
join
t1
ignore
index
(
primary
)
on
t1
.
fooID
=
t2
.
fooID
and
t1
.
fooID
=
30
;
drop
table
t1
,
t2
;
mysql-test/t/myisam.test
View file @
5c94a164
...
...
@@ -50,3 +50,19 @@ show index from t1;
optimize
table
t1
;
show
index
from
t1
;
drop
table
t1
;
#
# Test of how ORDER BY works when doing it on the whole table
#
create
table
t1
(
a
int
not
null
,
b
int
not
null
,
c
int
not
null
,
primary
key
(
a
),
key
(
b
))
type
=
myisam
;
insert
into
t1
values
(
3
,
3
,
3
),(
1
,
1
,
1
),(
2
,
2
,
2
),(
4
,
4
,
4
);
explain
select
*
from
t1
order
by
a
;
explain
select
*
from
t1
order
by
b
;
explain
select
*
from
t1
order
by
c
;
explain
select
a
from
t1
order
by
a
;
explain
select
b
from
t1
order
by
b
;
explain
select
a
,
b
from
t1
order
by
b
;
explain
select
a
,
b
from
t1
;
explain
select
a
,
b
,
c
from
t1
;
drop
table
t1
;
scripts/mysql_config.sh
View file @
5c94a164
...
...
@@ -18,11 +18,62 @@
# This script reports various configuration settings that may be needed
# when using the MySQL client library.
which
()
{
IFS
=
"
${
IFS
=
}
"
;
save_ifs
=
"
$IFS
"
;
IFS
=
':'
for
file
do
for
dir
in
$PATH
do
if
test
-f
$dir
/
$file
then
echo
"
$dir
/
$file
"
continue
2
fi
done
echo
"which: no
$file
in (
$PATH
)"
exit
1
done
IFS
=
"
$save_ifs
"
}
#
# If we can find the given directory relatively to where mysql_config is
# we should use this instead of the incompiled one.
# This is to ensure that this script also works with the binary MySQL
# version
fix_path
()
{
var
=
$1
shift
for
filename
do
path
=
$basedir
/
$filename
if
[
-d
"
$path
"
]
;
then
eval
"
$var
"
=
$path
return
fi
done
}
abs_path
=
`
expr
\(
substr
$0
1 1
\)
=
'/'
`
if
[
"x
$abs_path
"
=
"x1"
]
;
then
me
=
$0
else
me
=
`
which
$0
`
fi
basedir
=
`
echo
$me
|
sed
-e
's;/bin/mysql_config;;'
`
ldata
=
'@localstatedir@'
execdir
=
'@libexecdir@'
bindir
=
'@bindir@'
pkglibdir
=
'@pkglibdir@'
fix_path pkglibdir lib/mysql lib
pkgincludedir
=
'@pkgincludedir@'
fix_path pkgincludedir include/mysql include
version
=
'@VERSION@'
socket
=
'@MYSQL_UNIX_ADDR@'
port
=
'@MYSQL_TCP_PORT@'
...
...
scripts/mysqlhotcopy.sh
View file @
5c94a164
...
...
@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
# Documentation continued at end of file
my
$VERSION
=
"1.1
3
"
;
my
$VERSION
=
"1.1
4
"
;
my
$opt_tmpdir
=
$ENV
{
TMPDIR
}
||
"/tmp"
;
...
...
@@ -120,6 +120,7 @@ GetOptions( \%opt,
# 'target' - destination directory of the copy
# 'tables' - array-ref to list of tables in the db
# 'files' - array-ref to list of files to be copied
# (RAID files look like 'nn/name.MYD')
# 'index' - array-ref to list of indexes to be copied
#
...
...
@@ -265,11 +266,23 @@ foreach my $rdb ( @db_desc ) {
or die
"Cannot open dir '
$db_dir
':
$!
"
;
my %db_files
;
map
{
(
/
(
.+
)
\.\w
+
$/
?
(
$db_files
{
$_
}
=
$1
)
:
()
)
}
readdir
(
DBDIR
)
;
my @raid_dir
=
()
;
while
(
defined
(
my
$name
=
readdir DBDIR
)
)
{
if
(
$name
=
~ /^
\d\d
$/
&&
-d
"
$db_dir
/
$name
"
)
{
push @raid_dir,
$name
;
}
else
{
$db_files
{
$name
}
=
$1
if
(
$name
=
~ /
(
.+
)
\.\w
+
$/
)
;
}
}
closedir
(
DBDIR
)
;
scan_raid_dir
(
\%
db_files,
$db_dir
, @raid_dir
)
;
unless
(
keys %db_files
)
{
warn
"'
$db
' is an empty database
\n
"
;
}
closedir
(
DBDIR
)
;
## filter (out) files specified in t_regex
my @db_files
;
...
...
@@ -297,6 +310,8 @@ foreach my $rdb ( @db_desc ) {
my @hc_tables
=
map
{
"
$db
.
$_
"
}
@dbh_tables
;
$rdb
->
{
tables
}
=
[
@hc_tables
]
;
$rdb
->
{
raid_dirs
}
=
[
get_raid_dirs
(
$rdb
->
{
files
}
)
]
;
$hc_locks
.
=
", "
if
(
length
$hc_locks
&&
@hc_tables
)
;
$hc_locks
.
=
join
", "
, map
{
"
$_
READ"
}
@hc_tables
;
$hc_tables
.
=
", "
if
(
length
$hc_tables
&&
@hc_tables
)
;
...
...
@@ -370,17 +385,20 @@ if ($opt{method} =~ /^cp\b/)
retire_directory
(
@existing
)
if
(
@existing
)
;
foreach my
$rdb
(
@db_desc
)
{
my
$tgt_dirpath
=
$rdb
->
{
target
}
;
if
(
$opt
{
dryrun
}
)
{
print
"mkdir
$tgt_dirpath
, 0750
\n
"
;
}
elsif
(
$opt
{
method
}
=
~ /^scp
\b
/
)
{
## assume it's there?
## ...
}
else
{
mkdir
(
$tgt_dirpath
, 0750
)
or die
"Can't create '
$tgt_dirpath
':
$!
\n
"
;
foreach my
$td
(
''
, @
{
$rdb
->
{
raid_dirs
}}
)
{
my
$tgt_dirpath
=
"
$rdb
->{target}/
$td
"
;
if
(
$opt
{
dryrun
}
)
{
print
"mkdir
$tgt_dirpath
, 0750
\n
"
;
}
elsif
(
$opt
{
method
}
=
~ /^scp
\b
/
)
{
## assume it's there?
## ...
}
else
{
mkdir
(
$tgt_dirpath
, 0750
)
or die
"Can't create '
$tgt_dirpath
':
$!
\n
"
;
}
}
}
...
...
@@ -438,7 +456,7 @@ foreach my $rdb ( @db_desc )
my @files
=
map
{
"
$datadir
/
$rdb
->{src}/
$_
"
}
@
{
$rdb
->
{
files
}}
;
next unless @files
;
eval
{
copy_files
(
$opt
{
method
}
,
\@
files,
$rdb
->
{
target
}
)
;
}
;
eval
{
copy_files
(
$opt
{
method
}
,
\@
files,
$rdb
->
{
target
}
,
$rdb
->
{
raid_dirs
}
)
;
}
;
push @failed,
"
$rdb
->{src} ->
$rdb
->{target} failed:
$@
"
if
(
$@
)
;
...
...
@@ -531,27 +549,33 @@ exit 0;
# ---
sub copy_files
{
my
(
$method
,
$files
,
$target
)
=
@_
;
my
(
$method
,
$files
,
$target
,
$raid_dirs
)
=
@_
;
my @cmd
;
print
"Copying "
.@
$files
.
" files...
\n
"
unless
$opt
{
quiet
}
;
if
(
$method
=
~ /^s?cp
\b
/
)
{
# cp or scp with optional flags
@cmd
=
(
$method
)
;
my @cp
=
(
$method
)
;
# add option to preserve mod time etc of copied files
# not critical, but nice to have
push @c
md
,
"-p"
if
$^
O
=
~ m/^
(
solaris|linux|freebsd
)
$/
;
push @c
p
,
"-p"
if
$^
O
=
~ m/^
(
solaris|linux|freebsd
)
$/
;
# add recursive option for scp
push @cmd,
"-r"
if
$^
O
=
~ /m^
(
solaris|linux|freebsd
)
$/
&&
$method
=
~ /^scp
\b
/
;
push @cp,
"-r"
if
$^
O
=
~ /m^
(
solaris|linux|freebsd
)
$/
&&
$method
=
~ /^scp
\b
/
;
my @non_raid
=
grep
{
$_
!
~ m:
\d\d
/:
}
@
$files
;
# add files to copy and the destination directory
push @cmd, @
$files
,
$target
;
safe_system
(
@cp, @non_raid,
$target
)
;
foreach my
$rd
(
@
$raid_dirs
)
{
my @raid
=
grep
{
m:
$rd
/:
}
@
$files
;
safe_system
(
@cp, @raid,
"
$target
/
$rd
"
)
if
(
@raid
)
;
}
}
else
{
die
"Can't use unsupported method '
$method
'
\n
"
;
}
safe_system
(
@cmd
)
;
}
#
...
...
@@ -682,6 +706,35 @@ sub get_row {
return
$sth
->fetchrow_array
()
;
}
sub scan_raid_dir
{
my
(
$r_db_files
,
$data_dir
, @raid_dir
)
=
@_
;
local
(
*
RAID_DIR
)
;
foreach my
$rd
(
@raid_dir
)
{
opendir
(
RAID_DIR,
"
$data_dir
/
$rd
"
)
or die
"Cannot open dir '
$data_dir
/
$rd
':
$!
"
;
while
(
defined
(
my
$name
=
readdir RAID_DIR
)
)
{
$r_db_files
->
{
"
$rd
/
$name
"
}
=
$1
if
(
$name
=
~ /
(
.+
)
\.\w
+
$/
)
;
}
closedir
(
RAID_DIR
)
;
}
}
sub get_raid_dirs
{
my
(
$r_files
)
=
@_
;
my %dirs
=
()
;
foreach my
$f
(
@
$r_files
)
{
if
(
$f
=
~ m:^
(
\d\d
)
/:
)
{
$dirs
{
$1
}
=
1
;
}
}
return
sort
keys %dirs
;
}
__END__
=
head1 DESCRIPTION
...
...
@@ -905,6 +958,7 @@ Tim Bunce
Martin Waite - added checkpoint, flushlog, regexp and dryrun options
Fixed cleanup of targets when hotcopy fails.
Added
--record_log_pos
.
RAID tables are now copied
(
don
't know if this works over scp).
Ralph Corderoy - added synonyms for commands
...
...
sql/ha_berkeley.h
View file @
5c94a164
...
...
@@ -107,6 +107,7 @@ class ha_berkeley: public handler
uint
extra_rec_buf_length
()
{
return
BDB_HIDDEN_PRIMARY_KEY_LENGTH
;
}
ha_rows
estimate_number_of_rows
();
bool
fast_key_read
()
{
return
1
;}
key_map
keys_to_use_for_scanning
()
{
return
~
(
key_map
)
0
;
}
bool
has_transactions
()
{
return
1
;}
int
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
);
...
...
sql/sql_select.cc
View file @
5c94a164
...
...
@@ -2191,10 +2191,17 @@ get_best_combination(JOIN *join)
j
->
type
=
JT_REF
;
/* Must read with repeat */
else
if
(
ref_key
==
j
->
ref
.
key_copy
)
{
/* Should never be reached */
j
->
type
=
JT_CONST
;
/* purecov: deadcode */
/*
This happen if we are using a constant expression in the ON part
of an LEFT JOIN.
SELECT * FROM a LEFT JOIN b ON b.key=30
Here we should not mark the table as a 'const' as a field may
have a 'normal' value or a NULL value.
*/
j
->
type
=
JT_CONST
;
if
(
join
->
const_tables
==
tablenr
)
{
join
->
const_tables
++
;
/* purecov: deadcode */
join
->
const_tables
++
;
join
->
const_table_map
|=
form
->
map
;
}
}
...
...
@@ -2777,8 +2784,8 @@ static void update_depend_map(JOIN *join, ORDER *order)
/*
**
simple_order is set to 1 if sort_order only uses fields from head table
**
and the head table is not a LEFT JOIN table
simple_order is set to 1 if sort_order only uses fields from head table
and the head table is not a LEFT JOIN table
*/
static
ORDER
*
...
...
@@ -4424,8 +4431,11 @@ join_read_const(JOIN_TAB *tab)
}
store_record
(
table
,
1
);
}
else
if
(
!
table
->
status
)
// Only happens with left join
else
if
(
!
(
table
->
status
&
~
STATUS_NULL_ROW
))
// Only happens with left join
{
table
->
status
=
0
;
restore_record
(
table
,
1
);
// restore old record
}
table
->
null_row
=
0
;
return
table
->
status
?
-
1
:
0
;
}
...
...
@@ -5263,7 +5273,7 @@ static uint find_shortest_key(TABLE *table, key_map usable_keys)
/*****************************************************************************
** If not selecting by given key, create a index how records should be read
** If not selecting by given key, create a
n
index how records should be read
** return: 0 ok
** -1 some fatal error
** 1 no records
...
...
@@ -5367,6 +5377,11 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
join_init_read_last_with_key
);
table
->
file
->
index_init
(
nr
);
tab
->
type
=
JT_NEXT
;
// Read with index_first(), index_next()
if
(
table
->
used_keys
&
((
key_map
)
1
<<
nr
))
{
table
->
key_read
=
1
;
table
->
file
->
extra
(
HA_EXTRA_KEYREAD
);
}
}
DBUG_RETURN
(
1
);
}
...
...
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