diff --git a/CMakeLists.txt b/CMakeLists.txt index c4ffbe177ba59f87a70ebe150cba2245e81bb8e9..e8a3d4722ce866d927b217437fdf948f5c03bbe0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,6 +87,12 @@ else() message (FATAL_ERROR "Unsupported platform -- ${CMAKE_SYSTEM_NAME}") endif() +if (TARGET_OS_DARWIN) +# Mac ports get installed into /opt/local, hence: + set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES} /opt/local/include") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/opt/local/include -L/opt/local/lib") +endif() + check_symbol_exists(MAP_ANON sys/mman.h HAVE_MAP_ANON) check_symbol_exists(MAP_ANONYMOUS sys/mman.h HAVE_MAP_ANONYMOUS) check_include_file(sys/time.h HAVE_SYS_TIME_H) diff --git a/README.MacOSX b/README.MacOSX index b5f70dc47379ba575897d274a7868c4de2f17ca4..b0c378b5b5270f5ca8ecc31ea86a09f47824e455 100644 --- a/README.MacOSX +++ b/README.MacOSX @@ -36,14 +36,20 @@ CC=gcc-mp-4.6 make 5. Run tarantool test suite ------------- -NB: box/lua.test in not runnable on MacOS X at this point, in order to skip it add: +NB: the following tests are not runnable on MacOS X at this point: -disabled = lua.test +box/lua.test +box_big/lua.test +connector_c/xlog_rpl.test -to tarantool/test/suite.ini file; +To disable those add each of them to the 'disabled' clause in suite.ini file +in the appropriate directory; for instance, tarantool/test/box/suite.ini must +be edited to disable any test in the 'box' suite; + +To run all tests then, execute: cd ~/build/tarantool/test -PATH=~/build/bin:$PATH ./run +./run -- EOF diff --git a/client/tarantool/tc.c b/client/tarantool/tc.c index 862d18443c7bbfc82934b1ae0ae7caa01b46dff7..a649f9db76185db0234db53581d2f9335d5af88c 100644 --- a/client/tarantool/tc.c +++ b/client/tarantool/tc.c @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) { tc_init(); - int rc; + int rc = 0; enum tc_opt_mode mode = tc_opt_init(&tc.opt, argc, argv); switch (mode) { case TC_OPT_USAGE: diff --git a/connector/c/tntrpl/CMakeLists.txt b/connector/c/tntrpl/CMakeLists.txt index 85fcbcaf88c641e2b20ab10fb121c08933774337..6b68896aabe8b4bb808edf2e137ba9cac8019b75 100644 --- a/connector/c/tntrpl/CMakeLists.txt +++ b/connector/c/tntrpl/CMakeLists.txt @@ -50,7 +50,7 @@ set_target_properties(tntrpl PROPERTIES OUTPUT_NAME "tarantoolrpl") project(tntrpl_shared) add_library(tntrpl_shared SHARED ${tntrpl_sources}) -target_link_libraries(tntrpl_shared tnt_shared) +target_link_libraries(tntrpl_shared tnt_shared tntnet_shared) set_target_properties(tntrpl_shared PROPERTIES OUTPUT_NAME tntrpl) set_target_properties(tntrpl_shared PROPERTIES COMPILE_FLAGS "${tntrpl_cflags}") set_target_properties(tntrpl_shared PROPERTIES VERSION ${LIBTNT_VERSION} SOVERSION ${LIBTNT_SOVERSION}) diff --git a/connector/perl/lib/MR/IProto/Cluster.pm b/connector/perl/lib/MR/IProto/Cluster.pm index a966c16bb1628109b4302522b1d5d7c8b9da046e..815246d6b4f8d0590a0db2203800b6fe2d46b02b 100644 --- a/connector/perl/lib/MR/IProto/Cluster.pm +++ b/connector/perl/lib/MR/IProto/Cluster.pm @@ -120,6 +120,11 @@ has _one => ( lazy_build => 1, ); +has _server => ( + is => 'rw', + isa => 'Maybe[MR::IProto::Cluster::Server]', +); + has _ketama => ( is => 'ro', isa => 'ArrayRef[ArrayRef]', @@ -152,9 +157,12 @@ sub server { my ($self, $key) = @_; my $one = $self->_one; return $one if defined $one; - my $method = $self->balance == RR ? '_balance_rr' - : $self->balance == KETAMA ? '_balance_ketama' - : '_balance_hash'; + if($self->balance == RR) { + my $server = $self->_server; + return $server if $server && $server->active; + return $self->_server($self->_balance_rr); + } + my $method = $self->balance == KETAMA ? '_balance_ketama' : '_balance_hash'; return $self->$method($key); } diff --git a/connector/perl/lib/MR/Tarantool/Box.pm b/connector/perl/lib/MR/Tarantool/Box.pm index c8eb53fecd1668d91311a79aac634bc3229b12f2..265355623cae80bfef2da6fed5b0a6ec24bd4df8 100644 --- a/connector/perl/lib/MR/Tarantool/Box.pm +++ b/connector/perl/lib/MR/Tarantool/Box.pm @@ -81,7 +81,7 @@ use constant { sub IPROTOCLASS () { 'MR::IProto' } use vars qw/$VERSION %ERRORS/; -$VERSION = 0.0.25; +$VERSION = 0.0.26; BEGIN { *confess = \&MR::IProto::confess } @@ -592,7 +592,11 @@ An array of bytestrings to be passed as is to the procecedure. =over -=item B<unpack_format> +=item B<unpack_format_from_space> => $space_id_uint32_or_name_string + +Unpack the result tuple as a tuple from space. + +=item B<unpack_format> => $format_string Format to unpack the result tuple, the same as C<format> option for C<new()> @@ -603,7 +607,7 @@ Format to unpack the result tuple, the same as C<format> option for C<new()> =cut sub Call { - my ($param, $namespace) = $_[0]->_validate_param(\@_, qw/flags raise unpack unpack_format/); + my ($param, $namespace) = $_[0]->_validate_param(\@_, qw/flags raise unpack unpack_format unpack_format_from_space/); my ($self, $sp_name, $tuple) = @_; my $flags = $param->{flags} || 0; @@ -613,18 +617,21 @@ sub Call { confess "All fields must be defined" if grep { !defined } @$tuple; confess "Required `unpack_format` option wasn't defined" - unless exists $param->{unpack} or exists $param->{unpack_format} and $param->{unpack_format}; + unless exists $param->{unpack} or exists $param->{unpack_format} && $param->{unpack_format} or defined $param->{unpack_format_from_space}; + + my $space; + (undef, $space) = $_[0]->_validate_param([space => $param->{unpack_format_from_space}]) if defined $param->{unpack_format_from_space}; my $unpack_format = $param->{unpack_format}; - if($unpack_format) { + if(!$space && $unpack_format) { $unpack_format = join '', @$unpack_format if ref $unpack_format; my $f = { format => $unpack_format }; _make_unpack_format($f, "CALL"); $unpack_format = $f->{unpack_format}; } - local $namespace->{unpack_format} = $unpack_format if $unpack_format; # XXX - local $namespace->{append_for_unpack} = '' if $unpack_format; # shit... + local $namespace->{unpack_format} = $unpack_format if !$space && $unpack_format; # XXX + local $namespace->{append_for_unpack} = '' if !$space && $unpack_format; # shit... $tuple = [ map { my $x = $_; @@ -635,7 +642,7 @@ sub Call { $self->_chat ( msg => 22, payload => pack("L w/a* L(w/a*)*", $flags, $sp_name, scalar(@$tuple), @$tuple), - unpack => $param->{unpack} || sub { $self->_unpack_select($namespace, "CALL", @_) }, + unpack => $param->{unpack} || sub { $self->_unpack_select($space||$namespace, "CALL", @_) }, callback => $param->{callback}, ); } diff --git a/connector/perl/lib/MR/Tarantool/Box/Singleton.pm b/connector/perl/lib/MR/Tarantool/Box/Singleton.pm index a99417acb998a69f15fbf30e86a662fd6c3c3107..c0e4723b29f9348402599655a8a290b75ed642f1 100644 --- a/connector/perl/lib/MR/Tarantool/Box/Singleton.pm +++ b/connector/perl/lib/MR/Tarantool/Box/Singleton.pm @@ -177,7 +177,11 @@ its parameter mandatory. C<< pack() >>-compatible format to pack input parameters. Must match C<params>. -=item B<unpack_format> => $format +=item B<unpack_format_from_space> => $space_id_uint32_or_name_string + +Unpack the result tuple as a tuple from space. + +=item B<unpack_format> => $format_string C<< pack() >>-compatible format to unpack procedure output. @@ -224,7 +228,7 @@ sub declare_stored_procedure { for my $i (0..$#params) { $p->[$i] = $def[$i] if !defined$p->[$i] and $i < @def; confess "All params must be defined" unless defined $p->[$i]; - $p->[$i] = pack $fmt[$i], $p->[$i]; + $p->[$i] = $fmt[$i] =~ m/^[\$\&]$/ ? $p->[$i] : pack($fmt[$i], $p->[$i]); } return $p; }; @@ -244,6 +248,8 @@ sub declare_stored_procedure { undef $unpack; } $options->{unpack_format} = '&*'; + } elsif(defined $opts{unpack_format_from_space}) { + $options->{unpack_format_from_space} = $opts{unpack_format_from_space}; } else { confess "no `unpack` nor `unpack_format` given" if !exists $opts{unpack_format}; my $f = $opts{unpack_format}; @@ -252,7 +258,7 @@ sub declare_stored_procedure { } my $method = $opts{method_name} or confess "`method_name` not given"; - confess "bad `method_name` $method" unless $method =~ m/^[a-zA-Z]\w*$/; + confess "bad `method_name` $method" unless $method =~ m/^[_a-zA-Z]\w*$/; my $fn = "${class}::${method}"; confess "Method $method is already defined in class $class" if defined &{$fn}; do { diff --git a/debian/changelog b/debian/changelog index c5811f8e1d8c0134f7fd7dd56ec2f562a2487cb6..0731ef41fd22766d7fa9c2414b0435c7babf5568 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +tarantool (1.4.6+20120629+2158-1) unstable; urgency=low + + * Some fixes for Objective C 2.0. + + -- Dmitry E. Oboukhov <unera@debian.org> Fri, 29 Jun 2012 21:58:42 +0400 + +tarantool (1.4.6+20120629+2112-1) unstable; urgency=low + + * Package is built by gcc-4.7. + + -- Dmitry E. Oboukhov <unera@debian.org> Fri, 29 Jun 2012 21:11:30 +0400 + +tarantool (1.4.6+20120629+2105-1) unstable; urgency=low + + * Really fixed FTBFS with BSD (#679317). + + -- Dmitry E. Oboukhov <unera@debian.org> Fri, 29 Jun 2012 21:05:21 +0400 + +tarantool (1.4.6+20120629-1) unstable; urgency=low + + * New upstream version: fixed FTBFS with Debian/kFreeBSD. closes: #679317. + + -- Dmitry E. Oboukhov <unera@debian.org> Fri, 29 Jun 2012 17:26:03 +0400 + tarantool (1.4.6+20120626-1) unstable; urgency=low * New upstream version. diff --git a/debian/control b/debian/control index e1b08f268959cd12cb495b4a3cc8e3670cb9b0a6..8f43d9295604fcd36b2e332c1cd3e9603b936f97 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Build-Depends: cdbs, debhelper (>= 8), binutils-dev, dpkg-dev (>= 1.16.1~) Section: database -Standards-Version: 3.9.2 +Standards-Version: 3.9.3 Homepage: http://tarantool.org/ VCS-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/tarantool.git;a=summary VCS-Git: git+ssh://git.debian.org/git/collab-maint/tarantool.git diff --git a/doc/box-protocol.txt b/doc/box-protocol.txt index 6c3188b46dba92ae3289da4898fbc3e6696d36a2..a574c667655f60b545a4ae26b7defc88c56a9669 100644 --- a/doc/box-protocol.txt +++ b/doc/box-protocol.txt @@ -299,25 +299,21 @@ Tarantool/Box IPROTO protocol. ; It's an error to specify an argument of a type that ; differs from expected type. ; -; 'splice' operates on string field, and has 4 arguments: -; field number, offset in the field, number of bytes to remove, -; length of the string argument to inject, the string +<op_arg> ::= <field> -<op_arg> ::= <field> | <splice_op_arg> +; For simple operations <op_arg> field contains either a string +; to assign, a number to add or subtract. +; When <op_code> is splice, <field> has to carry not one argument, +; but 3: offset in the target field, number of bytes to remove, +; string argument to inject. Since <op_arg> is always a <field>, +; field data in case of splice argument contains 3 nested <field> +; objects, which store the arguments: -; -; <offset> is a non-negative integer, within the size of the -; original field. If offset is beyond the length of the -; field, it is set to the current length of the field. -; <length> is an integer, indicating the number of bytes to remove. -; If <length> ; is negative, all bytes until <length> to the -; end of the field are removed. <field> is injected in place of the -; removed string. -; -<splice_op_arg> ::= <offset><length><field> +<splice_field_data> ::= <offset><length><string> <offset> ::= <field> <length> ::= <field> +<string> ::= <field> ; diff --git a/doc/user/language-reference.xml b/doc/user/language-reference.xml index a0c4e1502bba3f19694e68870bc8b82f286657b8..2a6c903bd1ff1f23b4efd267c94af5896e141dd9 100644 --- a/doc/user/language-reference.xml +++ b/doc/user/language-reference.xml @@ -78,9 +78,9 @@ response, even if the latter arrived out of order. </para> <para>Request type defines the format of the payload. - INSERTs and DELETEs can only be made by the primary key, so + INSERTs, UPDATEs and DELETEs can only be made by the primary key, so an index id and key value are always present in these requests. - SELECTs and UPDATEs can use secondary keys. UPDATE only needs to + SELECTs can use secondary keys. UPDATE only needs to list the fields that are actually changed. With this one exception, all commands operate on whole tuple(s). </para> diff --git a/include/exception.h b/include/exception.h index dc4f63a3e76dd62aac831856f15a8412adfeed6f..78de0f365dc93fab05d2e3468f55793a6095b04a 100644 --- a/include/exception.h +++ b/include/exception.h @@ -28,7 +28,7 @@ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#import <objc/Object.h> +#import "object.h" #include <stdarg.h> #include "errcode.h" #include "say.h" @@ -38,12 +38,11 @@ * Note: implements garbage collection (see +alloc * implementation). */ -@interface tnt_Exception: Object { +@interface tnt_Exception: tnt_Object { @public const char *file; unsigned line; } - + (id) alloc; @end diff --git a/include/object.h b/include/object.h new file mode 100644 index 0000000000000000000000000000000000000000..9ce1459d7e2f92fbf8d57c7227d6adecceffdda1 --- /dev/null +++ b/include/object.h @@ -0,0 +1,40 @@ +#ifndef TARANTOOL_OBJECT_H_INCLUDED +#define TARANTOOL_OBJECT_H_INCLUDED +/* + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * <COPYRIGHT HOLDER> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include <objc/Object.h> +#include <objc/runtime.h> + +@interface tnt_Object: Object ++ (id) alloc; +- (id) init; +- (void) free; +- (void) subclassResponsibility: (SEL) cmd; +@end +#endif /* TARANTOOL_OBJECT_H_INCLUDED */ diff --git a/mod/box/box.m b/mod/box/box.m index 4198e98998efe5ec2103b0429a9d7a5caad663a3..997deaafcd2c07d3c73953a3ac992cc05184b41c 100644 --- a/mod/box/box.m +++ b/mod/box/box.m @@ -565,6 +565,3 @@ mod_info(struct tbuf *out) tbuf_printf(out, " status: %s" CRLF, status); } -/** - * vim: foldmethod=marker - */ diff --git a/mod/box/box_lua.m b/mod/box/box_lua.m index 3d52a44b353a78d77f37a823b2e1454353a1b2ea..6ad5bfe2707641dcf9845114aa53765b3911b950 100644 --- a/mod/box/box_lua.m +++ b/mod/box/box_lua.m @@ -29,7 +29,7 @@ * SUCH DAMAGE. */ #include "box_lua.h" -#include <objc/runtime.h> +#import "object.h" #include <tarantool_lua.h> #include <fiber.h> #include "box.h" @@ -830,6 +830,3 @@ void box_lua_init() root_L = tarantool_L; } -/** - * vim: foldmethod=marker - */ diff --git a/mod/box/index.h b/mod/box/index.h index 8ad94a73d9ce7308cae7c19617c793db401eba71..ec995a6c82e700e7af2a0c51a2b172217cefcb03 100644 --- a/mod/box/index.h +++ b/mod/box/index.h @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#import <objc/Object.h> +#import "object.h" #include <stdbool.h> #include <util.h> @@ -76,7 +76,7 @@ struct key_def { bool is_unique; }; -@interface Index: Object { +@interface Index: tnt_Object { @public /* Index owner space */ struct space *space; diff --git a/mod/box/index.m b/mod/box/index.m index 75daa29f3a94ceb383456053ab75c8a1e882398f..36a73ca752308f0fe8f5087f9832a19b4f71744f 100644 --- a/mod/box/index.m +++ b/mod/box/index.m @@ -688,6 +688,3 @@ int64_key_to_value(void *key) /* }}} */ -/** - * vim: foldmethod=marker - */ diff --git a/mod/box/port.h b/mod/box/port.h index 848e865192daccaafa2b17c1557ef89599c0937b..87491bfc1c3ff2bca7f1f247cc8aa4113452a7c8 100644 --- a/mod/box/port.h +++ b/mod/box/port.h @@ -29,12 +29,12 @@ * SUCH DAMAGE. */ #include <util.h> -#include <objc/Object.h> +#import "object.h" struct tuple; struct lua_State; -@interface Port: Object +@interface Port: tnt_Object - (void) addU32: (u32 *) u32; - (void) dupU32: (u32) u32; - (void) addTuple: (struct tuple *) tuple; diff --git a/mod/box/request.h b/mod/box/request.h index 2c58065a38dd8072afdc02a53eb8f163c7ce3dce..90cc56179b0bd36f5fc3fb49c51ecf9dda2c9d7b 100644 --- a/mod/box/request.h +++ b/mod/box/request.h @@ -28,7 +28,7 @@ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include <objc/Object.h> +#import "object.h" #include <util.h> #include <tbuf.h> #include <iproto.h> @@ -100,7 +100,7 @@ request_is_select(u32 type) return type == SELECT || type == CALL; } -@interface Request: Object { +@interface Request: tnt_Object { u32 type; struct tbuf *data; } diff --git a/mod/box/request.m b/mod/box/request.m index 2919c9a2600d8f26c304d2679b47aadcdf433215..8f2ccdb67e3d63c93ce25b93abe07dab6f224406 100644 --- a/mod/box/request.m +++ b/mod/box/request.m @@ -27,7 +27,6 @@ * SUCH DAMAGE. */ #include "request.h" -#include <objc/runtime.h> #include "txn.h" #include "tuple.h" #include "index.h" @@ -989,6 +988,3 @@ do_update_ops(struct update_cmd *cmd, struct tuple *new_tuple) } @end -/** - * vim: foldmethod=marker - */ diff --git a/mod/box/space.m b/mod/box/space.m index ea7ea71dd5d9f0cdf41008049889f836c47b9489..08a30873963e1cda48d696a6c2e6a78393fbbed8 100644 --- a/mod/box/space.m +++ b/mod/box/space.m @@ -28,6 +28,7 @@ */ #include "space.h" #include <stdlib.h> +#include <string.h> #include <cfg/tarantool_box_cfg.h> #include <cfg/warning.h> #include <tarantool.h> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c8333487485cd15d15340abaf2ff76ebbbd35a52..50a510e95c115d79f2d4523433f3132ebb1fa55b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,7 +3,6 @@ # add_library(ev tarantool_ev.c) - if (CMAKE_COMPILER_IS_GNUCC) check_c_compiler_flag ("-Wno-unused-result" gcc_has_wno_unused_result) if (gcc_has_wno_unused_result) @@ -24,10 +23,20 @@ elseif (TARGET_OS_FREEBSD) # On FreeBSD build libev loop on top of set_target_properties(ev PROPERTIES COMPILE_FLAGS "-DEV_USE_KQUEUE") endif() + # # libev uses ceil and floor from the standard math library # -target_link_libraries(ev m) + +# +# libev depends on librt under kFreeBSD +if (TARGET_OS_DEBIAN_FREEBSD) + set (ev_libs m rt) +else() + set (ev_libs m) +endif() + +target_link_libraries(ev ${ev_libs}) # # Build admin.m from admin.rl, but only if admin.rl was changed. @@ -67,7 +76,7 @@ set (recompiled_sources set (common_sources tbuf.m palloc.m util.m salloc.m pickle.m coro.m stat.m log_io.m recovery.m cpu_feature.m - replica.m iproto.m exception.m errcode.c errinj.m latch.m + replica.m iproto.m object.m exception.m errcode.c errinj.m latch.m nio.c crc32.c) if (ENABLE_TRACE) @@ -75,7 +84,7 @@ if (ENABLE_TRACE) endif() add_library(core STATIC ${common_sources}) -add_dependencies(core generate_headers luajit) +add_dependencies(core generate_headers) set_target_properties(core PROPERTIES COMPILE_FLAGS "${core_cflags}") set (common_libraries cfg core ev coro gopt misc objc) diff --git a/src/exception.m b/src/exception.m index 88223ea0fd73421f3784b6692780da0aed945be7..35f249b944c8ae6631143ed68eb4f56fdfaa5e9e 100644 --- a/src/exception.m +++ b/src/exception.m @@ -37,18 +37,19 @@ + (id) alloc { static __thread tnt_Exception *e = nil; + static __thread size_t sz = 0; - if ([e isKindOf:self]) { - *(Class *) e = self; + if (e != nil && class_getInstanceSize(self) <= sz) { + object_setClass(e, self); } else { - [e free]; - e = [super alloc]; + object_dispose(e); + e = class_createInstance(self, 0); + sz = class_getInstanceSize(self); } return e; } @end - @implementation SystemError - (id) init: (const char *) format, ... @@ -114,7 +115,7 @@ va_start(ap, errcode_); [super init: errcode_ args: ap]; - say_error("%s at %s:%d, %s", [self name], file, line, errmsg); + say_error("%s at %s:%d, %s", object_getClassName(self), file, line, errmsg); return self; } diff --git a/src/fiber.m b/src/fiber.m index f14ef41378186d805e6b4b45d6cb4b6dd0facedd..7fdd35644a79dd3300f18729c4ab5eeb6e997957 100644 --- a/src/fiber.m +++ b/src/fiber.m @@ -450,7 +450,7 @@ fiber_loop(void *data __attribute__((unused))) say_info("fiber `%s': exiting", fiber->name); } @catch (id e) { - say_error("fiber `%s': exception `%s'", fiber->name, [e name]); + say_error("fiber `%s': exception `%s'", fiber->name, object_getClassName(e)); panic("fiber `%s': exiting", fiber->name); } fiber_close(); diff --git a/src/log_io.m b/src/log_io.m index 0501036e44a8ddfd242bd538cf07515b1079daa3..0c7e6c0b924e76e92112be19e02c4d80db9667f0 100644 --- a/src/log_io.m +++ b/src/log_io.m @@ -200,8 +200,8 @@ format_filename(struct log_dir *dir, i64 lsn, enum log_suffix suffix) { static __thread char filename[PATH_MAX + 1]; const char *suffix_str = suffix == INPROGRESS ? inprogress_suffix : ""; - snprintf(filename, PATH_MAX, "%s/%020" PRIi64 "%s%s", - dir->dirname, lsn, dir->filename_ext, suffix_str); + snprintf(filename, PATH_MAX, "%s/%020lld%s%s", + dir->dirname, (long long)lsn, dir->filename_ext, suffix_str); return filename; } @@ -245,7 +245,7 @@ row_reader_v11(FILE *f, struct palloc_pool *pool) return NULL; } - say_debug("read row v11 success lsn:%" PRIi64, header_v11(m)->lsn); + say_debug("read row v11 success lsn:%lld", (long long)header_v11(m)->lsn); return m; } @@ -289,7 +289,7 @@ log_io_cursor_next(struct log_io_cursor *i) assert(i->eof_read == false); - say_debug("log_io_cursor_next: marker:0x%016" PRIX32 "/%" PRI_SZ, + say_debug("log_io_cursor_next: marker:0x%016X/%zu", row_marker_v11, sizeof(row_marker_v11)); /* @@ -317,9 +317,10 @@ restart: } marker_offset = ftello(l->f) - sizeof(row_marker_v11); if (i->good_offset != marker_offset) - say_warn("skipped %" PRI_OFFT " bytes after 0x%08" PRI_XFFT " offset", - marker_offset - i->good_offset, i->good_offset); - say_debug("magic found at 0x%08" PRI_XFFT, marker_offset); + say_warn("skipped %jd bytes after 0x%08jx offset", + (intmax_t)(marker_offset - i->good_offset), + (uintmax_t)i->good_offset); + say_debug("magic found at 0x%08jx", (uintmax_t)marker_offset); struct tbuf *row = row_reader_v11(l->f, fiber->gc_pool); if (row == ROW_EOF) @@ -610,6 +611,3 @@ error: /* }}} */ -/* - * vim: foldmethod=marker - */ diff --git a/src/nio.c b/src/nio.c index f4424f583257410690cb7b6c0d029f09258221df..ee338cece6fa1e7e5239829be7bfb35f6bb0c911 100644 --- a/src/nio.c +++ b/src/nio.c @@ -54,7 +54,9 @@ nfilename(int fd) filename_path[sz] = '\0'; return filename_path; } -#endif /* TARGET_OS_LINUX */ +#else /* TARGET_OS_LINUX */ + (void) fd; +#endif return ""; /* Not implemented. */ } @@ -133,14 +135,14 @@ nlseek(int fd, off_t offset, int whence) off_t effective_offset = lseek(fd, offset, whence); if (effective_offset == -1) { - say_syserror("lseek, offset=%"PRI_OFFT", whence=%d, [%s]", - (u64) offset, whence, + say_syserror("lseek, offset=%jd, whence=%d, [%s]", + (intmax_t) offset, whence, nfilename(fd)); } else if (whence == SEEK_SET && effective_offset != offset) { say_error("lseek, offset set to unexpected value: " - "requested %"PRI_OFFT", effective %"PRI_OFFT", " + "requested %jd effective %jd, " "[%s]", - offset, effective_offset, nfilename(fd)); + (intmax_t)offset, (intmax_t)effective_offset, nfilename(fd)); } return effective_offset; } diff --git a/src/object.m b/src/object.m new file mode 100644 index 0000000000000000000000000000000000000000..7d5a6c3bb278c62749c2b95c8764327eb48303be --- /dev/null +++ b/src/object.m @@ -0,0 +1,51 @@ +/* + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * <COPYRIGHT HOLDER> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#import "object.h" +#include <stdlib.h> + +@implementation tnt_Object ++ (id) alloc +{ + return class_createInstance(self, 0); +} +- (id) init +{ + return self; +} +- (void) subclassResponsibility: (SEL) cmd +{ + (void) cmd; + abort(); +} + +- (void) free +{ + object_dispose(self); +} +@end diff --git a/src/recovery.m b/src/recovery.m index 6478e73472e43ac668a44b3c71120fb141ff6b30..ed0290018194f0ade5ff81d6d3aba3975a1cca3e 100644 --- a/src/recovery.m +++ b/src/recovery.m @@ -1293,6 +1293,3 @@ read_log(const char *filename, /* }}} */ -/* - * vim: foldmethod=marker - */ diff --git a/src/tarantool_lua.m b/src/tarantool_lua.m index 5eb5709ef24984f7d9a51c75b2e52c4700a4f3ef..ba2314b049400b34b79b9efff8c9b45e2d07914d 100644 --- a/src/tarantool_lua.m +++ b/src/tarantool_lua.m @@ -1222,6 +1222,3 @@ tarantool_lua_load_init_script(struct lua_State *L) } -/* - * vim: foldmethod=marker - */ diff --git a/test/box/args.test b/test/box/args.test index 10bb598e48b6c46d2c7cc7ee0b32578502401a01..5a07380baef23a4b9992c82878534b1a962db26f 100644 --- a/test/box/args.test +++ b/test/box/args.test @@ -1,6 +1,9 @@ import sys import os +# mask BFD warnings: https://bugs.launchpad.net/tarantool/+bug/1018356 +sys.stdout.push_filter("unable to read unknown load command 0x2\d+", "") + server.test_option("--help") server.test_option("-h") sys.stdout.push_filter("(/\S+)+/tarantool", "tarantool") diff --git a/test/box/cat.test b/test/box/cat.test index ed2cb5dc1b23d793d5266666d89d948b0c8983aa..b6fe24038c88e5494719f86d6f698cb80ce745de 100644 --- a/test/box/cat.test +++ b/test/box/cat.test @@ -5,8 +5,12 @@ import os import time import yaml +import sys from signal import SIGUSR1 +# mask BFD warnings: https://bugs.launchpad.net/tarantool/+bug/1018356 +sys.stdout.push_filter("unable to read unknown load command 0x2\d+", "") + print """ # Verify that the server starts from a pre-recorded snapshot. # This way we check that the server can read old snapshots (v11) @@ -18,6 +22,7 @@ server.test_option("--cat=00000000000000000500.snap") # print "# Restore the default server..." os.unlink(snapshot) +sys.stdout.pop_filter() # __EOF__ diff --git a/test/box/configuration.test b/test/box/configuration.test index c3971ae35a03550ed72319fe601e65271af44df9..9ed8d7e7bef4fe772dd17870f52918684240490d 100644 --- a/test/box/configuration.test +++ b/test/box/configuration.test @@ -5,6 +5,9 @@ import os import sys import shutil +# mask BFD warnings: https://bugs.launchpad.net/tarantool/+bug/1018356 +sys.stdout.push_filter("unable to read unknown load command 0x2\d+", "") + print """ # Bug #708685: # Addition of required configuration file options broke backward @@ -78,4 +81,6 @@ server.stop() shutil.rmtree(script_dir_path, True) server.deploy(self.suite_ini["config"]) +sys.stdout.pop_filter() + # vim: syntax=python diff --git a/test/box/suite.ini b/test/box/suite.ini index f27570f1b9884f1b4d540fde533e2a0ebe37b202..a4883826b11489422e8aacdeae2ca3d17513907d 100644 --- a/test/box/suite.ini +++ b/test/box/suite.ini @@ -3,6 +3,7 @@ description = tarantool/box, minimal configuration config = tarantool.cfg # put disabled tests here #disabled = xlog.test +# disabled = lua.test # put disabled in valgrind test here valgrind_disabled = admin_coredump.test release_disabled = errinj.test diff --git a/test/box_big/suite.ini b/test/box_big/suite.ini index de837d0fe1855098780fc9e709a096cf6bea83f0..a7d20861193f0e45a52e5ed574549ae238cd7ac3 100644 --- a/test/box_big/suite.ini +++ b/test/box_big/suite.ini @@ -2,6 +2,6 @@ description = tarantool/box, various namespace configurations and properties config = tarantool.cfg # put disabled tests here -#disabled = sql.test +# disabled = lua.test # put disabled in valgrind test here #valgrind_disabled = ... diff --git a/test/box_memcached/off.test b/test/box_memcached/off.test index fe1f9cd0322bf33386cf6948044224ca23c6cb9e..4d292395ca331115a03690f97292cdba6cb00376 100644 --- a/test/box_memcached/off.test +++ b/test/box_memcached/off.test @@ -4,6 +4,9 @@ import os import sys +# mask BFD warnings: https://bugs.launchpad.net/tarantool/+bug/1018356 +sys.stdout.push_filter("unable to read unknown load command 0x2\d+", "") + print """ # Bug #855616: # memcached_space must not be configured @@ -27,4 +30,6 @@ sys.stdout.pop_filter() server.stop() server.deploy(self.suite_ini["config"]) +sys.stdout.pop_filter() + # vim: syntax=python diff --git a/test/connector_c/suite.ini b/test/connector_c/suite.ini index 90dd1ddd3180329b36827056e6830bc06f4f49c0..104f0eb71333232dfb1b19648128ee68fdcc64d0 100644 --- a/test/connector_c/suite.ini +++ b/test/connector_c/suite.ini @@ -2,6 +2,6 @@ description = tarantool/box connector C config = cfg/tarantool.cfg # put disabled tests here -#disabled = +# disabled = xlog_rpl.test # put disabled in valgrind test here #valgrind_disabled =