summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2008-05-29 21:39:25 +0300
committerunknown <monty@narttu.mysql.fi>2008-05-29 21:39:25 +0300
commit1f0f6be54cd911fbdf5f5644b659586b25497fb3 (patch)
treed7dd11206d6de4fc93a1a73a66f7a15f32bb92d3 /mysql-test
parent7004ef20dd7c39af0e9c5ec68c345d48481d3623 (diff)
parenta8ba9cb9a5bde4ef64d28647cb1c5542bdef50c0 (diff)
downloadmariadb-git-1f0f6be54cd911fbdf5f5644b659586b25497fb3.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-maria
into mysql.com:/home/my/mysql-maria mysql-test/r/maria.result: Auto merged mysql-test/suite/ndb/r/ndb_auto_increment.result: Auto merged mysql-test/t/maria.test: Auto merged mysys/hash.c: Auto merged mysys/thr_lock.c: Auto merged sql/field.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/ha_partition.cc: Auto merged sql/ha_partition.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/log_event.cc: Auto merged sql/log_event_old.cc: Auto merged sql/mysqld.cc: Auto merged sql/protocol.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged storage/csv/ha_tina.cc: Auto merged storage/federated/ha_federated.cc: Auto merged storage/maria/Makefile.am: Auto merged storage/maria/ma_check.c: Auto merged storage/maria/ma_control_file.c: Auto merged storage/maria/ma_delete_all.c: Auto merged storage/maria/ma_dynrec.c: Auto merged storage/maria/ma_init.c: Auto merged storage/maria/ma_key_recover.c: Auto merged storage/maria/ma_open.c: Auto merged storage/maria/ma_page.c: Auto merged storage/maria/ma_range.c: Auto merged storage/maria/ma_recovery.c: Auto merged storage/maria/ma_test1.c: Auto merged storage/maria/maria_read_log.c: Auto merged storage/maria/unittest/ma_test_all-t: Auto merged storage/maria/unittest/ma_test_loghandler_multigroup-t.c: Auto merged storage/maria/unittest/ma_test_recovery.pl: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/myisamdef.h: Auto merged include/my_base.h: Manual merge where error code are kept same as in 5.1 mysys/my_handler.c: No changes sql/item.cc: Manual merge sql/sql_class.cc: Manual merge sql/sql_insert.cc: Manual merge storage/maria/ha_maria.cc: Manual merge storage/maria/ma_blockrec.c: Manual merge storage/maria/ma_delete.c: Manual merge storage/maria/ma_write.c: Manual merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/install_test_db.sh2
-rw-r--r--mysql-test/r/maria-mvcc.result140
-rw-r--r--mysql-test/r/maria-page-checksum.result1
-rw-r--r--mysql-test/r/maria.result14
-rw-r--r--mysql-test/suite/ndb/r/ndb_auto_increment.result2
-rw-r--r--mysql-test/suite/ndb/t/ndb_auto_increment.test2
-rw-r--r--mysql-test/t/maria-mvcc.test87
-rw-r--r--mysql-test/t/maria-page-checksum.test11
-rw-r--r--mysql-test/t/maria.test8
9 files changed, 263 insertions, 4 deletions
diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh
index e4df8f619cc..855ec4351e3 100644
--- a/mysql-test/install_test_db.sh
+++ b/mysql-test/install_test_db.sh
@@ -102,7 +102,7 @@ basedir=.
EXTRA_ARG="--windows"
fi
-INSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --basedir=$basedir --datadir=mysql-test/$ldata --srcdir=."
+INSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --datadir=mysql-test/$ldata --srcdir=."
echo "running $INSTALL_CMD"
cd ..
diff --git a/mysql-test/r/maria-mvcc.result b/mysql-test/r/maria-mvcc.result
new file mode 100644
index 00000000000..b80f07cd9d2
--- /dev/null
+++ b/mysql-test/r/maria-mvcc.result
@@ -0,0 +1,140 @@
+set global maria_page_checksum=1;
+drop table if exists t1;
+create table t1 (i int) engine=maria;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+lock tables t1 write concurrent;
+insert into t1 values (1);
+insert into t1 values (2);
+/* should see 1 and 2 */
+select i from t1;
+i
+1
+2
+select count(*) from t1;
+count(*)
+2
+/* should see nothing */
+select i from t1;
+i
+select count(*) from t1;
+count(*)
+0
+lock tables t1 write concurrent;
+insert into t1 values (3);
+insert into t1 values (4);
+/* should see 3 and 4 */
+select i from t1;
+i
+3
+4
+select count(*) from t1;
+count(*)
+2
+unlock tables;
+lock tables t1 write concurrent;
+insert into t1 values (5);
+/* should see 3, 4 and 5 */
+select i from t1;
+i
+3
+4
+5
+select count(*) from t1;
+count(*)
+3
+lock tables t1 write concurrent;
+/* should see 3, 4 */
+select i from t1;
+i
+3
+4
+select count(*) from t1;
+count(*)
+2
+insert into t1 values (6);
+/* Should see 1, 2, 6 */
+select i from t1;
+i
+1
+2
+6
+select count(*) from t1;
+count(*)
+3
+unlock tables;
+lock tables t1 write concurrent;
+/* Should see 1, 2, 3, 4 and 6 */
+select i from t1;
+i
+1
+2
+3
+4
+6
+select count(*) from t1;
+count(*)
+5
+/* should see 3, 4, 5 */
+select i from t1;
+i
+3
+4
+5
+select count(*) from t1;
+count(*)
+3
+unlock tables;
+/* should see 1, 2, 3, 4, 5, 6 */
+select i from t1;
+i
+1
+2
+3
+4
+5
+6
+select count(*) from t1;
+count(*)
+6
+unlock tables;
+/* should see 1, 2, 3, 4, 5, 6 */
+select i from t1;
+i
+1
+2
+3
+4
+5
+6
+select count(*) from t1;
+count(*)
+6
+insert into t1 values (7);
+/* should see 3, 4, 7 */
+select i from t1;
+i
+3
+4
+7
+select count(*) from t1;
+count(*)
+3
+unlock tables;
+/* should see 1, 2, 3, 4, 5, 6, 7 */
+select i from t1;
+i
+1
+2
+3
+4
+5
+6
+7
+select count(*) from t1;
+count(*)
+7
+drop table t1;
diff --git a/mysql-test/r/maria-page-checksum.result b/mysql-test/r/maria-page-checksum.result
index 1a7ec2e3fdd..d7ab1fc4ba3 100644
--- a/mysql-test/r/maria-page-checksum.result
+++ b/mysql-test/r/maria-page-checksum.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
select @@global.maria_page_checksum;
@@global.maria_page_checksum
1
diff --git a/mysql-test/r/maria.result b/mysql-test/r/maria.result
index 5487024f073..a9f10a7ec4d 100644
--- a/mysql-test/r/maria.result
+++ b/mysql-test/r/maria.result
@@ -355,6 +355,9 @@ INSERT into t2 values (1,1,1), (2,2,2);
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 b 1 b A 5 NULL NULL YES BTREE
@@ -2101,6 +2104,11 @@ test.t2 check status OK
select t1,t2,length(t3),length(t4),length(t5),length(t6),t7,t8 from t2;
t1 t2 length(t3) length(t4) length(t5) length(t6) t7 t8
1 a 256 256 4096 4096
+drop table t2;
+create table t2 (primary key (auto)) engine=maria row_format=dynamic select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1;
+check table t2;
+Table Op Msg_type Msg_text
+test.t2 check status OK
drop table t1,t2;
CREATE TABLE t1 (seq int, s1 int, s2 blob);
insert into t1 values (1, 1, MD5(1));
@@ -2236,6 +2244,12 @@ t
9999-12-31 23:59:59
2003-01-00 00:00:00
2003-00-00 00:00:00
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
delete from t1 where t > 0;
optimize table t1;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/ndb/r/ndb_auto_increment.result b/mysql-test/suite/ndb/r/ndb_auto_increment.result
index 78612b35113..9f16f1ae477 100644
--- a/mysql-test/suite/ndb/r/ndb_auto_increment.result
+++ b/mysql-test/suite/ndb/r/ndb_auto_increment.result
@@ -416,7 +416,7 @@ a
insert into t1 values (35);
insert into t1 values (NULL);
insert into t1 values (NULL);
-ERROR 23000: Duplicate entry '35' for key 'PRIMARY'
+Got one of the listed errors
select * from t1 order by a;
a
1
diff --git a/mysql-test/suite/ndb/t/ndb_auto_increment.test b/mysql-test/suite/ndb/t/ndb_auto_increment.test
index 14e7ae7ca7b..33021331e44 100644
--- a/mysql-test/suite/ndb/t/ndb_auto_increment.test
+++ b/mysql-test/suite/ndb/t/ndb_auto_increment.test
@@ -276,7 +276,7 @@ connection server1;
insert into t1 values (35);
insert into t1 values (NULL);
connection server2;
---error ER_DUP_ENTRY
+--error ER_DUP_ENTRY, ER_DUP_KEY
insert into t1 values (NULL);
select * from t1 order by a;
diff --git a/mysql-test/t/maria-mvcc.test b/mysql-test/t/maria-mvcc.test
new file mode 100644
index 00000000000..f2946d9462f
--- /dev/null
+++ b/mysql-test/t/maria-mvcc.test
@@ -0,0 +1,87 @@
+#
+# Testing insert and select on a table with two threads
+# using locking
+#
+
+-- source include/have_maria.inc
+set global maria_page_checksum=1;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+connect (con1,localhost,root,,);
+connection con1;
+
+create table t1 (i int) engine=maria;
+show create table t1;
+lock tables t1 write concurrent;
+insert into t1 values (1);
+insert into t1 values (2);
+/* should see 1 and 2 */
+select i from t1;
+select count(*) from t1;
+
+connect (con2,localhost,root,,);
+connection con2;
+/* should see nothing */
+select i from t1;
+select count(*) from t1;
+lock tables t1 write concurrent;
+insert into t1 values (3);
+insert into t1 values (4);
+/* should see 3 and 4 */
+select i from t1;
+select count(*) from t1;
+unlock tables;
+lock tables t1 write concurrent;
+insert into t1 values (5);
+/* should see 3, 4 and 5 */
+select i from t1;
+select count(*) from t1;
+
+connect (con3,localhost,root,,);
+connection con3;
+lock tables t1 write concurrent;
+/* should see 3, 4 */
+select i from t1;
+select count(*) from t1;
+
+connection con1;
+insert into t1 values (6);
+/* Should see 1, 2, 6 */
+select i from t1;
+select count(*) from t1;
+unlock tables;
+lock tables t1 write concurrent;
+/* Should see 1, 2, 3, 4 and 6 */
+select i from t1;
+select count(*) from t1;
+
+connection con2;
+/* should see 3, 4, 5 */
+select i from t1;
+select count(*) from t1;
+unlock tables;
+/* should see 1, 2, 3, 4, 5, 6 */
+select i from t1;
+select count(*) from t1;
+
+connection con1;
+unlock tables;
+/* should see 1, 2, 3, 4, 5, 6 */
+select i from t1;
+select count(*) from t1;
+
+connection con3;
+insert into t1 values (7);
+/* should see 3, 4, 7 */
+select i from t1;
+select count(*) from t1;
+unlock tables;
+/* should see 1, 2, 3, 4, 5, 6, 7 */
+select i from t1;
+select count(*) from t1;
+
+connection default;
+drop table t1;
diff --git a/mysql-test/t/maria-page-checksum.test b/mysql-test/t/maria-page-checksum.test
index 7bed7393d2d..6c7c5afc2a5 100644
--- a/mysql-test/t/maria-page-checksum.test
+++ b/mysql-test/t/maria-page-checksum.test
@@ -1,3 +1,14 @@
+#
+# This can't be run with --extern as we are acccessing the tables in the
+# database directly
+#
+
+-- source include/have_maria.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
select @@global.maria_page_checksum;
--echo # iteration 1
diff --git a/mysql-test/t/maria.test b/mysql-test/t/maria.test
index a2b08860060..bea9521dcf6 100644
--- a/mysql-test/t/maria.test
+++ b/mysql-test/t/maria.test
@@ -1,5 +1,5 @@
#
-# Testing of potential probelms in Maria
+# Testing of potential problems in Maria
# This code was initially taken from myisam.test
#
@@ -377,6 +377,7 @@ INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
INSERT into t2 values (1,1,1), (2,2,2);
optimize table t1;
+check table t1;
show index from t1;
explain select * from t1,t2 where t1.a=t2.a;
explain select * from t1,t2 force index(a) where t1.a=t2.a;
@@ -1352,6 +1353,9 @@ insert into t1 values (10,1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','on
create table t2 (primary key (auto)) engine=maria row_format=page select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1;
check table t1,t2;
select t1,t2,length(t3),length(t4),length(t5),length(t6),t7,t8 from t2;
+drop table t2;
+create table t2 (primary key (auto)) engine=maria row_format=dynamic select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1;
+check table t2;
drop table t1,t2;
# Test UPDATE with small BLOB which fits on head page
@@ -1449,6 +1453,8 @@ drop table t1, t2, t3;
create table t1 (t datetime) engine=maria;
insert into t1 values (101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030100000000),(20030000000000);
select * from t1;
+optimize table t1;
+check table t1;
delete from t1 where t > 0;
optimize table t1;
check table t1;