Commit 47cba6a2 authored by Michael Widenius's avatar Michael Widenius

Automatic merge

parents 205f178d acb7de23
......@@ -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.%
......@@ -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
......
#!/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
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
# 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
}
......@@ -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
......
......@@ -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);
......
......@@ -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= [];
......
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
This diff is collapsed.
......@@ -100,7 +100,8 @@ static const char cur_dir_name[]= {FN_CURLIB, 0};
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, myf my_flags)
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];
......
......@@ -10565,4 +10565,6 @@ mysql_declare_plugin(ndbcluster)
}
mysql_declare_plugin_end;
#else
int Sun_ar_require_a_symbol_here= 0;
#endif
......@@ -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" {
......
......@@ -6094,7 +6094,7 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
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_tail(MARIA_HA *info, LSN lsn,
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,
......
......@@ -2823,8 +2823,8 @@ static my_bool translog_page_validator(uchar *page,
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: "
......
......@@ -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 lock_type)
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;
......
......@@ -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 lock_type)
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;
......
......@@ -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, THD *thd, bool all)
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;
......
......@@ -3314,7 +3314,7 @@ static void *xn_xres_run_recovery_thread(XTThreadPtr self)
* #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);
*/
......
......@@ -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(XTThreadPtr self, XTThreadPtr child, void *(*st
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);
......
......@@ -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);
......
......@@ -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* trx)
}
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;
......
......@@ -88,6 +88,9 @@ storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used
#
storage/pbxt/ : typedef.*was ignored in this declaration
#
# Yassl
include/runtime.hpp: .*pure_error.*
#
# Groff warnings on OpenSUSE.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment