diff options
-rw-r--r-- | configure.in | 4 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 2 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-autozerofill.result (renamed from mysql-test/r/maria-autozerofill.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-big.result (renamed from mysql-test/r/maria-big.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-big2.result (renamed from mysql-test/r/maria-big2.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-connect.result (renamed from mysql-test/r/maria-connect.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result (renamed from mysql-test/r/maria-gis-rtree-dynamic.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-gis-rtree-trans.result (renamed from mysql-test/r/maria-gis-rtree-trans.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-gis-rtree.result (renamed from mysql-test/r/maria-gis-rtree.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-mvcc.result (renamed from mysql-test/r/maria-mvcc.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-no-logging.result (renamed from mysql-test/r/maria-no-logging.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-page-checksum.result (renamed from mysql-test/r/maria-page-checksum.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-preload.result (renamed from mysql-test/r/maria-preload.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-purge.result (renamed from mysql-test/r/maria-purge.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-recover.result (renamed from mysql-test/r/maria-recover.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-recovery-big.result (renamed from mysql-test/r/maria-recovery-big.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-recovery-bitmap.result (renamed from mysql-test/r/maria-recovery-bitmap.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-recovery-rtree-ft.result (renamed from mysql-test/r/maria-recovery-rtree-ft.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-recovery.result (renamed from mysql-test/r/maria-recovery.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria-recovery2.result (renamed from mysql-test/r/maria-recovery2.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria.result (renamed from mysql-test/r/maria.result) | 2 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria2.result (renamed from mysql-test/r/maria2.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria3.result (renamed from mysql-test/r/maria3.result) | 13 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria_notembedded.result (renamed from mysql-test/r/maria_notembedded.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/ps_maria.result (renamed from mysql-test/r/ps_maria.result) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-autozerofill.test (renamed from mysql-test/t/maria-autozerofill.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-big.test (renamed from mysql-test/t/maria-big.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-big2.test (renamed from mysql-test/t/maria-big2.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-connect.test (renamed from mysql-test/t/maria-connect.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-gis-rtree-dynamic.test (renamed from mysql-test/t/maria-gis-rtree-dynamic.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-gis-rtree-trans.test (renamed from mysql-test/t/maria-gis-rtree-trans.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-gis-rtree.test (renamed from mysql-test/t/maria-gis-rtree.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-mvcc.test (renamed from mysql-test/t/maria-mvcc.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-no-logging.test (renamed from mysql-test/t/maria-no-logging.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-page-checksum.test (renamed from mysql-test/t/maria-page-checksum.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-preload.test (renamed from mysql-test/t/maria-preload.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-purge.test (renamed from mysql-test/t/maria-purge.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recover-master.opt (renamed from mysql-test/t/maria-recover-master.opt) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recover.test (renamed from mysql-test/t/maria-recover.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery-big-master.opt (renamed from mysql-test/t/maria-recovery-big-master.opt) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery-big.test (renamed from mysql-test/t/maria-recovery-big.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery-bitmap-master.opt (renamed from mysql-test/t/maria-recovery-bitmap-master.opt) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery-bitmap.test (renamed from mysql-test/t/maria-recovery-bitmap.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery-master.opt (renamed from mysql-test/t/maria-recovery-master.opt) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery-rtree-ft-master.opt (renamed from mysql-test/t/maria-recovery-rtree-ft-master.opt) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery-rtree-ft.test (renamed from mysql-test/t/maria-recovery-rtree-ft.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery.test (renamed from mysql-test/t/maria-recovery.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery2-master.opt (renamed from mysql-test/t/maria-recovery2-master.opt) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria-recovery2.test (renamed from mysql-test/t/maria-recovery2.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria.test (renamed from mysql-test/t/maria.test) | 2 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria2.test (renamed from mysql-test/t/maria2.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria3.test (renamed from mysql-test/t/maria3.test) | 20 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria_notembedded.test (renamed from mysql-test/t/maria_notembedded.test) | 0 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/ps_maria.test (renamed from mysql-test/t/ps_maria.test) | 0 | ||||
-rw-r--r-- | mysys/Makefile.am | 11 | ||||
-rw-r--r-- | mysys/lf_alloc-pin.c | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 4 | ||||
-rw-r--r-- | storage/maria/ha_maria.cc | 11 | ||||
-rw-r--r-- | storage/maria/ma_blockrec.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_commit.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_init.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_open.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_write.c | 17 | ||||
-rw-r--r-- | storage/maria/maria_def.h | 13 | ||||
-rw-r--r-- | unittest/mysys/waiting_threads-t.c | 4 |
65 files changed, 84 insertions, 30 deletions
diff --git a/configure.in b/configure.in index 7e3fbd1549e..b202c1b480a 100644 --- a/configure.in +++ b/configure.in @@ -2714,14 +2714,12 @@ if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no" then AC_DEFINE([THREAD], [1], [Define if you want to have threaded code. This may be undef on client code]) - # Avoid _PROGRAMS names - THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o waiting_threads.o" - AC_SUBST(THREAD_LOBJECTS) server_scripts="mysqld_safe mysql_install_db" sql_server_dirs="strings mysys dbug extra regex" sql_server="vio sql" fi +AM_CONDITIONAL(THREAD, test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no") # IMPORTANT - do not modify LIBS past this line - this hack is the only way # I know to add the static NSS magic if we have static NSS libraries with diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e816e0426f4..0845b7c0f5f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -135,7 +135,7 @@ our $default_vardir; our $opt_usage; our $opt_suites; -our $opt_suites_default= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run +our $opt_suites_default= "main,binlog,rpl,rpl_ndb,ndb,maria"; # Default suites to run our $opt_script_debug= 0; # Script debugging, enable with --script-debug our $opt_verbose= 0; # Verbose output, enable with --verbose diff --git a/mysql-test/r/maria-autozerofill.result b/mysql-test/suite/maria/r/maria-autozerofill.result index 0b069cd7a52..0b069cd7a52 100644 --- a/mysql-test/r/maria-autozerofill.result +++ b/mysql-test/suite/maria/r/maria-autozerofill.result diff --git a/mysql-test/r/maria-big.result b/mysql-test/suite/maria/r/maria-big.result index b45816367a5..b45816367a5 100644 --- a/mysql-test/r/maria-big.result +++ b/mysql-test/suite/maria/r/maria-big.result diff --git a/mysql-test/r/maria-big2.result b/mysql-test/suite/maria/r/maria-big2.result index 03b959642b4..03b959642b4 100644 --- a/mysql-test/r/maria-big2.result +++ b/mysql-test/suite/maria/r/maria-big2.result diff --git a/mysql-test/r/maria-connect.result b/mysql-test/suite/maria/r/maria-connect.result index 93beb1f13c5..93beb1f13c5 100644 --- a/mysql-test/r/maria-connect.result +++ b/mysql-test/suite/maria/r/maria-connect.result diff --git a/mysql-test/r/maria-gis-rtree-dynamic.result b/mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result index 189872e8e13..189872e8e13 100644 --- a/mysql-test/r/maria-gis-rtree-dynamic.result +++ b/mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result diff --git a/mysql-test/r/maria-gis-rtree-trans.result b/mysql-test/suite/maria/r/maria-gis-rtree-trans.result index 9e43daa9623..9e43daa9623 100644 --- a/mysql-test/r/maria-gis-rtree-trans.result +++ b/mysql-test/suite/maria/r/maria-gis-rtree-trans.result diff --git a/mysql-test/r/maria-gis-rtree.result b/mysql-test/suite/maria/r/maria-gis-rtree.result index 0c929fe1313..0c929fe1313 100644 --- a/mysql-test/r/maria-gis-rtree.result +++ b/mysql-test/suite/maria/r/maria-gis-rtree.result diff --git a/mysql-test/r/maria-mvcc.result b/mysql-test/suite/maria/r/maria-mvcc.result index 3919dfc597e..3919dfc597e 100644 --- a/mysql-test/r/maria-mvcc.result +++ b/mysql-test/suite/maria/r/maria-mvcc.result diff --git a/mysql-test/r/maria-no-logging.result b/mysql-test/suite/maria/r/maria-no-logging.result index e72842ae71b..e72842ae71b 100644 --- a/mysql-test/r/maria-no-logging.result +++ b/mysql-test/suite/maria/r/maria-no-logging.result diff --git a/mysql-test/r/maria-page-checksum.result b/mysql-test/suite/maria/r/maria-page-checksum.result index 0319bd9e9ca..0319bd9e9ca 100644 --- a/mysql-test/r/maria-page-checksum.result +++ b/mysql-test/suite/maria/r/maria-page-checksum.result diff --git a/mysql-test/r/maria-preload.result b/mysql-test/suite/maria/r/maria-preload.result index 7c41096217a..7c41096217a 100644 --- a/mysql-test/r/maria-preload.result +++ b/mysql-test/suite/maria/r/maria-preload.result diff --git a/mysql-test/r/maria-purge.result b/mysql-test/suite/maria/r/maria-purge.result index 14cf51948a8..14cf51948a8 100644 --- a/mysql-test/r/maria-purge.result +++ b/mysql-test/suite/maria/r/maria-purge.result diff --git a/mysql-test/r/maria-recover.result b/mysql-test/suite/maria/r/maria-recover.result index ecb6aa8bf5f..ecb6aa8bf5f 100644 --- a/mysql-test/r/maria-recover.result +++ b/mysql-test/suite/maria/r/maria-recover.result diff --git a/mysql-test/r/maria-recovery-big.result b/mysql-test/suite/maria/r/maria-recovery-big.result index ecbcba9ff82..ecbcba9ff82 100644 --- a/mysql-test/r/maria-recovery-big.result +++ b/mysql-test/suite/maria/r/maria-recovery-big.result diff --git a/mysql-test/r/maria-recovery-bitmap.result b/mysql-test/suite/maria/r/maria-recovery-bitmap.result index 01255c2394f..01255c2394f 100644 --- a/mysql-test/r/maria-recovery-bitmap.result +++ b/mysql-test/suite/maria/r/maria-recovery-bitmap.result diff --git a/mysql-test/r/maria-recovery-rtree-ft.result b/mysql-test/suite/maria/r/maria-recovery-rtree-ft.result index 474d63d5c93..474d63d5c93 100644 --- a/mysql-test/r/maria-recovery-rtree-ft.result +++ b/mysql-test/suite/maria/r/maria-recovery-rtree-ft.result diff --git a/mysql-test/r/maria-recovery.result b/mysql-test/suite/maria/r/maria-recovery.result index b0440489cd1..b0440489cd1 100644 --- a/mysql-test/r/maria-recovery.result +++ b/mysql-test/suite/maria/r/maria-recovery.result diff --git a/mysql-test/r/maria-recovery2.result b/mysql-test/suite/maria/r/maria-recovery2.result index 223b5578921..223b5578921 100644 --- a/mysql-test/r/maria-recovery2.result +++ b/mysql-test/suite/maria/r/maria-recovery2.result diff --git a/mysql-test/r/maria.result b/mysql-test/suite/maria/r/maria.result index d453f00fa21..82e73f67245 100644 --- a/mysql-test/r/maria.result +++ b/mysql-test/suite/maria/r/maria.result @@ -1922,12 +1922,10 @@ check table t2 extended; Table Op Msg_type Msg_text test.t2 check status OK drop table t2; -set session deadlock_timeout_long=60000000; create table t1 (a int unique) transactional=1; insert t1 values (1); lock table t1 write concurrent; insert t1 values (2); -set session deadlock_timeout_long=60000000; lock table t1 write concurrent; insert t1 values (3); insert t1 values (2); diff --git a/mysql-test/r/maria2.result b/mysql-test/suite/maria/r/maria2.result index eae5d7cf422..eae5d7cf422 100644 --- a/mysql-test/r/maria2.result +++ b/mysql-test/suite/maria/r/maria2.result diff --git a/mysql-test/r/maria3.result b/mysql-test/suite/maria/r/maria3.result index f7f6d969687..6a0342d7a4d 100644 --- a/mysql-test/r/maria3.result +++ b/mysql-test/suite/maria/r/maria3.result @@ -506,7 +506,7 @@ count(*) select count(*) from t1 where a >= 4; count(*) 1 -drop table t1; +drop table t1, t2; create table t1 (i int auto_increment not null primary key) transactional=0; check table t1 extended; Table Op Msg_type Msg_text @@ -540,3 +540,14 @@ TABLE_SCHEMA='test' and TABLE_NAME='t1'; CREATE_OPTIONS transactional=1 drop table t1; +create table t1 (a int, unique(a)) engine=maria transactional=1; +insert into t1 values(1); +insert into t1 values(2),(2); +ERROR 23000: Duplicate entry '2' for key 'a' +create table t2 (a int, unique(a)) engine=maria transactional=0 row_format=dynamic; +insert into t2 values(1); +insert into t2 values(2),(2); +ERROR 23000: Duplicate entry '2' for key 'a' +insert into t1 values(3); +insert into t2 values(3); +drop table t1, t2; diff --git a/mysql-test/r/maria_notembedded.result b/mysql-test/suite/maria/r/maria_notembedded.result index 77d06460a8b..77d06460a8b 100644 --- a/mysql-test/r/maria_notembedded.result +++ b/mysql-test/suite/maria/r/maria_notembedded.result diff --git a/mysql-test/r/ps_maria.result b/mysql-test/suite/maria/r/ps_maria.result index 24236f5ab37..24236f5ab37 100644 --- a/mysql-test/r/ps_maria.result +++ b/mysql-test/suite/maria/r/ps_maria.result diff --git a/mysql-test/t/maria-autozerofill.test b/mysql-test/suite/maria/t/maria-autozerofill.test index b3801679755..b3801679755 100644 --- a/mysql-test/t/maria-autozerofill.test +++ b/mysql-test/suite/maria/t/maria-autozerofill.test diff --git a/mysql-test/t/maria-big.test b/mysql-test/suite/maria/t/maria-big.test index aac26ec2e60..aac26ec2e60 100644 --- a/mysql-test/t/maria-big.test +++ b/mysql-test/suite/maria/t/maria-big.test diff --git a/mysql-test/t/maria-big2.test b/mysql-test/suite/maria/t/maria-big2.test index a06b6ea843b..a06b6ea843b 100644 --- a/mysql-test/t/maria-big2.test +++ b/mysql-test/suite/maria/t/maria-big2.test diff --git a/mysql-test/t/maria-connect.test b/mysql-test/suite/maria/t/maria-connect.test index 35a1518ca5a..35a1518ca5a 100644 --- a/mysql-test/t/maria-connect.test +++ b/mysql-test/suite/maria/t/maria-connect.test diff --git a/mysql-test/t/maria-gis-rtree-dynamic.test b/mysql-test/suite/maria/t/maria-gis-rtree-dynamic.test index 228998c01c3..228998c01c3 100644 --- a/mysql-test/t/maria-gis-rtree-dynamic.test +++ b/mysql-test/suite/maria/t/maria-gis-rtree-dynamic.test diff --git a/mysql-test/t/maria-gis-rtree-trans.test b/mysql-test/suite/maria/t/maria-gis-rtree-trans.test index f530699c755..f530699c755 100644 --- a/mysql-test/t/maria-gis-rtree-trans.test +++ b/mysql-test/suite/maria/t/maria-gis-rtree-trans.test diff --git a/mysql-test/t/maria-gis-rtree.test b/mysql-test/suite/maria/t/maria-gis-rtree.test index 7a3e5634388..7a3e5634388 100644 --- a/mysql-test/t/maria-gis-rtree.test +++ b/mysql-test/suite/maria/t/maria-gis-rtree.test diff --git a/mysql-test/t/maria-mvcc.test b/mysql-test/suite/maria/t/maria-mvcc.test index 4b6f8a3996d..4b6f8a3996d 100644 --- a/mysql-test/t/maria-mvcc.test +++ b/mysql-test/suite/maria/t/maria-mvcc.test diff --git a/mysql-test/t/maria-no-logging.test b/mysql-test/suite/maria/t/maria-no-logging.test index bca99848250..bca99848250 100644 --- a/mysql-test/t/maria-no-logging.test +++ b/mysql-test/suite/maria/t/maria-no-logging.test diff --git a/mysql-test/t/maria-page-checksum.test b/mysql-test/suite/maria/t/maria-page-checksum.test index e0a0a1517b1..e0a0a1517b1 100644 --- a/mysql-test/t/maria-page-checksum.test +++ b/mysql-test/suite/maria/t/maria-page-checksum.test diff --git a/mysql-test/t/maria-preload.test b/mysql-test/suite/maria/t/maria-preload.test index 49829a686e3..49829a686e3 100644 --- a/mysql-test/t/maria-preload.test +++ b/mysql-test/suite/maria/t/maria-preload.test diff --git a/mysql-test/t/maria-purge.test b/mysql-test/suite/maria/t/maria-purge.test index 1e588807895..1e588807895 100644 --- a/mysql-test/t/maria-purge.test +++ b/mysql-test/suite/maria/t/maria-purge.test diff --git a/mysql-test/t/maria-recover-master.opt b/mysql-test/suite/maria/t/maria-recover-master.opt index 0cdefeadf3d..0cdefeadf3d 100644 --- a/mysql-test/t/maria-recover-master.opt +++ b/mysql-test/suite/maria/t/maria-recover-master.opt diff --git a/mysql-test/t/maria-recover.test b/mysql-test/suite/maria/t/maria-recover.test index 63e764a3b0e..63e764a3b0e 100644 --- a/mysql-test/t/maria-recover.test +++ b/mysql-test/suite/maria/t/maria-recover.test diff --git a/mysql-test/t/maria-recovery-big-master.opt b/mysql-test/suite/maria/t/maria-recovery-big-master.opt index 425fda95086..425fda95086 100644 --- a/mysql-test/t/maria-recovery-big-master.opt +++ b/mysql-test/suite/maria/t/maria-recovery-big-master.opt diff --git a/mysql-test/t/maria-recovery-big.test b/mysql-test/suite/maria/t/maria-recovery-big.test index 9a5eeec56c5..9a5eeec56c5 100644 --- a/mysql-test/t/maria-recovery-big.test +++ b/mysql-test/suite/maria/t/maria-recovery-big.test diff --git a/mysql-test/t/maria-recovery-bitmap-master.opt b/mysql-test/suite/maria/t/maria-recovery-bitmap-master.opt index 425fda95086..425fda95086 100644 --- a/mysql-test/t/maria-recovery-bitmap-master.opt +++ b/mysql-test/suite/maria/t/maria-recovery-bitmap-master.opt diff --git a/mysql-test/t/maria-recovery-bitmap.test b/mysql-test/suite/maria/t/maria-recovery-bitmap.test index 286d44b4ff8..286d44b4ff8 100644 --- a/mysql-test/t/maria-recovery-bitmap.test +++ b/mysql-test/suite/maria/t/maria-recovery-bitmap.test diff --git a/mysql-test/t/maria-recovery-master.opt b/mysql-test/suite/maria/t/maria-recovery-master.opt index 9023fb74e8b..9023fb74e8b 100644 --- a/mysql-test/t/maria-recovery-master.opt +++ b/mysql-test/suite/maria/t/maria-recovery-master.opt diff --git a/mysql-test/t/maria-recovery-rtree-ft-master.opt b/mysql-test/suite/maria/t/maria-recovery-rtree-ft-master.opt index 425fda95086..425fda95086 100644 --- a/mysql-test/t/maria-recovery-rtree-ft-master.opt +++ b/mysql-test/suite/maria/t/maria-recovery-rtree-ft-master.opt diff --git a/mysql-test/t/maria-recovery-rtree-ft.test b/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test index 5416c2e4edf..5416c2e4edf 100644 --- a/mysql-test/t/maria-recovery-rtree-ft.test +++ b/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test diff --git a/mysql-test/t/maria-recovery.test b/mysql-test/suite/maria/t/maria-recovery.test index c3c9306f4d5..c3c9306f4d5 100644 --- a/mysql-test/t/maria-recovery.test +++ b/mysql-test/suite/maria/t/maria-recovery.test diff --git a/mysql-test/t/maria-recovery2-master.opt b/mysql-test/suite/maria/t/maria-recovery2-master.opt index 7fece2f8c1b..7fece2f8c1b 100644 --- a/mysql-test/t/maria-recovery2-master.opt +++ b/mysql-test/suite/maria/t/maria-recovery2-master.opt diff --git a/mysql-test/t/maria-recovery2.test b/mysql-test/suite/maria/t/maria-recovery2.test index 8ce601625f6..8ce601625f6 100644 --- a/mysql-test/t/maria-recovery2.test +++ b/mysql-test/suite/maria/t/maria-recovery2.test diff --git a/mysql-test/t/maria.test b/mysql-test/suite/maria/t/maria.test index d005103c6b6..cb39b3c4109 100644 --- a/mysql-test/t/maria.test +++ b/mysql-test/suite/maria/t/maria.test @@ -1204,13 +1204,11 @@ drop table t2; # # an example of a deadlock # -set session deadlock_timeout_long=60000000; create table t1 (a int unique) transactional=1; insert t1 values (1); lock table t1 write concurrent; insert t1 values (2); connect(con_d,localhost,root,,); -set session deadlock_timeout_long=60000000; lock table t1 write concurrent; insert t1 values (3); send insert t1 values (2); diff --git a/mysql-test/t/maria2.test b/mysql-test/suite/maria/t/maria2.test index 682e03890a4..682e03890a4 100644 --- a/mysql-test/t/maria2.test +++ b/mysql-test/suite/maria/t/maria2.test diff --git a/mysql-test/t/maria3.test b/mysql-test/suite/maria/t/maria3.test index 25b22ca5424..ddb6af8fa7a 100644 --- a/mysql-test/t/maria3.test +++ b/mysql-test/suite/maria/t/maria3.test @@ -406,7 +406,7 @@ insert into t2 select * from t1; insert into t1 select NULL from t2; select count(*) from t1; select count(*) from t1 where a >= 4; -drop table t1; +drop table t1, t2; # # Test problems with small rows and row_type=page @@ -461,6 +461,24 @@ select CREATE_OPTIONS from information_schema.TABLES where TABLE_SCHEMA='test' and TABLE_NAME='t1'; drop table t1; +# +# BUG#39697 - Maria: hang when failing to insert due to UNIQUE +# +create table t1 (a int, unique(a)) engine=maria transactional=1; +insert into t1 values(1); +--error 1062 +insert into t1 values(2),(2); +create table t2 (a int, unique(a)) engine=maria transactional=0 row_format=dynamic; +insert into t2 values(1); +--error 1062 +insert into t2 values(2),(2); +connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); +connection root; +insert into t1 values(3); +insert into t2 values(3); +connection default; +drop table t1, t2; + # End of 5.1 tests --disable_result_log diff --git a/mysql-test/t/maria_notembedded.test b/mysql-test/suite/maria/t/maria_notembedded.test index e6cff4179bb..e6cff4179bb 100644 --- a/mysql-test/t/maria_notembedded.test +++ b/mysql-test/suite/maria/t/maria_notembedded.test diff --git a/mysql-test/t/ps_maria.test b/mysql-test/suite/maria/t/ps_maria.test index d5a756c261e..d5a756c261e 100644 --- a/mysql-test/t/ps_maria.test +++ b/mysql-test/suite/maria/t/ps_maria.test diff --git a/mysys/Makefile.am b/mysys/Makefile.am index 093c6d3fb27..e5e7539ece6 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -57,11 +57,12 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ my_memmem.c stacktrace.c \ my_windac.c my_access.c base64.c my_libwrap.c \ wqueue.c -EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ - thr_mutex.c thr_rwlock.c waiting_threads.c \ - CMakeLists.txt mf_soundex.c \ +if THREAD +libmysys_a_SOURCES+= thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ + thr_mutex.c thr_rwlock.c waiting_threads.c +endif +EXTRA_DIST = CMakeLists.txt mf_soundex.c \ my_conio.c my_wincond.c my_winthread.c -libmysys_a_LIBADD = @THREAD_LOBJECTS@ # test_dir_DEPENDENCIES= $(LIBRARIES) # testhash_DEPENDENCIES= $(LIBRARIES) # test_charset_DEPENDENCIES= $(LIBRARIES) @@ -75,8 +76,6 @@ DEFS = -DDEFAULT_BASEDIR=\"$(prefix)\" \ -DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \ @DEFS@ -libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@ - # I hope this always does the right thing. Otherwise this is only test programs FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@ diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c index 4fae8e37ddb..7c3e3785b68 100644 --- a/mysys/lf_alloc-pin.c +++ b/mysys/lf_alloc-pin.c @@ -320,7 +320,7 @@ static int match_pins(LF_PINS *el, void *addr) #define available_stack_size(CUR,END) (long) ((char*)(END) - (char*)(CUR)) #endif -#define next_node(P, X) (*((uchar **)(((uchar *)(X)) + (P)->free_ptr_offset))) +#define next_node(P, X) (*((uchar * volatile *)(((uchar *)(X)) + (P)->free_ptr_offset))) #define anext_node(X) next_node(&allocator->pinbox, (X)) /* diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 43c9c2ee899..4df9842c4e5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5727,12 +5727,12 @@ struct my_option my_long_options[] = "Short timeout for the two-step deadlock detection (in microseconds)", (uchar**) &global_system_variables.wt_timeout_short, (uchar**) &max_system_variables.wt_timeout_short, - 0, GET_ULONG, REQUIRED_ARG, 100, 0, ULONG_MAX, 0, 0, 0}, + 0, GET_ULONG, REQUIRED_ARG, 10000, 0, ULONG_MAX, 0, 0, 0}, {"deadlock-timeout-long", OPT_DEADLOCK_TIMEOUT_LONG, "Long timeout for the two-step deadlock detection (in microseconds)", (uchar**) &global_system_variables.wt_timeout_long, (uchar**) &max_system_variables.wt_timeout_long, - 0, GET_ULONG, REQUIRED_ARG, 10000, 0, ULONG_MAX, 0, 0, 0}, + 0, GET_ULONG, REQUIRED_ARG, 50000000, 0, ULONG_MAX, 0, 0, 0}, #ifndef DBUG_OFF {"debug", '#', "Debug log.", (uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 64e5746cc4c..991989dfd5e 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -2223,7 +2223,8 @@ int ha_maria::extra(enum ha_extra_function operation) operation == HA_EXTRA_PREPARE_FOR_RENAME)) { THD *thd= table->in_use; - file->trn= THD_TRN; + TRN *trn= THD_TRN; + _ma_set_trn_for_table(file, trn); } return maria_extra(file, operation, 0); } @@ -2296,7 +2297,7 @@ int ha_maria::external_lock(THD *thd, int lock_type) if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) trans_register_ha(thd, TRUE, maria_hton); } - file->trn= trn; + _ma_set_trn_for_table(file, trn); if (!trnman_increment_locked_tables(trn)) { trans_register_ha(thd, FALSE, maria_hton); @@ -2352,7 +2353,7 @@ int ha_maria::external_lock(THD *thd, int lock_type) if (_ma_reenable_logging_for_table(file, TRUE)) DBUG_RETURN(1); /** @todo zero file->trn also in commit and rollback */ - file->trn= 0; // Safety + _ma_set_trn_for_table(file, NULL); // Safety /* Ensure that file->state points to the current number of rows. This is needed if someone calls maria_info() without first doing an @@ -2409,7 +2410,7 @@ int ha_maria::start_stmt(THD *thd, thr_lock_type lock_type) different ha_maria than 'this' then this->file->trn is a stale pointer. We fix it: */ - file->trn= trn; + _ma_set_trn_for_table(file, trn); /* As external_lock() was already called, don't increment locked_tables. Note that we call the function below possibly several times when @@ -2501,7 +2502,7 @@ int ha_maria::implicit_commit(THD *thd, bool new_trn) MARIA_HA *handler= ((ha_maria*) table->file)->file; if (handler->s->base.born_transactional) { - handler->trn= trn; + _ma_set_trn_for_table(handler, trn); if (handler->s->lock.get_status) { if (_ma_setup_live_state(handler)) diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index a1e3fabfcca..95697a4afce 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -7081,7 +7081,7 @@ void maria_ignore_trids(MARIA_HA *info) if (info->s->base.born_transactional) { if (!info->trn) - info->trn= &dummy_transaction_object; + _ma_set_trn_for_table(info, &dummy_transaction_object); /* Ignore transaction id when row is read */ info->trn->min_read_from= ~(TrID) 0; } diff --git a/storage/maria/ma_commit.c b/storage/maria/ma_commit.c index a4c50d9f8d6..1066eb15e11 100644 --- a/storage/maria/ma_commit.c +++ b/storage/maria/ma_commit.c @@ -111,7 +111,7 @@ int maria_begin(MARIA_HA *info) DBUG_RETURN(HA_ERR_OUT_OF_MEM); DBUG_PRINT("info", ("TRN set to 0x%lx", (ulong) trn)); - info->trn= trn; + _ma_set_trn_for_table(info, trn); } DBUG_RETURN(0); } diff --git a/storage/maria/ma_init.c b/storage/maria/ma_init.c index f657289ac76..1f2eddd7e30 100644 --- a/storage/maria/ma_init.c +++ b/storage/maria/ma_init.c @@ -68,6 +68,8 @@ int maria_init(void) } hash_init(&maria_stored_state, &my_charset_bin, 32, 0, sizeof(LSN), 0, (hash_free_key) history_state_free, 0); + DBUG_PRINT("info",("dummy_transaction_object: %p", + &dummy_transaction_object)); return 0; } diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index d1cbeb1310c..c8321b91a20 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -178,7 +178,8 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, int mode, if (!share->base.born_transactional) /* For transactional ones ... */ { - info.trn= &dummy_transaction_object; /* ... force crash if no trn given */ + /* ... force crash if no trn given */ + _ma_set_trn_for_table(&info, &dummy_transaction_object); info.state= &share->state.state; /* Change global values by default */ } else diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c index 4d4fccb8f39..16cbc5f74ec 100644 --- a/storage/maria/ma_write.c +++ b/storage/maria/ma_write.c @@ -194,8 +194,23 @@ int maria_write(MARIA_HA *info, uchar *record) Also, filter out non-thread maria use, and table modified in the same transaction. */ - if (!local_lock_tree || info->dup_key_trid == info->trn->trid) + if (!local_lock_tree) goto err; + if (info->dup_key_trid == info->trn->trid) + { + rw_unlock(&keyinfo->root_lock); + goto err; + } + /* Different TrIDs: table must be transactional */ + DBUG_ASSERT(share->base.born_transactional); + /* + If transactions are disabled, and dup_key_trid is different from + our TrID, it must be ALTER TABLE with dup_key_trid==0 (no + transaction). ALTER TABLE does have MARIA_HA::TRN not dummy but + puts TrID=0 in rows/keys. + */ + DBUG_ASSERT(share->now_transactional || + (info->dup_key_trid == 0)); blocker= trnman_trid_to_trn(info->trn, info->dup_key_trid); /* if blocker TRN was not found, it means that the conflicting diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index 42a78261d20..0ab7c86b594 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -698,6 +698,19 @@ struct st_maria_handler #define get_pack_length(length) ((length) >= 255 ? 3 : 1) #define _ma_have_versioning(info) ((info)->row_flag & ROW_FLAG_TRANSID) +/** + Sets table's trn and prints debug information + @param tbl MARIA_HA of table + @param newtrn what to put into tbl->trn + @note cast of newtrn is because %p of NULL gives warning (NULL is int) +*/ +#define _ma_set_trn_for_table(tbl, newtrn) do { \ + DBUG_PRINT("info",("table: %p trn: %p -> %p", \ + (tbl), (tbl)->trn, (void *)(newtrn))); \ + (tbl)->trn= (newtrn); \ + } while (0) + + #define MARIA_MIN_BLOCK_LENGTH 20 /* Because of delete-link */ /* Don't use to small record-blocks */ #define MARIA_EXTEND_BLOCK_LENGTH 20 diff --git a/unittest/mysys/waiting_threads-t.c b/unittest/mysys/waiting_threads-t.c index 39a8e800db0..dc3cf7d6265 100644 --- a/unittest/mysys/waiting_threads-t.c +++ b/unittest/mysys/waiting_threads-t.c @@ -54,7 +54,7 @@ pthread_handler_t test_wt(void *arg) my_rnd_init(&rand, (ulong)(intptr)&m, id); if (kill_strategy == YOUNGEST) - thds[id].thd.weight= ~my_getsystime(); + thds[id].thd.weight= (ulong volatile)~my_getsystime(); if (kill_strategy == LOCKS) thds[id].thd.weight= 0; @@ -104,7 +104,7 @@ retry: if (kill_strategy == LOCKS) thds[id].thd.weight= 0; if (kill_strategy == YOUNGEST) - thds[id].thd.weight= ~my_getsystime(); + thds[id].thd.weight= (ulong volatile)~my_getsystime(); } else if (kill_strategy == LOCKS) thds[id].thd.weight++; |