Re: [Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2787)

2010-01-07 Thread Kristian Nielsen
Michael Widenius  writes:

> #At lp:maria based on 
> revid:kniel...@knielsen-hq.org-20100105142834-adpbyr6x7edubwps
>
>  2787 Michael Widenius2010-01-06
>   Removed compiler warnings

This push broke Windows compilation, see below.

>   OpenSolaris 5.11-x86 now compiles (tested with 32 bit)

It still fails in Buildbot.

I am not 100% sure, but I think this is because it fails in 64-bit. When I
looked, I found that there is a check in ./configure to see if we can use
assembler, and then later assembler is used if the configure check was ok. But
there was some difference in CFLAGS or the like between the test and the
use. So I suppose the test is using 32-bit mode (which works) but the use is
using 64-bit mode (which fails). [Not 100% sure about this and also don't know
how to fix ...]

> === modified file 'extra/libevent/devpoll.c'
> --- a/extra/libevent/devpoll.c2009-03-12 22:27:35 +
> +++ b/extra/libevent/devpoll.c2010-01-06 21:27:53 +
> @@ -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)

Unfortunately, we cannot do this. __attribute__((unused)) is a GCC
extension. Now that this is pushed to 5.1-release, compilation fails on
Windows:

Building C object extra/libevent/CMakeFiles/libevent.dir/evbuffer.c.obj
evbuffer.c
extra\libevent\evbuffer.c(79) : error C2146: syntax error : missing ')' before 
identifier '__attribute__'
extra\libevent\evbuffer.c(79) : error C2061: syntax error : identifier 
'__attribute__'
extra\libevent\evbuffer.c(79) : error C2059: syntax error : ';'
extra\libevent\evbuffer.c(79) : error C2182: 'unused' : illegal use of type 
'void'
extra\libevent\evbuffer.c(79) : error C2059: syntax error : 'type'
extra\libevent\evbuffer.c(80) : error C2059: syntax error : ')'

> === modified file 'extra/libevent/evbuffer.c'
> --- a/extra/libevent/evbuffer.c   2009-03-12 22:27:35 +
> +++ b/extra/libevent/evbuffer.c   2010-01-06 21:27:53 +

> @@ -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,

Again __attribute__ breaks Windows build.

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2788)

2010-01-07 Thread knielsen
#At lp:maria

 2788 kniel...@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.sh2009-12-06 17:34:54 +
+++ b/BUILD/SETUP.sh2010-01-07 11:24:49 +
@@ -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 +
+++ b/BUILD/compile-bintar  2010-01-07 11:24:49 +
@@ -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 +
+++ b/BUILD/util.sh 2010-01-07 11:24:49 +
@@ -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
+# MERCHANTABILIT

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2788)

2010-01-07 Thread knielsen
#At lp:maria

 2788 kniel...@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 +
+++ b/BUILD/Makefile.am 2010-01-07 12:02:18 +
@@ -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.sh2009-12-06 17:34:54 +
+++ b/BUILD/SETUP.sh2010-01-07 12:02:18 +
@@ -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 +
+++ b/BUILD/compile-bintar  2010-01-07 12:02:18 +
@@ -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
+
+m

[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2789)

2010-01-07 Thread knielsen
#At lp:maria

 2789 kniel...@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 +
+++ b/extra/libevent/devpoll.c  2010-01-07 13:00:06 +
@@ -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 +
+++ b/extra/libevent/evbuffer.c 2010-01-07 13:00:06 +
@@ -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;
/* 


___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (knielsen:2790)

2010-01-07 Thread knielsen
#At lp:maria

 2790 kniel...@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 +
+++ b/BUILD/Makefile.am 2010-01-07 13:03:54 +
@@ -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.%


___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2787)

2010-01-07 Thread Kristian Nielsen
Kristian Nielsen  writes:

> Michael Widenius  writes:
>
>> #At lp:maria based on 
>> revid:kniel...@knielsen-hq.org-20100105142834-adpbyr6x7edubwps
>>
>>  2787 Michael Widenius   2010-01-06
>>   Removed compiler warnings
>
> This push broke Windows compilation, see below.

For now, I pushed to 5.1-release a revert of this part of the patch (the
__attribute__ additions inside libevent) to get Windows building
again. Hopefully you can find a better way to remove the warnings.

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Compiling MariaDB on Solaris (pbxt)

2010-01-07 Thread Paul McCullagh

Hi Monty,

Thanks for the fix. We will add the changes to PBXT shortly.

Best regards,

Paul

On Jan 6, 2010, at 9:05 PM, Michael Widenius wrote:



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  
+
+++ mysql-test/suite/pbxt/r/lock_multi.result	2010-01-06 12:18:02  
+

@@ -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   TypeNullKey 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_typeMsg_text
@@ -63,7 +46,8 @@ mysql.hostoptimizestatus  OK
mysql.user  optimizestatus  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