Commit 9b8ddd1a authored by unknown's avatar unknown

Removed duplicated index_init() calls that causes problems with BDB

tables.
Merged maxsql.spec with mysql.spec


mysql-test/r/innobase.result:
  Almost up to date test results
mysql-test/t/innobase.test:
  Added testing of error codes
sql-bench/test-insert.sh:
  Added testing of key-only-read
sql/ha_berkeley.cc:
  Added DBUG_PRINT
sql/sql_select.cc:
  Removed duplicated index_init() calls
support-files/maxsql.spec.sh:
  Merge with mysql.spec.  Take into account that BDB and Innobase is
  in the MySQL source tree
support-files/mysql.spec.sh:
  Removed usage of innobase in standard RPM
parent 6068405c
......@@ -108,14 +108,14 @@ id parent_id level
1204 107 2
id parent_id level
1008 102 2
1015 102 2
1010 102 2
1015 102 2
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used; Using index
t1 index level level 1 NULL 39 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used; Using index
t1 index level level 1 NULL 39 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used
t1 ref level level 1 const 12
level id
1 1002
1 1003
......@@ -130,28 +130,29 @@ level id parent_id
1 1005 101
1 1006 101
1 1007 101
Table Op Msg_type Msg_text
test.t1 optimize error The handler for the table doesn't support check/repair
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 id A 2 NULL NULL
t1 1 parent_id 1 parent_id A 4 NULL NULL
t1 1 level 1 level A 4 NULL NULL
gesuchnr benutzer_id
1 1
2 1
Table Op Msg_type Msg_text
test.t1 optimize error The handler for the table doesn't support check/repair
a
2
Table Op Msg_type Msg_text
test.t1 check error The handler for the table doesn't support check/repair
a b
a 1
a 2
a 3
a 4
a 5
b 2
b 3
b 4
c 1
c 2
c 3
d 1
d 2
d 5
e 1
k 1
2 testing
Table Op Msg_type Msg_text
test.t1 analyze error The handler for the table doesn't support check/repair
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 1 skr 1 a A 3 NULL NULL
a b
1
n after rollback
n after commit
4 after commit
......@@ -249,6 +250,11 @@ id ggid email passwd
1 test1 xxx
id ggid email passwd
2 test2 yyy
id ggid email passwd
2 test2 yyy
100 test2 xxx
id ggid email passwd
id ggid email passwd
user_name password subscribed user_id quota weight access_date access_time approved dummy_primary_key
user_0 somepassword N 0 0 0 2000-09-07 23:06:59 2000-09-07 23:06:59 1
user_1 somepassword Y 1 1 1 2000-09-07 23:06:59 2000-09-07 23:06:59 2
......@@ -344,7 +350,7 @@ id parent_id level
1025 102 2
1016 102 2
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used; Using index
t1 ref level level 1 const 6 where used; Using index
level id
1 1004
1 1005
......@@ -402,7 +408,37 @@ id parent_id level
1180 105 2
count(*)
1
count(*)
1
count(*)
2
count(*)
1
count(*)
0
count(*)
1
count(*)
1
sca_pic
NULL
NULL
a
1
2
3
a
2
3
5
a b
world 2
hello 1
Table Op Msg_type Msg_text
test.t1 optimize error The handler for the table doesn't support check/repair
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 a A 1 NULL NULL
i j
1 2
i j
1 2
......@@ -61,6 +61,7 @@ CREATE TABLE t1 (
replace into t1 (gesuchnr,benutzer_id) values (2,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
--error 1022
replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1;
drop table t1;
......@@ -268,7 +269,9 @@ select * from t1 where ggid='test1';
select * from t1 where passwd='xxx';
select * from t1 where id=2;
--error 1022
replace into t1 (ggid,id) values ('this will work',1);
--error 1022
replace into t1 (ggid,passwd) values ('test2','this will work');
-- error 1062
update t1 set id=100,ggid='test2' where id=1;
......
......@@ -487,7 +487,7 @@ check_select_key2("*","id","id2","select_key");
check_select_key2("id,id2","id","id2","select_key_return_key");
check_select_key("*","id3","select_key2");
check_select_key("id3","id3","select_key2_return_key");
check_select_key("id1,id2","id3","select_key2_return_prim");
check_select_key("id,id2","id3","select_key2_return_prim");
####
#### A lot of simple selects on ranges
......@@ -1443,7 +1443,7 @@ end_benchmark($start_time);
sub check_select_key
{
my ($column,$check)= @_;
my ($sel_columns,$column,$check)= @_;
my ($loop_time,$end_time,$i,$tmp_var,$tmp,$count,$row_count,$estimated);
$estimated=0;
......@@ -1454,10 +1454,10 @@ sub check_select_key
$count+=2;
$tmpvar^= ((($tmpvar + 63) + $i)*3 % $opt_loop_count);
$tmp=$tmpvar % ($total_rows);
fetch_all_rows($dbh,"select * from bench1 where $column=$tmp")
fetch_all_rows($dbh,"select $sel_columns from bench1 where $column=$tmp")
or die $DBI::errstr;
$tmp+=$total_rows;
defined($row_count=fetch_all_rows($dbh,"select * from bench1 where $column=$tmp")) or die $DBI::errstr;
defined($row_count=fetch_all_rows($dbh,"select $sel_columns from bench1 where $column=$tmp")) or die $DBI::errstr;
die "Found $row_count rows on impossible id: $tmp\n" if ($row_count);
$end_time=new Benchmark;
last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i,
......@@ -1475,7 +1475,7 @@ sub check_select_key
sub check_select_key2
{
my ($column,$column2,$check)= @_;
my ($sel_columns,$column,$column2,$check)= @_;
my ($loop_time,$end_time,$i,$tmp_var,$tmp,$count,$row_count,$estimated);
$estimated=0;
......@@ -1486,10 +1486,10 @@ sub check_select_key2
$count+=2;
$tmpvar^= ((($tmpvar + 63) + $i)*3 % $opt_loop_count);
$tmp=$tmpvar % ($total_rows);
fetch_all_rows($dbh,"select * from bench1 where $column=$tmp and $column2=$tmp")
fetch_all_rows($dbh,"select $sel_columns from bench1 where $column=$tmp and $column2=$tmp")
or die $DBI::errstr;
$tmp+=$total_rows;
defined($row_count=fetch_all_rows($dbh,"select * from bench1 where $column=$tmp and $column2=$tmp")) or die $DBI::errstr;
defined($row_count=fetch_all_rows($dbh,"select $sel_columns from bench1 where $column=$tmp and $column2=$tmp")) or die $DBI::errstr;
die "Found $row_count rows on impossible id: $tmp\n" if ($row_count);
$end_time=new Benchmark;
last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i,
......
......@@ -1306,6 +1306,7 @@ int ha_berkeley::index_init(uint keynr)
{
int error;
DBUG_ENTER("index_init");
DBUG_PRINT("enter",("table: '%s' key: %d", table->real_name, keynr));
active_index=keynr;
dbug_assert(cursor == 0);
if ((error=key_file[keynr]->cursor(key_file[keynr], transaction, &cursor,
......@@ -1323,6 +1324,7 @@ int ha_berkeley::index_end()
DBUG_ENTER("index_end");
if (cursor)
{
DBUG_PRINT("enter",("table: '%s'", table->real_name));
error=cursor->c_close(cursor);
cursor=0;
}
......
......@@ -2488,6 +2488,7 @@ make_join_readinfo(JOIN *join,uint options)
else if (table->used_keys && ! (tab->select && tab->select->quick))
{ // Only read index tree
tab->index=find_shortest_key(table, table->used_keys);
tab->table->file->index_init(tab->index);
tab->read_first_record= join_init_read_first_with_key;
tab->type=JT_NEXT; // Read with index_first / index_next
}
......@@ -4445,7 +4446,6 @@ join_init_read_first_with_key(JOIN_TAB *tab)
tab->read_record.file=table->file;
tab->read_record.index=tab->index;
tab->read_record.record=table->record[0];
tab->table->file->index_init(tab->index);
error=tab->table->file->index_first(tab->table->record[0]);
if (error)
{
......@@ -4494,7 +4494,6 @@ join_init_read_last_with_key(JOIN_TAB *tab)
tab->read_record.file=table->file;
tab->read_record.index=tab->index;
tab->read_record.record=table->record[0];
tab->table->file->index_init(tab->index);
error=tab->table->file->index_last(tab->table->record[0]);
if (error)
{
......@@ -5177,6 +5176,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit)
tab->index=nr;
tab->read_first_record= (flag > 0 ? join_init_read_first_with_key:
join_init_read_last_with_key);
tab->table->file->index_init(tab->index);
tab->type=JT_NEXT; // Read with index_first(), index_next()
DBUG_RETURN(1);
}
......
......@@ -2,7 +2,6 @@
%define shared_lib_version @SHARED_LIB_VERSION@
%define release 2
%define mysqld_user mysql
%define db_version 3.1.14
%define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
......@@ -15,7 +14,6 @@ Version: @MYSQL_NO_DASH_VERSION@
Release: %{release}
Copyright: GPL / LGPL
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
Source1: ftp://ftp.mysql.com/pub/mysql/Downloads/db/db-%{db_version}.tar.gz
Icon: mysql.gif
URL: http://www.mysql.com/
Packager: David Axmark <david@mysql.com>
......@@ -87,7 +85,7 @@ Este pacote cont
%package bench
Release: %{release}
Requires: MySQL-client MySQL-DBI-perl-bin perl
Summary: MySQL - Benchmarks
Summary: MySQL - Benchmarks and test system
Group: Applications/Databases
Summary(pt_BR): MySQL - Medies de desempenho
Group(pt_BR): Aplicaes/Banco_de_Dados
......@@ -135,7 +133,7 @@ languages and applications need to dynamically load and use MySQL.
%build
# The all-static flag is to make the RPM work on different
# distributions. This version tries to put shared mysqlcliet libraries
# distributions. This version tries to put shared mysqlclient libraries
# in a separate package.
BuildMySQL() {
......@@ -143,10 +141,11 @@ BuildMySQL() {
# support assembler speedups.
sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
CC=\"${MYSQL_BUILD_CC:-egcs}\" \
CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O6 -fomit-frame-pointer}\" \
CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O6 -fno-omit-frame-pointer}\" \
CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \
CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O6 -fomit-frame-pointer \
-felide-constructors -fno-exceptions -fno-rtti}\" \
CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O6 \
-felide-constructors -fno-exceptions -fno-rtti \
-fno-omit-frame-pointer}\" \
./configure \
$* \
--enable-assembler \
......@@ -162,14 +161,17 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
--infodir=/usr/info \
--includedir=/usr/include \
--mandir=/usr/man \
--with-berkeley-db=$RPM_BUILD_ROOT/usr/BDB \
--with-comment=\"Official MySQL RPM\";
--with-berkeley-db \
--with-innobase-db \
--with-comment=\"Official MySQL-Max RPM\";
# Add this for more debugging support
# --with-debug
# Add this for MyISAM RAID support:
# --with-raid
"
# benchdir does not fit in above model. Maybe a separate bench distribution
make benchdir=$RPM_BUILD_ROOT/usr/share/sql-bench
make benchdir_root=$RPM_BUILD_ROOT/usr/share/
}
# Use the build root for temporary storage of the shared libraries.
......@@ -198,6 +200,7 @@ tar cf $RBR/all.tar .
# Save shared libraries
(cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*)
(cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*)
# Save manual to avoid rebuilding
mv Docs/manual.ps Docs/manual.ps.save
......@@ -215,11 +218,12 @@ MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
install -d $RBR/etc/{logrotate.d,rc.d/init.d}
install -d $RBR/var/lib/mysql/mysql
install -d $RBR/usr/share/sql-bench
install -d $RBR/usr/share/mysql-test
install -d $RBR/usr/{sbin,share,man,include}
install -d $RBR/usr/doc/MySQL-%{mysql_version}
install -d $RBR/usr/lib
# Make install
make install DESTDIR=$RBR benchdir=/usr/share/sql-bench
make install DESTDIR=$RBR benchdir_root=/usr/share/
# Install shared libraries (Disable for architectures that don't support it)
(cd $RBR/usr/lib; tar xf $RBR/shared-libs.tar)
......@@ -311,14 +315,16 @@ fi
%attr(755, root, root) /usr/bin/mysql_setpermission
%attr(755, root, root) /usr/bin/mysql_zap
%attr(755, root, root) /usr/bin/mysqlbug
%attr(755, root, root) /usr/bin/mysqltest
%attr(755, root, root) /usr/bin/mysqlhotcopy
%attr(755, root, root) /usr/bin/perror
%attr(755, root, root) /usr/bin/replace
%attr(755, root, root) /usr/bin/resolveip
%attr(755, root, root) /usr/bin/safe_mysqld
%attr(755, root, root) /usr/bin/mysqld_multi
%attr(755, root, root) /usr/bin/my_print_defaults
%attr(644, root, root) /usr/info/mysql.info
%attr(644, root, root) /usr/info/mysql.info*
%attr(755, root, root) /usr/sbin/mysqld
......@@ -338,7 +344,19 @@ fi
%attr(755, root, root) /usr/bin/mysqlshow
%attr(755, root, root) /usr/bin/mysqlbinlog
%attr(644, root, man) %doc /usr/man/man1/mysql.1
%attr(644, root, man) %doc /usr/man/man1/mysql.1*
%attr(644, root, man) %doc /usr/man/man1/isamchk.1*
%attr(644, root, man) %doc /usr/man/man1/isamlog.1*
%attr(644, root, man) %doc /usr/man/man1/mysql_zap.1*
%attr(644, root, man) %doc /usr/man/man1/mysqlaccess.1*
%attr(644, root, man) %doc /usr/man/man1/mysqladmin.1*
%attr(644, root, man) %doc /usr/man/man1/mysqld.1*
%attr(644, root, man) %doc /usr/man/man1/mysqld_multi.1*
%attr(644, root, man) %doc /usr/man/man1/mysqldump.1*
%attr(644, root, man) %doc /usr/man/man1/mysqlshow.1*
%attr(644, root, man) %doc /usr/man/man1/perror.1*
%attr(644, root, man) %doc /usr/man/man1/replace.1*
%attr(644, root, man) %doc /usr/man/man1/safe_mysqld.1*
%post shared
/sbin/ldconfig
......@@ -350,20 +368,26 @@ fi
%attr(755, root, root) /usr/bin/comp_err
%attr(755, root, root) /usr/include/mysql/
%attr(755, root, root) /usr/lib/mysql/
%attr(755, root, root) /usr/bin/mysql_config
%files shared
# Shared libraries (omit for architectures that don't support them)
%attr(755, root, root) /usr/lib/*
%attr(755, root, root) /usr/lib/*.so*
%files bench
%attr(-, root, root) /usr/share/sql-bench
%attr(-, root, root) /usr/share/mysql-test
%changelog
%changelog
* Fri Jun 29 2000 Steven Lawrance <slawrance@technologist.com>
* Tue Jan 2 2001 Monty
- Merged changes from official MySQL RPM and upgraded Berkeley DB to
3.1.14 within this RPM.
- Added mysql-test to the bench package
* Fri Aug 18 2000 Tim Smith <tim@mysql.com>
- Added separate libmysql_r directory; now both a threaded
and non-threaded library is shipped.
* Wed Sep 28 1999 David Axmark <davida@mysql.com>
......
......@@ -161,6 +161,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
--includedir=/usr/include \
--mandir=/usr/man \
--without-berkeley-db \
--without-innobase-db \
--with-comment=\"Official MySQL RPM\";
# Add this for more debugging support
# --with-debug
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment