Commit 361067e9 authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Extended mysqltest with --commands and 'require'

Fixed test results.
Added mysqld variable 'have_isam'
parent 988a98c3
...@@ -183,3 +183,4 @@ mysqld.S ...@@ -183,3 +183,4 @@ mysqld.S
mysqld.sym mysqld.sym
.snprj/* .snprj/*
sql-bench/output/* sql-bench/output/*
sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
...@@ -20271,7 +20271,7 @@ differ somewhat: ...@@ -20271,7 +20271,7 @@ differ somewhat:
| flush | OFF | | flush | OFF |
| flush_time | 0 | | flush_time | 0 |
| have_bdb | YES | | have_bdb | YES |
| have_gemeni | NO | | have_gemini | NO |
| have_innobase | YES | | have_innobase | YES |
| have_raid | YES | | have_raid | YES |
| have_ssl | NO | | have_ssl | NO |
...@@ -20449,9 +20449,9 @@ very little resources. ...@@ -20449,9 +20449,9 @@ very little resources.
@item @code{have_bdb} @item @code{have_bdb}
@code{YES} if @code{mysqld} supports Berkeley DB tables. @code{DISABLED} @code{YES} if @code{mysqld} supports Berkeley DB tables. @code{DISABLED}
if @code{--skip-bdb} is used. if @code{--skip-bdb} is used.
@item @code{have_gemeni} @item @code{have_gemini}
@code{YES} if @code{mysqld} supports Gemeni tables. @code{DISABLED} @code{YES} if @code{mysqld} supports Gemini tables. @code{DISABLED}
if @code{--skip-gemeni} is used. if @code{--skip-gemini} is used.
@item @code{have_innobase} @item @code{have_innobase}
@code{YES} if @code{mysqld} supports Innobase tables. @code{DISABLED} @code{YES} if @code{mysqld} supports Innobase tables. @code{DISABLED}
if @code{--skip-innobase} is used. if @code{--skip-innobase} is used.
...@@ -40052,7 +40052,7 @@ though, so Version 3.23 is not released as a stable version yet. ...@@ -40052,7 +40052,7 @@ though, so Version 3.23 is not released as a stable version yet.
@item @item
Added option @code{--safe-show-databases}. Added option @code{--safe-show-databases}.
@item @item
Added @code{have_bdb}, @code{have_gemeni}, @code{have_innobase}, Added @code{have_bdb}, @code{have_gemini}, @code{have_innobase},
@code{have_raid} and @code{have_ssl} to @code{SHOW VARIABLES} to make it @code{have_raid} and @code{have_ssl} to @code{SHOW VARIABLES} to make it
easy to test for supported extensions. easy to test for supported extensions.
@item @item
This diff is collapsed.
...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. ...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc) AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line! # The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 3.23.29a-gamma) AM_INIT_AUTOMAKE(mysql, 3.23.30-gamma)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
......
...@@ -393,7 +393,7 @@ static int examine_log(my_string file_name, char **table_names) ...@@ -393,7 +393,7 @@ static int examine_log(my_string file_name, char **table_names)
char *pos,*to; char *pos,*to;
/* Fix if old DOS files to new format */ /* Fix if old DOS files to new format */
for (pos=file_info.name; pos=strchr(pos,'\\') ; pos++) for (pos=file_info.name; (pos=strchr(pos,'\\')) ; pos++)
*pos= '/'; *pos= '/';
pos=file_info.name; pos=file_info.name;
......
-- require r/have_bdb.require
show variables like "have_bdb";
-- require r/have_isam.require
show variables like "have_isam";
...@@ -189,6 +189,10 @@ fail_inc () { ...@@ -189,6 +189,10 @@ fail_inc () {
TOT_FAIL=`$EXPR $TOT_FAIL + 1` TOT_FAIL=`$EXPR $TOT_FAIL + 1`
} }
skip_inc () {
TOT_SKIP=`$EXPR $TOT_SKIP + 1`
}
total_inc () { total_inc () {
TOT_TEST=`$EXPR $TOT_TEST + 1` TOT_TEST=`$EXPR $TOT_TEST + 1`
} }
...@@ -463,9 +467,14 @@ run_testcase () ...@@ -463,9 +467,14 @@ run_testcase ()
$SETCOLOR_NORMAL && $ECHO -n "$pname $timestr" $SETCOLOR_NORMAL && $ECHO -n "$pname $timestr"
total_inc
if [ $res != 0 ]; then if [ $res == 0 ]; then
total_inc
pass_inc
echo "$RES_SPACE [ pass ]"
else
if [ $res == 1 ]; then
total_inc
fail_inc fail_inc
echo "$RES_SPACE [ fail ]" echo "$RES_SPACE [ fail ]"
$ECHO "failed output" $ECHO "failed output"
...@@ -481,12 +490,12 @@ run_testcase () ...@@ -481,12 +490,12 @@ run_testcase ()
echo "Restarting mysqld" echo "Restarting mysqld"
mysql_restart mysql_restart
echo "Resuming Tests" echo "Resuming Tests"
else else
pass_inc pass_inc
echo "$RES_SPACE [ pass ]" echo "$RES_SPACE [ skipped ]"
fi
fi fi
fi fi
} }
...@@ -525,7 +534,8 @@ then ...@@ -525,7 +534,8 @@ then
done done
fi fi
else else
tf=$TESTDIR/$1.$TESTSUFFIX tname=`$BASENAME $1 .test`
tf=$TESTDIR/$tname.$TESTSUFFIX
if [ -f $tf ] ; then if [ -f $tf ] ; then
run_testcase $tf run_testcase $tf
else else
......
id code name id code name
1 1 Tim 1 1 Tim
2 1 Monty 2 1 Monty
3 2 David 3 2 David
4 2 Erik 4 2 Erik
5 3 Sasha 5 3 Sasha
6 3 Jeremy 6 3 Jeremy
7 4 Matt 7 4 Matt
id code name id code name
2 1 Monty 2 1 Monty
3 2 David 3 2 David
4 2 Erik 4 2 Erik
5 3 Sasha 5 3 Sasha
6 3 Jeremy 6 3 Jeremy
7 4 Matt 7 4 Matt
8 1 Sinisa 8 1 Sinisa
id code name id code name
3 2 David 3 2 David
4 2 Erik 4 2 Erik
5 3 Sasha 5 3 Sasha
6 3 Jeremy 6 3 Jeremy
7 4 Matt 7 4 Matt
8 1 Sinisa 8 1 Sinisa
12 1 Ralph 12 1 Ralph
gesuchnr benutzer_id
1 1
2 1
encrypt('foo', 'ff') encrypt('foo', 'ff')
ffTU0fyIP09Z. ffTU0fyIP09Z.
0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL 0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL
1 1 1 1 1 1 1 1
1<=>0 0<=>NULL NULL<=>0 1<=>0 0<=>NULL NULL<=>0
0 0 0 0 0 0
1.0<=>0.0 0.0<=>NULL NULL<=>0.0 1.0<=>0.0 0.0<=>NULL NULL<=>0.0
0 0 0 0 0 0
"A"<=>"B" "A"<=>NULL NULL<=>"A" "A"<=>"B" "A"<=>NULL NULL<=>"A"
0 0 0 0 0 0
id value id value t1.value<=>t2.value id value id value t1.value<=>t2.value
1 NULL 1 NULL 1 1 NULL 1 NULL 1
id value id value
1 NULL 1 NULL
id value id value
1 NULL 1 NULL
id value id value
a MATCH (message) AGAINST ('steve') a MATCH (message) AGAINST ('steve')
4 0.90587321329654 4 0.90587321329654
7 0.89568988462614 7 0.89568988462614
a MATCH (message) AGAINST ('steve') a MATCH (message) AGAINST ('steve')
4 0.90587321329654 4 0.90587321329654
7 0.89568988462614 7 0.89568988462614
a MATCH (message) AGAINST ('steve') a MATCH (message) AGAINST ('steve')
7 0.89568988462614 7 0.89568988462614
4 0.90587321329654 4 0.90587321329654
a MATCH (message) AGAINST ('steve') a MATCH (message) AGAINST ('steve')
7 0.89568988462614 7 0.89568988462614
a rel a rel
1 0 1 0
2 0 2 0
3 0 3 0
5 0 5 0
6 0 6 0
7 0.89568988462614 7 0.89568988462614
4 0.90587321329654 4 0.90587321329654
a MATCH b AGAINST ('lala lkjh') a MATCH b AGAINST ('lala lkjh')
1 0.67003110026735 1 0.67003110026735
2 0 2 0
3 0 3 0
a MATCH c AGAINST ('lala lkjh') a MATCH c AGAINST ('lala lkjh')
1 0 1 0
2 0.67756324121582 2 0.67756324121582
3 0 3 0
a MATCH b,c AGAINST ('lala lkjh') a MATCH b,c AGAINST ('lala lkjh')
1 0.64840710366884 1 0.64840710366884
2 0.66266459031789 2 0.66266459031789
3 0 3 0
Variable_name Value
have_bdb YES
Variable_name Value
have_isam YES
id domain id domain
1 mysql.com 1 mysql.com
2 hotmail.com 2 hotmail.com
3 aol.com 3 aol.com
incr othr incr othr
1 10 1 10
2 24 2 24
4 33 4 33
3 53 3 53
sum(length(word)) sum(length(word))
71 71
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.words check status OK test.words check status OK
name age id name age id
Andy 31 00000001 Andy 31 00000001
Jacob 2 00000002 Jacob 2 00000002
Caleb 1 00000003 Caleb 1 00000003
unix_timestamp(t) unix_timestamp(t)
200006 200006
Variable_name Value Variable_name Value
Slave_open_temp_tables 0 Slave_open_temp_tables 0
Variable_name Value Variable_name Value
Slave_open_temp_tables 0 Slave_open_temp_tables 0
File Position Binlog_do_db Binlog_ignore_db File Position Binlog_do_db Binlog_ignore_db
master-bin.001 73 master-bin.001 73
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 1 73 Yes 127.0.0.1 root 9306 1 73 Yes
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 1 73 No 127.0.0.1 root 9306 1 73 No
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 1 73 Yes 127.0.0.1 root 9306 1 73 Yes
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 1 173 Yes 127.0.0.1 root 9306 1 173 Yes
File Position Binlog_do_db Binlog_ignore_db File Position Binlog_do_db Binlog_ignore_db
master-bin.001 73 master-bin.001 73
n n
1 1
2 2
3 3
File Position Binlog_do_db Binlog_ignore_db File Position Binlog_do_db Binlog_ignore_db
master-bin.001 73 master-bin.001 73
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
0 0 0 No 0 0 0 No
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 test 3306 60 4 No 127.0.0.1 test 3306 60 4 No
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 60 4 No 127.0.0.1 root 9306 60 4 No
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 60 4 Yes 127.0.0.1 root 9306 60 4 Yes
n n
10 10
45 45
90 90
s s
Could not break slave Could not break slave
Tried hard Tried hard
Log_name Log_name
master-bin.001 master-bin.001
master-bin.002 master-bin.002
master-bin.003 master-bin.003
Log_name Log_name
master-bin.003 master-bin.003
m m
34 34
67 67
123 123
65 65
n score n score
4 10 4 10
2 20 2 20
1+1 1-1 1+1*2 8/5 8%5 MOD(8,5) MOD(8,5)|0 -(1+1)*-2 SIGN(-5) 1+1 1-1 1+1*2 8/5 8%5 MOD(8,5) MOD(8,5)|0 -(1+1)*-2 SIGN(-5)
2 0 3 1.60 3 3 3 4 -1 2 0 3 1.60 3 3 3 4 -1
FLOOR(5.5) FLOOR(-5.5) CEILING(5.5) CEILING(-5.5) ROUND(5.5) ROUND(-5.5) FLOOR(5.5) FLOOR(-5.5) CEILING(5.5) CEILING(-5.5) ROUND(5.5) ROUND(-5.5)
5 -6 6 -5 6 -6 5 -6 6 -5 6 -6
ROUND(5.64,1) ROUND(5.64,2) ROUND(5.64,-1) ROUND(5.64,-2) ROUND(5.64,1) ROUND(5.64,2) ROUND(5.64,-1) ROUND(5.64,-2)
5.6 5.64 10 0 5.6 5.64 10 0
TRUNCATE(52.64,1) TRUNCATE(52.64,2) TRUNCATE(52.64,-1) TRUNCATE(52.64,-2) TRUNCATE(52.64,1) TRUNCATE(52.64,2) TRUNCATE(52.64,-1) TRUNCATE(52.64,-2)
52.6 52.64 50 0 52.6 52.64 50 0
ABS(-10) LOG(EXP(10)) EXP(LOG(SQRT(10))*2) POW(10,LOG10(10)) RAND(999999) RAND() POWER(2,4) ABS(-10) LOG(EXP(10)) EXP(LOG(SQRT(10))*2) POW(10,LOG10(10)) RAND(999999) RAND() POWER(2,4)
10 10.000000 10.000000 10.000000 0.18435012473199 0.76373626176616 16.000000 10 10.000000 10.000000 10.000000 0.18435012473199 0.76373626176616 16.000000
PI() SIN(PI()/2) COS(PI()/2) TAN(PI()) COT(1) ASIN(1) ACOS(0) ATAN(1) PI() SIN(PI()/2) COS(PI()/2) TAN(PI()) COT(1) ASIN(1) ACOS(0) ATAN(1)
3.141593 1.000000 0.000000 -0.000000 0.64209262 1.570796 1.570796 0.785398 3.141593 1.000000 0.000000 -0.000000 0.64209262 1.570796 1.570796 0.785398
1 | (1+1) 5 & 3 BIT_COUNT(7) 1 | (1+1) 5 & 3 BIT_COUNT(7)
3 1 3 3 1 3
1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60 1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60
4294967296 -9223372036854775808 0 1 0 8 4294967296 -9223372036854775808 0 1 0 8
10 10.0 10. .1e+2 100.0e-1 10 10.0 10. .1e+2 100.0e-1
10 10.0 10 10 10 10 10.0 10 10 10
6e-05 -6e-05 --6e-05 -6e-05+1.000000 6e-05 -6e-05 --6e-05 -6e-05+1.000000
6e-05 -6e-05 6e-05 0.99994 6e-05 -6e-05 6e-05 0.99994
0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296 0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296
0 256 65536 2147483647 -2147483648 2147483648 4294967296 0 256 65536 2147483647 -2147483648 2147483648 4294967296
922337203685477580 92233720368547758000 922337203685477580 92233720368547758000
922337203685477580 92233720368547758080 922337203685477580 92233720368547758080
-922337203685477580 -92233720368547758000 -922337203685477580 -92233720368547758000
-922337203685477580 -92233720368547758080 -922337203685477580 -92233720368547758080
9223372036854775807 -009223372036854775808 9223372036854775807 -009223372036854775808
9223372036854775807 -9223372036854775808 9223372036854775807 -9223372036854775808
+9999999999999999999 -9999999999999999999 +9999999999999999999 -9999999999999999999
10000000000000000000 -10000000000000000000 10000000000000000000 -10000000000000000000
DEGREES(PI()) RADIANS(360) DEGREES(PI()) RADIANS(360)
180 6.2831853071796 180 6.2831853071796
0=0 1>0 1>=1 1<0 1<=0 1!=0 STRCMP("abc","abcd") STRCMP("b","a") STRCMP("a","a") 0=0 1>0 1>=1 1<0 1<=0 1!=0 STRCMP("abc","abcd") STRCMP("b","a") STRCMP("a","a")
1 1 1 0 0 1 -1 1 0 1 1 1 0 0 1 -1 1 0
"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b" "a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b"
1 1 1 1 1 1 1 1 1 1 1 1
"a "="A" "A "="a" "a " <= "A b" "a "="A" "A "="a" "a " <= "A b"
1 1 1 1 1 1
"abc" LIKE "a%" "abc" NOT LIKE "%d%" "a%" LIKE "a\%" "abc%" LIKE "a%\%" "abcd" LIKE "a%b_%d" "a" LIKE "%%a" "abcde" LIKE "a%_e" "abc" LIKE "abc%" "abc" LIKE "a%" "abc" NOT LIKE "%d%" "a%" LIKE "a\%" "abc%" LIKE "a%\%" "abcd" LIKE "a%b_%d" "a" LIKE "%%a" "abcde" LIKE "a%_e" "abc" LIKE "abc%"
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
"a" LIKE "%%b" "a" LIKE "%%ab" "ab" LIKE "a\%" "ab" LIKE "_" "ab" LIKE "ab_" "abc" LIKE "%_d" "abc" LIKE "abc%d" "a" LIKE "%%b" "a" LIKE "%%ab" "ab" LIKE "a\%" "ab" LIKE "_" "ab" LIKE "ab_" "abc" LIKE "%_d" "abc" LIKE "abc%d"
0 0 0 0 0 0 0 0 0 0 0 0 0 0
'?' LIKE '|%' '?' LIKE '|%' ESCAPE '|' '%' LIKE '|%' '%' LIKE '|%' ESCAPE '|' '%' LIKE '%' '?' LIKE '|%' '?' LIKE '|%' ESCAPE '|' '%' LIKE '|%' '%' LIKE '|%' ESCAPE '|' '%' LIKE '%'
0 0 0 1 1 0 0 0 1 1
'abc' LIKE '%c' 'abcabc' LIKE '%c' "ab" LIKE "" "ab" LIKE "a" "ab" LIKE "ab" 'abc' LIKE '%c' 'abcabc' LIKE '%c' "ab" LIKE "" "ab" LIKE "a" "ab" LIKE "ab"
1 1 0 0 1 1 1 0 0 1
"Det här är svenska" REGEXP "h[[:alpha:]]+r" "aba" REGEXP "^(a|b)*$" "Det här är svenska" REGEXP "h[[:alpha:]]+r" "aba" REGEXP "^(a|b)*$"
1 1 1 1
"aba" REGEXP CONCAT("^","a") "aba" REGEXP CONCAT("^","a")
1 1
!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 OR 1=1 AND 1=0 !0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 OR 1=1 AND 1=0
1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1
IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0 IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0
this is a 2 2.0 this is a 2 2.0
id elt(two.val,'one','two') id elt(two.val,'one','two')
1 one 1 one
2 one 2 one
4 two 4 two
id elt(two.val,'one','two') id elt(two.val,'one','two')
1 one 1 one
2 one 2 one
4 two 4 two
key_link_id link key_link_id link
NULL NULL NULL NULL
Table Create Table Table Create Table
test CREATE TABLE `test` ( test CREATE TABLE `test` (
`test_set` set('val1','val2','val3') NOT NULL default '', `test_set` set('val1','val2','val3') NOT NULL default '',
`name` char(20) default 'O''Brien' `name` char(20) default 'O''Brien'
) TYPE=MyISAM COMMENT='it''s a table' ) TYPE=MyISAM COMMENT='it''s a table'
Variable_name Value Variable_name Value
Slave_running ON Slave_running ON
Variable_name Value Variable_name Value
Slave_running OFF Slave_running OFF
-- source include/have_bdb.inc
drop table if exists t1; drop table if exists t1;
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=bdb; create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=bdb;
...@@ -10,3 +12,19 @@ update ignore t1 set id = id + 10, name = 'Ralph' where id < 4; ...@@ -10,3 +12,19 @@ update ignore t1 set id = id + 10, name = 'Ralph' where id < 4;
select id, code, name from t1 order by id; select id, code, name from t1 order by id;
drop table t1; drop table t1;
#
# Test replace
#
CREATE TABLE t1 (
gesuchnr int(11) DEFAULT '0' NOT NULL,
benutzer_id int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (gesuchnr,benutzer_id)
) type=BDB;
replace into t1 (gesuchnr,benutzer_id) values (2,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1;
drop table t1;
connect (master,localhost,root,,test,0,var/tmp/mysql.sock);
connect (master1,localhost,root,,test,0,var/tmp/mysql.sock);
connect (slave,localhost,root,,test,0,var/tmp/mysql-slave.sock);
connect (slave1,localhost,root,,test,0,var/tmp/mysql-slave.sock);
connection slave;
!slave stop;
connection master;
reset master;
connection slave;
reset slave;
!slave start;
-- source include/have_isam.inc
# #
# Test of REPLACE with ISAM and MyISAM and BDB # Test of REPLACE with ISAM and MyISAM and HEAP
# #
drop table if exists t1; drop table if exists t1;
...@@ -15,8 +17,6 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1); ...@@ -15,8 +17,6 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1);
alter table t1 type=myisam; alter table t1 type=myisam;
replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1);
alter table t1 type=bdb;
replace into t1 (gesuchnr,benutzer_id) values (1,1);
alter table t1 type=heap; alter table t1 type=heap;
replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1);
drop table t1; drop table t1;
...@@ -330,7 +330,7 @@ static struct option long_options[] = ...@@ -330,7 +330,7 @@ static struct option long_options[] =
static void usage(int version) static void usage(int version)
{ {
printf("%s Ver 3.1 Distrib %s, for %s (%s)\n", printf("%s Ver 3.2 Distrib %s, for %s (%s)\n",
my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
if (version) if (version)
return; return;
...@@ -350,7 +350,7 @@ static void usage(int version) ...@@ -350,7 +350,7 @@ static void usage(int version)
} }
static uint best_type; static uint best_type;
static ulong best_t1,best_t2; static ulong best_t1,best_t2, best_start_value;
static int get_options(int argc, char **argv) static int get_options(int argc, char **argv)
{ {
...@@ -510,8 +510,10 @@ int main(int argc,char **argv) ...@@ -510,8 +510,10 @@ int main(int argc,char **argv)
best_mod=function_mod; best_add=function_plus; best_mod=function_mod; best_add=function_plus;
best_functype=function_type; best_functype=function_type;
best_t1=t1; best_t2=t2; best_type=type; best_t1=t1; best_t2=t2; best_type=type;
printf("\nstart_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; /* mode=%d add=%d func_type: %d */\n", best_start_value=start_value;
start_value,best_t1,best_t2,best_type,best_mod,best_add,best_functype); printf("\nstart_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; /* mode=%d add=%d type: %d */\n",
best_start_value,best_t1,best_t2,best_type,best_mod,best_add,
best_functype);
} }
} }
} }
...@@ -537,8 +539,8 @@ printf("/* This code is generated by gen_lex_hash.cc that seeks for a perfect\nh ...@@ -537,8 +539,8 @@ printf("/* This code is generated by gen_lex_hash.cc that seeks for a perfect\nh
print_arrays(); print_arrays();
printf("/* start_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; */ /* mode=%d add=%d type: %d */\n\n", printf("/* start_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; */ /* mode=%d add=%d t ype: %d */\n\n",
start_value, best_t1, best_t2,best_type, best_start_value, best_t1, best_t2, best_type,
best_mod, best_add, best_functype); best_mod, best_add, best_functype);
printf("inline SYMBOL *get_hash_symbol(const char *s,unsigned int length,bool function)\n\ printf("inline SYMBOL *get_hash_symbol(const char *s,unsigned int length,bool function)\n\
......
...@@ -89,7 +89,7 @@ static DB_ENV *db_env; ...@@ -89,7 +89,7 @@ static DB_ENV *db_env;
static HASH bdb_open_tables; static HASH bdb_open_tables;
const char *berkeley_lock_names[] = const char *berkeley_lock_names[] =
{ "DEFAULT", "OLDEST","RANDOM","YOUNGEST" }; { "DEFAULT", "OLDEST","RANDOM","YOUNGEST",0 };
u_int32_t berkeley_lock_types[]= u_int32_t berkeley_lock_types[]=
{ DB_LOCK_DEFAULT, DB_LOCK_OLDEST, DB_LOCK_RANDOM }; { DB_LOCK_DEFAULT, DB_LOCK_OLDEST, DB_LOCK_RANDOM };
TYPELIB berkeley_lock_typelib= {array_elements(berkeley_lock_names),"", TYPELIB berkeley_lock_typelib= {array_elements(berkeley_lock_names),"",
......
...@@ -91,7 +91,7 @@ class ha_berkeley: public handler ...@@ -91,7 +91,7 @@ class ha_berkeley: public handler
HA_BLOB_KEY | HA_NOT_EXACT_COUNT | HA_BLOB_KEY | HA_NOT_EXACT_COUNT |
HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE | HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE |
HA_AUTO_PART_KEY), HA_AUTO_PART_KEY),
last_dup_key((uint) -1),version(0) last_dup_key((uint) -1),version(0),using_ignore(0)
{ {
} }
~ha_berkeley() {} ~ha_berkeley() {}
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define NO_HASH /* Not yet implemented */ #define NO_HASH /* Not yet implemented */
#endif #endif
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB) #if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMINI_DB)
#define USING_TRANSACTIONS #define USING_TRANSACTIONS
#endif #endif
...@@ -121,7 +121,7 @@ enum row_type { ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, ROW_TYPE_DYNAMIC, ...@@ -121,7 +121,7 @@ enum row_type { ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, ROW_TYPE_DYNAMIC,
typedef struct st_thd_trans { typedef struct st_thd_trans {
void *bdb_tid; void *bdb_tid;
void *innobase_tid; void *innobase_tid;
void *gemeni_tid; void *gemini_tid;
} THD_TRANS; } THD_TRANS;
typedef struct st_ha_create_information typedef struct st_ha_create_information
......
...@@ -151,16 +151,21 @@ SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_YES; ...@@ -151,16 +151,21 @@ SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_YES;
#else #else
SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_NO; SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_NO;
#endif #endif
#ifdef HAVE_GEMENI_DB #ifdef HAVE_GEMINI_DB
SHOW_COMP_OPTION have_gemeni=SHOW_OPTION_YES; SHOW_COMP_OPTION have_gemini=SHOW_OPTION_YES;
#else #else
SHOW_COMP_OPTION have_gemeni=SHOW_OPTION_NO; SHOW_COMP_OPTION have_gemini=SHOW_OPTION_NO;
#endif #endif
#ifdef HAVE_INNOBASE_DB #ifdef HAVE_INNOBASE_DB
SHOW_COMP_OPTION have_innobase=SHOW_OPTION_YES; SHOW_COMP_OPTION have_innobase=SHOW_OPTION_YES;
#else #else
SHOW_COMP_OPTION have_innobase=SHOW_OPTION_NO; SHOW_COMP_OPTION have_innobase=SHOW_OPTION_NO;
#endif #endif
#ifndef NO_ISAM
SHOW_COMP_OPTION have_isam=SHOW_OPTION_YES;
#else
SHOW_COMP_OPTION have_isam=SHOW_OPTION_NO;
#endif
#ifdef USE_RAID #ifdef USE_RAID
SHOW_COMP_OPTION have_raid=SHOW_OPTION_YES; SHOW_COMP_OPTION have_raid=SHOW_OPTION_YES;
#else #else
...@@ -1077,26 +1082,26 @@ inline static __volatile__ void trace_stack() ...@@ -1077,26 +1082,26 @@ inline static __volatile__ void trace_stack()
uchar **stack_bottom; uchar **stack_bottom;
uchar** ebp; uchar** ebp;
LINT_INIT(ebp); LINT_INIT(ebp);
fprintf(stderr, "Attemping backtrace, please send the info below to\ fprintf(stderr, "Attemping backtrace, please send the info below to \
bugs@lists.mysql.com. If you see no messages after this, something \ bugs@lists.mysql.com. If you see no messages after this, something \
went terribly wrong - report this anyway\n"); went terribly wrong - report this anyway\n");
THD* thd = current_thd; THD* thd = current_thd;
uint frame_count = 0; uint frame_count = 0;
__asm __volatile__ ("movl %%ebp,%0" __asm __volatile__ ("movl %%ebp,%0"
:"=r"(ebp) :"=r"(ebp)
:"r"(ebp)); :"r"(ebp));
if(!ebp) if (!ebp)
{ {
fprintf(stderr, "frame pointer (ebp) is NULL, did you compile with \ fprintf(stderr, "frame pointer (ebp) is NULL, did you compile with \
-fomit-frame-pointer? Aborting backtrace\n"); -fomit-frame-pointer? Aborting backtrace\n");
return; return;
} }
if(!thd) if (!thd)
{ {
fprintf(stderr, "Cannot determine thread, ebp=%p, aborting backtrace\n", fprintf(stderr, "Cannot determine thread, ebp=%p, aborting backtrace\n",
ebp); ebp);
return; return;
} }
stack_bottom = (uchar**)thd->thread_stack; stack_bottom = (uchar**)thd->thread_stack;
if(ebp > stack_bottom || ebp < stack_bottom - thread_stack) if(ebp > stack_bottom || ebp < stack_bottom - thread_stack)
{ {
...@@ -1107,20 +1112,20 @@ inline static __volatile__ void trace_stack() ...@@ -1107,20 +1112,20 @@ inline static __volatile__ void trace_stack()
fprintf(stderr, "stack range sanity check, ok, backtrace follows\n"); fprintf(stderr, "stack range sanity check, ok, backtrace follows\n");
while(ebp < stack_bottom) while (ebp < stack_bottom)
{
uchar** new_ebp = (uchar**)*ebp;
fprintf(stderr, "%p\n", frame_count == SIGRETURN_FRAME_COUNT ?
*(ebp+17) : *(ebp+1));
if (new_ebp <= ebp )
{ {
uchar** new_ebp = (uchar**)*ebp; fprintf(stderr, "New value of ebp failed sanity check\
fprintf(stderr, "%p\n", frame_count == SIGRETURN_FRAME_COUNT ?
*(ebp+17) : *(ebp+1));
if(new_ebp <= ebp )
{
fprintf(stderr, "New value of ebp failed sanity check\
terminating backtrace\n"); terminating backtrace\n");
return; return;
}
ebp = new_ebp;
++frame_count;
} }
ebp = new_ebp;
++frame_count;
}
fprintf(stderr, "stack trace successful\n"); fprintf(stderr, "stack trace successful\n");
} }
...@@ -1133,31 +1138,27 @@ static sig_handler handle_segfault(int sig) ...@@ -1133,31 +1138,27 @@ static sig_handler handle_segfault(int sig)
// but since we have got SIGSEGV already, things are a mess // but since we have got SIGSEGV already, things are a mess
// so not having the mutex is not as bad as possibly using a buggy // so not having the mutex is not as bad as possibly using a buggy
// mutex - so we keep things simple // mutex - so we keep things simple
if(segfaulted) if (segfaulted)
return; return;
segfaulted = 1; segfaulted = 1;
fprintf(stderr,"\ fprintf(stderr,"\
mysqld got signal %s in thread %d; \n\ mysqld got signal %d;\n\
The manual section 'Debugging a MySQL server' tells you how to use a \n\ The manual section 'Debugging a MySQL server' tells you how to use a \n\
debugger on the core file to produce a backtrace that may help you find out\n\ debugger on the core file to produce a backtrace that may help you find out\n\
why mysqld died\n",sys_siglist[sig],getpid()); why mysqld died\n",sig);
#if defined(HAVE_LINUXTHREADS) && defined(__i386__) #if defined(HAVE_LINUXTHREADS)
#ifdef __i386__
trace_stack(); trace_stack();
#endif #endif /* __i386__ */
#ifdef HAVE_LINUXTHREADS
if (test_flags & TEST_CORE_ON_SIGNAL) if (test_flags & TEST_CORE_ON_SIGNAL)
write_core(sig); write_core(sig);
else #endif /* HAVE_LINUXTHREADS */
exit(1); exit(1);
#else
exit(1); /* abort everything */
#endif
} }
#ifdef HAVE_LINUXTHREADS
/* Produce a core for the thread */ /* Produce a core for the thread */
#ifdef HAVE_LINUXTHREADS
static sig_handler write_core(int sig) static sig_handler write_core(int sig)
{ {
signal(sig, SIG_DFL); signal(sig, SIG_DFL);
...@@ -1756,7 +1757,7 @@ The server will not act as a slave"); ...@@ -1756,7 +1757,7 @@ The server will not act as a slave");
if (master_host) if (master_host)
{ {
pthread_t hThread; pthread_t hThread;
if(!opt_skip_slave_start && if (!opt_skip_slave_start &&
pthread_create(&hThread, &connection_attrib, handle_slave, 0)) pthread_create(&hThread, &connection_attrib, handle_slave, 0))
sql_print_error("Warning: Can't create thread to handle slave"); sql_print_error("Warning: Can't create thread to handle slave");
else if(opt_skip_slave_start) else if(opt_skip_slave_start)
...@@ -2623,8 +2624,9 @@ struct show_var_st init_vars[]= { ...@@ -2623,8 +2624,9 @@ struct show_var_st init_vars[]= {
{"flush", (char*) &myisam_flush, SHOW_MY_BOOL}, {"flush", (char*) &myisam_flush, SHOW_MY_BOOL},
{"flush_time", (char*) &flush_time, SHOW_LONG}, {"flush_time", (char*) &flush_time, SHOW_LONG},
{"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE}, {"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE},
{"have_gemeni", (char*) &have_gemeni, SHOW_HAVE}, {"have_gemini", (char*) &have_gemini, SHOW_HAVE},
{"have_innobase", (char*) &have_innobase, SHOW_HAVE}, {"have_innobase", (char*) &have_innobase, SHOW_HAVE},
{"have_isam", (char*) &have_isam, SHOW_HAVE},
{"have_raid", (char*) &have_raid, SHOW_HAVE}, {"have_raid", (char*) &have_raid, SHOW_HAVE},
{"have_ssl", (char*) &have_ssl, SHOW_HAVE}, {"have_ssl", (char*) &have_ssl, SHOW_HAVE},
{"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR}, {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR},
...@@ -3101,7 +3103,7 @@ static void get_options(int argc,char **argv) ...@@ -3101,7 +3103,7 @@ static void get_options(int argc,char **argv)
{ {
char* key = optarg,*p, *val; char* key = optarg,*p, *val;
p = strstr(optarg, "->"); p = strstr(optarg, "->");
if(!p) if (!p)
{ {
fprintf(stderr, fprintf(stderr,
"bad syntax in replicate-rewrite-db - missing ->\n"); "bad syntax in replicate-rewrite-db - missing ->\n");
...@@ -3118,7 +3120,7 @@ static void get_options(int argc,char **argv) ...@@ -3118,7 +3120,7 @@ static void get_options(int argc,char **argv)
*val = 0; *val = 0;
val += 2; val += 2;
while(*val && isspace(*val)) *val++; while(*val && isspace(*val)) *val++;
if(!*val) if (!*val)
{ {
fprintf(stderr, fprintf(stderr,
"bad syntax in replicate-rewrite-db - empty TO db\n"); "bad syntax in replicate-rewrite-db - empty TO db\n");
...@@ -3144,7 +3146,7 @@ static void get_options(int argc,char **argv) ...@@ -3144,7 +3146,7 @@ static void get_options(int argc,char **argv)
} }
case (int)OPT_REPLICATE_DO_TABLE: case (int)OPT_REPLICATE_DO_TABLE:
{ {
if(!do_table_inited) if (!do_table_inited)
init_table_rule_hash(&replicate_do_table, &do_table_inited); init_table_rule_hash(&replicate_do_table, &do_table_inited);
if(add_table_rule(&replicate_do_table, optarg)) if(add_table_rule(&replicate_do_table, optarg))
{ {
...@@ -3156,7 +3158,7 @@ static void get_options(int argc,char **argv) ...@@ -3156,7 +3158,7 @@ static void get_options(int argc,char **argv)
} }
case (int)OPT_REPLICATE_WILD_DO_TABLE: case (int)OPT_REPLICATE_WILD_DO_TABLE:
{ {
if(!wild_do_table_inited) if (!wild_do_table_inited)
init_table_rule_array(&replicate_wild_do_table, init_table_rule_array(&replicate_wild_do_table,
&wild_do_table_inited); &wild_do_table_inited);
if(add_wild_table_rule(&replicate_wild_do_table, optarg)) if(add_wild_table_rule(&replicate_wild_do_table, optarg))
...@@ -3169,7 +3171,7 @@ static void get_options(int argc,char **argv) ...@@ -3169,7 +3171,7 @@ static void get_options(int argc,char **argv)
} }
case (int)OPT_REPLICATE_WILD_IGNORE_TABLE: case (int)OPT_REPLICATE_WILD_IGNORE_TABLE:
{ {
if(!wild_ignore_table_inited) if (!wild_ignore_table_inited)
init_table_rule_array(&replicate_wild_ignore_table, init_table_rule_array(&replicate_wild_ignore_table,
&wild_ignore_table_inited); &wild_ignore_table_inited);
if(add_wild_table_rule(&replicate_wild_ignore_table, optarg)) if(add_wild_table_rule(&replicate_wild_ignore_table, optarg))
...@@ -3182,7 +3184,7 @@ static void get_options(int argc,char **argv) ...@@ -3182,7 +3184,7 @@ static void get_options(int argc,char **argv)
} }
case (int)OPT_REPLICATE_IGNORE_TABLE: case (int)OPT_REPLICATE_IGNORE_TABLE:
{ {
if(!ignore_table_inited) if (!ignore_table_inited)
init_table_rule_hash(&replicate_ignore_table, &ignore_table_inited); init_table_rule_hash(&replicate_ignore_table, &ignore_table_inited);
if(add_table_rule(&replicate_ignore_table, optarg)) if(add_table_rule(&replicate_ignore_table, optarg))
{ {
......
...@@ -301,7 +301,7 @@ public: ...@@ -301,7 +301,7 @@ public:
{ {
return (transaction.all.bdb_tid != 0 || return (transaction.all.bdb_tid != 0 ||
transaction.all.innobase_tid != 0 || transaction.all.innobase_tid != 0 ||
transaction.all.gemeni_tid != 0); transaction.all.gemini_tid != 0);
} }
inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); } inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); }
inline gptr calloc(unsigned int size) inline gptr calloc(unsigned int size)
......
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