developers
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 6871 discussions

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2792)
by Michael Widenius 09 Jan '10
by Michael Widenius 09 Jan '10
09 Jan '10
#At lp:maria based on revid:monty@askmonty.org-20100109090905-oviprnl7ehqn45fq
2792 Michael Widenius 2010-01-09 [merge]
Automatic merge
added:
BUILD/compile-bintar
BUILD/util.sh
modified:
BUILD/Makefile.am
BUILD/SETUP.sh
BUILD/compile-solaris-amd64-debug-forte*
BUILD/compile-solaris-x86-32*
BUILD/compile-solaris-x86-32-debug*
BUILD/compile-solaris-x86-32-debug-forte*
BUILD/compile-solaris-x86-forte-32*
extra/libevent/evbuffer.c
extra/libevent/select.c
mysql-test/mysql-test-run.pl
mysql-test/suite/pbxt/r/lock_multi.result
mysql-test/suite/pbxt/t/lock_multi.test
mysys/my_sync.c
sql/ha_ndbcluster.cc
storage/archive/azlib.h
storage/maria/ma_blockrec.c
storage/maria/ma_loghandler.c
storage/maria/ma_test3.c
storage/myisam/mi_test3.c
storage/pbxt/src/ha_pbxt.cc
storage/pbxt/src/restart_xt.cc
storage/pbxt/src/thread_xt.cc
storage/pbxt/src/thread_xt.h
storage/xtradb/srv/srv0srv.c
support-files/compiler_warnings.supp
=== modified file 'BUILD/Makefile.am'
--- a/BUILD/Makefile.am 2009-08-29 19:04:46 +0000
+++ b/BUILD/Makefile.am 2010-01-07 13:03:54 +0000
@@ -34,6 +34,7 @@ EXTRA_DIST = FINISH.sh \
compile-amd64-max \
compile-amd64-max-sci \
compile-amd64-valgrind-max \
+ compile-bintar \
compile-darwin-mwcc \
compile-dist \
compile-hpux11-parisc2-aCC \
@@ -80,7 +81,8 @@ EXTRA_DIST = FINISH.sh \
compile-solaris-x86-32 \
compile-solaris-x86-32-debug \
compile-solaris-x86-32-debug-forte \
- compile-solaris-x86-forte-32
+ compile-solaris-x86-forte-32 \
+ util.sh
# Don't update the files from bitkeeper
%::SCCS/s.%
=== modified file 'BUILD/SETUP.sh'
--- a/BUILD/SETUP.sh 2009-12-06 17:34:54 +0000
+++ b/BUILD/SETUP.sh 2010-01-07 12:02:18 +0000
@@ -86,15 +86,9 @@ set -e
#
path=`dirname $0`
. "$path/check-cpu"
+. "$path/util.sh"
-export AM_MAKEFLAGS
-# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
-# (So buildbots can easily disable this behaviour if required.)
-if test -z "$AM_MAKEFLAGS"
-then
- AM_MAKEFLAGS="-j 6"
-fi
-
+get_make_parallel_flag
# SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. To use openSSl you will nee too point out
=== added file 'BUILD/compile-bintar'
--- a/BUILD/compile-bintar 1970-01-01 00:00:00 +0000
+++ b/BUILD/compile-bintar 2010-01-07 12:02:18 +0000
@@ -0,0 +1,81 @@
+#!/bin/bash
+#
+# MariaDB SQL server.
+# Copyright (C) 2010 Kristian Nielsen and Monty Program AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+# This script's purpose is to build the binary tarball packages for MariaDB
+# (currently only on Linux systems).
+#
+# Thus BUILD/compile-bintar from the appropriate source tarball will reproduce
+# such a release, provided the build environment (gcc version etc.) matches
+# (use scripts/make_binary_distribution after running this script to actually
+# create the binary tarball package).
+#
+# Note that packages are built from source tarballs not bzr checkouts.
+# Therefore, this script assumes autotools have already been run.
+#
+# We link libc dynamically, otherwise we get lots of problems loading
+# .so files at runtime (either system stuff like NSS, or server
+# plugins).
+#
+# We link libgcc statically (and avoid linking libstdc++ at all by
+# CXX=gcc), to avoid reduce nasty library version dependencies.
+
+test -f Makefile && make distclean
+
+path=`dirname $0`
+. $path/util.sh
+
+SYSTEM_TYPE="$(uname -o)"
+MACHINE_TYPE="$(uname -m)"
+
+# We cannot have a slash '/' in tarfile name.
+SYSTEM_TYPE="$(echo ${SYSTEM_TYPE} | sed -e 's/GNU\///')"
+
+# Get correct options for architecture into CPUOPT.
+get_cpuopt
+# Get correct -j option into AM_MAKEFLAGS
+get_make_parallel_flag
+
+# Use gcc rather than g++ to avoid linking libstdc++.so (which we don't need).
+COMP="gcc -static-libgcc"
+FLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall $CPUOPT"
+
+# Don't press on in case of error.
+set -e
+
+CC="$COMP" CXX="$COMP" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
+ ./configure \
+ --prefix=/usr/local/mysql \
+ --exec-prefix=/usr/local/mysql \
+ --libexecdir=/usr/local/mysql/bin \
+ --localstatedir=/usr/local/mysql/data \
+ \
+ --with-comment="(MariaDB - http://mariadb.com/)" \
+ --with-system-type="${SYSTEM_TYPE}" \
+ --with-machine-type="${MACHINE_TYPE}" \
+ \
+ --enable-shared --enable-static \
+ --with-client-ldflags=-static --with-mysqld-ldflags=-static \
+ --enable-thread-safe-client --enable-local-infile --with-big-tables \
+ --without-docs --with-extra-charsets=all \
+ --with-libwrap --with-ssl --with-readline --with-libevent --with-zlib-dir=bundled \
+ --with-partition --with-embedded-server \
+ --with-plugins=max-no-ndb \
+ --without-plugin-innodb_plugin
+
+make $AM_MAKEFLAGS
=== modified file 'BUILD/compile-solaris-amd64-debug-forte' (properties changed: -x to +x)
=== modified file 'BUILD/compile-solaris-x86-32' (properties changed: -x to +x)
=== modified file 'BUILD/compile-solaris-x86-32-debug' (properties changed: -x to +x)
=== modified file 'BUILD/compile-solaris-x86-32-debug-forte' (properties changed: -x to +x)
=== modified file 'BUILD/compile-solaris-x86-forte-32' (properties changed: -x to +x)
=== added file 'BUILD/util.sh'
--- a/BUILD/util.sh 1970-01-01 00:00:00 +0000
+++ b/BUILD/util.sh 2010-01-07 12:02:18 +0000
@@ -0,0 +1,40 @@
+# MariaDB SQL server.
+# Copyright (C) 2010 Kristian Nielsen and Monty Program AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Setting cpu options.
+get_cpuopt () {
+ case "$(gcc -dumpmachine)" in
+ x86_64-*)
+ # gcc barfs on -march=... on x64
+ CPUOPT="-m64 -mtune=generic"
+ ;;
+ *)
+ # we'd use i586 to not trip up mobile/lowpower devices
+ CPUOPT="-m32 -march=i586 -mtune=generic"
+ ;;
+ esac
+ return 0
+}
+
+# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
+# (So buildbots can easily disable this behaviour if required.)
+get_make_parallel_flag () {
+ if test -z "$AM_MAKEFLAGS"
+ then
+ AM_MAKEFLAGS="-j 6"
+ fi
+ return 0
+}
=== modified file 'extra/libevent/evbuffer.c'
--- a/extra/libevent/evbuffer.c 2009-03-12 22:27:35 +0000
+++ b/extra/libevent/evbuffer.c 2010-01-07 13:00:06 +0000
@@ -25,12 +25,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <sys/types.h>
+
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
=== modified file 'extra/libevent/select.c'
--- a/extra/libevent/select.c 2009-03-12 22:27:35 +0000
+++ b/extra/libevent/select.c 2010-01-06 21:27:53 +0000
@@ -266,7 +266,7 @@ select_add(void *arg, struct event *ev)
* of the fd_sets for select(2)
*/
if (sop->event_fds < ev->ev_fd) {
- int fdsz = sop->event_fdsz;
+ unsigned int fdsz = sop->event_fdsz;
if (fdsz < sizeof(fd_mask))
fdsz = sizeof(fd_mask);
@@ -275,7 +275,7 @@ select_add(void *arg, struct event *ev)
(howmany(ev->ev_fd + 1, NFDBITS) * sizeof(fd_mask)))
fdsz *= 2;
- if (fdsz != sop->event_fdsz) {
+ if (fdsz != (unsigned int) sop->event_fdsz) {
if (select_resize(sop, fdsz)) {
check_selectop(sop);
return (-1);
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2010-01-05 14:28:34 +0000
+++ b/mysql-test/mysql-test-run.pl 2010-01-06 21:27:53 +0000
@@ -4010,6 +4010,7 @@ sub extract_warning_lines ($) {
qr/Slave I\/O: error reconnecting to master '.*' - retry-time: [1-3] retries/,
qr/Error reading packet/,
qr/Slave: Can't drop database.* database doesn't exist/,
+ qr/Slave: Operation DROP USER failed for 'create_rout_db'/,
);
my $matched_lines= [];
=== modified file 'mysql-test/suite/pbxt/r/lock_multi.result'
--- a/mysql-test/suite/pbxt/r/lock_multi.result 2009-04-02 10:03:14 +0000
+++ b/mysql-test/suite/pbxt/r/lock_multi.result 2010-01-06 21:27:53 +0000
@@ -1,22 +1,4 @@
drop table if exists t1,t2;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 write;
-update low_priority t1 set n = 4;
-select n from t1;
-unlock tables;
-n
-1
-drop table t1;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 read;
-update low_priority t1 set n = 4;
-select n from t1;
-unlock tables;
-n
-1
-drop table t1;
create table t1 (a int, b int);
create table t2 (c int, d int);
insert into t1 values(1,1);
@@ -43,6 +25,7 @@ insert t1 select * from t2;
drop table t2;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
+End of 4.1 tests
create table t1(a int);
lock tables t1 write;
show columns from t1;
@@ -50,10 +33,10 @@ Field Type Null Key Default Extra
a int(11) YES NULL
unlock tables;
drop table t1;
-use mysql;
+USE mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES;
-use mysql;
+USE mysql;
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
OPTIMIZE TABLES columns_priv, db, host, user;
Table Op Msg_type Msg_text
@@ -63,7 +46,8 @@ mysql.host optimize status OK
mysql.user optimize status OK
UNLOCK TABLES;
Select_priv
-use test;
+N
+USE test;
use test;
CREATE TABLE t1 (c1 int);
LOCK TABLE t1 WRITE;
@@ -90,7 +74,115 @@ DROP DATABASE mysqltest_1;
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
lock tables t1 write;
-alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+alter table t1 auto_increment=0;
+alter table t1 auto_increment=0;
+unlock tables;
+drop table t1;
+create table t1 (a int);
+create table t2 like t1;
+# con1
+lock tables t1 write;
+# con2
+flush tables with read lock;
+# con5
+# global read lock is taken
+# con3
+select * from t2 for update;
+# waiting for release of read lock
+# con4
+# would hang and later cause a deadlock
+flush tables t2;
+# clean up
+unlock tables;
+unlock tables;
+a
+drop table t1,t2;
+#
+# Lightweight version:
+# Ensure that the wait for a GRL is done before opening tables.
+#
+create table t1 (a int);
+create table t2 like t1;
+#
+# UPDATE
+#
+# default
+flush tables with read lock;
+# con1
+update t2 set a = 1;
+# default
+# statement is waiting for release of read lock
+# con2
+flush table t2;
+# default
+unlock tables;
+# con1
+#
+# LOCK TABLES .. WRITE
+#
+# default
+flush tables with read lock;
+# con1
+lock tables t2 write;
+# default
+# statement is waiting for release of read lock
+# con2
+flush table t2;
+# default
+unlock tables;
+# con1
+unlock tables;
+drop table t1,t2;
+End of 5.0 tests
+create table t1 (i int);
+lock table t1 read;
+update t1 set i= 10;
+select * from t1;
+Timeout in wait_condition.inc for select count(*) = 1 from information_schema.processlist
+where state = "Locked" and info = "select * from t1"
+kill query ID;
+i
+ERROR 70100: Query execution was interrupted
+unlock tables;
+drop table t1;
+drop table if exists t1;
+create table t1 (i int);
+connection: default
+lock tables t1 write;
+connection: flush
+flush tables with read lock;;
+connection: default
+alter table t1 add column j int;
+connection: insert
+insert into t1 values (1,2);;
+connection: default
+unlock tables;
+connection: flush
+select * from t1;
+i j
+unlock tables;
+select * from t1;
+i j
+1 2
+drop table t1;
+drop table if exists t1;
+create table t1 (i int);
+connection: default
+lock tables t1 write;
+connection: flush
+flush tables with read lock;;
+connection: default
+flush tables;
+unlock tables;
+drop table t1;
+drop table if exists t1,t2;
+create table t1 (a int);
+flush status;
+lock tables t1 read;
+insert into t1 values(1);;
unlock tables;
drop table t1;
+select @tlwa < @tlwb;
+@tlwa < @tlwb
+1
+End of 5.1 tests
=== modified file 'mysql-test/suite/pbxt/t/lock_multi.test'
--- a/mysql-test/suite/pbxt/t/lock_multi.test 2009-04-02 10:03:14 +0000
+++ b/mysql-test/suite/pbxt/t/lock_multi.test 2010-01-06 21:27:53 +0000
@@ -1,4 +1,8 @@
-- source include/not_embedded.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
@@ -9,42 +13,6 @@ connect (locker,localhost,root,,);
connect (reader,localhost,root,,);
connect (writer,localhost,root,,);
-connection locker;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 write;
-connection writer;
-send update low_priority t1 set n = 4;
-connection reader;
---sleep 2
-send select n from t1;
-connection locker;
---sleep 2
-unlock tables;
-connection writer;
-reap;
-connection reader;
-reap;
-drop table t1;
-
-connection locker;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 read;
-connection writer;
-send update low_priority t1 set n = 4;
-connection reader;
---sleep 2
-send select n from t1;
-connection locker;
---sleep 2
-unlock tables;
-connection writer;
-reap;
-connection reader;
-reap;
-drop table t1;
-
#
# Test problem when using locks with multi-updates
# It should not block when multi-update is reading on a read-locked table
@@ -58,32 +26,33 @@ insert into t1 values(2,2);
insert into t2 values(1,2);
lock table t1 read;
connection writer;
---sleep 2
-send update t1,t2 set c=a where b=d;
+update t1,t2 set c=a where b=d;
connection reader;
---sleep 2
select c from t2;
-connection writer;
-reap;
connection locker;
drop table t1;
drop table t2;
#
-# Test problem when using locks on many tables and droping a table that
+# Test problem when using locks on many tables and dropping a table that
# is to-be-locked by another thread
#
-
+#
connection locker;
create table t1 (a int);
create table t2 (a int);
lock table t1 write, t2 write;
connection reader;
-send insert t1 select * from t2;
+send
+insert t1 select * from t2;
connection locker;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert t1 select * from t2";
+--source include/wait_condition.inc
drop table t2;
connection reader;
---error 1146
+--error ER_NO_SUCH_TABLE
reap;
connection locker;
drop table t1;
@@ -97,20 +66,26 @@ create table t1 (a int);
create table t2 (a int);
lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
connection reader;
-send insert t1 select * from t2;
+send
+insert t1 select * from t2;
connection locker;
+# Sleep a bit till the insert of connection reader is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert t1 select * from t2";
+--source include/wait_condition.inc
drop table t2;
connection reader;
---error 1146
+--error ER_NO_SUCH_TABLE
reap;
connection locker;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
#
-# BUG#9998 - MySQL client hangs on USE "database"
+# Bug#9998 MySQL client hangs on USE "database"
#
create table t1(a int);
lock tables t1 write;
@@ -121,21 +96,30 @@ unlock tables;
drop table t1;
#
-# Bug#16986 - Deadlock condition with MyISAM tables
+# Bug#16986 Deadlock condition with MyISAM tables
#
+
+# Need a matching user in mysql.user for multi-table select
+--source include/add_anonymous_users.inc
+
connection locker;
-use mysql;
+USE mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES;
---sleep 1
#
connection reader;
-use mysql;
-#NOTE: This must be a multi-table select, otherwise the deadlock will not occur
-send SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
---sleep 1
+USE mysql;
+# Note: This must be a multi-table select, otherwise the deadlock will not occur
+send
+SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
#
connection locker;
+# Sleep a bit till the select of connection reader is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table" and info =
+ "SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1";
+--source include/wait_condition.inc
# Make test case independent from earlier grants.
--replace_result "Table is already up to date" "OK"
OPTIMIZE TABLES columns_priv, db, host, user;
@@ -143,7 +127,7 @@ UNLOCK TABLES;
#
connection reader;
reap;
-use test;
+USE test;
#
connection locker;
use test;
@@ -158,11 +142,16 @@ LOCK TABLE t1 WRITE;
#
# This waits until t1 is unlocked.
connection locker;
-send FLUSH TABLES WITH READ LOCK;
---sleep 1
+send
+FLUSH TABLES WITH READ LOCK;
#
-# This must not block.
connection writer;
+# Sleep a bit till the flush of connection locker is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables" and info = "FLUSH TABLES WITH READ LOCK";
+--source include/wait_condition.inc
+# This must not block.
CREATE TABLE t2 (c1 int);
UNLOCK TABLES;
#
@@ -182,12 +171,17 @@ LOCK TABLE t1 WRITE;
#
# This waits until t1 is unlocked.
connection locker;
-send FLUSH TABLES WITH READ LOCK;
---sleep 1
+send
+FLUSH TABLES WITH READ LOCK;
#
# This must not block.
connection writer;
---error 1100
+# Sleep a bit till the flush of connection locker is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables" and info = "FLUSH TABLES WITH READ LOCK";
+--source include/wait_condition.inc
+--error ER_TABLE_NOT_LOCKED
CREATE TABLE t2 AS SELECT * FROM t1;
UNLOCK TABLES;
#
@@ -199,8 +193,10 @@ UNLOCK TABLES;
connection default;
DROP TABLE t1;
+--source include/delete_anonymous_users.inc
+
#
-# Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
+# Bug#19815 CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
#
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
@@ -212,12 +208,18 @@ FLUSH TABLES WITH READ LOCK;
# With bug in place: acquire LOCK_mysql_create_table and
# wait in wait_if_global_read_lock().
connection con2;
-send DROP DATABASE mysqltest_1;
---sleep 1
+send
+DROP DATABASE mysqltest_1;
#
# With bug in place: try to acquire LOCK_mysql_create_table...
# When fixed: Reject dropping db because of the read lock.
connection con1;
+# Wait a bit so that the session con2 is in state "Waiting for release of readlock"
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock"
+ and info = "DROP DATABASE mysqltest_1";
+--source include/wait_condition.inc
--error ER_CANT_UPDATE_WITH_READLOCK
DROP DATABASE mysqltest_1;
UNLOCK TABLES;
@@ -234,7 +236,7 @@ disconnect con2;
DROP DATABASE mysqltest_1;
#
-# Bug #17264: MySQL Server freeze
+# Bug#17264 MySQL Server freeze
#
connection locker;
# Disable warnings to allow test to run also without InnoDB
@@ -243,17 +245,22 @@ create table t1 (f1 int(12) unsigned not
--enable_warnings
lock tables t1 write;
connection writer;
---sleep 2
-delimiter //;
-send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-delimiter ;//
-connection reader;
---sleep 2
-delimiter //;
-send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-delimiter ;//
-connection locker;
---sleep 2
+send
+alter table t1 auto_increment=0;
+connection reader;
+# Wait till connection writer is blocked
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "alter table t1 auto_increment=0";
+--source include/wait_condition.inc
+send
+alter table t1 auto_increment=0;
+connection locker;
+# Wait till connection reader is blocked
+let $wait_condition=
+ select count(*) = 2 from information_schema.processlist
+ where state = "Locked" and info = "alter table t1 auto_increment=0";
+--source include/wait_condition.inc
unlock tables;
connection writer;
reap;
@@ -262,8 +269,310 @@ reap;
connection locker;
drop table t1;
+#
+# Bug#43230: SELECT ... FOR UPDATE can hang with FLUSH TABLES WITH READ LOCK indefinitely
+#
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connect (con3,localhost,root,,);
+connect (con4,localhost,root,,);
+connect (con5,localhost,root,,);
+
+create table t1 (a int);
+create table t2 like t1;
+
+connection con1;
+--echo # con1
+lock tables t1 write;
+connection con2;
+--echo # con2
+send flush tables with read lock;
+connection con5;
+--echo # con5
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Flushing tables';
+--source include/wait_show_condition.inc
+--echo # global read lock is taken
+connection con3;
+--echo # con3
+send select * from t2 for update;
+connection con5;
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Waiting for release of readlock';
+--source include/wait_show_condition.inc
+--echo # waiting for release of read lock
+connection con4;
+--echo # con4
+--echo # would hang and later cause a deadlock
+flush tables t2;
+connection con1;
+--echo # clean up
+unlock tables;
+connection con2;
+--reap
+unlock tables;
+connection con3;
+--reap
+connection default;
+disconnect con5;
+disconnect con4;
+disconnect con3;
+disconnect con2;
+disconnect con1;
+
+drop table t1,t2;
+
+--echo #
+--echo # Lightweight version:
+--echo # Ensure that the wait for a GRL is done before opening tables.
+--echo #
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+create table t1 (a int);
+create table t2 like t1;
+
+--echo #
+--echo # UPDATE
+--echo #
+
+connection default;
+--echo # default
+flush tables with read lock;
+connection con1;
+--echo # con1
+send update t2 set a = 1;
+connection default;
+--echo # default
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Waiting for release of readlock';
+--source include/wait_show_condition.inc
+--echo # statement is waiting for release of read lock
+connection con2;
+--echo # con2
+flush table t2;
+connection default;
+--echo # default
+unlock tables;
+connection con1;
+--echo # con1
+--reap
+
+--echo #
+--echo # LOCK TABLES .. WRITE
+--echo #
+
+connection default;
+--echo # default
+flush tables with read lock;
+connection con1;
+--echo # con1
+send lock tables t2 write;
+connection default;
+--echo # default
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Waiting for release of readlock';
+--source include/wait_show_condition.inc
+--echo # statement is waiting for release of read lock
+connection con2;
+--echo # con2
+flush table t2;
+connection default;
+--echo # default
+unlock tables;
+connection con1;
+--echo # con1
+--reap
+unlock tables;
+
+connection default;
+disconnect con2;
+disconnect con1;
+
+drop table t1,t2;
+
+
+--echo End of 5.0 tests
+
+
+#
+# Bug#21281 Pending write lock is incorrectly removed when its
+# statement being KILLed
+#
+create table t1 (i int);
+connection locker;
+lock table t1 read;
+connection writer;
+send
+update t1 set i= 10;
+connection reader;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "update t1 set i= 10";
+--source include/wait_condition.inc
+send
+select * from t1;
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "select * from t1";
+--source include/wait_condition.inc
+let $ID= `select id from information_schema.processlist where state = "Locked" and info = "update t1 set i= 10"`;
+--replace_result $ID ID
+eval kill query $ID;
+connection reader;
+--reap
+connection writer;
+--error ER_QUERY_INTERRUPTED
+--reap
+connection locker;
+unlock tables;
+connection default;
+drop table t1;
+
+# Disconnect sessions used in many subtests above
+disconnect locker;
+disconnect reader;
+disconnect writer;
+
+#
+# Bug#32395 Alter table under a impending global read lock causes a server crash
+#
+
+#
+# Test ALTER TABLE under LOCK TABLES and FLUSH TABLES WITH READ LOCK
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (i int);
+connect (flush,localhost,root,,test,,);
+connection default;
+--echo connection: default
+lock tables t1 write;
+connection flush;
+--echo connection: flush
+--send flush tables with read lock;
+connection default;
+--echo connection: default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+alter table t1 add column j int;
+connect (insert,localhost,root,,test,,);
+connection insert;
+--echo connection: insert
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+--send insert into t1 values (1,2);
+--echo connection: default
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock";
+--source include/wait_condition.inc
+unlock tables;
+connection flush;
+--echo connection: flush
+--reap
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock";
+--source include/wait_condition.inc
+select * from t1;
+unlock tables;
+connection insert;
+--reap
+connection default;
+let $wait_condition=
+ select count(*) = 1 from t1;
+--source include/wait_condition.inc
+select * from t1;
+drop table t1;
+disconnect flush;
+disconnect insert;
+
+#
+# Test that FLUSH TABLES under LOCK TABLES protects write locked tables
+# from a impending FLUSH TABLES WITH READ LOCK
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (i int);
+connect (flush,localhost,root,,test,,);
+connection default;
+--echo connection: default
+lock tables t1 write;
+connection flush;
+--echo connection: flush
+--send flush tables with read lock;
+connection default;
+--echo connection: default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+flush tables;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+unlock tables;
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+connection flush;
+--reap
+connection default;
+disconnect flush;
+drop table t1;
+
+#
+# Bug#30331 Table_locks_waited shows inaccurate values
+#
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+create table t1 (a int);
+flush status;
+lock tables t1 read;
+let $tlwa= `show status like 'Table_locks_waited'`;
+connect (waiter,localhost,root,,);
+connection waiter;
+--send insert into t1 values(1);
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert into t1 values(1)";
+--source include/wait_condition.inc
+let $tlwb= `show status like 'Table_locks_waited'`;
+unlock tables;
+drop table t1;
+disconnect waiter;
+connection default;
--disable_query_log
+eval SET @tlwa= SUBSTRING_INDEX('$tlwa', ' ', -1);
+eval SET @tlwb= SUBSTRING_INDEX('$tlwb', ' ', -1);
drop database pbxt;
--enable_query_log
-# End of 5.0 tests
+select @tlwa < @tlwb;
+
+--echo End of 5.1 tests
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
=== modified file 'mysys/my_sync.c'
--- a/mysys/my_sync.c 2008-04-28 16:24:05 +0000
+++ b/mysys/my_sync.c 2010-01-06 21:27:53 +0000
@@ -100,7 +100,8 @@ static const char cur_dir_name[]= {FN_CU
RETURN
0 if ok, !=0 if error
*/
-int my_sync_dir(const char *dir_name, myf my_flags)
+int my_sync_dir(const char *dir_name __attribute__((unused)),
+ myf my_flags __attribute__((unused)))
{
#ifdef NEED_EXPLICIT_SYNC_DIR
DBUG_ENTER("my_sync_dir");
@@ -141,7 +142,8 @@ int my_sync_dir(const char *dir_name, my
RETURN
0 if ok, !=0 if error
*/
-int my_sync_dir_by_file(const char *file_name, myf my_flags)
+int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
+ myf my_flags __attribute__((unused)))
{
#ifdef NEED_EXPLICIT_SYNC_DIR
char dir_name[FN_REFLEN];
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2009-12-03 11:19:05 +0000
+++ b/sql/ha_ndbcluster.cc 2010-01-06 21:27:53 +0000
@@ -10565,4 +10565,6 @@ mysql_declare_plugin(ndbcluster)
}
mysql_declare_plugin_end;
+#else
+int Sun_ar_require_a_symbol_here= 0;
#endif
=== modified file 'storage/archive/azlib.h'
--- a/storage/archive/azlib.h 2009-02-13 16:41:47 +0000
+++ b/storage/archive/azlib.h 2010-01-06 21:27:53 +0000
@@ -33,10 +33,9 @@
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
-#include <zlib.h>
-
#include "../../mysys/mysys_priv.h"
#include <my_dir.h>
+#include <zlib.h>
#ifdef __cplusplus
extern "C" {
=== modified file 'storage/maria/ma_blockrec.c'
--- a/storage/maria/ma_blockrec.c 2009-10-03 20:13:58 +0000
+++ b/storage/maria/ma_blockrec.c 2010-01-06 21:27:53 +0000
@@ -6094,7 +6094,7 @@ uint _ma_apply_redo_insert_row_head_or_t
DBUG_RETURN(0);
}
- if (((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) != page_type))
+ if (((uint) (buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) != page_type))
{
/*
This is a page that has been freed before and now should be
@@ -6241,7 +6241,7 @@ uint _ma_apply_redo_purge_row_head_or_ta
Note that in case the page is not anymore a head or tail page
a future redo will fix the bitmap.
*/
- if ((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == page_type)
+ if ((uint) (buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == page_type)
{
empty_space= uint2korr(buff+EMPTY_SPACE_OFFSET);
if (_ma_bitmap_set(info, page, page_type == HEAD_PAGE,
=== modified file 'storage/maria/ma_loghandler.c'
--- a/storage/maria/ma_loghandler.c 2009-05-19 09:28:05 +0000
+++ b/storage/maria/ma_loghandler.c 2010-01-06 21:27:53 +0000
@@ -2823,8 +2823,8 @@ static my_bool translog_page_validator(u
data->was_recovered= 0;
- if (uint3korr(page) != page_no ||
- uint3korr(page + 3) != data->number)
+ if ((pgcache_page_no_t) uint3korr(page) != page_no ||
+ (uint32) uint3korr(page + 3) != data->number)
{
DBUG_PRINT("error", ("Page (%lu,0x%lx): "
"page address written in the page is incorrect: "
=== modified file 'storage/maria/ma_test3.c'
--- a/storage/maria/ma_test3.c 2008-01-10 12:21:53 +0000
+++ b/storage/maria/ma_test3.c 2010-01-06 21:27:53 +0000
@@ -180,7 +180,7 @@ void start_test(int id)
if (pagecacheing && rnd(2) == 0)
init_pagecache(maria_pagecache, 65536L, 0, 0, MARIA_KEY_BLOCK_LENGTH,
MY_WME);
- printf("Process %d, pid: %d\n",id,getpid()); fflush(stdout);
+ printf("Process %d, pid: %ld\n",id,(long) getpid()); fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)
{
@@ -362,7 +362,7 @@ int test_write(MARIA_HA *file,int id,int
maria_extra(file,HA_EXTRA_WRITE_CACHE,0);
}
- sprintf((char*) record.id,"%7d",getpid());
+ sprintf((char*) record.id,"%7ld", (long) getpid());
strnmov((char*) record.text,"Testing...", sizeof(record.text));
tries=(uint) rnd(100)+10;
=== modified file 'storage/myisam/mi_test3.c'
--- a/storage/myisam/mi_test3.c 2008-04-28 16:24:05 +0000
+++ b/storage/myisam/mi_test3.c 2010-01-06 21:27:53 +0000
@@ -178,7 +178,8 @@ void start_test(int id)
}
if (key_cacheing && rnd(2) == 0)
init_key_cache(dflt_key_cache, KEY_CACHE_BLOCK_SIZE, 65536L, 0, 0);
- printf("Process %d, pid: %d\n",id,getpid()); fflush(stdout);
+ printf("Process %d, pid: %ld\n", id, (long) getpid());
+ fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)
{
@@ -362,7 +363,7 @@ int test_write(MI_INFO *file,int id,int
mi_extra(file,HA_EXTRA_WRITE_CACHE,0);
}
- sprintf((char*) record.id,"%7d",getpid());
+ sprintf((char*) record.id,"%7ld",(long) getpid());
strnmov((char*) record.text,"Testing...", sizeof(record.text));
tries=(uint) rnd(100)+10;
=== modified file 'storage/pbxt/src/ha_pbxt.cc'
--- a/storage/pbxt/src/ha_pbxt.cc 2009-12-29 11:34:44 +0000
+++ b/storage/pbxt/src/ha_pbxt.cc 2010-01-06 21:27:53 +0000
@@ -1294,7 +1294,7 @@ static int pbxt_init(void *p)
#6 0x000debe1 in THD::THD at sql_class.cc:631
#7 0x00e207a4 in myxt_create_thread at myxt_xt.cc:2666
#8 0x00e3134b in tabc_fr_run_thread at tabcache_xt.cc:982
- #9 0x00e422ca in thr_main at thread_xt.cc:1006
+ #9 0x00e422ca in thr_main_pbxt at thread_xt.cc:1006
#10 0x91ff7c55 in _pthread_start
#11 0x91ff7b12 in thread_start
*
@@ -1557,7 +1557,7 @@ static int pbxt_prepare(handlerton *hton
return err;
}
-static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, char *thread_name, int *err)
+static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, const char *thread_name, int *err)
{
THD *thd;
XTThreadPtr self = NULL;
=== modified file 'storage/pbxt/src/restart_xt.cc'
--- a/storage/pbxt/src/restart_xt.cc 2009-11-27 15:37:02 +0000
+++ b/storage/pbxt/src/restart_xt.cc 2010-01-06 21:27:53 +0000
@@ -3314,7 +3314,7 @@ static void *xn_xres_run_recovery_thread
* #7 0x000c0db2 in THD::~THD at sql_class.cc:934
* #8 0x003b025b in myxt_destroy_thread at myxt_xt.cc:2999
* #9 0x003b66b5 in xn_xres_run_recovery_thread at restart_xt.cc:3196
- * #10 0x003cbfbb in thr_main at thread_xt.cc:1020
+ * #10 0x003cbfbb in thr_main_pbxt at thread_xt.cc:1020
*
myxt_destroy_thread(mysql_thread, TRUE);
*/
=== modified file 'storage/pbxt/src/thread_xt.cc'
--- a/storage/pbxt/src/thread_xt.cc 2009-12-22 10:33:20 +0000
+++ b/storage/pbxt/src/thread_xt.cc 2010-01-06 21:27:53 +0000
@@ -1013,7 +1013,7 @@ static xtBool thr_setup_signals(void)
typedef void *(*ThreadMainFunc)(XTThreadPtr self);
-extern "C" void *thr_main(void *data)
+extern "C" void *thr_main_pbxt(void *data)
{
ThreadDataPtr td = (ThreadDataPtr) data;
XTThreadPtr self = td->td_thr;
@@ -1503,10 +1503,10 @@ xtPublic pthread_t xt_run_thread(XTThrea
pthread_attr_t attr = { 0, 0, 0 };
attr.priority = THREAD_PRIORITY_NORMAL;
- err = pthread_create(&child_thread, &attr, thr_main, &data);
+ err = pthread_create(&child_thread, &attr, thr_main_pbxt, &data);
}
#else
- err = pthread_create(&child_thread, NULL, thr_main, &data);
+ err = pthread_create(&child_thread, NULL, thr_main_pbxt, &data);
#endif
if (err) {
xt_free_thread(child);
=== modified file 'storage/pbxt/src/thread_xt.h'
--- a/storage/pbxt/src/thread_xt.h 2009-11-24 10:55:06 +0000
+++ b/storage/pbxt/src/thread_xt.h 2010-01-06 21:27:53 +0000
@@ -536,7 +536,7 @@ extern struct XTThread **xt_thr_array;
* Function prototypes
*/
-extern "C" void *thr_main(void *data);
+extern "C" void *thr_main_pbxt(void *data);
void xt_get_now(char *buffer, size_t len);
xtBool xt_init_logging(void);
=== modified file 'storage/xtradb/srv/srv0srv.c'
--- a/storage/xtradb/srv/srv0srv.c 2009-11-13 21:26:08 +0000
+++ b/storage/xtradb/srv/srv0srv.c 2010-01-06 21:27:53 +0000
@@ -81,6 +81,7 @@ Created 10/8/1995 Heikki Tuuri
#include "ut0mem.h"
#include "ut0ut.h"
#include "os0proc.h"
+#include "os0sync.h"
#include "mem0mem.h"
#include "mem0pool.h"
#include "sync0sync.h"
@@ -1102,12 +1103,12 @@ srv_conc_enter_innodb_timer_based(trx_t*
}
retry:
if (srv_conc_n_threads < (lint) srv_thread_concurrency) {
- conc_n_threads = __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ conc_n_threads = os_atomic_increment_lint(&srv_conc_n_threads, 1);
if (conc_n_threads <= (lint) srv_thread_concurrency) {
enter_innodb_with_tickets(trx);
return;
}
- __sync_add_and_fetch(&srv_conc_n_threads, -1);
+ os_atomic_increment_lint(&srv_conc_n_threads, -1);
}
if (!has_yielded)
{
@@ -1118,7 +1119,7 @@ retry:
if (trx->has_search_latch
|| NULL != UT_LIST_GET_FIRST(trx->trx_locks)) {
- conc_n_threads = __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ conc_n_threads = os_atomic_increment_lint(&srv_conc_n_threads, 1);
enter_innodb_with_tickets(trx);
return;
}
@@ -1129,7 +1130,7 @@ retry:
trx->op_info = "";
has_slept++;
}
- conc_n_threads = __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ conc_n_threads = os_atomic_increment_lint(&srv_conc_n_threads, 1);
enter_innodb_with_tickets(trx);
return;
}
@@ -1137,7 +1138,7 @@ retry:
static void
srv_conc_exit_innodb_timer_based(trx_t* trx)
{
- __sync_add_and_fetch(&srv_conc_n_threads, -1);
+ os_atomic_increment_lint(&srv_conc_n_threads, -1);
trx->declared_to_be_inside_innodb = FALSE;
trx->n_tickets_to_enter_innodb = 0;
return;
@@ -1326,7 +1327,7 @@ srv_conc_force_enter_innodb(
ut_ad(srv_conc_n_threads >= 0);
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
if (srv_thread_concurrency_timer_based) {
- __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ os_atomic_increment_lint(&srv_conc_n_threads, 1);
trx->declared_to_be_inside_innodb = TRUE;
trx->n_tickets_to_enter_innodb = 1;
return;
=== modified file 'support-files/compiler_warnings.supp'
--- a/support-files/compiler_warnings.supp 2009-10-03 20:13:58 +0000
+++ b/support-files/compiler_warnings.supp 2010-01-06 21:27:53 +0000
@@ -88,6 +88,9 @@ storage/maria/ma_pagecache.c: .*'info_ch
#
storage/pbxt/ : typedef.*was ignored in this declaration
+#
+# Yassl
+include/runtime.hpp: .*pure_error.*
#
# Groff warnings on OpenSUSE.
1
0

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2791)
by Michael Widenius 09 Jan '10
by Michael Widenius 09 Jan '10
09 Jan '10
#At lp:maria based on revid:monty@askmonty.org-20100109090451-n06my8ri38byi38g
2791 Michael Widenius 2010-01-09 [merge]
Automatic merge
renamed:
mysql-test/suite/pbxt/t/load_unique_error1.inc => mysql-test/std_data/pbxt_load_unique_error1.inc
modified:
.bzrignore
config/ac-macros/plugins.m4
configure.in
mysql-test/mysql-test-run.pl
mysql-test/suite/pbxt/r/join_nested.result
mysql-test/suite/pbxt/r/pbxt_bugs.result
mysql-test/suite/pbxt/t/join_nested.test
mysql-test/suite/pbxt/t/pbxt_bugs.test
mysql-test/suite/pbxt/t/pbxt_locking.test
mysql-test/suite/pbxt/t/pbxt_transactions.test
mysql-test/suite/pbxt/t/ps_1general.test
sql/handler.h
sql/sql_plugin.cc
storage/pbxt/ChangeLog
storage/pbxt/plug.in
storage/pbxt/src/Makefile.am
storage/pbxt/src/discover_xt.cc
storage/pbxt/src/ha_pbxt.cc
storage/pbxt/src/strutil_xt.cc
storage/pbxt/src/table_xt.cc
storage/pbxt/src/thread_xt.cc
storage/pbxt/src/trace_xt.cc
=== modified file '.bzrignore'
--- a/.bzrignore 2009-12-03 11:34:11 +0000
+++ b/.bzrignore 2009-12-22 13:50:20 +0000
@@ -666,6 +666,9 @@ libmysqld/time.cc
libmysqld/tztime.cc
libmysqld/uniques.cc
libmysqld/unireg.cc
+libmysqld/discover_xt.cc
+libmysqld/ha_pbxt.cc
+libmysqld/myxt_xt.cc
libmysqltest/*.ds?
libmysqltest/*.vcproj
libmysqltest/mytest.c
=== modified file 'config/ac-macros/plugins.m4'
--- a/config/ac-macros/plugins.m4 2009-04-25 10:05:32 +0000
+++ b/config/ac-macros/plugins.m4 2009-12-22 10:33:20 +0000
@@ -267,7 +267,6 @@ dnl we have to recompile these modules
dnl to compile server parts with the different #defines
dnl Normally it happens when we compile the embedded server
dnl Thus one should mark such files in his handler using this macro
-dnl (currently only one such a file per plugin is supported)
dnl
dnl ---------------------------------------------------------------------------
@@ -463,11 +462,13 @@ dnl Although this is "pretty", it breaks
mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]"
[with_plugin_]$2=yes
AC_MSG_RESULT([yes])
- m4_ifdef([$11],[
- condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp($11, [[^/]+$], [\&])"
- condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp($11, [[^/]+\.], [\&o])"
- condition_dependent_plugin_links="$condition_dependent_plugin_links $6/$11"
- condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp($11, [^.+[/$]], [\&])"
+ m4_ifdef([$11], [
+ m4_foreach([plugin], [$11], [
+ condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp(plugin, [[^/]+$], [\&])"
+ condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp(plugin, [[^/]+\.], [\&o])"
+ condition_dependent_plugin_links="$condition_dependent_plugin_links $6/plugin"
+ condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp(plugin, [^.+[/$]], [\&])"
+ ])
])
fi
fi
=== modified file 'configure.in'
--- a/configure.in 2009-12-03 11:34:11 +0000
+++ b/configure.in 2009-12-23 08:32:14 +0000
@@ -15,7 +15,7 @@ AC_CANONICAL_SYSTEM
# MySQL version number.
#
# Note: the following line must be parseable by win/configure.js:GetVersion()
-AM_INIT_AUTOMAKE(mysql, 5.1.41-MariaDB-beta)
+AM_INIT_AUTOMAKE(mysql, 5.1.41-MariaDB-rc)
AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2009-12-21 16:26:36 +0000
+++ b/mysql-test/mysql-test-run.pl 2010-01-05 14:28:34 +0000
@@ -301,6 +301,9 @@ sub main {
}
}
+ # Check for plugin availability so we know whether to skip tests or not.
+ detect_plugins();
+
mtr_report("Collecting tests...");
my $tests= collect_test_cases($opt_suites, \@opt_cases);
@@ -1877,6 +1880,37 @@ sub have_maria_support () {
}
+# Detect plugin presense and set environment variables appropriately.
+# This needs to be done early, so we can know whether to skip tests.
+sub detect_plugins {
+ # --------------------------------------------------------------------------
+ # Add the path where mysqld will find ha_example.so
+ # --------------------------------------------------------------------------
+ if ($mysql_version_id >= 50100) {
+ my $plugin_filename;
+ if (IS_WINDOWS)
+ {
+ $plugin_filename = "ha_example.dll";
+ }
+ else
+ {
+ $plugin_filename = "ha_example.so";
+ }
+ my $lib_example_plugin=
+ mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
+ "$basedir/storage/example/.libs/".$plugin_filename,
+ "$basedir/lib/mariadb/plugin/".$plugin_filename,
+ "$basedir/lib/mysql/plugin/".$plugin_filename);
+ $ENV{'EXAMPLE_PLUGIN'}=
+ ($lib_example_plugin ? basename($lib_example_plugin) : "");
+ $ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
+ ($lib_example_plugin ? dirname($lib_example_plugin) : "");
+
+ $ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'";
+ $ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename;
+ }
+}
+
#
# Set environment to be used by childs of this process for
# things that are constant during the whole lifetime of mysql-test-run
@@ -1935,33 +1969,6 @@ sub environment_setup {
$ENV{'UDF_EXAMPLE_LIB_OPT'}= "--plugin-dir=".
($lib_udf_example ? dirname($lib_udf_example) : "");
- # --------------------------------------------------------------------------
- # Add the path where mysqld will find ha_example.so
- # --------------------------------------------------------------------------
- if ($mysql_version_id >= 50100) {
- my $plugin_filename;
- if (IS_WINDOWS)
- {
- $plugin_filename = "ha_example.dll";
- }
- else
- {
- $plugin_filename = "ha_example.so";
- }
- my $lib_example_plugin=
- mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
- "$basedir/storage/example/.libs/".$plugin_filename,
- "$basedir/lib/mariadb/plugin/".$plugin_filename,
- "$basedir/lib/mysql/plugin/".$plugin_filename);
- $ENV{'EXAMPLE_PLUGIN'}=
- ($lib_example_plugin ? basename($lib_example_plugin) : "");
- $ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
- ($lib_example_plugin ? dirname($lib_example_plugin) : "");
-
- $ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'";
- $ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename;
- }
-
# ----------------------------------------------------
# Add the path where mysqld will find mypluglib.so
# ----------------------------------------------------
=== renamed file 'mysql-test/suite/pbxt/t/load_unique_error1.inc' => 'mysql-test/std_data/pbxt_load_unique_error1.inc'
=== modified file 'mysql-test/suite/pbxt/r/join_nested.result'
--- a/mysql-test/suite/pbxt/r/join_nested.result 2009-11-24 10:19:08 +0000
+++ b/mysql-test/suite/pbxt/r/join_nested.result 2009-12-27 16:48:27 +0000
@@ -968,7 +968,7 @@ id select_type table type possible_keys
Warnings:
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`
.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
CREATE INDEX idx_b ON t8(b);
-EXPLAIN EXTENDED
+EXPLAIN
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
FROM t0,t1
@@ -1003,22 +1003,23 @@ t0.b=t1.b AND
(t8.a < 1 OR t8.c IS NULL) AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where
-1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where
-1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`
.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
-Warnings:
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t0 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join buffer
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2
+1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1
+1 SIMPLE t5 ALL idx_b NULL NULL NULL 3
+1 SIMPLE t6 ALL NULL NULL NULL NULL 3
+1 SIMPLE t7 ALL NULL NULL NULL NULL 2
+1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1
+1 SIMPLE t9 ALL NULL NULL NULL NULL 3 Using join buffer
+ATTENTION: the above EXPLAIN has several competing QEPs with identical
+. costs. To combat the plan change it uses --sorted_result and
+. and --replace tricks
CREATE INDEX idx_b ON t1(b);
CREATE INDEX idx_a ON t0(a);
-EXPLAIN EXTENDED
+EXPLAIN
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
FROM t0,t1
@@ -1053,19 +1054,20 @@ t0.b=t1.b AND
(t8.a < 1 OR t8.c IS NULL) AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t0 ref idx_a idx_a 5 const 1 100.00 Using where
-1 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 1 100.00 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where
-1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where
-1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`
.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
-Warnings:
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t0 ref idx_a idx_a 5 const 1
+1 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2
+1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1
+1 SIMPLE t5 ALL idx_b NULL NULL NULL 3
+1 SIMPLE t6 ALL NULL NULL NULL NULL 3
+1 SIMPLE t7 ALL NULL NULL NULL NULL 2
+1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1
+1 SIMPLE t9 ALL NULL NULL NULL NULL 3 Using join buffer
+ATTENTION: the above EXPLAIN has several competing QEPs with identical
+. costs. To combat the plan change it uses --sorted_result
+. and --replace tricks
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
FROM t0,t1
=== modified file 'mysql-test/suite/pbxt/r/pbxt_bugs.result'
--- a/mysql-test/suite/pbxt/r/pbxt_bugs.result 2009-08-17 15:57:58 +0000
+++ b/mysql-test/suite/pbxt/r/pbxt_bugs.result 2009-12-22 10:33:20 +0000
@@ -1212,7 +1212,7 @@ c1
2147483647
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(255));
-LOAD DATA LOCAL INFILE 'suite/pbxt/t/load_unique_error1.inc' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
+LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/pbxt_load_unique_error1.inc' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
SELECT * FROM t1 ORDER BY c1;
c1 c2
0 opq
=== modified file 'mysql-test/suite/pbxt/t/join_nested.test'
--- a/mysql-test/suite/pbxt/t/join_nested.test 2009-08-17 15:57:58 +0000
+++ b/mysql-test/suite/pbxt/t/join_nested.test 2009-12-27 16:48:27 +0000
@@ -546,8 +546,9 @@ SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.
CREATE INDEX idx_b ON t8(b);
+--replace_regex /Using where; // /Using where//
--sorted_result
-EXPLAIN EXTENDED
+EXPLAIN
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
FROM t0,t1
@@ -582,12 +583,16 @@ SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.
(t8.a < 1 OR t8.c IS NULL) AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
+--echo ATTENTION: the above EXPLAIN has several competing QEPs with identical
+--echo . costs. To combat the plan change it uses --sorted_result and
+--echo . and --replace tricks
CREATE INDEX idx_b ON t1(b);
CREATE INDEX idx_a ON t0(a);
+--replace_regex /Using where; // /Using where//
--sorted_result
-EXPLAIN EXTENDED
+EXPLAIN
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
FROM t0,t1
@@ -622,6 +627,9 @@ SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.
(t8.a < 1 OR t8.c IS NULL) AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
+--echo ATTENTION: the above EXPLAIN has several competing QEPs with identical
+--echo . costs. To combat the plan change it uses --sorted_result
+--echo . and --replace tricks
--sorted_result
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
=== modified file 'mysql-test/suite/pbxt/t/pbxt_bugs.test'
--- a/mysql-test/suite/pbxt/t/pbxt_bugs.test 2009-08-17 15:57:58 +0000
+++ b/mysql-test/suite/pbxt/t/pbxt_bugs.test 2009-12-22 10:33:20 +0000
@@ -921,7 +921,8 @@ SELECT c1 FROM t2;
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(255));
-LOAD DATA LOCAL INFILE 'suite/pbxt/t/load_unique_error1.inc' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/pbxt_load_unique_error1.inc' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
--sorted_result
SELECT * FROM t1 ORDER BY c1;
DROP TABLE t1;
=== modified file 'mysql-test/suite/pbxt/t/pbxt_locking.test'
--- a/mysql-test/suite/pbxt/t/pbxt_locking.test 2009-04-02 10:03:14 +0000
+++ b/mysql-test/suite/pbxt/t/pbxt_locking.test 2009-12-22 10:33:20 +0000
@@ -1,6 +1,9 @@
# This test covers various aspects of PBXT locking mechanism, including
# internal permanent/temporary row locking and MySQL locking
+# SHOW PROCESSLIST has hardcoded "Writing to net" as state.
+-- source include/not_embedded.inc
+
# TEST: select for update test
drop table if exists t1;
=== modified file 'mysql-test/suite/pbxt/t/pbxt_transactions.test'
--- a/mysql-test/suite/pbxt/t/pbxt_transactions.test 2009-04-02 10:03:14 +0000
+++ b/mysql-test/suite/pbxt/t/pbxt_transactions.test 2009-12-22 10:33:20 +0000
@@ -1,3 +1,6 @@
+# We cannot run mysqldump against embedded server.
+-- source include/not_embedded.inc
+
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
=== modified file 'mysql-test/suite/pbxt/t/ps_1general.test'
--- a/mysql-test/suite/pbxt/t/ps_1general.test 2009-04-02 10:03:14 +0000
+++ b/mysql-test/suite/pbxt/t/ps_1general.test 2009-12-22 10:33:20 +0000
@@ -582,7 +582,7 @@ prepare stmt1 from ' rename table t5 to
create table t5 (a int) ;
# rename must fail, t7 does not exist
# Clean up the filename here because embedded server reports whole path
---replace_result $MYSQLTEST_VARDIR . master-data/ '' t7.frm t7
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' t7.frm t7
--error 1017
execute stmt1 ;
create table t7 (a int) ;
=== modified file 'sql/handler.h'
--- a/sql/handler.h 2009-12-03 11:19:05 +0000
+++ b/sql/handler.h 2010-01-04 13:12:53 +0000
@@ -278,6 +278,11 @@ enum legacy_db_type
DB_TYPE_FIRST_DYNAMIC=42,
DB_TYPE_DEFAULT=127 // Must be last
};
+/*
+ Better name for DB_TYPE_UNKNOWN. Should be used for engines that do not have
+ a hard-coded type value here.
+ */
+#define DB_TYPE_AUTOASSIGN DB_TYPE_UNKNOWN
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2009-12-03 11:19:05 +0000
+++ b/sql/sql_plugin.cc 2009-12-22 10:33:20 +0000
@@ -1168,22 +1168,7 @@ int plugin_init(int *argc, char **argv,
!my_strnncoll(&my_charset_latin1, (const uchar*) plugin->name,
6, (const uchar*) "InnoDB", 6))
continue;
-#ifdef EMBEDDED_LIBRARY
- /*
- MariaDB: disable PBXT in embedded server. We do this for two reasons
- - PBXT currently doesn't work in embedded server (see
- https://bugs.launchpad.net/maria/+bug/439889)
- - Embedded server is supposed to be "leaner" and our current
- understanding of that is "without PBXT". At the same time, we want
- regular server to be with PBXT, and since we don't support compiling
- embedded server with different options than the regular server,
- the only way was to disable PBXT from here.
- */
- if (!my_strnncoll(&my_charset_latin1, (const uchar*) plugin->name,
- 4, (const uchar*) "PBXT", 4))
- continue;
-#endif
bzero(&tmp, sizeof(tmp));
tmp.plugin= plugin;
tmp.name.str= (char *)plugin->name;
=== modified file 'storage/pbxt/ChangeLog'
--- a/storage/pbxt/ChangeLog 2009-12-01 09:50:46 +0000
+++ b/storage/pbxt/ChangeLog 2009-12-21 13:13:15 +0000
@@ -1,6 +1,10 @@
PBXT Release Notes
==================
+------- 1.0.09g RC3 - 2009-12-16
+
+RN292: Fixed a bug that resulted in 2-phase commit not being used between PBXT and the binlog. This bug was a result of a hack which as added to solve a problem in an pre-release version of MySQL 5.1. The hack was removed.
+
------- 1.0.09f RC3 - 2009-11-30
RN291: Fixed bug #489088: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown.
=== modified file 'storage/pbxt/plug.in'
--- a/storage/pbxt/plug.in 2009-05-12 06:44:01 +0000
+++ b/storage/pbxt/plug.in 2009-12-09 21:39:23 +0000
@@ -5,3 +5,4 @@ MYSQL_PLUGIN_STATIC(pbxt, [src/libpbx
MYSQL_PLUGIN_ACTIONS(pbxt, [
# AC_CONFIG_FILES(storage/pbxt/src/Makefile)
])
+MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(pbxt, [[src/ha_pbxt.cc],[src/myxt_xt.cc],[src/discover_xt.cc]])
=== modified file 'storage/pbxt/src/Makefile.am'
--- a/storage/pbxt/src/Makefile.am 2009-11-24 10:55:06 +0000
+++ b/storage/pbxt/src/Makefile.am 2009-12-22 10:33:20 +0000
@@ -46,7 +46,5 @@ libpbxt_la_CFLAGS = $(AM_CFLAGS) -DMYSQ
EXTRA_LIBRARIES = libpbxt.a
noinst_LIBRARIES = libpbxt.a
libpbxt_a_SOURCES = $(libpbxt_la_SOURCES)
-libpbxt_a_CXXFLAGS = $(AM_CXXFLAGS)
-libpbxt_a_CFLAGS = $(AM_CFLAGS) -std=c99
EXTRA_DIST = pbms_enabled.cc win_inttypes.h
=== modified file 'storage/pbxt/src/discover_xt.cc'
--- a/storage/pbxt/src/discover_xt.cc 2009-12-16 08:13:18 +0000
+++ b/storage/pbxt/src/discover_xt.cc 2009-12-21 13:13:15 +0000
@@ -355,10 +355,10 @@ static int sort_keys(KEY *a, KEY *b)
{
if (!(b_flags & HA_NOSAME))
return -1;
- if ((a_flags ^ b_flags) & (HA_NULL_PART_KEY | HA_END_SPACE_KEY))
+ if ((a_flags ^ b_flags) & HA_NULL_PART_KEY)
{
/* Sort NOT NULL keys before other keys */
- return (a_flags & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) ? 1 : -1;
+ return (a_flags & HA_NULL_PART_KEY) ? 1 : -1;
}
if (a->name == primary_key_name)
return -1;
=== modified file 'storage/pbxt/src/ha_pbxt.cc'
--- a/storage/pbxt/src/ha_pbxt.cc 2009-11-27 15:37:02 +0000
+++ b/storage/pbxt/src/ha_pbxt.cc 2009-12-29 11:34:44 +0000
@@ -1175,8 +1175,13 @@ static int pbxt_init(void *p)
* +1 Temporary thread (e.g. TempForClose, TempForEnd)
*/
#ifndef DRIZZLED
- if (pbxt_max_threads == 0)
- pbxt_max_threads = max_connections + 7;
+ if (pbxt_max_threads == 0) {
+ // Embedded server sets max_connections=1
+ if (max_connections > 1)
+ pbxt_max_threads = max_connections + 7;
+ else
+ pbxt_max_threads = 100;
+ }
#endif
self = xt_init_threading(pbxt_max_threads); /* Create the main self: */
if (!self)
@@ -1442,7 +1447,7 @@ static int pbxt_commit(handlerton *hton,
XTThreadPtr self;
if ((self = (XTThreadPtr) *thd_ha_data(thd, hton))) {
- XT_PRINT1(self, "pbxt_commit all=%d\n", all);
+ XT_PRINT2(self, "%s pbxt_commit all=%d\n", all ? "END CONN XACT" : "END STAT", all);
if (self->st_xact_data) {
/* There are no table locks, commit immediately in all cases
@@ -1474,7 +1479,7 @@ static int pbxt_rollback(handlerton *hto
XTThreadPtr self;
if ((self = (XTThreadPtr) *thd_ha_data(thd, hton))) {
- XT_PRINT1(self, "pbxt_rollback all=%d in pbxt_commit\n", all);
+ XT_PRINT2(self, "%s pbxt_rollback all=%d\n", all ? "CONN END XACT" : "STAT END", all);
if (self->st_xact_data) {
/* There are no table locks, rollback immediately in all cases
@@ -1538,7 +1543,7 @@ static int pbxt_prepare(handlerton *hton
* except when this is a statement commit with an explicit
* transaction (!all && !self->st_auto_commit).
*/
- if (all) {
+ if (all || self->st_auto_commit) {
XID xid;
XT_PRINT0(self, "xt_xn_prepare in pbxt_prepare\n");
@@ -2620,26 +2625,7 @@ int ha_pbxt::write_row(byte *buf)
}
#endif
- /* GOTCHA: I have a huge problem with the transaction statement.
- * It is not ALWAYS committed (I mean ha_commit_trans() is
- * not always called - for example in SELECT).
- *
- * If I call trans_register_ha() but ha_commit_trans() is not called
- * then MySQL thinks a transaction is still running (while
- * I have committed the auto-transaction in ha_pbxt::external_lock()).
- *
- * This causes all kinds of problems, like transactions
- * are killed when they should not be.
- *
- * To prevent this, I only inform MySQL that a transaction
- * has beens started when an update is performed. I have determined that
- * ha_commit_trans() is only guarenteed to be called if an update is done.
- */
- if (!pb_open_tab->ot_thread->st_stat_trans) {
- trans_register_ha(pb_mysql_thd, FALSE, pbxt_hton);
- XT_PRINT0(pb_open_tab->ot_thread, "ha_pbxt::write_row trans_register_ha all=FALSE\n");
- pb_open_tab->ot_thread->st_stat_trans = TRUE;
- }
+ /* {START-STAT-HACK} previously position of start statement hack. */
xt_xlog_check_long_writer(pb_open_tab->ot_thread);
@@ -2730,11 +2716,7 @@ int ha_pbxt::update_row(const byte * old
XT_DISABLED_TRACE(("UPDATE tx=%d val=%d\n", (int) self->st_xact_data->xd_start_xn_id, (int) XT_GET_DISK_4(&new_data[1])));
//statistic_increment(ha_update_count,&LOCK_status);
- if (!self->st_stat_trans) {
- trans_register_ha(pb_mysql_thd, FALSE, pbxt_hton);
- XT_PRINT0(self, "ha_pbxt::update_row trans_register_ha all=FALSE\n");
- self->st_stat_trans = TRUE;
- }
+ /* {START-STAT-HACK} previously position of start statement hack. */
xt_xlog_check_long_writer(self);
@@ -2821,11 +2803,7 @@ int ha_pbxt::delete_row(const byte * buf
}
#endif
- if (!pb_open_tab->ot_thread->st_stat_trans) {
- trans_register_ha(pb_mysql_thd, FALSE, pbxt_hton);
- XT_PRINT0(pb_open_tab->ot_thread, "ha_pbxt::delete_row trans_register_ha all=FALSE\n");
- pb_open_tab->ot_thread->st_stat_trans = TRUE;
- }
+ /* {START-STAT-HACK} previously position of start statement hack. */
xt_xlog_check_long_writer(pb_open_tab->ot_thread);
@@ -3155,15 +3133,12 @@ int ha_pbxt::index_init(uint idx, bool X
printf("index_init %s index %d cols req=%d/%d read_bits=%X write_bits=%X index_bits=%X\n", pb_open_tab->ot_table->tab_name->ps_path, (int) idx, pb_open_tab->ot_cols_req, pb_open_tab->ot_cols_req, (int) *table->read_set->bitmap, (int) *table->write_set->bitmap, (int) *ind->mi_col_map.bitmap);
#endif
+ /* {START-STAT-HACK} previously position of start statement hack,
+ * previous comment to code below: */
/* Start a statement based transaction as soon
* as a read is done for a modify type statement!
* Previously, this was done too late!
*/
- if (!thread->st_stat_trans) {
- trans_register_ha(pb_mysql_thd, FALSE, pbxt_hton);
- XT_PRINT0(thread, "ha_pbxt::update_row trans_register_ha all=FALSE\n");
- thread->st_stat_trans = TRUE;
- }
}
else {
pb_open_tab->ot_cols_req = ha_get_max_bit(table->read_set);
@@ -3612,15 +3587,12 @@ int ha_pbxt::rnd_init(bool scan)
/* The number of columns required: */
if (pb_open_tab->ot_is_modify) {
pb_open_tab->ot_cols_req = table->read_set->MX_BIT_SIZE();
+ /* {START-STAT-HACK} previously position of start statement hack,
+ * previous comment to code below: */
/* Start a statement based transaction as soon
* as a read is done for a modify type statement!
* Previously, this was done too late!
*/
- if (!thread->st_stat_trans) {
- trans_register_ha(pb_mysql_thd, FALSE, pbxt_hton);
- XT_PRINT0(thread, "ha_pbxt::update_row trans_register_ha all=FALSE\n");
- thread->st_stat_trans = TRUE;
- }
}
else {
pb_open_tab->ot_cols_req = ha_get_max_bit(table->read_set);
@@ -4631,7 +4603,7 @@ xtPublic int ha_pbxt::external_lock(THD
cont_(b);
}
- /* See (***) */
+ /* See {IS-UPDATE-STAT} */
self->st_is_update = FALSE;
/* Auto begin a transaction (if one is not already running): */
@@ -4660,7 +4632,7 @@ xtPublic int ha_pbxt::external_lock(THD
}
/*
- * (**) GOTCHA: trans_register_ha() is not mentioned in the documentation.
+ * {START-TRANS} GOTCHA: trans_register_ha() is not mentioned in the documentation.
* It must be called to inform MySQL that we have a transaction (see start_stmt).
*
* Here are some tests that confirm whether things are done correctly:
@@ -4698,10 +4670,46 @@ xtPublic int ha_pbxt::external_lock(THD
*/
if (!self->st_auto_commit) {
trans_register_ha(thd, TRUE, pbxt_hton);
- XT_PRINT0(self, "ha_pbxt::external_lock trans_register_ha all=TRUE\n");
+ XT_PRINT0(self, "CONN START XACT - ha_pbxt::external_lock --> trans_register_ha\n");
}
}
+ /* Start a statment transaction: */
+ /* {START-STAT-HACK} The problem that ha_commit_trans() is not
+ * called by MySQL seems to be fixed (tests confirm this).
+ * Here is the previous comment when this code was execute
+ * here {START-STAT-HACK}
+ *
+ * GOTCHA: I have a huge problem with the transaction statement.
+ * It is not ALWAYS committed (I mean ha_commit_trans() is
+ * not always called - for example in SELECT).
+ *
+ * If I call trans_register_ha() but ha_commit_trans() is not called
+ * then MySQL thinks a transaction is still running (while
+ * I have committed the auto-transaction in ha_pbxt::external_lock()).
+ *
+ * This causes all kinds of problems, like transactions
+ * are killed when they should not be.
+ *
+ * To prevent this, I only inform MySQL that a transaction
+ * has beens started when an update is performed. I have determined that
+ * ha_commit_trans() is only guarenteed to be called if an update is done.
+ * --------
+ *
+ * So, this is the correct place to start a statement transaction.
+ *
+ * Note: if trans_register_ha() is not called before ha_write_row(), then
+ * PBXT is not registered correctly as a modification transaction.
+ * (mark_trx_read_write call in ha_write_row).
+ * This leads to 2-phase commit not being called as it should when
+ * binary logging is enabled.
+ */
+ if (!pb_open_tab->ot_thread->st_stat_trans) {
+ trans_register_ha(pb_mysql_thd, FALSE, pbxt_hton);
+ XT_PRINT0(pb_open_tab->ot_thread, "STAT START - ha_pbxt::external_lock --> trans_register_ha\n");
+ pb_open_tab->ot_thread->st_stat_trans = TRUE;
+ }
+
if (lock_type == F_WRLCK || self->st_xact_mode < XT_XACT_REPEATABLE_READ)
self->st_visible_time = self->st_database->db_xn_end_time;
@@ -4826,7 +4834,7 @@ int ha_pbxt::start_stmt(THD *thd, thr_lo
}
}
- /* (***) This is required at this level!
+ /* {IS-UPDATE-STAT} This is required at this level!
* No matter how often it is called, it is still the start of a
* statement. We need to make sure statements that are NOT mistaken
* for different type of statement.
@@ -4841,7 +4849,7 @@ int ha_pbxt::start_stmt(THD *thd, thr_lo
*/
self->st_is_update = FALSE;
- /* See comment (**) */
+ /* See comment {START-TRANS} */
if (!self->st_xact_data) {
self->st_xact_mode = thd_tx_isolation(thd) <= ISO_READ_COMMITTED ? XT_XACT_COMMITTED_READ : XT_XACT_REPEATABLE_READ;
self->st_ignore_fkeys = (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) != 0;
@@ -4858,10 +4866,17 @@ int ha_pbxt::start_stmt(THD *thd, thr_lo
}
if (!self->st_auto_commit) {
trans_register_ha(thd, TRUE, pbxt_hton);
- XT_PRINT0(self, "ha_pbxt::start_stmt trans_register_ha all=TRUE\n");
+ XT_PRINT0(self, "START CONN XACT - ha_pbxt::start_stmt --> trans_register_ha\n");
}
}
+ /* Start a statment (see {START-STAT-HACK}): */
+ if (!pb_open_tab->ot_thread->st_stat_trans) {
+ trans_register_ha(pb_mysql_thd, FALSE, pbxt_hton);
+ XT_PRINT0(pb_open_tab->ot_thread, "START STAT - ha_pbxt::start_stmt --> trans_register_ha\n");
+ pb_open_tab->ot_thread->st_stat_trans = TRUE;
+ }
+
if (pb_open_tab->ot_for_update || self->st_xact_mode < XT_XACT_REPEATABLE_READ)
self->st_visible_time = self->st_database->db_xn_end_time;
=== modified file 'storage/pbxt/src/strutil_xt.cc'
--- a/storage/pbxt/src/strutil_xt.cc 2009-11-24 10:55:06 +0000
+++ b/storage/pbxt/src/strutil_xt.cc 2009-12-21 13:13:15 +0000
@@ -380,7 +380,7 @@ xtPublic void xt_int8_to_byte_size(xtInt
/* Version number must also be set in configure.in! */
xtPublic c_char *xt_get_version(void)
{
- return "1.0.09f RC";
+ return "1.0.09g RC";
}
/* Copy and URL decode! */
=== modified file 'storage/pbxt/src/table_xt.cc'
--- a/storage/pbxt/src/table_xt.cc 2009-11-25 15:40:51 +0000
+++ b/storage/pbxt/src/table_xt.cc 2009-12-22 10:33:20 +0000
@@ -1297,7 +1297,7 @@ xtPublic void xt_create_table(XTThreadPt
XTSortedListInfoRec li_undo;
#ifdef TRACE_CREATE_TABLES
- printf("CREATE %s\n", name->ps_path);
+ fprintf(stderr, "CREATE %s\n", name->ps_path);
#endif
enter_();
if (strlen(xt_last_name_of_path(name->ps_path)) > XT_TABLE_NAME_SIZE-1)
@@ -1619,7 +1619,7 @@ xtPublic void xt_drop_table(XTThreadPtr
enter_();
#ifdef TRACE_CREATE_TABLES
- printf("DROP %s\n", tab_name->ps_path);
+ fprintf(stderr, "DROP %s\n", tab_name->ps_path);
#endif
table_pool = tab_lock_table(self, tab_name, FALSE, TRUE, TRUE, &tab);
@@ -1777,7 +1777,7 @@ xtPublic void xt_check_table(XTThreadPtr
u_llong ext_data_len = 0;
#if defined(DUMP_CHECK_TABLE) || defined(CHECK_TABLE_STATS)
- printf("\nCHECK TABLE: %s\n", tab->tab_name->ps_path);
+ fprintf(stderr, "\nCHECK TABLE: %s\n", tab->tab_name->ps_path);
#endif
xt_lock_mutex(self, &tab->tab_db->db_co_ext_lock);
@@ -1787,38 +1787,38 @@ xtPublic void xt_check_table(XTThreadPtr
pushr_(xt_unlock_mutex, &tab->tab_rec_lock);
#ifdef CHECK_TABLE_STATS
- printf("Record buffer size = %lu\n", (u_long) tab->tab_dic.dic_mysql_buf_size);
- printf("Fixed length rec. len. = %lu\n", (u_long) tab->tab_dic.dic_mysql_rec_size);
- printf("Handle data record size = %lu\n", (u_long) tab->tab_dic.dic_rec_size);
- printf("Min/max header size = %d/%d\n", (int) offsetof(XTTabRecFix, rf_data), tab->tab_dic.dic_rec_fixed ? (int) offsetof(XTTabRecFix, rf_data) : (int) offsetof(XTTabRecExtDRec, re_data));
- printf("Min/avg/max record size = %llu/%llu/%llu\n", (u_llong) tab->tab_dic.dic_min_row_size, (u_llong) tab->tab_dic.dic_ave_row_size, (u_llong) tab->tab_dic.dic_max_row_size);
+ fprintf(stderr, "Record buffer size = %lu\n", (u_long) tab->tab_dic.dic_mysql_buf_size);
+ fprintf(stderr, "Fixed length rec. len. = %lu\n", (u_long) tab->tab_dic.dic_mysql_rec_size);
+ fprintf(stderr, "Handle data record size = %lu\n", (u_long) tab->tab_dic.dic_rec_size);
+ fprintf(stderr, "Min/max header size = %d/%d\n", (int) offsetof(XTTabRecFix, rf_data), tab->tab_dic.dic_rec_fixed ? (int) offsetof(XTTabRecFix, rf_data) : (int) offsetof(XTTabRecExtDRec, re_data));
+ fprintf(stderr, "Min/avg/max record size = %llu/%llu/%llu\n", (u_llong) tab->tab_dic.dic_min_row_size, (u_llong) tab->tab_dic.dic_ave_row_size, (u_llong) tab->tab_dic.dic_max_row_size);
if (tab->tab_dic.dic_def_ave_row_size)
- printf("Avg row len set for tab = %lu\n", (u_long) tab->tab_dic.dic_def_ave_row_size);
+ fprintf(stderr, "Avg row len set for tab = %lu\n", (u_long) tab->tab_dic.dic_def_ave_row_size);
else
- printf("Avg row len set for tab = not specified\n");
- printf("Rows fixed length = %s\n", tab->tab_dic.dic_rec_fixed ? "YES" : "NO");
+ fprintf(stderr, "Avg row len set for tab = not specified\n");
+ fprintf(stderr, "Rows fixed length = %s\n", tab->tab_dic.dic_rec_fixed ? "YES" : "NO");
if (tab->tab_dic.dic_tab_flags & XT_TAB_FLAGS_TEMP_TAB)
- printf("Table type = TEMP\n");
+ fprintf(stderr, "Table type = TEMP\n");
if (tab->tab_dic.dic_def_ave_row_size)
- printf("Maximum fixed size = %lu\n", (u_long) XT_TAB_MAX_FIX_REC_LENGTH_SPEC);
+ fprintf(stderr, "Maximum fixed size = %lu\n", (u_long) XT_TAB_MAX_FIX_REC_LENGTH_SPEC);
else
- printf("Maximum fixed size = %lu\n", (u_long) XT_TAB_MAX_FIX_REC_LENGTH);
- printf("Minimum variable size = %lu\n", (u_long) XT_TAB_MIN_VAR_REC_LENGTH);
- printf("Minimum auto-increment = %llu\n", (u_llong) tab->tab_dic.dic_min_auto_inc);
- printf("Number of columns = %lu\n", (u_long) tab->tab_dic.dic_no_of_cols);
- printf("Number of fixed columns = %lu\n", (u_long) tab->tab_dic.dic_fix_col_count);
- printf("Columns req. for index = %lu\n", (u_long) tab->tab_dic.dic_ind_cols_req);
+ fprintf(stderr, "Maximum fixed size = %lu\n", (u_long) XT_TAB_MAX_FIX_REC_LENGTH);
+ fprintf(stderr, "Minimum variable size = %lu\n", (u_long) XT_TAB_MIN_VAR_REC_LENGTH);
+ fprintf(stderr, "Minimum auto-increment = %llu\n", (u_llong) tab->tab_dic.dic_min_auto_inc);
+ fprintf(stderr, "Number of columns = %lu\n", (u_long) tab->tab_dic.dic_no_of_cols);
+ fprintf(stderr, "Number of fixed columns = %lu\n", (u_long) tab->tab_dic.dic_fix_col_count);
+ fprintf(stderr, "Columns req. for index = %lu\n", (u_long) tab->tab_dic.dic_ind_cols_req);
if (tab->tab_dic.dic_ind_rec_len)
- printf("Rec len req. for index = %llu\n", (u_llong) tab->tab_dic.dic_ind_rec_len);
- printf("Columns req. for blobs = %lu\n", (u_long) tab->tab_dic.dic_blob_cols_req);
- printf("Number of blob columns = %lu\n", (u_long) tab->tab_dic.dic_blob_count);
- printf("Number of indices = %lu\n", (u_long) tab->tab_dic.dic_key_count);
+ fprintf(stderr, "Rec len req. for index = %llu\n", (u_llong) tab->tab_dic.dic_ind_rec_len);
+ fprintf(stderr, "Columns req. for blobs = %lu\n", (u_long) tab->tab_dic.dic_blob_cols_req);
+ fprintf(stderr, "Number of blob columns = %lu\n", (u_long) tab->tab_dic.dic_blob_count);
+ fprintf(stderr, "Number of indices = %lu\n", (u_long) tab->tab_dic.dic_key_count);
#endif
#ifdef DUMP_CHECK_TABLE
- printf("Records:-\n");
- printf("Free list: %llu (%llu)\n", (u_llong) tab->tab_rec_free_id, (u_llong) tab->tab_rec_fnum);
- printf("EOF: %llu\n", (u_llong) tab->tab_rec_eof_id);
+ fprintf(stderr, "Records:-\n");
+ fprintf(stderr, "Free list: %llu (%llu)\n", (u_llong) tab->tab_rec_free_id, (u_llong) tab->tab_rec_fnum);
+ fprintf(stderr, "EOF: %llu\n", (u_llong) tab->tab_rec_eof_id);
#endif
rec_size = XT_REC_EXT_HEADER_SIZE;
@@ -1830,24 +1830,24 @@ xtPublic void xt_check_table(XTThreadPtr
xt_throw(self);
#ifdef DUMP_CHECK_TABLE
- printf("%-4llu ", (u_llong) rec_id);
+ fprintf(stderr, "%-4llu ", (u_llong) rec_id);
#endif
switch (rec_buf->tr_rec_type_1 & XT_TAB_STATUS_MASK) {
case XT_TAB_STATUS_FREED:
#ifdef DUMP_CHECK_TABLE
- printf("======== ");
+ fprintf(stderr, "======== ");
#endif
free_rec_count++;
break;
case XT_TAB_STATUS_DELETE:
#ifdef DUMP_CHECK_TABLE
- printf("delete ");
+ fprintf(stderr, "delete ");
#endif
delete_rec_count++;
break;
case XT_TAB_STATUS_FIXED:
#ifdef DUMP_CHECK_TABLE
- printf("record-F ");
+ fprintf(stderr, "record-F ");
#endif
alloc_rec_count++;
row_size = myxt_store_row_length(ot, (char *) ot->ot_row_rbuffer + XT_REC_FIX_HEADER_SIZE);
@@ -1859,7 +1859,7 @@ xtPublic void xt_check_table(XTThreadPtr
break;
case XT_TAB_STATUS_VARIABLE:
#ifdef DUMP_CHECK_TABLE
- printf("record-V ");
+ fprintf(stderr, "record-V ");
#endif
alloc_rec_count++;
row_size = myxt_load_row_length(ot, tab->tab_dic.dic_rec_size, ot->ot_row_rbuffer + XT_REC_FIX_HEADER_SIZE, NULL);
@@ -1871,7 +1871,7 @@ xtPublic void xt_check_table(XTThreadPtr
break;
case XT_TAB_STATUS_EXT_DLOG:
#ifdef DUMP_CHECK_TABLE
- printf("record-X ");
+ fprintf(stderr, "record-X ");
#endif
alloc_rec_count++;
ext_data_len += XT_GET_DISK_4(rec_buf->re_log_dat_siz_4);
@@ -1885,9 +1885,9 @@ xtPublic void xt_check_table(XTThreadPtr
}
#ifdef DUMP_CHECK_TABLE
if (rec_buf->tr_rec_type_1 & XT_TAB_STATUS_CLEANED_BIT)
- printf("C");
+ fprintf(stderr, "C");
else
- printf(" ");
+ fprintf(stderr, " ");
#endif
prev_rec_id = XT_GET_DISK_4(rec_buf->tr_prev_rec_id_4);
xn_id = XT_GET_DISK_4(rec_buf->tr_xact_id_4);
@@ -1895,12 +1895,12 @@ xtPublic void xt_check_table(XTThreadPtr
switch (rec_buf->tr_rec_type_1 & XT_TAB_STATUS_MASK) {
case XT_TAB_STATUS_FREED:
#ifdef DUMP_CHECK_TABLE
- printf(" prev=%-3llu (xact=%-3llu row=%lu)\n", (u_llong) prev_rec_id, (u_llong) xn_id, (u_long) row_id);
+ fprintf(stderr, " prev=%-3llu (xact=%-3llu row=%lu)\n", (u_llong) prev_rec_id, (u_llong) xn_id, (u_long) row_id);
#endif
break;
case XT_TAB_STATUS_EXT_DLOG:
#ifdef DUMP_CHECK_TABLE
- printf(" prev=%-3llu xact=%-3llu row=%lu Xlog=%lu Xoff=%llu Xsiz=%lu\n", (u_llong) prev_rec_id, (u_llong) xn_id, (u_long) row_id, (u_long) XT_GET_DISK_2(rec_buf->re_log_id_2), (u_llong) XT_GET_DISK_6(rec_buf->re_log_offs_6), (u_long) XT_GET_DISK_4(rec_buf->re_log_dat_siz_4));
+ fprintf(stderr, " prev=%-3llu xact=%-3llu row=%lu Xlog=%lu Xoff=%llu Xsiz=%lu\n", (u_llong) prev_rec_id, (u_llong) xn_id, (u_long) row_id, (u_long) XT_GET_DISK_2(rec_buf->re_log_id_2), (u_llong) XT_GET_DISK_6(rec_buf->re_log_offs_6), (u_long) XT_GET_DISK_4(rec_buf->re_log_dat_siz_4));
#endif
log_size = XT_GET_DISK_4(rec_buf->re_log_dat_siz_4);
@@ -1922,7 +1922,7 @@ xtPublic void xt_check_table(XTThreadPtr
break;
default:
#ifdef DUMP_CHECK_TABLE
- printf(" prev=%-3llu xact=%-3llu row=%lu\n", (u_llong) prev_rec_id, (u_llong) xn_id, (u_long) row_id);
+ fprintf(stderr, " prev=%-3llu xact=%-3llu row=%lu\n", (u_llong) prev_rec_id, (u_llong) xn_id, (u_long) row_id);
#endif
break;
}
@@ -1931,16 +1931,16 @@ xtPublic void xt_check_table(XTThreadPtr
#ifdef CHECK_TABLE_STATS
if (!tab->tab_dic.dic_rec_fixed)
- printf("Extendend data length = %llu\n", ext_data_len);
+ fprintf(stderr, "Extendend data length = %llu\n", ext_data_len);
if (alloc_rec_count) {
- printf("Minumum comp. rec. len. = %llu\n", (u_llong) min_comp_rec_len);
- printf("Average comp. rec. len. = %llu\n", (u_llong) ((double) alloc_rec_bytes / (double) alloc_rec_count + (double) 0.5));
- printf("Maximum comp. rec. len. = %llu\n", (u_llong) max_comp_rec_len);
- }
- printf("Free record count = %llu\n", (u_llong) free_rec_count);
- printf("Deleted record count = %llu\n", (u_llong) delete_rec_count);
- printf("Allocated record count = %llu\n", (u_llong) alloc_rec_count);
+ fprintf(stderr, "Minumum comp. rec. len. = %llu\n", (u_llong) min_comp_rec_len);
+ fprintf(stderr, "Average comp. rec. len. = %llu\n", (u_llong) ((double) alloc_rec_bytes / (double) alloc_rec_count + (double) 0.5));
+ fprintf(stderr, "Maximum comp. rec. len. = %llu\n", (u_llong) max_comp_rec_len);
+ }
+ fprintf(stderr, "Free record count = %llu\n", (u_llong) free_rec_count);
+ fprintf(stderr, "Deleted record count = %llu\n", (u_llong) delete_rec_count);
+ fprintf(stderr, "Allocated record count = %llu\n", (u_llong) alloc_rec_count);
#endif
if (tab->tab_rec_fnum != free_rec_count)
xt_logf(XT_INFO, "Table %s: incorrect number of free blocks, %llu, should be: %llu\n", tab->tab_name, (u_llong) free_rec_count, (u_llong) tab->tab_rec_fnum);
@@ -1978,9 +1978,9 @@ xtPublic void xt_check_table(XTThreadPtr
pushr_(xt_unlock_mutex, &tab->tab_row_lock);
#ifdef DUMP_CHECK_TABLE
- printf("Rows:-\n");
- printf("Free list: %llu (%llu)\n", (u_llong) tab->tab_row_free_id, (u_llong) tab->tab_row_fnum);
- printf("EOF: %llu\n", (u_llong) tab->tab_row_eof_id);
+ fprintf(stderr, "Rows:-\n");
+ fprintf(stderr, "Free list: %llu (%llu)\n", (u_llong) tab->tab_row_free_id, (u_llong) tab->tab_row_fnum);
+ fprintf(stderr, "EOF: %llu\n", (u_llong) tab->tab_row_eof_id);
#endif
rec_id = 1;
@@ -1988,13 +1988,13 @@ xtPublic void xt_check_table(XTThreadPtr
if (!tab->tab_rows.xt_tc_read_4(ot->ot_row_file, rec_id, &ref_id, self))
xt_throw(self);
#ifdef DUMP_CHECK_TABLE
- printf("%-3llu ", (u_llong) rec_id);
+ fprintf(stderr, "%-3llu ", (u_llong) rec_id);
#endif
#ifdef DUMP_CHECK_TABLE
if (ref_id == 0)
- printf("====== 0\n");
+ fprintf(stderr, "====== 0\n");
else
- printf("in use %llu\n", (u_llong) ref_id);
+ fprintf(stderr, "in use %llu\n", (u_llong) ref_id);
#endif
rec_id++;
}
@@ -2026,7 +2026,7 @@ xtPublic void xt_rename_table(XTThreadPt
memset(&dic, 0, sizeof(dic));
#ifdef TRACE_CREATE_TABLES
- printf("RENAME %s --> %s\n", old_name->ps_path, new_name->ps_path);
+ fprintf(stderr, "RENAME %s --> %s\n", old_name->ps_path, new_name->ps_path);
#endif
if (strlen(xt_last_name_of_path(new_name->ps_path)) > XT_TABLE_NAME_SIZE-1)
xt_throw_taberr(XT_CONTEXT, XT_ERR_NAME_TOO_LONG, new_name);
@@ -2221,7 +2221,7 @@ xtPublic xtBool xt_flush_record_row(XTOp
xt_tab_store_header(ot, &rec_head);
#ifdef TRACE_FLUSH
- printf("FLUSH rec/row %d %s\n", (int) tab->tab_bytes_to_flush, tab->tab_name->ps_path);
+ fprintf(stderr, "FLUSH rec/row %d %s\n", (int) tab->tab_bytes_to_flush, tab->tab_name->ps_path);
fflush(stdout);
#endif
/* Write the table header: */
@@ -2276,7 +2276,7 @@ xtPublic xtBool xt_flush_record_row(XTOp
xt_unlock_mutex_ns(&cp->cp_state_lock);
#ifdef TRACE_FLUSH
- printf("FLUSH --end-- %s\n", tab->tab_name->ps_path);
+ fprintf(stderr, "FLUSH --end-- %s\n", tab->tab_name->ps_path);
fflush(stdout);
#endif
xt_unlock_mutex_ns(&tab->tab_rec_flush_lock);
=== modified file 'storage/pbxt/src/thread_xt.cc'
--- a/storage/pbxt/src/thread_xt.cc 2009-11-24 10:55:06 +0000
+++ b/storage/pbxt/src/thread_xt.cc 2009-12-22 10:33:20 +0000
@@ -96,7 +96,7 @@ xtPublic xtBool xt_init_logging(void)
{
int err;
- log_file = stdout;
+ log_file = stderr;
log_level = XT_LOG_TRACE;
err = xt_p_mutex_init_with_autoname(&log_mutex, NULL);
if (err) {
=== modified file 'storage/pbxt/src/trace_xt.cc'
--- a/storage/pbxt/src/trace_xt.cc 2009-08-17 11:12:36 +0000
+++ b/storage/pbxt/src/trace_xt.cc 2009-12-22 10:33:20 +0000
@@ -109,10 +109,10 @@ xtPublic void xt_print_trace(void)
xt_lock_mutex_ns(&trace_mutex);
if (trace_log_end > trace_log_offset+1) {
trace_log_buffer[trace_log_end] = 0;
- printf("%s", trace_log_buffer + trace_log_offset + 1);
+ fprintf(stderr, "%s", trace_log_buffer + trace_log_offset + 1);
}
trace_log_buffer[trace_log_offset] = 0;
- printf("%s", trace_log_buffer);
+ fprintf(stderr, "%s", trace_log_buffer);
trace_log_offset = 0;
trace_log_end = 0;
xt_unlock_mutex_ns(&trace_mutex);
@@ -379,9 +379,9 @@ xtPublic void xt_dump_conn_tracking(void
ptr = conn_info;
for (int i=0; i<XT_TRACK_MAX_CONNS; i++) {
if (ptr->ci_curr_xact_id || ptr->ci_prev_xact_id) {
- printf("%3d curr=%d prev=%d prev-time=%ld\n", (int) ptr->cu_t_id, (int) ptr->ci_curr_xact_id, (int) ptr->ci_prev_xact_id, (long) ptr->ci_prev_xact_time);
+ fprintf(stderr, "%3d curr=%d prev=%d prev-time=%ld\n", (int) ptr->cu_t_id, (int) ptr->ci_curr_xact_id, (int) ptr->ci_prev_xact_id, (long) ptr->ci_prev_xact_time);
if (i+1<XT_TRACK_MAX_CONNS) {
- printf(" diff=%d\n", (int) (ptr+1)->ci_curr_xact_id - (int) ptr->ci_curr_xact_id);
+ fprintf(stderr, " diff=%d\n", (int) (ptr+1)->ci_curr_xact_id - (int) ptr->ci_curr_xact_id);
}
}
ptr++;
1
0

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2790)
by Michael Widenius 09 Jan '10
by Michael Widenius 09 Jan '10
09 Jan '10
#At lp:maria based on revid:monty@askmonty.org-20100104183126-gskwc3tnm7f26os6
2790 Michael Widenius 2010-01-09
Fixed bug where mysqlbinlog hold up multiple connections to MySQL when using mysqlbinlog -R file1 file2 ...
modified:
client/mysqlbinlog.cc
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc 2009-12-03 11:19:05 +0000
+++ b/client/mysqlbinlog.cc 2010-01-09 09:04:51 +0000
@@ -1378,6 +1378,10 @@ static int parse_args(int *argc, char***
*/
static Exit_status safe_connect()
{
+ /* Close and old connections to MySQL */
+ if (mysql)
+ mysql_close(mysql);
+
mysql= mysql_init(NULL);
if (!mysql)
1
0
Hi!
Here is part from a patch that I will push today to
MariaDB-5.1-release that fixes so that pbxt compiles on OpenSolaris
5.11.
Issues fixed:
- lock_multi.test was not updated to latest release main.lock_multi.test
and still relied on sleep, which caused random failures. Fixed by
merging with main.lock_multi.test
- thr_main() was declared in /usr/include/thread.h and caused a name conflict.
Fixed by renaming it to thr_main_pbxt()
Hope you can add this to pbxt ASAP!
Regards,
Monty
=== modified file 'mysql-test/suite/pbxt/r/lock_multi.result'
--- mysql-test/suite/pbxt/r/lock_multi.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/lock_multi.result 2010-01-06 12:18:02 +0000
@@ -1,22 +1,4 @@
drop table if exists t1,t2;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 write;
-update low_priority t1 set n = 4;
-select n from t1;
-unlock tables;
-n
-1
-drop table t1;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 read;
-update low_priority t1 set n = 4;
-select n from t1;
-unlock tables;
-n
-1
-drop table t1;
create table t1 (a int, b int);
create table t2 (c int, d int);
insert into t1 values(1,1);
@@ -43,6 +25,7 @@ insert t1 select * from t2;
drop table t2;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
+End of 4.1 tests
create table t1(a int);
lock tables t1 write;
show columns from t1;
@@ -50,10 +33,10 @@ Field Type Null Key Default Extra
a int(11) YES NULL
unlock tables;
drop table t1;
-use mysql;
+USE mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES;
-use mysql;
+USE mysql;
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
OPTIMIZE TABLES columns_priv, db, host, user;
Table Op Msg_type Msg_text
@@ -63,7 +46,8 @@ mysql.host optimize status OK
mysql.user optimize status OK
UNLOCK TABLES;
Select_priv
-use test;
+N
+USE test;
use test;
CREATE TABLE t1 (c1 int);
LOCK TABLE t1 WRITE;
@@ -90,7 +74,115 @@ DROP DATABASE mysqltest_1;
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
lock tables t1 write;
-alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+alter table t1 auto_increment=0;
+alter table t1 auto_increment=0;
+unlock tables;
+drop table t1;
+create table t1 (a int);
+create table t2 like t1;
+# con1
+lock tables t1 write;
+# con2
+flush tables with read lock;
+# con5
+# global read lock is taken
+# con3
+select * from t2 for update;
+# waiting for release of read lock
+# con4
+# would hang and later cause a deadlock
+flush tables t2;
+# clean up
+unlock tables;
+unlock tables;
+a
+drop table t1,t2;
+#
+# Lightweight version:
+# Ensure that the wait for a GRL is done before opening tables.
+#
+create table t1 (a int);
+create table t2 like t1;
+#
+# UPDATE
+#
+# default
+flush tables with read lock;
+# con1
+update t2 set a = 1;
+# default
+# statement is waiting for release of read lock
+# con2
+flush table t2;
+# default
+unlock tables;
+# con1
+#
+# LOCK TABLES .. WRITE
+#
+# default
+flush tables with read lock;
+# con1
+lock tables t2 write;
+# default
+# statement is waiting for release of read lock
+# con2
+flush table t2;
+# default
+unlock tables;
+# con1
+unlock tables;
+drop table t1,t2;
+End of 5.0 tests
+create table t1 (i int);
+lock table t1 read;
+update t1 set i= 10;
+select * from t1;
+Timeout in wait_condition.inc for select count(*) = 1 from information_schema.processlist
+where state = "Locked" and info = "select * from t1"
+kill query ID;
+i
+ERROR 70100: Query execution was interrupted
+unlock tables;
+drop table t1;
+drop table if exists t1;
+create table t1 (i int);
+connection: default
+lock tables t1 write;
+connection: flush
+flush tables with read lock;;
+connection: default
+alter table t1 add column j int;
+connection: insert
+insert into t1 values (1,2);;
+connection: default
+unlock tables;
+connection: flush
+select * from t1;
+i j
+unlock tables;
+select * from t1;
+i j
+1 2
+drop table t1;
+drop table if exists t1;
+create table t1 (i int);
+connection: default
+lock tables t1 write;
+connection: flush
+flush tables with read lock;;
+connection: default
+flush tables;
+unlock tables;
+drop table t1;
+drop table if exists t1,t2;
+create table t1 (a int);
+flush status;
+lock tables t1 read;
+insert into t1 values(1);;
unlock tables;
drop table t1;
+select @tlwa < @tlwb;
+@tlwa < @tlwb
+1
+End of 5.1 tests
=== modified file 'mysql-test/suite/pbxt/t/lock_multi.test'
--- mysql-test/suite/pbxt/t/lock_multi.test 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/t/lock_multi.test 2010-01-06 12:17:25 +0000
@@ -1,4 +1,8 @@
-- source include/not_embedded.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
@@ -9,42 +13,6 @@ connect (locker,localhost,root,,);
connect (reader,localhost,root,,);
connect (writer,localhost,root,,);
-connection locker;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 write;
-connection writer;
-send update low_priority t1 set n = 4;
-connection reader;
---sleep 2
-send select n from t1;
-connection locker;
---sleep 2
-unlock tables;
-connection writer;
-reap;
-connection reader;
-reap;
-drop table t1;
-
-connection locker;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 read;
-connection writer;
-send update low_priority t1 set n = 4;
-connection reader;
---sleep 2
-send select n from t1;
-connection locker;
---sleep 2
-unlock tables;
-connection writer;
-reap;
-connection reader;
-reap;
-drop table t1;
-
#
# Test problem when using locks with multi-updates
# It should not block when multi-update is reading on a read-locked table
@@ -58,32 +26,33 @@ insert into t1 values(2,2);
insert into t2 values(1,2);
lock table t1 read;
connection writer;
---sleep 2
-send update t1,t2 set c=a where b=d;
+update t1,t2 set c=a where b=d;
connection reader;
---sleep 2
select c from t2;
-connection writer;
-reap;
connection locker;
drop table t1;
drop table t2;
#
-# Test problem when using locks on many tables and droping a table that
+# Test problem when using locks on many tables and dropping a table that
# is to-be-locked by another thread
#
-
+#
connection locker;
create table t1 (a int);
create table t2 (a int);
lock table t1 write, t2 write;
connection reader;
-send insert t1 select * from t2;
+send
+insert t1 select * from t2;
connection locker;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert t1 select * from t2";
+--source include/wait_condition.inc
drop table t2;
connection reader;
---error 1146
+--error ER_NO_SUCH_TABLE
reap;
connection locker;
drop table t1;
@@ -97,20 +66,26 @@ create table t1 (a int);
create table t2 (a int);
lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
connection reader;
-send insert t1 select * from t2;
+send
+insert t1 select * from t2;
connection locker;
+# Sleep a bit till the insert of connection reader is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert t1 select * from t2";
+--source include/wait_condition.inc
drop table t2;
connection reader;
---error 1146
+--error ER_NO_SUCH_TABLE
reap;
connection locker;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
#
-# BUG#9998 - MySQL client hangs on USE "database"
+# Bug#9998 MySQL client hangs on USE "database"
#
create table t1(a int);
lock tables t1 write;
@@ -121,21 +96,30 @@ unlock tables;
drop table t1;
#
-# Bug#16986 - Deadlock condition with MyISAM tables
+# Bug#16986 Deadlock condition with MyISAM tables
#
+
+# Need a matching user in mysql.user for multi-table select
+--source include/add_anonymous_users.inc
+
connection locker;
-use mysql;
+USE mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES;
---sleep 1
#
connection reader;
-use mysql;
-#NOTE: This must be a multi-table select, otherwise the deadlock will not occur
-send SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
---sleep 1
+USE mysql;
+# Note: This must be a multi-table select, otherwise the deadlock will not occur
+send
+SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
#
connection locker;
+# Sleep a bit till the select of connection reader is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table" and info =
+ "SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1";
+--source include/wait_condition.inc
# Make test case independent from earlier grants.
--replace_result "Table is already up to date" "OK"
OPTIMIZE TABLES columns_priv, db, host, user;
@@ -143,7 +127,7 @@ UNLOCK TABLES;
#
connection reader;
reap;
-use test;
+USE test;
#
connection locker;
use test;
@@ -158,11 +142,16 @@ LOCK TABLE t1 WRITE;
#
# This waits until t1 is unlocked.
connection locker;
-send FLUSH TABLES WITH READ LOCK;
---sleep 1
+send
+FLUSH TABLES WITH READ LOCK;
#
-# This must not block.
connection writer;
+# Sleep a bit till the flush of connection locker is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables" and info = "FLUSH TABLES WITH READ LOCK";
+--source include/wait_condition.inc
+# This must not block.
CREATE TABLE t2 (c1 int);
UNLOCK TABLES;
#
@@ -182,12 +171,17 @@ LOCK TABLE t1 WRITE;
#
# This waits until t1 is unlocked.
connection locker;
-send FLUSH TABLES WITH READ LOCK;
---sleep 1
+send
+FLUSH TABLES WITH READ LOCK;
#
# This must not block.
connection writer;
---error 1100
+# Sleep a bit till the flush of connection locker is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables" and info = "FLUSH TABLES WITH READ LOCK";
+--source include/wait_condition.inc
+--error ER_TABLE_NOT_LOCKED
CREATE TABLE t2 AS SELECT * FROM t1;
UNLOCK TABLES;
#
@@ -199,8 +193,10 @@ UNLOCK TABLES;
connection default;
DROP TABLE t1;
+--source include/delete_anonymous_users.inc
+
#
-# Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
+# Bug#19815 CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
#
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
@@ -212,12 +208,18 @@ FLUSH TABLES WITH READ LOCK;
# With bug in place: acquire LOCK_mysql_create_table and
# wait in wait_if_global_read_lock().
connection con2;
-send DROP DATABASE mysqltest_1;
---sleep 1
+send
+DROP DATABASE mysqltest_1;
#
# With bug in place: try to acquire LOCK_mysql_create_table...
# When fixed: Reject dropping db because of the read lock.
connection con1;
+# Wait a bit so that the session con2 is in state "Waiting for release of readlock"
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock"
+ and info = "DROP DATABASE mysqltest_1";
+--source include/wait_condition.inc
--error ER_CANT_UPDATE_WITH_READLOCK
DROP DATABASE mysqltest_1;
UNLOCK TABLES;
@@ -234,7 +236,7 @@ disconnect con2;
DROP DATABASE mysqltest_1;
#
-# Bug #17264: MySQL Server freeze
+# Bug#17264 MySQL Server freeze
#
connection locker;
# Disable warnings to allow test to run also without InnoDB
@@ -243,17 +245,22 @@ create table t1 (f1 int(12) unsigned not
--enable_warnings
lock tables t1 write;
connection writer;
---sleep 2
-delimiter //;
-send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-delimiter ;//
-connection reader;
---sleep 2
-delimiter //;
-send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-delimiter ;//
-connection locker;
---sleep 2
+send
+alter table t1 auto_increment=0;
+connection reader;
+# Wait till connection writer is blocked
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "alter table t1 auto_increment=0";
+--source include/wait_condition.inc
+send
+alter table t1 auto_increment=0;
+connection locker;
+# Wait till connection reader is blocked
+let $wait_condition=
+ select count(*) = 2 from information_schema.processlist
+ where state = "Locked" and info = "alter table t1 auto_increment=0";
+--source include/wait_condition.inc
unlock tables;
connection writer;
reap;
@@ -262,8 +269,310 @@ reap;
connection locker;
drop table t1;
+#
+# Bug#43230: SELECT ... FOR UPDATE can hang with FLUSH TABLES WITH READ LOCK indefinitely
+#
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connect (con3,localhost,root,,);
+connect (con4,localhost,root,,);
+connect (con5,localhost,root,,);
+
+create table t1 (a int);
+create table t2 like t1;
+
+connection con1;
+--echo # con1
+lock tables t1 write;
+connection con2;
+--echo # con2
+send flush tables with read lock;
+connection con5;
+--echo # con5
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Flushing tables';
+--source include/wait_show_condition.inc
+--echo # global read lock is taken
+connection con3;
+--echo # con3
+send select * from t2 for update;
+connection con5;
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Waiting for release of readlock';
+--source include/wait_show_condition.inc
+--echo # waiting for release of read lock
+connection con4;
+--echo # con4
+--echo # would hang and later cause a deadlock
+flush tables t2;
+connection con1;
+--echo # clean up
+unlock tables;
+connection con2;
+--reap
+unlock tables;
+connection con3;
+--reap
+connection default;
+disconnect con5;
+disconnect con4;
+disconnect con3;
+disconnect con2;
+disconnect con1;
+
+drop table t1,t2;
+
+--echo #
+--echo # Lightweight version:
+--echo # Ensure that the wait for a GRL is done before opening tables.
+--echo #
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+create table t1 (a int);
+create table t2 like t1;
+
+--echo #
+--echo # UPDATE
+--echo #
+
+connection default;
+--echo # default
+flush tables with read lock;
+connection con1;
+--echo # con1
+send update t2 set a = 1;
+connection default;
+--echo # default
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Waiting for release of readlock';
+--source include/wait_show_condition.inc
+--echo # statement is waiting for release of read lock
+connection con2;
+--echo # con2
+flush table t2;
+connection default;
+--echo # default
+unlock tables;
+connection con1;
+--echo # con1
+--reap
+
+--echo #
+--echo # LOCK TABLES .. WRITE
+--echo #
+
+connection default;
+--echo # default
+flush tables with read lock;
+connection con1;
+--echo # con1
+send lock tables t2 write;
+connection default;
+--echo # default
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Waiting for release of readlock';
+--source include/wait_show_condition.inc
+--echo # statement is waiting for release of read lock
+connection con2;
+--echo # con2
+flush table t2;
+connection default;
+--echo # default
+unlock tables;
+connection con1;
+--echo # con1
+--reap
+unlock tables;
+
+connection default;
+disconnect con2;
+disconnect con1;
+
+drop table t1,t2;
+
+
+--echo End of 5.0 tests
+
+
+#
+# Bug#21281 Pending write lock is incorrectly removed when its
+# statement being KILLed
+#
+create table t1 (i int);
+connection locker;
+lock table t1 read;
+connection writer;
+send
+update t1 set i= 10;
+connection reader;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "update t1 set i= 10";
+--source include/wait_condition.inc
+send
+select * from t1;
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "select * from t1";
+--source include/wait_condition.inc
+let $ID= `select id from information_schema.processlist where state = "Locked" and info = "update t1 set i= 10"`;
+--replace_result $ID ID
+eval kill query $ID;
+connection reader;
+--reap
+connection writer;
+--error ER_QUERY_INTERRUPTED
+--reap
+connection locker;
+unlock tables;
+connection default;
+drop table t1;
+
+# Disconnect sessions used in many subtests above
+disconnect locker;
+disconnect reader;
+disconnect writer;
+
+#
+# Bug#32395 Alter table under a impending global read lock causes a server crash
+#
+
+#
+# Test ALTER TABLE under LOCK TABLES and FLUSH TABLES WITH READ LOCK
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (i int);
+connect (flush,localhost,root,,test,,);
+connection default;
+--echo connection: default
+lock tables t1 write;
+connection flush;
+--echo connection: flush
+--send flush tables with read lock;
+connection default;
+--echo connection: default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+alter table t1 add column j int;
+connect (insert,localhost,root,,test,,);
+connection insert;
+--echo connection: insert
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+--send insert into t1 values (1,2);
+--echo connection: default
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock";
+--source include/wait_condition.inc
+unlock tables;
+connection flush;
+--echo connection: flush
+--reap
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock";
+--source include/wait_condition.inc
+select * from t1;
+unlock tables;
+connection insert;
+--reap
+connection default;
+let $wait_condition=
+ select count(*) = 1 from t1;
+--source include/wait_condition.inc
+select * from t1;
+drop table t1;
+disconnect flush;
+disconnect insert;
+
+#
+# Test that FLUSH TABLES under LOCK TABLES protects write locked tables
+# from a impending FLUSH TABLES WITH READ LOCK
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (i int);
+connect (flush,localhost,root,,test,,);
+connection default;
+--echo connection: default
+lock tables t1 write;
+connection flush;
+--echo connection: flush
+--send flush tables with read lock;
+connection default;
+--echo connection: default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+flush tables;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+unlock tables;
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+connection flush;
+--reap
+connection default;
+disconnect flush;
+drop table t1;
+
+#
+# Bug#30331 Table_locks_waited shows inaccurate values
+#
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+create table t1 (a int);
+flush status;
+lock tables t1 read;
+let $tlwa= `show status like 'Table_locks_waited'`;
+connect (waiter,localhost,root,,);
+connection waiter;
+--send insert into t1 values(1);
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert into t1 values(1)";
+--source include/wait_condition.inc
+let $tlwb= `show status like 'Table_locks_waited'`;
+unlock tables;
+drop table t1;
+disconnect waiter;
+connection default;
--disable_query_log
+eval SET @tlwa= SUBSTRING_INDEX('$tlwa', ' ', -1);
+eval SET @tlwb= SUBSTRING_INDEX('$tlwb', ' ', -1);
drop database pbxt;
--enable_query_log
-# End of 5.0 tests
+select @tlwa < @tlwb;
+
+--echo End of 5.1 tests
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
=== modified file 'storage/pbxt/src/ha_pbxt.cc'
--- storage/pbxt/src/ha_pbxt.cc 2009-12-29 11:34:44 +0000
+++ storage/pbxt/src/ha_pbxt.cc 2010-01-06 17:38:08 +0000
@@ -1294,7 +1294,7 @@ static int pbxt_init(void *p)
#6 0x000debe1 in THD::THD at sql_class.cc:631
#7 0x00e207a4 in myxt_create_thread at myxt_xt.cc:2666
#8 0x00e3134b in tabc_fr_run_thread at tabcache_xt.cc:982
- #9 0x00e422ca in thr_main at thread_xt.cc:1006
+ #9 0x00e422ca in thr_main_pbxt at thread_xt.cc:1006
#10 0x91ff7c55 in _pthread_start
#11 0x91ff7b12 in thread_start
*
@@ -1557,7 +1557,7 @@ static int pbxt_prepare(handlerton *hton
return err;
}
-static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, char *thread_name, int *err)
+static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, const char *thread_name, int *err)
{
THD *thd;
XTThreadPtr self = NULL;
=== modified file 'storage/pbxt/src/restart_xt.cc'
--- storage/pbxt/src/restart_xt.cc 2009-11-27 15:37:02 +0000
+++ storage/pbxt/src/restart_xt.cc 2010-01-06 17:38:22 +0000
@@ -3314,7 +3314,7 @@ static void *xn_xres_run_recovery_thread
* #7 0x000c0db2 in THD::~THD at sql_class.cc:934
* #8 0x003b025b in myxt_destroy_thread at myxt_xt.cc:2999
* #9 0x003b66b5 in xn_xres_run_recovery_thread at restart_xt.cc:3196
- * #10 0x003cbfbb in thr_main at thread_xt.cc:1020
+ * #10 0x003cbfbb in thr_main_pbxt at thread_xt.cc:1020
*
myxt_destroy_thread(mysql_thread, TRUE);
*/
=== modified file 'storage/pbxt/src/thread_xt.cc'
--- storage/pbxt/src/thread_xt.cc 2009-12-22 10:33:20 +0000
+++ storage/pbxt/src/thread_xt.cc 2010-01-06 17:37:45 +0000
@@ -1013,7 +1013,7 @@ static xtBool thr_setup_signals(void)
typedef void *(*ThreadMainFunc)(XTThreadPtr self);
-extern "C" void *thr_main(void *data)
+extern "C" void *thr_main_pbxt(void *data)
{
ThreadDataPtr td = (ThreadDataPtr) data;
XTThreadPtr self = td->td_thr;
@@ -1503,10 +1503,10 @@ xtPublic pthread_t xt_run_thread(XTThrea
pthread_attr_t attr = { 0, 0, 0 };
attr.priority = THREAD_PRIORITY_NORMAL;
- err = pthread_create(&child_thread, &attr, thr_main, &data);
+ err = pthread_create(&child_thread, &attr, thr_main_pbxt, &data);
}
#else
- err = pthread_create(&child_thread, NULL, thr_main, &data);
+ err = pthread_create(&child_thread, NULL, thr_main_pbxt, &data);
#endif
if (err) {
xt_free_thread(child);
=== modified file 'storage/pbxt/src/thread_xt.h'
--- storage/pbxt/src/thread_xt.h 2009-11-24 10:55:06 +0000
+++ storage/pbxt/src/thread_xt.h 2010-01-06 17:37:13 +0000
@@ -536,7 +536,7 @@ extern struct XTThread **xt_thr_array;
* Function prototypes
*/
-extern "C" void *thr_main(void *data);
+extern "C" void *thr_main_pbxt(void *data);
void xt_get_now(char *buffer, size_t len);
xtBool xt_init_logging(void);
2
1

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2787)
by Michael Widenius 07 Jan '10
by Michael Widenius 07 Jan '10
07 Jan '10
#At lp:maria based on revid:knielsen@knielsen-hq.org-20100105142834-adpbyr6x7edubwps
2787 Michael Widenius 2010-01-06
Removed compiler warnings
Fixed sporadic test failure for suit/pbxt/t/lock_multi.test
Fixed sporadic test faulure for suit/rpl/t/do_grant.test
OpenSolaris 5.11-x86 now compiles (tested with 32 bit)
modified:
BUILD/compile-solaris-amd64-debug-forte*
BUILD/compile-solaris-x86-32*
BUILD/compile-solaris-x86-32-debug*
BUILD/compile-solaris-x86-32-debug-forte*
BUILD/compile-solaris-x86-forte-32*
extra/libevent/devpoll.c
extra/libevent/evbuffer.c
extra/libevent/select.c
mysql-test/mysql-test-run.pl
mysql-test/suite/pbxt/r/lock_multi.result
mysql-test/suite/pbxt/t/lock_multi.test
mysys/my_sync.c
sql/ha_ndbcluster.cc
storage/archive/azlib.h
storage/maria/ma_blockrec.c
storage/maria/ma_loghandler.c
storage/maria/ma_test3.c
storage/myisam/mi_test3.c
storage/pbxt/src/ha_pbxt.cc
storage/pbxt/src/restart_xt.cc
storage/pbxt/src/thread_xt.cc
storage/pbxt/src/thread_xt.h
storage/xtradb/srv/srv0srv.c
support-files/compiler_warnings.supp
per-file messages:
BUILD/compile-solaris-amd64-debug-forte
Added execute bit
BUILD/compile-solaris-x86-32
Added execute bit
BUILD/compile-solaris-x86-32-debug
Added execute bit
BUILD/compile-solaris-x86-32-debug-forte
Added execute bit
BUILD/compile-solaris-x86-forte-32
Added execute bit
extra/libevent/devpoll.c
Removed compiler warning
extra/libevent/evbuffer.c
Removed compiler warning
extra/libevent/select.c
Removed compiler warning
mysql-test/mysql-test-run.pl
Fixed sporadic test faulure for suit/rpl/t/do_grant.test (Seen on OpenSolaris)
mysql-test/suite/pbxt/r/lock_multi.result
Fixed sporadic test failure for suit/pbxt/t/lock_multi.test (seen in buildbot)
This was done by merging the test with main/lock_multi.test
mysql-test/suite/pbxt/t/lock_multi.test
Fixed sporadic test failure for suit/pbxt/t/lock_multi.test (seen in buildbot)
This was done by merging the test with main/lock_multi.test
mysys/my_sync.c
Removed compiler warnings
sql/ha_ndbcluster.cc
Fixed linking error on OpenSolaris when compiling without ndb
Bug #34866 Can't compile on Solaris 9/Sparc with gcc
storage/archive/azlib.h
Removed compiler warning about redefined symbols
storage/maria/ma_blockrec.c
Removed compiler warning
storage/maria/ma_loghandler.c
Removed compiler warning
storage/maria/ma_test3.c
Removed compiler warning
storage/myisam/mi_test3.c
Removed compiler warning
storage/pbxt/src/ha_pbxt.cc
Removed compiler warning
thr_main -> thr_main_pbxt
storage/pbxt/src/restart_xt.cc
thr_main -> thr_main_pbxt
storage/pbxt/src/thread_xt.cc
thr_main -> thr_main_pbxt
This was needed as thr_main() is an internal thread function on OpenSolaris()
storage/pbxt/src/thread_xt.h
thr_main -> thr_main_pbxt
storage/xtradb/srv/srv0srv.c
Use compatiblity macro to get code to work on OpenSolaris
support-files/compiler_warnings.supp
Ignore compiler warning from yassl
=== modified file 'BUILD/compile-solaris-amd64-debug-forte' (properties changed: -x to +x)
=== modified file 'BUILD/compile-solaris-x86-32' (properties changed: -x to +x)
=== modified file 'BUILD/compile-solaris-x86-32-debug' (properties changed: -x to +x)
=== modified file 'BUILD/compile-solaris-x86-32-debug-forte' (properties changed: -x to +x)
=== modified file 'BUILD/compile-solaris-x86-forte-32' (properties changed: -x to +x)
=== modified file 'extra/libevent/devpoll.c'
--- a/extra/libevent/devpoll.c 2009-03-12 22:27:35 +0000
+++ b/extra/libevent/devpoll.c 2010-01-06 21:27:53 +0000
@@ -185,7 +185,9 @@ devpoll_init(struct event_base *base)
}
static int
-devpoll_recalc(struct event_base *base, void *arg, int max)
+devpoll_recalc(struct event_base *base __attribute__((unused)),
+ void *arg __attribute__((unused)),
+ int max)
{
struct devpollop *devpollop = arg;
=== modified file 'extra/libevent/evbuffer.c'
--- a/extra/libevent/evbuffer.c 2009-03-12 22:27:35 +0000
+++ b/extra/libevent/evbuffer.c 2010-01-06 21:27:53 +0000
@@ -25,12 +25,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <sys/types.h>
+
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -75,7 +75,8 @@ bufferevent_add(struct event *ev, int ti
*/
void
-bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now,
+bufferevent_read_pressure_cb(struct evbuffer *buf,
+ size_t old __attribute__((unused)), size_t now,
void *arg) {
struct bufferevent *bufev = arg;
/*
=== modified file 'extra/libevent/select.c'
--- a/extra/libevent/select.c 2009-03-12 22:27:35 +0000
+++ b/extra/libevent/select.c 2010-01-06 21:27:53 +0000
@@ -266,7 +266,7 @@ select_add(void *arg, struct event *ev)
* of the fd_sets for select(2)
*/
if (sop->event_fds < ev->ev_fd) {
- int fdsz = sop->event_fdsz;
+ unsigned int fdsz = sop->event_fdsz;
if (fdsz < sizeof(fd_mask))
fdsz = sizeof(fd_mask);
@@ -275,7 +275,7 @@ select_add(void *arg, struct event *ev)
(howmany(ev->ev_fd + 1, NFDBITS) * sizeof(fd_mask)))
fdsz *= 2;
- if (fdsz != sop->event_fdsz) {
+ if (fdsz != (unsigned int) sop->event_fdsz) {
if (select_resize(sop, fdsz)) {
check_selectop(sop);
return (-1);
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2010-01-05 14:28:34 +0000
+++ b/mysql-test/mysql-test-run.pl 2010-01-06 21:27:53 +0000
@@ -4010,6 +4010,7 @@ sub extract_warning_lines ($) {
qr/Slave I\/O: error reconnecting to master '.*' - retry-time: [1-3] retries/,
qr/Error reading packet/,
qr/Slave: Can't drop database.* database doesn't exist/,
+ qr/Slave: Operation DROP USER failed for 'create_rout_db'/,
);
my $matched_lines= [];
=== modified file 'mysql-test/suite/pbxt/r/lock_multi.result'
--- a/mysql-test/suite/pbxt/r/lock_multi.result 2009-04-02 10:03:14 +0000
+++ b/mysql-test/suite/pbxt/r/lock_multi.result 2010-01-06 21:27:53 +0000
@@ -1,22 +1,4 @@
drop table if exists t1,t2;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 write;
-update low_priority t1 set n = 4;
-select n from t1;
-unlock tables;
-n
-1
-drop table t1;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 read;
-update low_priority t1 set n = 4;
-select n from t1;
-unlock tables;
-n
-1
-drop table t1;
create table t1 (a int, b int);
create table t2 (c int, d int);
insert into t1 values(1,1);
@@ -43,6 +25,7 @@ insert t1 select * from t2;
drop table t2;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
+End of 4.1 tests
create table t1(a int);
lock tables t1 write;
show columns from t1;
@@ -50,10 +33,10 @@ Field Type Null Key Default Extra
a int(11) YES NULL
unlock tables;
drop table t1;
-use mysql;
+USE mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES;
-use mysql;
+USE mysql;
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
OPTIMIZE TABLES columns_priv, db, host, user;
Table Op Msg_type Msg_text
@@ -63,7 +46,8 @@ mysql.host optimize status OK
mysql.user optimize status OK
UNLOCK TABLES;
Select_priv
-use test;
+N
+USE test;
use test;
CREATE TABLE t1 (c1 int);
LOCK TABLE t1 WRITE;
@@ -90,7 +74,115 @@ DROP DATABASE mysqltest_1;
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
lock tables t1 write;
-alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+alter table t1 auto_increment=0;
+alter table t1 auto_increment=0;
+unlock tables;
+drop table t1;
+create table t1 (a int);
+create table t2 like t1;
+# con1
+lock tables t1 write;
+# con2
+flush tables with read lock;
+# con5
+# global read lock is taken
+# con3
+select * from t2 for update;
+# waiting for release of read lock
+# con4
+# would hang and later cause a deadlock
+flush tables t2;
+# clean up
+unlock tables;
+unlock tables;
+a
+drop table t1,t2;
+#
+# Lightweight version:
+# Ensure that the wait for a GRL is done before opening tables.
+#
+create table t1 (a int);
+create table t2 like t1;
+#
+# UPDATE
+#
+# default
+flush tables with read lock;
+# con1
+update t2 set a = 1;
+# default
+# statement is waiting for release of read lock
+# con2
+flush table t2;
+# default
+unlock tables;
+# con1
+#
+# LOCK TABLES .. WRITE
+#
+# default
+flush tables with read lock;
+# con1
+lock tables t2 write;
+# default
+# statement is waiting for release of read lock
+# con2
+flush table t2;
+# default
+unlock tables;
+# con1
+unlock tables;
+drop table t1,t2;
+End of 5.0 tests
+create table t1 (i int);
+lock table t1 read;
+update t1 set i= 10;
+select * from t1;
+Timeout in wait_condition.inc for select count(*) = 1 from information_schema.processlist
+where state = "Locked" and info = "select * from t1"
+kill query ID;
+i
+ERROR 70100: Query execution was interrupted
+unlock tables;
+drop table t1;
+drop table if exists t1;
+create table t1 (i int);
+connection: default
+lock tables t1 write;
+connection: flush
+flush tables with read lock;;
+connection: default
+alter table t1 add column j int;
+connection: insert
+insert into t1 values (1,2);;
+connection: default
+unlock tables;
+connection: flush
+select * from t1;
+i j
+unlock tables;
+select * from t1;
+i j
+1 2
+drop table t1;
+drop table if exists t1;
+create table t1 (i int);
+connection: default
+lock tables t1 write;
+connection: flush
+flush tables with read lock;;
+connection: default
+flush tables;
+unlock tables;
+drop table t1;
+drop table if exists t1,t2;
+create table t1 (a int);
+flush status;
+lock tables t1 read;
+insert into t1 values(1);;
unlock tables;
drop table t1;
+select @tlwa < @tlwb;
+@tlwa < @tlwb
+1
+End of 5.1 tests
=== modified file 'mysql-test/suite/pbxt/t/lock_multi.test'
--- a/mysql-test/suite/pbxt/t/lock_multi.test 2009-04-02 10:03:14 +0000
+++ b/mysql-test/suite/pbxt/t/lock_multi.test 2010-01-06 21:27:53 +0000
@@ -1,4 +1,8 @@
-- source include/not_embedded.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
@@ -9,42 +13,6 @@ connect (locker,localhost,root,,);
connect (reader,localhost,root,,);
connect (writer,localhost,root,,);
-connection locker;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 write;
-connection writer;
-send update low_priority t1 set n = 4;
-connection reader;
---sleep 2
-send select n from t1;
-connection locker;
---sleep 2
-unlock tables;
-connection writer;
-reap;
-connection reader;
-reap;
-drop table t1;
-
-connection locker;
-create table t1(n int);
-insert into t1 values (1);
-lock tables t1 read;
-connection writer;
-send update low_priority t1 set n = 4;
-connection reader;
---sleep 2
-send select n from t1;
-connection locker;
---sleep 2
-unlock tables;
-connection writer;
-reap;
-connection reader;
-reap;
-drop table t1;
-
#
# Test problem when using locks with multi-updates
# It should not block when multi-update is reading on a read-locked table
@@ -58,32 +26,33 @@ insert into t1 values(2,2);
insert into t2 values(1,2);
lock table t1 read;
connection writer;
---sleep 2
-send update t1,t2 set c=a where b=d;
+update t1,t2 set c=a where b=d;
connection reader;
---sleep 2
select c from t2;
-connection writer;
-reap;
connection locker;
drop table t1;
drop table t2;
#
-# Test problem when using locks on many tables and droping a table that
+# Test problem when using locks on many tables and dropping a table that
# is to-be-locked by another thread
#
-
+#
connection locker;
create table t1 (a int);
create table t2 (a int);
lock table t1 write, t2 write;
connection reader;
-send insert t1 select * from t2;
+send
+insert t1 select * from t2;
connection locker;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert t1 select * from t2";
+--source include/wait_condition.inc
drop table t2;
connection reader;
---error 1146
+--error ER_NO_SUCH_TABLE
reap;
connection locker;
drop table t1;
@@ -97,20 +66,26 @@ create table t1 (a int);
create table t2 (a int);
lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
connection reader;
-send insert t1 select * from t2;
+send
+insert t1 select * from t2;
connection locker;
+# Sleep a bit till the insert of connection reader is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert t1 select * from t2";
+--source include/wait_condition.inc
drop table t2;
connection reader;
---error 1146
+--error ER_NO_SUCH_TABLE
reap;
connection locker;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
#
-# BUG#9998 - MySQL client hangs on USE "database"
+# Bug#9998 MySQL client hangs on USE "database"
#
create table t1(a int);
lock tables t1 write;
@@ -121,21 +96,30 @@ unlock tables;
drop table t1;
#
-# Bug#16986 - Deadlock condition with MyISAM tables
+# Bug#16986 Deadlock condition with MyISAM tables
#
+
+# Need a matching user in mysql.user for multi-table select
+--source include/add_anonymous_users.inc
+
connection locker;
-use mysql;
+USE mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES;
---sleep 1
#
connection reader;
-use mysql;
-#NOTE: This must be a multi-table select, otherwise the deadlock will not occur
-send SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
---sleep 1
+USE mysql;
+# Note: This must be a multi-table select, otherwise the deadlock will not occur
+send
+SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
#
connection locker;
+# Sleep a bit till the select of connection reader is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table" and info =
+ "SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1";
+--source include/wait_condition.inc
# Make test case independent from earlier grants.
--replace_result "Table is already up to date" "OK"
OPTIMIZE TABLES columns_priv, db, host, user;
@@ -143,7 +127,7 @@ UNLOCK TABLES;
#
connection reader;
reap;
-use test;
+USE test;
#
connection locker;
use test;
@@ -158,11 +142,16 @@ LOCK TABLE t1 WRITE;
#
# This waits until t1 is unlocked.
connection locker;
-send FLUSH TABLES WITH READ LOCK;
---sleep 1
+send
+FLUSH TABLES WITH READ LOCK;
#
-# This must not block.
connection writer;
+# Sleep a bit till the flush of connection locker is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables" and info = "FLUSH TABLES WITH READ LOCK";
+--source include/wait_condition.inc
+# This must not block.
CREATE TABLE t2 (c1 int);
UNLOCK TABLES;
#
@@ -182,12 +171,17 @@ LOCK TABLE t1 WRITE;
#
# This waits until t1 is unlocked.
connection locker;
-send FLUSH TABLES WITH READ LOCK;
---sleep 1
+send
+FLUSH TABLES WITH READ LOCK;
#
# This must not block.
connection writer;
---error 1100
+# Sleep a bit till the flush of connection locker is in work and hangs
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables" and info = "FLUSH TABLES WITH READ LOCK";
+--source include/wait_condition.inc
+--error ER_TABLE_NOT_LOCKED
CREATE TABLE t2 AS SELECT * FROM t1;
UNLOCK TABLES;
#
@@ -199,8 +193,10 @@ UNLOCK TABLES;
connection default;
DROP TABLE t1;
+--source include/delete_anonymous_users.inc
+
#
-# Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
+# Bug#19815 CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
#
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
@@ -212,12 +208,18 @@ FLUSH TABLES WITH READ LOCK;
# With bug in place: acquire LOCK_mysql_create_table and
# wait in wait_if_global_read_lock().
connection con2;
-send DROP DATABASE mysqltest_1;
---sleep 1
+send
+DROP DATABASE mysqltest_1;
#
# With bug in place: try to acquire LOCK_mysql_create_table...
# When fixed: Reject dropping db because of the read lock.
connection con1;
+# Wait a bit so that the session con2 is in state "Waiting for release of readlock"
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock"
+ and info = "DROP DATABASE mysqltest_1";
+--source include/wait_condition.inc
--error ER_CANT_UPDATE_WITH_READLOCK
DROP DATABASE mysqltest_1;
UNLOCK TABLES;
@@ -234,7 +236,7 @@ disconnect con2;
DROP DATABASE mysqltest_1;
#
-# Bug #17264: MySQL Server freeze
+# Bug#17264 MySQL Server freeze
#
connection locker;
# Disable warnings to allow test to run also without InnoDB
@@ -243,17 +245,22 @@ create table t1 (f1 int(12) unsigned not
--enable_warnings
lock tables t1 write;
connection writer;
---sleep 2
-delimiter //;
-send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-delimiter ;//
-connection reader;
---sleep 2
-delimiter //;
-send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-delimiter ;//
-connection locker;
---sleep 2
+send
+alter table t1 auto_increment=0;
+connection reader;
+# Wait till connection writer is blocked
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "alter table t1 auto_increment=0";
+--source include/wait_condition.inc
+send
+alter table t1 auto_increment=0;
+connection locker;
+# Wait till connection reader is blocked
+let $wait_condition=
+ select count(*) = 2 from information_schema.processlist
+ where state = "Locked" and info = "alter table t1 auto_increment=0";
+--source include/wait_condition.inc
unlock tables;
connection writer;
reap;
@@ -262,8 +269,310 @@ reap;
connection locker;
drop table t1;
+#
+# Bug#43230: SELECT ... FOR UPDATE can hang with FLUSH TABLES WITH READ LOCK indefinitely
+#
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connect (con3,localhost,root,,);
+connect (con4,localhost,root,,);
+connect (con5,localhost,root,,);
+
+create table t1 (a int);
+create table t2 like t1;
+
+connection con1;
+--echo # con1
+lock tables t1 write;
+connection con2;
+--echo # con2
+send flush tables with read lock;
+connection con5;
+--echo # con5
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Flushing tables';
+--source include/wait_show_condition.inc
+--echo # global read lock is taken
+connection con3;
+--echo # con3
+send select * from t2 for update;
+connection con5;
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Waiting for release of readlock';
+--source include/wait_show_condition.inc
+--echo # waiting for release of read lock
+connection con4;
+--echo # con4
+--echo # would hang and later cause a deadlock
+flush tables t2;
+connection con1;
+--echo # clean up
+unlock tables;
+connection con2;
+--reap
+unlock tables;
+connection con3;
+--reap
+connection default;
+disconnect con5;
+disconnect con4;
+disconnect con3;
+disconnect con2;
+disconnect con1;
+
+drop table t1,t2;
+
+--echo #
+--echo # Lightweight version:
+--echo # Ensure that the wait for a GRL is done before opening tables.
+--echo #
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+create table t1 (a int);
+create table t2 like t1;
+
+--echo #
+--echo # UPDATE
+--echo #
+
+connection default;
+--echo # default
+flush tables with read lock;
+connection con1;
+--echo # con1
+send update t2 set a = 1;
+connection default;
+--echo # default
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Waiting for release of readlock';
+--source include/wait_show_condition.inc
+--echo # statement is waiting for release of read lock
+connection con2;
+--echo # con2
+flush table t2;
+connection default;
+--echo # default
+unlock tables;
+connection con1;
+--echo # con1
+--reap
+
+--echo #
+--echo # LOCK TABLES .. WRITE
+--echo #
+
+connection default;
+--echo # default
+flush tables with read lock;
+connection con1;
+--echo # con1
+send lock tables t2 write;
+connection default;
+--echo # default
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Waiting for release of readlock';
+--source include/wait_show_condition.inc
+--echo # statement is waiting for release of read lock
+connection con2;
+--echo # con2
+flush table t2;
+connection default;
+--echo # default
+unlock tables;
+connection con1;
+--echo # con1
+--reap
+unlock tables;
+
+connection default;
+disconnect con2;
+disconnect con1;
+
+drop table t1,t2;
+
+
+--echo End of 5.0 tests
+
+
+#
+# Bug#21281 Pending write lock is incorrectly removed when its
+# statement being KILLed
+#
+create table t1 (i int);
+connection locker;
+lock table t1 read;
+connection writer;
+send
+update t1 set i= 10;
+connection reader;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "update t1 set i= 10";
+--source include/wait_condition.inc
+send
+select * from t1;
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "select * from t1";
+--source include/wait_condition.inc
+let $ID= `select id from information_schema.processlist where state = "Locked" and info = "update t1 set i= 10"`;
+--replace_result $ID ID
+eval kill query $ID;
+connection reader;
+--reap
+connection writer;
+--error ER_QUERY_INTERRUPTED
+--reap
+connection locker;
+unlock tables;
+connection default;
+drop table t1;
+
+# Disconnect sessions used in many subtests above
+disconnect locker;
+disconnect reader;
+disconnect writer;
+
+#
+# Bug#32395 Alter table under a impending global read lock causes a server crash
+#
+
+#
+# Test ALTER TABLE under LOCK TABLES and FLUSH TABLES WITH READ LOCK
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (i int);
+connect (flush,localhost,root,,test,,);
+connection default;
+--echo connection: default
+lock tables t1 write;
+connection flush;
+--echo connection: flush
+--send flush tables with read lock;
+connection default;
+--echo connection: default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+alter table t1 add column j int;
+connect (insert,localhost,root,,test,,);
+connection insert;
+--echo connection: insert
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+--send insert into t1 values (1,2);
+--echo connection: default
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock";
+--source include/wait_condition.inc
+unlock tables;
+connection flush;
+--echo connection: flush
+--reap
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock";
+--source include/wait_condition.inc
+select * from t1;
+unlock tables;
+connection insert;
+--reap
+connection default;
+let $wait_condition=
+ select count(*) = 1 from t1;
+--source include/wait_condition.inc
+select * from t1;
+drop table t1;
+disconnect flush;
+disconnect insert;
+
+#
+# Test that FLUSH TABLES under LOCK TABLES protects write locked tables
+# from a impending FLUSH TABLES WITH READ LOCK
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (i int);
+connect (flush,localhost,root,,test,,);
+connection default;
+--echo connection: default
+lock tables t1 write;
+connection flush;
+--echo connection: flush
+--send flush tables with read lock;
+connection default;
+--echo connection: default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+flush tables;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+unlock tables;
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+connection flush;
+--reap
+connection default;
+disconnect flush;
+drop table t1;
+
+#
+# Bug#30331 Table_locks_waited shows inaccurate values
+#
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+create table t1 (a int);
+flush status;
+lock tables t1 read;
+let $tlwa= `show status like 'Table_locks_waited'`;
+connect (waiter,localhost,root,,);
+connection waiter;
+--send insert into t1 values(1);
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert into t1 values(1)";
+--source include/wait_condition.inc
+let $tlwb= `show status like 'Table_locks_waited'`;
+unlock tables;
+drop table t1;
+disconnect waiter;
+connection default;
--disable_query_log
+eval SET @tlwa= SUBSTRING_INDEX('$tlwa', ' ', -1);
+eval SET @tlwb= SUBSTRING_INDEX('$tlwb', ' ', -1);
drop database pbxt;
--enable_query_log
-# End of 5.0 tests
+select @tlwa < @tlwb;
+
+--echo End of 5.1 tests
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
=== modified file 'mysys/my_sync.c'
--- a/mysys/my_sync.c 2008-04-28 16:24:05 +0000
+++ b/mysys/my_sync.c 2010-01-06 21:27:53 +0000
@@ -100,7 +100,8 @@ static const char cur_dir_name[]= {FN_CU
RETURN
0 if ok, !=0 if error
*/
-int my_sync_dir(const char *dir_name, myf my_flags)
+int my_sync_dir(const char *dir_name __attribute__((unused)),
+ myf my_flags __attribute__((unused)))
{
#ifdef NEED_EXPLICIT_SYNC_DIR
DBUG_ENTER("my_sync_dir");
@@ -141,7 +142,8 @@ int my_sync_dir(const char *dir_name, my
RETURN
0 if ok, !=0 if error
*/
-int my_sync_dir_by_file(const char *file_name, myf my_flags)
+int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
+ myf my_flags __attribute__((unused)))
{
#ifdef NEED_EXPLICIT_SYNC_DIR
char dir_name[FN_REFLEN];
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2009-12-03 11:19:05 +0000
+++ b/sql/ha_ndbcluster.cc 2010-01-06 21:27:53 +0000
@@ -10565,4 +10565,6 @@ mysql_declare_plugin(ndbcluster)
}
mysql_declare_plugin_end;
+#else
+int Sun_ar_require_a_symbol_here= 0;
#endif
=== modified file 'storage/archive/azlib.h'
--- a/storage/archive/azlib.h 2009-02-13 16:41:47 +0000
+++ b/storage/archive/azlib.h 2010-01-06 21:27:53 +0000
@@ -33,10 +33,9 @@
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
-#include <zlib.h>
-
#include "../../mysys/mysys_priv.h"
#include <my_dir.h>
+#include <zlib.h>
#ifdef __cplusplus
extern "C" {
=== modified file 'storage/maria/ma_blockrec.c'
--- a/storage/maria/ma_blockrec.c 2009-10-03 20:13:58 +0000
+++ b/storage/maria/ma_blockrec.c 2010-01-06 21:27:53 +0000
@@ -6094,7 +6094,7 @@ uint _ma_apply_redo_insert_row_head_or_t
DBUG_RETURN(0);
}
- if (((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) != page_type))
+ if (((uint) (buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) != page_type))
{
/*
This is a page that has been freed before and now should be
@@ -6241,7 +6241,7 @@ uint _ma_apply_redo_purge_row_head_or_ta
Note that in case the page is not anymore a head or tail page
a future redo will fix the bitmap.
*/
- if ((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == page_type)
+ if ((uint) (buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == page_type)
{
empty_space= uint2korr(buff+EMPTY_SPACE_OFFSET);
if (_ma_bitmap_set(info, page, page_type == HEAD_PAGE,
=== modified file 'storage/maria/ma_loghandler.c'
--- a/storage/maria/ma_loghandler.c 2009-05-19 09:28:05 +0000
+++ b/storage/maria/ma_loghandler.c 2010-01-06 21:27:53 +0000
@@ -2823,8 +2823,8 @@ static my_bool translog_page_validator(u
data->was_recovered= 0;
- if (uint3korr(page) != page_no ||
- uint3korr(page + 3) != data->number)
+ if ((pgcache_page_no_t) uint3korr(page) != page_no ||
+ (uint32) uint3korr(page + 3) != data->number)
{
DBUG_PRINT("error", ("Page (%lu,0x%lx): "
"page address written in the page is incorrect: "
=== modified file 'storage/maria/ma_test3.c'
--- a/storage/maria/ma_test3.c 2008-01-10 12:21:53 +0000
+++ b/storage/maria/ma_test3.c 2010-01-06 21:27:53 +0000
@@ -180,7 +180,7 @@ void start_test(int id)
if (pagecacheing && rnd(2) == 0)
init_pagecache(maria_pagecache, 65536L, 0, 0, MARIA_KEY_BLOCK_LENGTH,
MY_WME);
- printf("Process %d, pid: %d\n",id,getpid()); fflush(stdout);
+ printf("Process %d, pid: %ld\n",id,(long) getpid()); fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)
{
@@ -362,7 +362,7 @@ int test_write(MARIA_HA *file,int id,int
maria_extra(file,HA_EXTRA_WRITE_CACHE,0);
}
- sprintf((char*) record.id,"%7d",getpid());
+ sprintf((char*) record.id,"%7ld", (long) getpid());
strnmov((char*) record.text,"Testing...", sizeof(record.text));
tries=(uint) rnd(100)+10;
=== modified file 'storage/myisam/mi_test3.c'
--- a/storage/myisam/mi_test3.c 2008-04-28 16:24:05 +0000
+++ b/storage/myisam/mi_test3.c 2010-01-06 21:27:53 +0000
@@ -178,7 +178,8 @@ void start_test(int id)
}
if (key_cacheing && rnd(2) == 0)
init_key_cache(dflt_key_cache, KEY_CACHE_BLOCK_SIZE, 65536L, 0, 0);
- printf("Process %d, pid: %d\n",id,getpid()); fflush(stdout);
+ printf("Process %d, pid: %ld\n", id, (long) getpid());
+ fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)
{
@@ -362,7 +363,7 @@ int test_write(MI_INFO *file,int id,int
mi_extra(file,HA_EXTRA_WRITE_CACHE,0);
}
- sprintf((char*) record.id,"%7d",getpid());
+ sprintf((char*) record.id,"%7ld",(long) getpid());
strnmov((char*) record.text,"Testing...", sizeof(record.text));
tries=(uint) rnd(100)+10;
=== modified file 'storage/pbxt/src/ha_pbxt.cc'
--- a/storage/pbxt/src/ha_pbxt.cc 2009-12-29 11:34:44 +0000
+++ b/storage/pbxt/src/ha_pbxt.cc 2010-01-06 21:27:53 +0000
@@ -1294,7 +1294,7 @@ static int pbxt_init(void *p)
#6 0x000debe1 in THD::THD at sql_class.cc:631
#7 0x00e207a4 in myxt_create_thread at myxt_xt.cc:2666
#8 0x00e3134b in tabc_fr_run_thread at tabcache_xt.cc:982
- #9 0x00e422ca in thr_main at thread_xt.cc:1006
+ #9 0x00e422ca in thr_main_pbxt at thread_xt.cc:1006
#10 0x91ff7c55 in _pthread_start
#11 0x91ff7b12 in thread_start
*
@@ -1557,7 +1557,7 @@ static int pbxt_prepare(handlerton *hton
return err;
}
-static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, char *thread_name, int *err)
+static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, const char *thread_name, int *err)
{
THD *thd;
XTThreadPtr self = NULL;
=== modified file 'storage/pbxt/src/restart_xt.cc'
--- a/storage/pbxt/src/restart_xt.cc 2009-11-27 15:37:02 +0000
+++ b/storage/pbxt/src/restart_xt.cc 2010-01-06 21:27:53 +0000
@@ -3314,7 +3314,7 @@ static void *xn_xres_run_recovery_thread
* #7 0x000c0db2 in THD::~THD at sql_class.cc:934
* #8 0x003b025b in myxt_destroy_thread at myxt_xt.cc:2999
* #9 0x003b66b5 in xn_xres_run_recovery_thread at restart_xt.cc:3196
- * #10 0x003cbfbb in thr_main at thread_xt.cc:1020
+ * #10 0x003cbfbb in thr_main_pbxt at thread_xt.cc:1020
*
myxt_destroy_thread(mysql_thread, TRUE);
*/
=== modified file 'storage/pbxt/src/thread_xt.cc'
--- a/storage/pbxt/src/thread_xt.cc 2009-12-22 10:33:20 +0000
+++ b/storage/pbxt/src/thread_xt.cc 2010-01-06 21:27:53 +0000
@@ -1013,7 +1013,7 @@ static xtBool thr_setup_signals(void)
typedef void *(*ThreadMainFunc)(XTThreadPtr self);
-extern "C" void *thr_main(void *data)
+extern "C" void *thr_main_pbxt(void *data)
{
ThreadDataPtr td = (ThreadDataPtr) data;
XTThreadPtr self = td->td_thr;
@@ -1503,10 +1503,10 @@ xtPublic pthread_t xt_run_thread(XTThrea
pthread_attr_t attr = { 0, 0, 0 };
attr.priority = THREAD_PRIORITY_NORMAL;
- err = pthread_create(&child_thread, &attr, thr_main, &data);
+ err = pthread_create(&child_thread, &attr, thr_main_pbxt, &data);
}
#else
- err = pthread_create(&child_thread, NULL, thr_main, &data);
+ err = pthread_create(&child_thread, NULL, thr_main_pbxt, &data);
#endif
if (err) {
xt_free_thread(child);
=== modified file 'storage/pbxt/src/thread_xt.h'
--- a/storage/pbxt/src/thread_xt.h 2009-11-24 10:55:06 +0000
+++ b/storage/pbxt/src/thread_xt.h 2010-01-06 21:27:53 +0000
@@ -536,7 +536,7 @@ extern struct XTThread **xt_thr_array;
* Function prototypes
*/
-extern "C" void *thr_main(void *data);
+extern "C" void *thr_main_pbxt(void *data);
void xt_get_now(char *buffer, size_t len);
xtBool xt_init_logging(void);
=== modified file 'storage/xtradb/srv/srv0srv.c'
--- a/storage/xtradb/srv/srv0srv.c 2009-11-13 21:26:08 +0000
+++ b/storage/xtradb/srv/srv0srv.c 2010-01-06 21:27:53 +0000
@@ -81,6 +81,7 @@ Created 10/8/1995 Heikki Tuuri
#include "ut0mem.h"
#include "ut0ut.h"
#include "os0proc.h"
+#include "os0sync.h"
#include "mem0mem.h"
#include "mem0pool.h"
#include "sync0sync.h"
@@ -1102,12 +1103,12 @@ srv_conc_enter_innodb_timer_based(trx_t*
}
retry:
if (srv_conc_n_threads < (lint) srv_thread_concurrency) {
- conc_n_threads = __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ conc_n_threads = os_atomic_increment_lint(&srv_conc_n_threads, 1);
if (conc_n_threads <= (lint) srv_thread_concurrency) {
enter_innodb_with_tickets(trx);
return;
}
- __sync_add_and_fetch(&srv_conc_n_threads, -1);
+ os_atomic_increment_lint(&srv_conc_n_threads, -1);
}
if (!has_yielded)
{
@@ -1118,7 +1119,7 @@ retry:
if (trx->has_search_latch
|| NULL != UT_LIST_GET_FIRST(trx->trx_locks)) {
- conc_n_threads = __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ conc_n_threads = os_atomic_increment_lint(&srv_conc_n_threads, 1);
enter_innodb_with_tickets(trx);
return;
}
@@ -1129,7 +1130,7 @@ retry:
trx->op_info = "";
has_slept++;
}
- conc_n_threads = __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ conc_n_threads = os_atomic_increment_lint(&srv_conc_n_threads, 1);
enter_innodb_with_tickets(trx);
return;
}
@@ -1137,7 +1138,7 @@ retry:
static void
srv_conc_exit_innodb_timer_based(trx_t* trx)
{
- __sync_add_and_fetch(&srv_conc_n_threads, -1);
+ os_atomic_increment_lint(&srv_conc_n_threads, -1);
trx->declared_to_be_inside_innodb = FALSE;
trx->n_tickets_to_enter_innodb = 0;
return;
@@ -1326,7 +1327,7 @@ srv_conc_force_enter_innodb(
ut_ad(srv_conc_n_threads >= 0);
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
if (srv_thread_concurrency_timer_based) {
- __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ os_atomic_increment_lint(&srv_conc_n_threads, 1);
trx->declared_to_be_inside_innodb = TRUE;
trx->n_tickets_to_enter_innodb = 1;
return;
=== modified file 'support-files/compiler_warnings.supp'
--- a/support-files/compiler_warnings.supp 2009-10-03 20:13:58 +0000
+++ b/support-files/compiler_warnings.supp 2010-01-06 21:27:53 +0000
@@ -88,6 +88,9 @@ storage/maria/ma_pagecache.c: .*'info_ch
#
storage/pbxt/ : typedef.*was ignored in this declaration
+#
+# Yassl
+include/runtime.hpp: .*pure_error.*
#
# Groff warnings on OpenSUSE.
2
2

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2790)
by knielsenï¼ knielsen-hq.org 07 Jan '10
by knielsenï¼ knielsen-hq.org 07 Jan '10
07 Jan '10
#At lp:maria
2790 knielsen(a)knielsen-hq.org 2010-01-07
Add forgotten file to `make dist`.
modified:
BUILD/Makefile.am
=== modified file 'BUILD/Makefile.am'
--- a/BUILD/Makefile.am 2010-01-07 12:02:18 +0000
+++ b/BUILD/Makefile.am 2010-01-07 13:03:54 +0000
@@ -81,7 +81,8 @@ EXTRA_DIST = FINISH.sh \
compile-solaris-x86-32 \
compile-solaris-x86-32-debug \
compile-solaris-x86-32-debug-forte \
- compile-solaris-x86-forte-32
+ compile-solaris-x86-forte-32 \
+ util.sh
# Don't update the files from bitkeeper
%::SCCS/s.%
1
0

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2789)
by knielsenï¼ knielsen-hq.org 07 Jan '10
by knielsenï¼ knielsen-hq.org 07 Jan '10
07 Jan '10
#At lp:maria
2789 knielsen(a)knielsen-hq.org 2010-01-07
Revert earlier change that removes warnings, but breaks Windows compilation.
modified:
extra/libevent/devpoll.c
extra/libevent/evbuffer.c
=== modified file 'extra/libevent/devpoll.c'
--- a/extra/libevent/devpoll.c 2010-01-06 21:27:53 +0000
+++ b/extra/libevent/devpoll.c 2010-01-07 13:00:06 +0000
@@ -185,9 +185,7 @@ devpoll_init(struct event_base *base)
}
static int
-devpoll_recalc(struct event_base *base __attribute__((unused)),
- void *arg __attribute__((unused)),
- int max)
+devpoll_recalc(struct event_base *base, void *arg, int max)
{
struct devpollop *devpollop = arg;
=== modified file 'extra/libevent/evbuffer.c'
--- a/extra/libevent/evbuffer.c 2010-01-06 21:27:53 +0000
+++ b/extra/libevent/evbuffer.c 2010-01-07 13:00:06 +0000
@@ -75,8 +75,7 @@ bufferevent_add(struct event *ev, int ti
*/
void
-bufferevent_read_pressure_cb(struct evbuffer *buf,
- size_t old __attribute__((unused)), size_t now,
+bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now,
void *arg) {
struct bufferevent *bufev = arg;
/*
1
0

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2788)
by knielsenï¼ knielsen-hq.org 07 Jan '10
by knielsenï¼ knielsen-hq.org 07 Jan '10
07 Jan '10
#At lp:maria
2788 knielsen(a)knielsen-hq.org 2010-01-07
Add BUILD/compile-bintar, which builds MariaDB with correct options for a binary tarball release.
added:
BUILD/compile-bintar
BUILD/util.sh
modified:
BUILD/Makefile.am
BUILD/SETUP.sh
per-file messages:
BUILD/Makefile.am
Add BUILD/compile-bintar to source tarball.
BUILD/SETUP.sh
Move common code to separate file to enable sharing.
BUILD/compile-bintar
Add script to build with correct flags and ./configure options for bintar package.
BUILD/util.sh
Move common code to separate file to enable sharing.
=== modified file 'BUILD/Makefile.am'
--- a/BUILD/Makefile.am 2009-08-29 19:04:46 +0000
+++ b/BUILD/Makefile.am 2010-01-07 12:02:18 +0000
@@ -34,6 +34,7 @@ EXTRA_DIST = FINISH.sh \
compile-amd64-max \
compile-amd64-max-sci \
compile-amd64-valgrind-max \
+ compile-bintar \
compile-darwin-mwcc \
compile-dist \
compile-hpux11-parisc2-aCC \
=== modified file 'BUILD/SETUP.sh'
--- a/BUILD/SETUP.sh 2009-12-06 17:34:54 +0000
+++ b/BUILD/SETUP.sh 2010-01-07 12:02:18 +0000
@@ -86,15 +86,9 @@ set -e
#
path=`dirname $0`
. "$path/check-cpu"
+. "$path/util.sh"
-export AM_MAKEFLAGS
-# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
-# (So buildbots can easily disable this behaviour if required.)
-if test -z "$AM_MAKEFLAGS"
-then
- AM_MAKEFLAGS="-j 6"
-fi
-
+get_make_parallel_flag
# SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. To use openSSl you will nee too point out
=== added file 'BUILD/compile-bintar'
--- a/BUILD/compile-bintar 1970-01-01 00:00:00 +0000
+++ b/BUILD/compile-bintar 2010-01-07 12:02:18 +0000
@@ -0,0 +1,81 @@
+#!/bin/bash
+#
+# MariaDB SQL server.
+# Copyright (C) 2010 Kristian Nielsen and Monty Program AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+# This script's purpose is to build the binary tarball packages for MariaDB
+# (currently only on Linux systems).
+#
+# Thus BUILD/compile-bintar from the appropriate source tarball will reproduce
+# such a release, provided the build environment (gcc version etc.) matches
+# (use scripts/make_binary_distribution after running this script to actually
+# create the binary tarball package).
+#
+# Note that packages are built from source tarballs not bzr checkouts.
+# Therefore, this script assumes autotools have already been run.
+#
+# We link libc dynamically, otherwise we get lots of problems loading
+# .so files at runtime (either system stuff like NSS, or server
+# plugins).
+#
+# We link libgcc statically (and avoid linking libstdc++ at all by
+# CXX=gcc), to avoid reduce nasty library version dependencies.
+
+test -f Makefile && make distclean
+
+path=`dirname $0`
+. $path/util.sh
+
+SYSTEM_TYPE="$(uname -o)"
+MACHINE_TYPE="$(uname -m)"
+
+# We cannot have a slash '/' in tarfile name.
+SYSTEM_TYPE="$(echo ${SYSTEM_TYPE} | sed -e 's/GNU\///')"
+
+# Get correct options for architecture into CPUOPT.
+get_cpuopt
+# Get correct -j option into AM_MAKEFLAGS
+get_make_parallel_flag
+
+# Use gcc rather than g++ to avoid linking libstdc++.so (which we don't need).
+COMP="gcc -static-libgcc"
+FLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall $CPUOPT"
+
+# Don't press on in case of error.
+set -e
+
+CC="$COMP" CXX="$COMP" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
+ ./configure \
+ --prefix=/usr/local/mysql \
+ --exec-prefix=/usr/local/mysql \
+ --libexecdir=/usr/local/mysql/bin \
+ --localstatedir=/usr/local/mysql/data \
+ \
+ --with-comment="(MariaDB - http://mariadb.com/)" \
+ --with-system-type="${SYSTEM_TYPE}" \
+ --with-machine-type="${MACHINE_TYPE}" \
+ \
+ --enable-shared --enable-static \
+ --with-client-ldflags=-static --with-mysqld-ldflags=-static \
+ --enable-thread-safe-client --enable-local-infile --with-big-tables \
+ --without-docs --with-extra-charsets=all \
+ --with-libwrap --with-ssl --with-readline --with-libevent --with-zlib-dir=bundled \
+ --with-partition --with-embedded-server \
+ --with-plugins=max-no-ndb \
+ --without-plugin-innodb_plugin
+
+make $AM_MAKEFLAGS
=== added file 'BUILD/util.sh'
--- a/BUILD/util.sh 1970-01-01 00:00:00 +0000
+++ b/BUILD/util.sh 2010-01-07 12:02:18 +0000
@@ -0,0 +1,40 @@
+# MariaDB SQL server.
+# Copyright (C) 2010 Kristian Nielsen and Monty Program AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Setting cpu options.
+get_cpuopt () {
+ case "$(gcc -dumpmachine)" in
+ x86_64-*)
+ # gcc barfs on -march=... on x64
+ CPUOPT="-m64 -mtune=generic"
+ ;;
+ *)
+ # we'd use i586 to not trip up mobile/lowpower devices
+ CPUOPT="-m32 -march=i586 -mtune=generic"
+ ;;
+ esac
+ return 0
+}
+
+# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
+# (So buildbots can easily disable this behaviour if required.)
+get_make_parallel_flag () {
+ if test -z "$AM_MAKEFLAGS"
+ then
+ AM_MAKEFLAGS="-j 6"
+ fi
+ return 0
+}
1
0

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2788)
by knielsenï¼ knielsen-hq.org 07 Jan '10
by knielsenï¼ knielsen-hq.org 07 Jan '10
07 Jan '10
#At lp:maria
2788 knielsen(a)knielsen-hq.org 2010-01-07
Add BUILD/compile-bintar, which builds MariaDB with correct options for a binary tarball release.
added:
BUILD/compile-bintar
BUILD/util.sh
modified:
BUILD/SETUP.sh
per-file messages:
BUILD/SETUP.sh
Move common code to separate file to enable sharing.
BUILD/compile-bintar
Add script to build with correct flags and ./configure options for bintar package.
BUILD/util.sh
Move common code to separate file to enable sharing.
=== modified file 'BUILD/SETUP.sh'
--- a/BUILD/SETUP.sh 2009-12-06 17:34:54 +0000
+++ b/BUILD/SETUP.sh 2010-01-07 11:24:49 +0000
@@ -86,15 +86,9 @@ set -e
#
path=`dirname $0`
. "$path/check-cpu"
+. "$path/util.sh"
-export AM_MAKEFLAGS
-# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
-# (So buildbots can easily disable this behaviour if required.)
-if test -z "$AM_MAKEFLAGS"
-then
- AM_MAKEFLAGS="-j 6"
-fi
-
+get_make_parallel_flag
# SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. To use openSSl you will nee too point out
=== added file 'BUILD/compile-bintar'
--- a/BUILD/compile-bintar 1970-01-01 00:00:00 +0000
+++ b/BUILD/compile-bintar 2010-01-07 11:24:49 +0000
@@ -0,0 +1,81 @@
+#!/bin/bash
+#
+# MariaDB SQL server.
+# Copyright (C) 2010 Kristian Nielsen and Monty Program AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+# This script's purpose is to build the binary tarball packages for MariaDB
+# (currently only on Linux systems).
+#
+# Thus BUILD/compile-bintar from the appropriate source tarball will reproduce
+# such a release, provided the build environment (gcc version etc.) matches
+# (use scripts/make_binary_distribution after running this script to actually
+# create the binary tarball package).
+#
+# Note that packages are built from source tarballs not bzr checkouts.
+# Therefore, this script assumes autotools have already been run.
+#
+# We link libc dynamically, otherwise we get lots of problems loading
+# .so files at runtime (either system stuff like NSS, or server
+# plugins).
+#
+# We link libgcc statically (and avoid linking libstdc++ at all by
+# CXX=gcc), to avoid reduce nasty library version dependencies.
+
+test -f Makefile && make distclean
+
+path=`dirname $0`
+. $path/util.sh
+
+SYSTEM_TYPE="$(uname -o)"
+MACHINE_TYPE="$(uname -m)"
+
+# We cannot have a slash '/' in tarfile name.
+SYSTEM_TYPE="$(echo ${SYSTEM_TYPE} | sed -e 's/GNU\///')"
+
+# Get correct options for architecture into CPUOPT.
+get_cpuopt
+# Get correct -j option into AM_MAKEFLAGS
+get_make_parallel_flag
+
+# Use gcc rather than g++ to avoid linking libstdc++.so (which we don't need).
+COMP="gcc -static-libgcc"
+FLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall $CPUOPT"
+
+# Don't press on in case of error.
+set -e
+
+CC="$COMP" CXX="$COMP" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
+ ./configure \
+ --prefix=/usr/local/mysql \
+ --exec-prefix=/usr/local/mysql \
+ --libexecdir=/usr/local/mysql/bin \
+ --localstatedir=/usr/local/mysql/data \
+ \
+ --with-comment="(MariaDB - http://mariadb.com/)" \
+ --with-system-type="${SYSTEM_TYPE}" \
+ --with-machine-type="${MACHINE_TYPE}" \
+ \
+ --enable-shared --enable-static \
+ --with-client-ldflags=-static --with-mysqld-ldflags=-static \
+ --enable-thread-safe-client --enable-local-infile --with-big-tables \
+ --without-docs --with-extra-charsets=all \
+ --with-libwrap --with-ssl --with-readline --with-libevent --with-zlib-dir=bundled \
+ --with-partition --with-embedded-server \
+ --with-plugins=max-no-ndb \
+ --without-plugin-innodb_plugin
+
+make $AM_MAKEFLAGS
=== added file 'BUILD/util.sh'
--- a/BUILD/util.sh 1970-01-01 00:00:00 +0000
+++ b/BUILD/util.sh 2010-01-07 11:24:49 +0000
@@ -0,0 +1,40 @@
+# MariaDB SQL server.
+# Copyright (C) 2010 Kristian Nielsen and Monty Program AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Setting cpu options.
+get_cpuopt () {
+ case "$(gcc -dumpmachine)" in
+ x86_64-*)
+ # gcc barfs on -march=... on x64
+ CPUOPT="-m64 -mtune=generic"
+ ;;
+ *)
+ # we'd use i586 to not trip up mobile/lowpower devices
+ CPUOPT="-m32 -march=i586 -mtune=generic"
+ ;;
+ esac
+ return 0
+}
+
+# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
+# (So buildbots can easily disable this behaviour if required.)
+get_make_parallel_flag () {
+ if test -z "$AM_MAKEFLAGS"
+ then
+ AM_MAKEFLAGS="-j 6"
+ fi
+ return 0
+}
1
0
Hi!
Here is part from a patch that I will push today to
MariaDB-5.1-release that fixes so that xtradb compiles on OpenSolaris
5.11.
The issue was that srv0srv.c used gcc specific functions, not the
general one that is defined in os0sync.h.
Hope you can add this to to XtraDB ASAP!
=== modified file 'storage/xtradb/srv/srv0srv.c'
--- storage/xtradb/srv/srv0srv.c 2009-11-13 21:26:08 +0000
+++ storage/xtradb/srv/srv0srv.c 2010-01-06 18:54:29 +0000
@@ -81,6 +81,7 @@ Created 10/8/1995 Heikki Tuuri
#include "ut0mem.h"
#include "ut0ut.h"
#include "os0proc.h"
+#include "os0sync.h"
#include "mem0mem.h"
#include "mem0pool.h"
#include "sync0sync.h"
@@ -1102,12 +1103,12 @@ srv_conc_enter_innodb_timer_based(trx_t*
}
retry:
if (srv_conc_n_threads < (lint) srv_thread_concurrency) {
- conc_n_threads = __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ conc_n_threads = os_atomic_increment_lint(&srv_conc_n_threads, 1);
if (conc_n_threads <= (lint) srv_thread_concurrency) {
enter_innodb_with_tickets(trx);
return;
}
- __sync_add_and_fetch(&srv_conc_n_threads, -1);
+ os_atomic_increment_lint(&srv_conc_n_threads, -1);
}
if (!has_yielded)
{
@@ -1118,7 +1119,7 @@ retry:
if (trx->has_search_latch
|| NULL != UT_LIST_GET_FIRST(trx->trx_locks)) {
- conc_n_threads = __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ conc_n_threads = os_atomic_increment_lint(&srv_conc_n_threads, 1);
enter_innodb_with_tickets(trx);
return;
}
@@ -1129,7 +1130,7 @@ retry:
trx->op_info = "";
has_slept++;
}
- conc_n_threads = __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ conc_n_threads = os_atomic_increment_lint(&srv_conc_n_threads, 1);
enter_innodb_with_tickets(trx);
return;
}
@@ -1137,7 +1138,7 @@ retry:
static void
srv_conc_exit_innodb_timer_based(trx_t* trx)
{
- __sync_add_and_fetch(&srv_conc_n_threads, -1);
+ os_atomic_increment_lint(&srv_conc_n_threads, -1);
trx->declared_to_be_inside_innodb = FALSE;
trx->n_tickets_to_enter_innodb = 0;
return;
@@ -1326,7 +1327,7 @@ srv_conc_force_enter_innodb(
ut_ad(srv_conc_n_threads >= 0);
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
if (srv_thread_concurrency_timer_based) {
- __sync_add_and_fetch(&srv_conc_n_threads, 1);
+ os_atomic_increment_lint(&srv_conc_n_threads, 1);
trx->declared_to_be_inside_innodb = TRUE;
trx->n_tickets_to_enter_innodb = 1;
return;
Regards,
Monty
1
0