diff options
Diffstat (limited to 'ndb')
1086 files changed, 8641 insertions, 4869 deletions
diff --git a/ndb/Makefile.am b/ndb/Makefile.am index ead70766e97..a652fc5b6a9 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SUBDIRS = src tools . include @ndb_opt_subdirs@ DIST_SUBDIRS = src tools include test docs EXTRA_DIST = config ndbapi-examples @@ -29,3 +44,6 @@ all-windoze-dsp: windoze find . -name '*.dsp' | grep -v SCCS | xargs unix2dos $(top_srcdir)/ndb/config/make-win-dsw.sh | unix2dos > ndb.dsw tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp' | grep -v SCCS` + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/config/common.mk.am b/ndb/config/common.mk.am index 6fda12d33b0..749046066cb 100644 --- a/ndb/config/common.mk.am +++ b/ndb/config/common.mk.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004, 2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + ndbbindir = "$(libexecdir)" ndbtoolsdir = "$(bindir)" ndbtestdir = "$(bindir)" diff --git a/ndb/config/type_kernel.mk.am b/ndb/config/type_kernel.mk.am index 703876ee2e9..7a641f1b533 100644 --- a/ndb/config/type_kernel.mk.am +++ b/ndb/config/type_kernel.mk.am @@ -1,6 +1,23 @@ +# Copyright (C) 2004, 2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA INCLUDES += \ - -I$(srcdir) -I$(top_srcdir)/include \ + -I$(srcdir) \ + -I$(top_builddir)/include \ + -I$(top_builddir)/ndb/include \ + -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include \ -I$(top_srcdir)/ndb/src/kernel/vm \ -I$(top_srcdir)/ndb/src/kernel/error \ diff --git a/ndb/config/type_mgmapiclient.mk.am b/ndb/config/type_mgmapiclient.mk.am index 1ef4a81d67e..ad935e5f2b6 100644 --- a/ndb/config/type_mgmapiclient.mk.am +++ b/ndb/config/type_mgmapiclient.mk.am @@ -1,2 +1,16 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi diff --git a/ndb/config/type_ndbapi.mk.am b/ndb/config/type_ndbapi.mk.am index ab84c683e86..1e8b5d86e44 100644 --- a/ndb/config/type_ndbapi.mk.am +++ b/ndb/config/type_ndbapi.mk.am @@ -1,6 +1,23 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA INCLUDES += \ - -I$(srcdir) -I$(top_srcdir)/include \ + -I$(srcdir) \ + -I$(top_builddir)/include \ + -I$(top_builddir)/ndb/include \ + -I$(top_srcdir)/include \ -I$(top_srcdir)/mysys \ -I$(top_srcdir)/ndb/include \ -I$(top_srcdir)/ndb/include/kernel \ diff --git a/ndb/config/type_ndbapiclient.mk.am b/ndb/config/type_ndbapiclient.mk.am index 88b57e49e19..159c6e4456a 100644 --- a/ndb/config/type_ndbapiclient.mk.am +++ b/ndb/config/type_ndbapiclient.mk.am @@ -1,2 +1,16 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA INCLUDES += -I$(top_srcdir)/ndb/include/ndbapi diff --git a/ndb/config/type_ndbapitest.mk.am b/ndb/config/type_ndbapitest.mk.am index 392c4e9fc70..2859b1eb2ee 100644 --- a/ndb/config/type_ndbapitest.mk.am +++ b/ndb/config/type_ndbapitest.mk.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004, 2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA LDADD += $(top_builddir)/ndb/test/src/libNDBT.a \ $(top_builddir)/ndb/src/libndbclient.la \ @@ -5,7 +19,10 @@ LDADD += $(top_builddir)/ndb/test/src/libNDBT.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@ -INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/include \ +INCLUDES += -I$(top_srcdir) \ + -I$(top_builddir)/include \ + -I$(top_builddir)/ndb/include \ + -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include \ -I$(top_srcdir)/ndb/include/ndbapi \ -I$(top_srcdir)/ndb/include/util \ diff --git a/ndb/config/type_ndbapitools.mk.am b/ndb/config/type_ndbapitools.mk.am index d4eb090112d..49163ad9874 100644 --- a/ndb/config/type_ndbapitools.mk.am +++ b/ndb/config/type_ndbapitools.mk.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004, 2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA LDADD += \ $(top_builddir)/ndb/src/libndbclient.la \ @@ -5,7 +19,10 @@ LDADD += \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@ -INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \ +INCLUDES += -I$(srcdir) \ + -I$(top_builddir)/include \ + -I$(top_builddir)/ndb/include \ + -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include \ -I$(top_srcdir)/ndb/include/ndbapi \ -I$(top_srcdir)/ndb/include/util \ diff --git a/ndb/config/type_util.mk.am b/ndb/config/type_util.mk.am index 4f2d605dc91..fb64d7859a3 100644 --- a/ndb/config/type_util.mk.am +++ b/ndb/config/type_util.mk.am @@ -1,5 +1,21 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA INCLUDES += -I$(srcdir) \ + -I$(top_builddir)/include \ + -I$(top_builddir)/ndb/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/mysys \ -I$(top_srcdir)/ndb/include \ diff --git a/ndb/docs/Makefile.am b/ndb/docs/Makefile.am index 78fced4b2e4..4c7343661f2 100644 --- a/ndb/docs/Makefile.am +++ b/ndb/docs/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + DOXYDIR = doxygen noinst_HEADERS = $(DOXYDIR)/predoxy.pl $(DOXYDIR)/postdoxy.pl $(DOXYDIR)/Doxyfile.ndbapi $(DOXYDIR)/Doxyfile.mgmapi $(DOXYDIR)/header.ndbapi.tex $(DOXYDIR)/header.mgmapi.tex @@ -112,3 +127,6 @@ testdoc: DUMMY cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test windoze-dsp: + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index 842f4daabee..7c3e8a26171 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA include $(top_srcdir)/ndb/config/common.mk.am diff --git a/ndb/include/debugger/DebuggerNames.hpp b/ndb/include/debugger/DebuggerNames.hpp index cf9b1b57226..86d76ae070c 100644 --- a/ndb/include/debugger/DebuggerNames.hpp +++ b/ndb/include/debugger/DebuggerNames.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/debugger/EventLogger.hpp b/ndb/include/debugger/EventLogger.hpp index 6308cf25465..11df3f513fc 100644 --- a/ndb/include/debugger/EventLogger.hpp +++ b/ndb/include/debugger/EventLogger.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/debugger/GrepError.hpp b/ndb/include/debugger/GrepError.hpp index beedbd95c80..5a12a132f18 100644 --- a/ndb/include/debugger/GrepError.hpp +++ b/ndb/include/debugger/GrepError.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/debugger/SignalLoggerManager.hpp b/ndb/include/debugger/SignalLoggerManager.hpp index d212329bf78..578085ca1b8 100644 --- a/ndb/include/debugger/SignalLoggerManager.hpp +++ b/ndb/include/debugger/SignalLoggerManager.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/editline/editline.h b/ndb/include/editline/editline.h index 2757e385968..c0befc788e2 100644 --- a/ndb/include/editline/editline.h +++ b/ndb/include/editline/editline.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/AttributeDescriptor.hpp b/ndb/include/kernel/AttributeDescriptor.hpp index 2fe7c9f0973..d5c535893dd 100644 --- a/ndb/include/kernel/AttributeDescriptor.hpp +++ b/ndb/include/kernel/AttributeDescriptor.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/AttributeHeader.hpp b/ndb/include/kernel/AttributeHeader.hpp index 3cb432067eb..448952a0780 100644 --- a/ndb/include/kernel/AttributeHeader.hpp +++ b/ndb/include/kernel/AttributeHeader.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/AttributeList.hpp b/ndb/include/kernel/AttributeList.hpp index 70b178c6c79..272332141a5 100644 --- a/ndb/include/kernel/AttributeList.hpp +++ b/ndb/include/kernel/AttributeList.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/BlockNumbers.h b/ndb/include/kernel/BlockNumbers.h index 49b5842ac4e..31b4361fbe8 100644 --- a/ndb/include/kernel/BlockNumbers.h +++ b/ndb/include/kernel/BlockNumbers.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/GlobalSignalNumbers.h b/ndb/include/kernel/GlobalSignalNumbers.h index 76b7d30059e..1ffc198de41 100644 --- a/ndb/include/kernel/GlobalSignalNumbers.h +++ b/ndb/include/kernel/GlobalSignalNumbers.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -541,13 +540,13 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; #define GSN_ABORT_ALL_REF 446 #define GSN_ABORT_ALL_CONF 447 -#define GSN_STATISTICS_REQ 448 +/* 448 unused - formerly GSN_STATISTICS_REQ */ #define GSN_STOP_ORD 449 #define GSN_TAMPER_ORD 450 -#define GSN_SET_VAR_REQ 451 -#define GSN_SET_VAR_CONF 452 -#define GSN_SET_VAR_REF 453 -#define GSN_STATISTICS_CONF 454 +/* 451 unused - formerly GSN_SET_VAR_REQ */ +/* 452 unused - formerly GSN_SET_VAR_CONF */ +/* 453 unused - formerly GSN_SET_VAR_REF */ +/* 454 unused - formerly GSN_STATISTICS_CONF */ #define GSN_START_ORD 455 /* 457 unused */ diff --git a/ndb/include/kernel/GrepEvent.hpp b/ndb/include/kernel/GrepEvent.hpp index 2073a7072c9..dd1034e6e91 100644 --- a/ndb/include/kernel/GrepEvent.hpp +++ b/ndb/include/kernel/GrepEvent.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/Interpreter.hpp b/ndb/include/kernel/Interpreter.hpp index 69c952ea7c3..356d32599ac 100644 --- a/ndb/include/kernel/Interpreter.hpp +++ b/ndb/include/kernel/Interpreter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp index 60dcd36ab56..d58ac67083c 100644 --- a/ndb/include/kernel/LogLevel.hpp +++ b/ndb/include/kernel/LogLevel.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/NodeBitmask.hpp b/ndb/include/kernel/NodeBitmask.hpp index 423c01cd841..7d48cd9f689 100644 --- a/ndb/include/kernel/NodeBitmask.hpp +++ b/ndb/include/kernel/NodeBitmask.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/NodeInfo.hpp b/ndb/include/kernel/NodeInfo.hpp index 622185323a3..dba4b098d85 100644 --- a/ndb/include/kernel/NodeInfo.hpp +++ b/ndb/include/kernel/NodeInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/NodeState.hpp b/ndb/include/kernel/NodeState.hpp index 16784ecde79..61fa25fb237 100644 --- a/ndb/include/kernel/NodeState.hpp +++ b/ndb/include/kernel/NodeState.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/RefConvert.hpp b/ndb/include/kernel/RefConvert.hpp index 7604b1cf224..c15681e1504 100644 --- a/ndb/include/kernel/RefConvert.hpp +++ b/ndb/include/kernel/RefConvert.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/kernel_config_parameters.h b/ndb/include/kernel/kernel_config_parameters.h index bb7c6ebd42c..b715a1129d3 100644 --- a/ndb/include/kernel/kernel_config_parameters.h +++ b/ndb/include/kernel/kernel_config_parameters.h @@ -1,3 +1,18 @@ +/* Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #ifndef DB_CONFIG_PARAMTERS_H #define DB_CONFIG_PARAMTERS_H diff --git a/ndb/include/kernel/kernel_types.h b/ndb/include/kernel/kernel_types.h index e16e61471e7..251f1307a57 100644 --- a/ndb/include/kernel/kernel_types.h +++ b/ndb/include/kernel/kernel_types.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/ndb_limits.h b/ndb/include/kernel/ndb_limits.h index 8822cb8976e..c82288c762a 100644 --- a/ndb/include/kernel/ndb_limits.h +++ b/ndb/include/kernel/ndb_limits.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/AbortAll.hpp b/ndb/include/kernel/signaldata/AbortAll.hpp index a3d7f483953..2d7d3bd7c29 100644 --- a/ndb/include/kernel/signaldata/AbortAll.hpp +++ b/ndb/include/kernel/signaldata/AbortAll.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/AccFrag.hpp b/ndb/include/kernel/signaldata/AccFrag.hpp index e28ab0d1ee6..c44e157485c 100644 --- a/ndb/include/kernel/signaldata/AccFrag.hpp +++ b/ndb/include/kernel/signaldata/AccFrag.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/AccLock.hpp b/ndb/include/kernel/signaldata/AccLock.hpp index 1a41b4c9334..a0d540820be 100644 --- a/ndb/include/kernel/signaldata/AccLock.hpp +++ b/ndb/include/kernel/signaldata/AccLock.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/AccScan.hpp b/ndb/include/kernel/signaldata/AccScan.hpp index d94d4da8cca..e821e6f8fcd 100644 --- a/ndb/include/kernel/signaldata/AccScan.hpp +++ b/ndb/include/kernel/signaldata/AccScan.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/AccSizeAltReq.hpp b/ndb/include/kernel/signaldata/AccSizeAltReq.hpp index ac348444826..b3b239640ae 100644 --- a/ndb/include/kernel/signaldata/AccSizeAltReq.hpp +++ b/ndb/include/kernel/signaldata/AccSizeAltReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/AlterIndx.hpp b/ndb/include/kernel/signaldata/AlterIndx.hpp index f5ad835b6f3..bd9bf9a1293 100644 --- a/ndb/include/kernel/signaldata/AlterIndx.hpp +++ b/ndb/include/kernel/signaldata/AlterIndx.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/AlterTab.hpp b/ndb/include/kernel/signaldata/AlterTab.hpp index 02d4eb95d2e..465d6f2a093 100644 --- a/ndb/include/kernel/signaldata/AlterTab.hpp +++ b/ndb/include/kernel/signaldata/AlterTab.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/AlterTable.hpp b/ndb/include/kernel/signaldata/AlterTable.hpp index f5006c27fdb..c2fd742c234 100644 --- a/ndb/include/kernel/signaldata/AlterTable.hpp +++ b/ndb/include/kernel/signaldata/AlterTable.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -131,7 +130,8 @@ public: NullablePrimaryKey = 740, UnsupportedChange = 741, BackupInProgress = 762, - IncompatibleVersions = 763 + IncompatibleVersions = 763, + SingleUser = 299 }; private: diff --git a/ndb/include/kernel/signaldata/AlterTrig.hpp b/ndb/include/kernel/signaldata/AlterTrig.hpp index a97c1fd0196..5ecda1c470c 100644 --- a/ndb/include/kernel/signaldata/AlterTrig.hpp +++ b/ndb/include/kernel/signaldata/AlterTrig.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ApiBroadcast.hpp b/ndb/include/kernel/signaldata/ApiBroadcast.hpp index 8050326ce78..8d71d335103 100644 --- a/ndb/include/kernel/signaldata/ApiBroadcast.hpp +++ b/ndb/include/kernel/signaldata/ApiBroadcast.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ApiRegSignalData.hpp b/ndb/include/kernel/signaldata/ApiRegSignalData.hpp index 84dca8fb260..ca38564ddd1 100644 --- a/ndb/include/kernel/signaldata/ApiRegSignalData.hpp +++ b/ndb/include/kernel/signaldata/ApiRegSignalData.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ApiVersion.hpp b/ndb/include/kernel/signaldata/ApiVersion.hpp index a3774c9fba6..c895d881f61 100644 --- a/ndb/include/kernel/signaldata/ApiVersion.hpp +++ b/ndb/include/kernel/signaldata/ApiVersion.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ArbitSignalData.hpp b/ndb/include/kernel/signaldata/ArbitSignalData.hpp index 34b73644a13..ed7e3929414 100644 --- a/ndb/include/kernel/signaldata/ArbitSignalData.hpp +++ b/ndb/include/kernel/signaldata/ArbitSignalData.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -32,6 +31,7 @@ private: Uint32 data[2]; public: + ArbitTicket() {} STATIC_CONST( DataLength = 2 ); STATIC_CONST( TextLength = DataLength * 8 ); // hex digits @@ -143,6 +143,7 @@ public: ArbitTicket ticket; // ticket NodeBitmask mask; // set of nodes + ArbitSignalData() {} STATIC_CONST( SignalLength = 3 + ArbitTicket::DataLength + NodeBitmask::Size ); inline bool match(ArbitSignalData& aData) const { diff --git a/ndb/include/kernel/signaldata/AttrInfo.hpp b/ndb/include/kernel/signaldata/AttrInfo.hpp index c87470db8b0..45533178ab7 100644 --- a/ndb/include/kernel/signaldata/AttrInfo.hpp +++ b/ndb/include/kernel/signaldata/AttrInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/BackupContinueB.hpp b/ndb/include/kernel/signaldata/BackupContinueB.hpp index fe3f48444ec..eb2cedd1a2b 100644 --- a/ndb/include/kernel/signaldata/BackupContinueB.hpp +++ b/ndb/include/kernel/signaldata/BackupContinueB.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/BackupImpl.hpp b/ndb/include/kernel/signaldata/BackupImpl.hpp index 07ab5bc543b..65cc0efa889 100644 --- a/ndb/include/kernel/signaldata/BackupImpl.hpp +++ b/ndb/include/kernel/signaldata/BackupImpl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/BackupSignalData.hpp b/ndb/include/kernel/signaldata/BackupSignalData.hpp index 9e34ea3a211..21e24fcf5bc 100644 --- a/ndb/include/kernel/signaldata/BackupSignalData.hpp +++ b/ndb/include/kernel/signaldata/BackupSignalData.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/BlockCommitOrd.hpp b/ndb/include/kernel/signaldata/BlockCommitOrd.hpp index 3b33dceb758..924045926f9 100644 --- a/ndb/include/kernel/signaldata/BlockCommitOrd.hpp +++ b/ndb/include/kernel/signaldata/BlockCommitOrd.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/BuildIndx.hpp b/ndb/include/kernel/signaldata/BuildIndx.hpp index a6ea84c5ea0..d52dee648b8 100644 --- a/ndb/include/kernel/signaldata/BuildIndx.hpp +++ b/ndb/include/kernel/signaldata/BuildIndx.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CheckNodeGroups.hpp b/ndb/include/kernel/signaldata/CheckNodeGroups.hpp index b3e79949c68..6fc04a31709 100644 --- a/ndb/include/kernel/signaldata/CheckNodeGroups.hpp +++ b/ndb/include/kernel/signaldata/CheckNodeGroups.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CloseComReqConf.hpp b/ndb/include/kernel/signaldata/CloseComReqConf.hpp index 3d3dc54ba64..fbc92acfb2f 100644 --- a/ndb/include/kernel/signaldata/CloseComReqConf.hpp +++ b/ndb/include/kernel/signaldata/CloseComReqConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CmInit.hpp b/ndb/include/kernel/signaldata/CmInit.hpp index b59547b767b..a61c58abb51 100644 --- a/ndb/include/kernel/signaldata/CmInit.hpp +++ b/ndb/include/kernel/signaldata/CmInit.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CmRegSignalData.hpp b/ndb/include/kernel/signaldata/CmRegSignalData.hpp index ab51ed17bc3..e2e35cc9f93 100644 --- a/ndb/include/kernel/signaldata/CmRegSignalData.hpp +++ b/ndb/include/kernel/signaldata/CmRegSignalData.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -90,7 +89,11 @@ public: ZNOT_PRESIDENT = 5, /* We are not president */ ZNOT_DEAD = 6, /* We are not dead when we are starting */ ZINCOMPATIBLE_VERSION = 7, - ZINCOMPATIBLE_START_TYPE = 8 + ZINCOMPATIBLE_START_TYPE = 8, + ZSINGLE_USER_MODE = 9, /* The cluster is in single user mode, + * data node is not allowed to get added + * in the cluster while in single user mode */ + ZGENERIC = 100 /* The generic error code */ }; private: diff --git a/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp b/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp index 12b785723d9..dc2eaee786b 100644 --- a/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp +++ b/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CntrMasterConf.hpp b/ndb/include/kernel/signaldata/CntrMasterConf.hpp index e6bf363ea68..f2948a8835e 100644 --- a/ndb/include/kernel/signaldata/CntrMasterConf.hpp +++ b/ndb/include/kernel/signaldata/CntrMasterConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CntrMasterReq.hpp b/ndb/include/kernel/signaldata/CntrMasterReq.hpp index caf9efb1243..50ff9b95e6c 100644 --- a/ndb/include/kernel/signaldata/CntrMasterReq.hpp +++ b/ndb/include/kernel/signaldata/CntrMasterReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CntrStart.hpp b/ndb/include/kernel/signaldata/CntrStart.hpp index abdd1003c0f..9fc25a3fc4b 100644 --- a/ndb/include/kernel/signaldata/CntrStart.hpp +++ b/ndb/include/kernel/signaldata/CntrStart.hpp @@ -1,3 +1,18 @@ +/* Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #ifndef CNTR_START_HPP #define CNTR_START_HPP diff --git a/ndb/include/kernel/signaldata/ConfigParamId.hpp b/ndb/include/kernel/signaldata/ConfigParamId.hpp index 9d9e04957ab..90d604fd024 100644 --- a/ndb/include/kernel/signaldata/ConfigParamId.hpp +++ b/ndb/include/kernel/signaldata/ConfigParamId.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ContinueFragmented.hpp b/ndb/include/kernel/signaldata/ContinueFragmented.hpp index 3d12b9e51eb..31f47392a8b 100644 --- a/ndb/include/kernel/signaldata/ContinueFragmented.hpp +++ b/ndb/include/kernel/signaldata/ContinueFragmented.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CopyActive.hpp b/ndb/include/kernel/signaldata/CopyActive.hpp index 19b05bda072..2107d63ca5d 100644 --- a/ndb/include/kernel/signaldata/CopyActive.hpp +++ b/ndb/include/kernel/signaldata/CopyActive.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CopyFrag.hpp b/ndb/include/kernel/signaldata/CopyFrag.hpp index 3fd5d704727..c36206dea46 100644 --- a/ndb/include/kernel/signaldata/CopyFrag.hpp +++ b/ndb/include/kernel/signaldata/CopyFrag.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CopyGCIReq.hpp b/ndb/include/kernel/signaldata/CopyGCIReq.hpp index 4b401654de3..c669e5cabee 100644 --- a/ndb/include/kernel/signaldata/CopyGCIReq.hpp +++ b/ndb/include/kernel/signaldata/CopyGCIReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CreateEvnt.hpp b/ndb/include/kernel/signaldata/CreateEvnt.hpp index 8712ce8890c..ed052e3be04 100644 --- a/ndb/include/kernel/signaldata/CreateEvnt.hpp +++ b/ndb/include/kernel/signaldata/CreateEvnt.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CreateFrag.hpp b/ndb/include/kernel/signaldata/CreateFrag.hpp index a7b3f836353..dad2aa542ca 100644 --- a/ndb/include/kernel/signaldata/CreateFrag.hpp +++ b/ndb/include/kernel/signaldata/CreateFrag.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CreateFragmentation.hpp b/ndb/include/kernel/signaldata/CreateFragmentation.hpp index 7d53dd91154..b3e963a821c 100644 --- a/ndb/include/kernel/signaldata/CreateFragmentation.hpp +++ b/ndb/include/kernel/signaldata/CreateFragmentation.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CreateIndx.hpp b/ndb/include/kernel/signaldata/CreateIndx.hpp index a9dc653f349..f6168959d1a 100644 --- a/ndb/include/kernel/signaldata/CreateIndx.hpp +++ b/ndb/include/kernel/signaldata/CreateIndx.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -192,6 +191,7 @@ public: enum ErrorCode { NoError = 0, Busy = 701, + BusyWithNR = 711, NotMaster = 702, TriggerNotFound = 4238, TriggerExists = 4239, @@ -206,7 +206,8 @@ public: NotUnique = 4251, AllocationError = 4252, CreateIndexTableFailed = 4253, - DuplicateAttributes = 4258 + DuplicateAttributes = 4258, + SingleUser = 299 }; CreateIndxConf m_conf; diff --git a/ndb/include/kernel/signaldata/CreateTab.hpp b/ndb/include/kernel/signaldata/CreateTab.hpp index b2ef52a6bf7..87702c401a2 100644 --- a/ndb/include/kernel/signaldata/CreateTab.hpp +++ b/ndb/include/kernel/signaldata/CreateTab.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/CreateTable.hpp b/ndb/include/kernel/signaldata/CreateTable.hpp index 7d3189cc126..3f33da1e9b4 100644 --- a/ndb/include/kernel/signaldata/CreateTable.hpp +++ b/ndb/include/kernel/signaldata/CreateTable.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -92,7 +91,8 @@ public: RecordTooBig = 738, InvalidPrimaryKeySize = 739, NullablePrimaryKey = 740, - InvalidCharset = 743 + InvalidCharset = 743, + SingleUser = 299 }; private: diff --git a/ndb/include/kernel/signaldata/CreateTrig.hpp b/ndb/include/kernel/signaldata/CreateTrig.hpp index 62627256dcf..7f5ff640cf6 100644 --- a/ndb/include/kernel/signaldata/CreateTrig.hpp +++ b/ndb/include/kernel/signaldata/CreateTrig.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DiAddTab.hpp b/ndb/include/kernel/signaldata/DiAddTab.hpp index 6b17515eb6f..96adcbedd6c 100644 --- a/ndb/include/kernel/signaldata/DiAddTab.hpp +++ b/ndb/include/kernel/signaldata/DiAddTab.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DiGetNodes.hpp b/ndb/include/kernel/signaldata/DiGetNodes.hpp index 05ab6bfebb3..5e22c64143e 100644 --- a/ndb/include/kernel/signaldata/DiGetNodes.hpp +++ b/ndb/include/kernel/signaldata/DiGetNodes.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DictLock.hpp b/ndb/include/kernel/signaldata/DictLock.hpp index 3e29d762962..9cf6199ae5c 100644 --- a/ndb/include/kernel/signaldata/DictLock.hpp +++ b/ndb/include/kernel/signaldata/DictLock.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DictSchemaInfo.hpp b/ndb/include/kernel/signaldata/DictSchemaInfo.hpp index c15dcf2fd7a..88919769b37 100644 --- a/ndb/include/kernel/signaldata/DictSchemaInfo.hpp +++ b/ndb/include/kernel/signaldata/DictSchemaInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DictSizeAltReq.hpp b/ndb/include/kernel/signaldata/DictSizeAltReq.hpp index b40f0c8c1af..a5b2584a374 100644 --- a/ndb/include/kernel/signaldata/DictSizeAltReq.hpp +++ b/ndb/include/kernel/signaldata/DictSizeAltReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DictStart.hpp b/ndb/include/kernel/signaldata/DictStart.hpp index 59310601f48..ec317149095 100644 --- a/ndb/include/kernel/signaldata/DictStart.hpp +++ b/ndb/include/kernel/signaldata/DictStart.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index 0a7f6aa3fb3..985cb7ef643 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -47,17 +46,17 @@ inline int my_decimal_get_binary_size(uint precision, uint scale) #endif #define DTIMAP(x, y, z) \ - { DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 } + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 } #define DTIMAP2(x, y, z, u, v) \ - { DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 } + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 } #define DTIMAPS(x, y, z, u, v) \ - { DictTabInfo::y, offsetof(x, z), SimpleProperties::StringValue, u, v, 0 } + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::StringValue, u, v, 0 } #define DTIMAPB(x, y, z, u, v, l) \ - { DictTabInfo::y, offsetof(x, z), SimpleProperties::BinaryValue, u, v, \ - offsetof(x, l) } + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::BinaryValue, u, v, \ + my_offsetof(x, l) } #define DTIBREAK(x) \ { DictTabInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 } @@ -127,6 +126,8 @@ public: MinRowsLow = 143, MinRowsHigh = 144, + SingleUserMode = 152, + TableEnd = 999, AttributeName = 1000, // String, Mandatory @@ -274,7 +275,9 @@ public: Uint32 MaxRowsHigh; Uint32 MinRowsLow; Uint32 MinRowsHigh; + Uint32 SingleUserMode; + Table() {} void init(); }; @@ -335,6 +338,7 @@ public: Uint32 AttributeAutoIncrement; char AttributeDefaultValue[MAX_ATTR_DEFAULT_VALUE_SIZE]; + Attribute() {} void init(); inline diff --git a/ndb/include/kernel/signaldata/DihAddFrag.hpp b/ndb/include/kernel/signaldata/DihAddFrag.hpp index 6e5a24ee413..123b81c9480 100644 --- a/ndb/include/kernel/signaldata/DihAddFrag.hpp +++ b/ndb/include/kernel/signaldata/DihAddFrag.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DihContinueB.hpp b/ndb/include/kernel/signaldata/DihContinueB.hpp index 77ecf360601..0bc2141c4cc 100644 --- a/ndb/include/kernel/signaldata/DihContinueB.hpp +++ b/ndb/include/kernel/signaldata/DihContinueB.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DihSizeAltReq.hpp b/ndb/include/kernel/signaldata/DihSizeAltReq.hpp index 73279447859..9e901d5bf49 100644 --- a/ndb/include/kernel/signaldata/DihSizeAltReq.hpp +++ b/ndb/include/kernel/signaldata/DihSizeAltReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DihStartTab.hpp b/ndb/include/kernel/signaldata/DihStartTab.hpp index 75443e6070e..434712dbf47 100644 --- a/ndb/include/kernel/signaldata/DihStartTab.hpp +++ b/ndb/include/kernel/signaldata/DihStartTab.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DihSwitchReplica.hpp b/ndb/include/kernel/signaldata/DihSwitchReplica.hpp index d4212f510f3..cbeeb60af92 100644 --- a/ndb/include/kernel/signaldata/DihSwitchReplica.hpp +++ b/ndb/include/kernel/signaldata/DihSwitchReplica.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DisconnectRep.hpp b/ndb/include/kernel/signaldata/DisconnectRep.hpp index d7fcdc4fb35..26515fc0ef8 100644 --- a/ndb/include/kernel/signaldata/DisconnectRep.hpp +++ b/ndb/include/kernel/signaldata/DisconnectRep.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DropIndx.hpp b/ndb/include/kernel/signaldata/DropIndx.hpp index fd2ea7f0b7b..6e3b183995f 100644 --- a/ndb/include/kernel/signaldata/DropIndx.hpp +++ b/ndb/include/kernel/signaldata/DropIndx.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -168,11 +167,13 @@ public: NoError = 0, InvalidIndexVersion = 241, Busy = 701, + BusyWithNR = 711, NotMaster = 702, IndexNotFound = 4243, BadRequestType = 4247, InvalidName = 4248, - NotAnIndex = 4254 + NotAnIndex = 4254, + SingleUser = 299 }; STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 ); diff --git a/ndb/include/kernel/signaldata/DropTab.hpp b/ndb/include/kernel/signaldata/DropTab.hpp index dd3946d8cc0..2129f6297b0 100644 --- a/ndb/include/kernel/signaldata/DropTab.hpp +++ b/ndb/include/kernel/signaldata/DropTab.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DropTabFile.hpp b/ndb/include/kernel/signaldata/DropTabFile.hpp index 9ae4dae41c1..d9e6b96b5a9 100644 --- a/ndb/include/kernel/signaldata/DropTabFile.hpp +++ b/ndb/include/kernel/signaldata/DropTabFile.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DropTable.hpp b/ndb/include/kernel/signaldata/DropTable.hpp index e762446d2b8..c0a4596e1dc 100644 --- a/ndb/include/kernel/signaldata/DropTable.hpp +++ b/ndb/include/kernel/signaldata/DropTable.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -59,7 +58,8 @@ public: InvalidTableVersion = 241, DropInProgress = 283, NoDropTableRecordAvailable = 1229, - BackupInProgress = 761 + BackupInProgress = 761, + SingleUser = 299 }; }; diff --git a/ndb/include/kernel/signaldata/DropTrig.hpp b/ndb/include/kernel/signaldata/DropTrig.hpp index 7c5049f3de8..27e1a67801d 100644 --- a/ndb/include/kernel/signaldata/DropTrig.hpp +++ b/ndb/include/kernel/signaldata/DropTrig.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/DumpStateOrd.hpp b/ndb/include/kernel/signaldata/DumpStateOrd.hpp index 04f94aaba58..5a1d9ece9cf 100644 --- a/ndb/include/kernel/signaldata/DumpStateOrd.hpp +++ b/ndb/include/kernel/signaldata/DumpStateOrd.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -108,6 +107,10 @@ public: CmvmiDumpLongSignalMemory = 2601, CmvmiSetRestartOnErrorInsert = 2602, CmvmiTestLongSigWithDelay = 2603, + CmvmiDumpSubscriptions = 2604, /* note: done to respective outfile + to be able to debug if events + for some reason does not end up + in clusterlog */ // 7000 DIH // 7001 DIH // 7002 DIH diff --git a/ndb/include/kernel/signaldata/EmptyLcp.hpp b/ndb/include/kernel/signaldata/EmptyLcp.hpp index 32ea6c13231..60fccd742b6 100644 --- a/ndb/include/kernel/signaldata/EmptyLcp.hpp +++ b/ndb/include/kernel/signaldata/EmptyLcp.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/EndTo.hpp b/ndb/include/kernel/signaldata/EndTo.hpp index 944cca3ca98..0885edff45b 100644 --- a/ndb/include/kernel/signaldata/EndTo.hpp +++ b/ndb/include/kernel/signaldata/EndTo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/EventReport.hpp b/ndb/include/kernel/signaldata/EventReport.hpp index e1cdbcfd753..e7b1fa3d79a 100644 --- a/ndb/include/kernel/signaldata/EventReport.hpp +++ b/ndb/include/kernel/signaldata/EventReport.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/EventSubscribeReq.hpp b/ndb/include/kernel/signaldata/EventSubscribeReq.hpp index 84a1717b1de..d72b6dec3e5 100644 --- a/ndb/include/kernel/signaldata/EventSubscribeReq.hpp +++ b/ndb/include/kernel/signaldata/EventSubscribeReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ExecFragReq.hpp b/ndb/include/kernel/signaldata/ExecFragReq.hpp index e40213d6e29..47155638b81 100644 --- a/ndb/include/kernel/signaldata/ExecFragReq.hpp +++ b/ndb/include/kernel/signaldata/ExecFragReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/FailRep.hpp b/ndb/include/kernel/signaldata/FailRep.hpp index f2250f1af73..798ff3f5e47 100644 --- a/ndb/include/kernel/signaldata/FailRep.hpp +++ b/ndb/include/kernel/signaldata/FailRep.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/FireTrigOrd.hpp b/ndb/include/kernel/signaldata/FireTrigOrd.hpp index 20a0a863094..20036edaf31 100644 --- a/ndb/include/kernel/signaldata/FireTrigOrd.hpp +++ b/ndb/include/kernel/signaldata/FireTrigOrd.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/FsAppendReq.hpp b/ndb/include/kernel/signaldata/FsAppendReq.hpp index e2fd61f8a11..2ffe3ebbd7a 100644 --- a/ndb/include/kernel/signaldata/FsAppendReq.hpp +++ b/ndb/include/kernel/signaldata/FsAppendReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/FsCloseReq.hpp b/ndb/include/kernel/signaldata/FsCloseReq.hpp index 10d094fb30b..245e7e5d24d 100644 --- a/ndb/include/kernel/signaldata/FsCloseReq.hpp +++ b/ndb/include/kernel/signaldata/FsCloseReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/FsConf.hpp b/ndb/include/kernel/signaldata/FsConf.hpp index f66d9feea49..efb6cac3c9c 100644 --- a/ndb/include/kernel/signaldata/FsConf.hpp +++ b/ndb/include/kernel/signaldata/FsConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/FsOpenReq.hpp b/ndb/include/kernel/signaldata/FsOpenReq.hpp index 906bb947128..cdc3241f24f 100644 --- a/ndb/include/kernel/signaldata/FsOpenReq.hpp +++ b/ndb/include/kernel/signaldata/FsOpenReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/FsReadWriteReq.hpp b/ndb/include/kernel/signaldata/FsReadWriteReq.hpp index 6e4fa4d260e..d7929ac7924 100644 --- a/ndb/include/kernel/signaldata/FsReadWriteReq.hpp +++ b/ndb/include/kernel/signaldata/FsReadWriteReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/FsRef.hpp b/ndb/include/kernel/signaldata/FsRef.hpp index a0e1dc55dae..e7a570ef0d8 100644 --- a/ndb/include/kernel/signaldata/FsRef.hpp +++ b/ndb/include/kernel/signaldata/FsRef.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/FsRemoveReq.hpp b/ndb/include/kernel/signaldata/FsRemoveReq.hpp index efb566d883a..24971a489e6 100644 --- a/ndb/include/kernel/signaldata/FsRemoveReq.hpp +++ b/ndb/include/kernel/signaldata/FsRemoveReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/GCPSave.hpp b/ndb/include/kernel/signaldata/GCPSave.hpp index 2b4a25e6bb2..61a0414c093 100644 --- a/ndb/include/kernel/signaldata/GCPSave.hpp +++ b/ndb/include/kernel/signaldata/GCPSave.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/GetTabInfo.hpp b/ndb/include/kernel/signaldata/GetTabInfo.hpp index 6b223cab119..50e63b6bb9f 100644 --- a/ndb/include/kernel/signaldata/GetTabInfo.hpp +++ b/ndb/include/kernel/signaldata/GetTabInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/GetTableId.hpp b/ndb/include/kernel/signaldata/GetTableId.hpp index fb91c2e10d7..8c785a911ab 100644 --- a/ndb/include/kernel/signaldata/GetTableId.hpp +++ b/ndb/include/kernel/signaldata/GetTableId.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/GrepImpl.hpp b/ndb/include/kernel/signaldata/GrepImpl.hpp index 95b93df0a58..335c78f58eb 100644 --- a/ndb/include/kernel/signaldata/GrepImpl.hpp +++ b/ndb/include/kernel/signaldata/GrepImpl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/HotSpareRep.hpp b/ndb/include/kernel/signaldata/HotSpareRep.hpp index fb9d338be1b..c3e2922f1d7 100644 --- a/ndb/include/kernel/signaldata/HotSpareRep.hpp +++ b/ndb/include/kernel/signaldata/HotSpareRep.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/IndxAttrInfo.hpp b/ndb/include/kernel/signaldata/IndxAttrInfo.hpp index ec5790d84f3..f42e9ff8657 100755 --- a/ndb/include/kernel/signaldata/IndxAttrInfo.hpp +++ b/ndb/include/kernel/signaldata/IndxAttrInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/IndxKeyInfo.hpp b/ndb/include/kernel/signaldata/IndxKeyInfo.hpp index 7cd7795ec71..82ba9ae6c3f 100755 --- a/ndb/include/kernel/signaldata/IndxKeyInfo.hpp +++ b/ndb/include/kernel/signaldata/IndxKeyInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp b/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp index 2497af354ce..49293a5d18b 100644 --- a/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp +++ b/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp b/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp index e55a58710b4..57f9870d019 100644 --- a/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp +++ b/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/KeyInfo.hpp b/ndb/include/kernel/signaldata/KeyInfo.hpp index 686f3ae053d..bc7f4b52a88 100644 --- a/ndb/include/kernel/signaldata/KeyInfo.hpp +++ b/ndb/include/kernel/signaldata/KeyInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/LCP.hpp b/ndb/include/kernel/signaldata/LCP.hpp index 7d3fb71ae7e..e631d694037 100644 --- a/ndb/include/kernel/signaldata/LCP.hpp +++ b/ndb/include/kernel/signaldata/LCP.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ListTables.hpp b/ndb/include/kernel/signaldata/ListTables.hpp index 7fbfab1294c..47b9c9b34d6 100644 --- a/ndb/include/kernel/signaldata/ListTables.hpp +++ b/ndb/include/kernel/signaldata/ListTables.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/LqhFrag.hpp b/ndb/include/kernel/signaldata/LqhFrag.hpp index 72c1537854c..ec8637c254c 100644 --- a/ndb/include/kernel/signaldata/LqhFrag.hpp +++ b/ndb/include/kernel/signaldata/LqhFrag.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/LqhKey.hpp b/ndb/include/kernel/signaldata/LqhKey.hpp index e937180e3f7..486639613fe 100644 --- a/ndb/include/kernel/signaldata/LqhKey.hpp +++ b/ndb/include/kernel/signaldata/LqhKey.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp b/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp index e47ce39897a..109f7343678 100644 --- a/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp +++ b/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/LqhTransConf.hpp b/ndb/include/kernel/signaldata/LqhTransConf.hpp index f62dfd07f51..4a72d344ad6 100644 --- a/ndb/include/kernel/signaldata/LqhTransConf.hpp +++ b/ndb/include/kernel/signaldata/LqhTransConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ManagementServer.hpp b/ndb/include/kernel/signaldata/ManagementServer.hpp index ce14e30c81d..c97a252d638 100644 --- a/ndb/include/kernel/signaldata/ManagementServer.hpp +++ b/ndb/include/kernel/signaldata/ManagementServer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/MasterGCP.hpp b/ndb/include/kernel/signaldata/MasterGCP.hpp index ebe6857a107..683a1ac869f 100644 --- a/ndb/include/kernel/signaldata/MasterGCP.hpp +++ b/ndb/include/kernel/signaldata/MasterGCP.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/MasterLCP.hpp b/ndb/include/kernel/signaldata/MasterLCP.hpp index bf84ac73309..b9fbff2313d 100644 --- a/ndb/include/kernel/signaldata/MasterLCP.hpp +++ b/ndb/include/kernel/signaldata/MasterLCP.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/NFCompleteRep.hpp b/ndb/include/kernel/signaldata/NFCompleteRep.hpp index 764da85b163..18b201021b5 100644 --- a/ndb/include/kernel/signaldata/NFCompleteRep.hpp +++ b/ndb/include/kernel/signaldata/NFCompleteRep.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/NdbSttor.hpp b/ndb/include/kernel/signaldata/NdbSttor.hpp index edd93ef96a8..e5e5dfb829c 100644 --- a/ndb/include/kernel/signaldata/NdbSttor.hpp +++ b/ndb/include/kernel/signaldata/NdbSttor.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/NdbfsContinueB.hpp b/ndb/include/kernel/signaldata/NdbfsContinueB.hpp index 6154e5c19b1..22e6e8e3e0b 100644 --- a/ndb/include/kernel/signaldata/NdbfsContinueB.hpp +++ b/ndb/include/kernel/signaldata/NdbfsContinueB.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/NextScan.hpp b/ndb/include/kernel/signaldata/NextScan.hpp index a502a89108c..277c827de93 100644 --- a/ndb/include/kernel/signaldata/NextScan.hpp +++ b/ndb/include/kernel/signaldata/NextScan.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/NodeFailRep.hpp b/ndb/include/kernel/signaldata/NodeFailRep.hpp index fe57ba1a712..a7c55e8fff1 100644 --- a/ndb/include/kernel/signaldata/NodeFailRep.hpp +++ b/ndb/include/kernel/signaldata/NodeFailRep.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/NodeStateSignalData.hpp b/ndb/include/kernel/signaldata/NodeStateSignalData.hpp index 391d8f89566..0c15f3f968b 100644 --- a/ndb/include/kernel/signaldata/NodeStateSignalData.hpp +++ b/ndb/include/kernel/signaldata/NodeStateSignalData.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/PackedSignal.hpp b/ndb/include/kernel/signaldata/PackedSignal.hpp index ea0ff6db526..50f9517b1c8 100644 --- a/ndb/include/kernel/signaldata/PackedSignal.hpp +++ b/ndb/include/kernel/signaldata/PackedSignal.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/PrepDropTab.hpp b/ndb/include/kernel/signaldata/PrepDropTab.hpp index c54b2474aa3..9fed2f287d2 100644 --- a/ndb/include/kernel/signaldata/PrepDropTab.hpp +++ b/ndb/include/kernel/signaldata/PrepDropTab.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/PrepFailReqRef.hpp b/ndb/include/kernel/signaldata/PrepFailReqRef.hpp index 90b568237b8..e7b83f6b316 100644 --- a/ndb/include/kernel/signaldata/PrepFailReqRef.hpp +++ b/ndb/include/kernel/signaldata/PrepFailReqRef.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ReadConfig.hpp b/ndb/include/kernel/signaldata/ReadConfig.hpp index 0835b252a32..68a32ec4e68 100644 --- a/ndb/include/kernel/signaldata/ReadConfig.hpp +++ b/ndb/include/kernel/signaldata/ReadConfig.hpp @@ -1,3 +1,18 @@ +/* Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #ifndef READ_CONFIG_HPP #define READ_CONFIG_HPP diff --git a/ndb/include/kernel/signaldata/ReadNodesConf.hpp b/ndb/include/kernel/signaldata/ReadNodesConf.hpp index 0507007f71a..f42c9249418 100644 --- a/ndb/include/kernel/signaldata/ReadNodesConf.hpp +++ b/ndb/include/kernel/signaldata/ReadNodesConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/RelTabMem.hpp b/ndb/include/kernel/signaldata/RelTabMem.hpp index 9cf1787bba4..372ef58d283 100644 --- a/ndb/include/kernel/signaldata/RelTabMem.hpp +++ b/ndb/include/kernel/signaldata/RelTabMem.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/RepImpl.hpp b/ndb/include/kernel/signaldata/RepImpl.hpp index 0de1389a4a9..a82ae979d4d 100644 --- a/ndb/include/kernel/signaldata/RepImpl.hpp +++ b/ndb/include/kernel/signaldata/RepImpl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ResumeReq.hpp b/ndb/include/kernel/signaldata/ResumeReq.hpp index a4880474ca8..5ef57a9b700 100644 --- a/ndb/include/kernel/signaldata/ResumeReq.hpp +++ b/ndb/include/kernel/signaldata/ResumeReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ScanFrag.hpp b/ndb/include/kernel/signaldata/ScanFrag.hpp index f21a3eef7ac..accd16503f4 100644 --- a/ndb/include/kernel/signaldata/ScanFrag.hpp +++ b/ndb/include/kernel/signaldata/ScanFrag.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/ScanTab.hpp b/ndb/include/kernel/signaldata/ScanTab.hpp index 8cb282270ff..15a022e2cba 100644 --- a/ndb/include/kernel/signaldata/ScanTab.hpp +++ b/ndb/include/kernel/signaldata/ScanTab.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -114,15 +113,15 @@ private: z = Descending (TUX) - 1 Bit 14 x = Range Scan (TUX) - 1 Bit 15 b = Scan batch - 10 Bit 16-25 (max 1023) - d = Distribution key flag + d = Distribution key flag - 1 Bit 26 1111111111222222222233 01234567890123456789012345678901 - ppppppppl hcktzxbbbbbbbbbb + ppppppppl hcktzxbbbbbbbbbbd */ -#define PARALLELL_SHIFT (0) -#define PARALLELL_MASK (255) +#define PARALLEL_SHIFT (0) +#define PARALLEL_MASK (255) #define LOCK_MODE_SHIFT (8) #define LOCK_MODE_MASK (1) @@ -149,11 +148,12 @@ private: #define SCAN_BATCH_MASK (1023) #define SCAN_DISTR_KEY_SHIFT (26) +#define SCAN_DISTR_KEY_MASK (1) inline Uint8 ScanTabReq::getParallelism(const UintR & requestInfo){ - return (Uint8)((requestInfo >> PARALLELL_SHIFT) & PARALLELL_MASK); + return (Uint8)((requestInfo >> PARALLEL_SHIFT) & PARALLEL_MASK); } inline @@ -207,58 +207,65 @@ ScanTabReq::clearRequestInfo(UintR & requestInfo){ inline void ScanTabReq::setParallelism(UintR & requestInfo, Uint32 type){ - ASSERT_MAX(type, PARALLELL_MASK, "ScanTabReq::setParallellism"); - requestInfo |= (type << PARALLELL_SHIFT); + ASSERT_MAX(type, PARALLEL_MASK, "ScanTabReq::setParallelism"); + requestInfo= (requestInfo & ~(PARALLEL_MASK << PARALLEL_SHIFT)) | + ((type & PARALLEL_MASK) << PARALLEL_SHIFT); } inline void ScanTabReq::setLockMode(UintR & requestInfo, Uint32 mode){ ASSERT_MAX(mode, LOCK_MODE_MASK, "ScanTabReq::setLockMode"); - requestInfo |= (mode << LOCK_MODE_SHIFT); + requestInfo= (requestInfo & ~(LOCK_MODE_MASK << LOCK_MODE_SHIFT)) | + ((mode & LOCK_MODE_MASK) << LOCK_MODE_SHIFT); } inline void ScanTabReq::setHoldLockFlag(UintR & requestInfo, Uint32 flag){ ASSERT_BOOL(flag, "ScanTabReq::setHoldLockFlag"); - requestInfo |= (flag << HOLD_LOCK_SHIFT); + requestInfo= (requestInfo & ~(HOLD_LOCK_MASK << HOLD_LOCK_SHIFT)) | + ((flag & HOLD_LOCK_MASK) << HOLD_LOCK_SHIFT); } inline void ScanTabReq::setReadCommittedFlag(UintR & requestInfo, Uint32 flag){ ASSERT_BOOL(flag, "ScanTabReq::setReadCommittedFlag"); - requestInfo |= (flag << READ_COMMITTED_SHIFT); + requestInfo= (requestInfo & ~(READ_COMMITTED_MASK << READ_COMMITTED_SHIFT)) | + ((flag & READ_COMMITTED_MASK) << READ_COMMITTED_SHIFT); } inline void ScanTabReq::setRangeScanFlag(UintR & requestInfo, Uint32 flag){ ASSERT_BOOL(flag, "ScanTabReq::setRangeScanFlag"); - requestInfo |= (flag << RANGE_SCAN_SHIFT); + requestInfo= (requestInfo & ~(RANGE_SCAN_MASK << RANGE_SCAN_SHIFT)) | + ((flag & RANGE_SCAN_MASK) << RANGE_SCAN_SHIFT); } inline void ScanTabReq::setDescendingFlag(UintR & requestInfo, Uint32 flag){ ASSERT_BOOL(flag, "ScanTabReq::setDescendingFlag"); - requestInfo |= (flag << DESCENDING_SHIFT); + requestInfo= (requestInfo & ~(DESCENDING_MASK << DESCENDING_SHIFT)) | + ((flag & DESCENDING_MASK) << DESCENDING_SHIFT); } inline void ScanTabReq::setTupScanFlag(UintR & requestInfo, Uint32 flag){ ASSERT_BOOL(flag, "ScanTabReq::setTupScanFlag"); - requestInfo |= (flag << TUP_SCAN_SHIFT); + requestInfo= (requestInfo & ~(TUP_SCAN_MASK << TUP_SCAN_SHIFT)) | + ((flag & TUP_SCAN_MASK) << TUP_SCAN_SHIFT); } inline void ScanTabReq::setScanBatch(Uint32 & requestInfo, Uint32 flag){ ASSERT_MAX(flag, SCAN_BATCH_MASK, "ScanTabReq::setScanBatch"); - requestInfo &= ~(SCAN_BATCH_MASK << SCAN_BATCH_SHIFT); - requestInfo |= (flag << SCAN_BATCH_SHIFT); + requestInfo= (requestInfo & ~(SCAN_BATCH_MASK << SCAN_BATCH_SHIFT)) | + ((flag & SCAN_BATCH_MASK) << SCAN_BATCH_SHIFT); } inline @@ -271,7 +278,8 @@ inline void ScanTabReq::setKeyinfoFlag(UintR & requestInfo, Uint32 flag){ ASSERT_BOOL(flag, "ScanTabReq::setKeyinfoFlag"); - requestInfo |= (flag << KEYINFO_SHIFT); + requestInfo= (requestInfo & ~(KEYINFO_MASK << KEYINFO_SHIFT)) | + ((flag & KEYINFO_MASK) << KEYINFO_SHIFT); } inline @@ -284,7 +292,8 @@ inline void ScanTabReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){ ASSERT_BOOL(flag, "ScanTabReq::setKeyinfoFlag"); - requestInfo |= (flag << SCAN_DISTR_KEY_SHIFT); + requestInfo= (requestInfo & ~(SCAN_DISTR_KEY_MASK << SCAN_DISTR_KEY_SHIFT)) | + ((flag & SCAN_DISTR_KEY_MASK) << SCAN_DISTR_KEY_SHIFT); } /** diff --git a/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp b/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp index 2923029f8f6..942baf2a9ad 100644 --- a/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp +++ b/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/SetVarReq.hpp b/ndb/include/kernel/signaldata/SetVarReq.hpp index 8cb3e78be8b..a4bf54d2a2a 100644 --- a/ndb/include/kernel/signaldata/SetVarReq.hpp +++ b/ndb/include/kernel/signaldata/SetVarReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/SignalData.hpp b/ndb/include/kernel/signaldata/SignalData.hpp index 0591a85d6e6..812a0dda6f8 100644 --- a/ndb/include/kernel/signaldata/SignalData.hpp +++ b/ndb/include/kernel/signaldata/SignalData.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/SignalDataPrint.hpp b/ndb/include/kernel/signaldata/SignalDataPrint.hpp index 17ab07acd4e..1d0b3a17bfd 100644 --- a/ndb/include/kernel/signaldata/SignalDataPrint.hpp +++ b/ndb/include/kernel/signaldata/SignalDataPrint.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/SignalDroppedRep.hpp b/ndb/include/kernel/signaldata/SignalDroppedRep.hpp index 20863524358..fd6d5afabce 100644 --- a/ndb/include/kernel/signaldata/SignalDroppedRep.hpp +++ b/ndb/include/kernel/signaldata/SignalDroppedRep.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/SrFragidConf.hpp b/ndb/include/kernel/signaldata/SrFragidConf.hpp index 9a6088ad57f..e534378779e 100644 --- a/ndb/include/kernel/signaldata/SrFragidConf.hpp +++ b/ndb/include/kernel/signaldata/SrFragidConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StartFragReq.hpp b/ndb/include/kernel/signaldata/StartFragReq.hpp index ab17a147195..884bc904bcd 100644 --- a/ndb/include/kernel/signaldata/StartFragReq.hpp +++ b/ndb/include/kernel/signaldata/StartFragReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StartInfo.hpp b/ndb/include/kernel/signaldata/StartInfo.hpp index d0850b13ef4..733082cae1e 100644 --- a/ndb/include/kernel/signaldata/StartInfo.hpp +++ b/ndb/include/kernel/signaldata/StartInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StartMe.hpp b/ndb/include/kernel/signaldata/StartMe.hpp index 6593a9e9741..56b20efe951 100644 --- a/ndb/include/kernel/signaldata/StartMe.hpp +++ b/ndb/include/kernel/signaldata/StartMe.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StartOrd.hpp b/ndb/include/kernel/signaldata/StartOrd.hpp index 43a48f70ba9..03092719629 100644 --- a/ndb/include/kernel/signaldata/StartOrd.hpp +++ b/ndb/include/kernel/signaldata/StartOrd.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StartPerm.hpp b/ndb/include/kernel/signaldata/StartPerm.hpp index 63e01ed3868..ffb16bfec9d 100644 --- a/ndb/include/kernel/signaldata/StartPerm.hpp +++ b/ndb/include/kernel/signaldata/StartPerm.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StartRec.hpp b/ndb/include/kernel/signaldata/StartRec.hpp index f8a4e01a094..24367c541ab 100644 --- a/ndb/include/kernel/signaldata/StartRec.hpp +++ b/ndb/include/kernel/signaldata/StartRec.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StartTo.hpp b/ndb/include/kernel/signaldata/StartTo.hpp index 5aecef6275d..f8ac256e98f 100644 --- a/ndb/include/kernel/signaldata/StartTo.hpp +++ b/ndb/include/kernel/signaldata/StartTo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StopMe.hpp b/ndb/include/kernel/signaldata/StopMe.hpp index 51d944a3b96..98531bffa00 100644 --- a/ndb/include/kernel/signaldata/StopMe.hpp +++ b/ndb/include/kernel/signaldata/StopMe.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StopPerm.hpp b/ndb/include/kernel/signaldata/StopPerm.hpp index 95fb82c8cde..145a120646a 100644 --- a/ndb/include/kernel/signaldata/StopPerm.hpp +++ b/ndb/include/kernel/signaldata/StopPerm.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/StopReq.hpp b/ndb/include/kernel/signaldata/StopReq.hpp index 70e195961ce..a065f528735 100644 --- a/ndb/include/kernel/signaldata/StopReq.hpp +++ b/ndb/include/kernel/signaldata/StopReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/SumaImpl.hpp b/ndb/include/kernel/signaldata/SumaImpl.hpp index 75fb65e1ad2..8420de02899 100644 --- a/ndb/include/kernel/signaldata/SumaImpl.hpp +++ b/ndb/include/kernel/signaldata/SumaImpl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/SystemError.hpp b/ndb/include/kernel/signaldata/SystemError.hpp index c2c51e88bf2..e12499f6c8d 100644 --- a/ndb/include/kernel/signaldata/SystemError.hpp +++ b/ndb/include/kernel/signaldata/SystemError.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TamperOrd.hpp b/ndb/include/kernel/signaldata/TamperOrd.hpp index eb6cd47b093..34831704166 100644 --- a/ndb/include/kernel/signaldata/TamperOrd.hpp +++ b/ndb/include/kernel/signaldata/TamperOrd.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcCommit.hpp b/ndb/include/kernel/signaldata/TcCommit.hpp index dcbca0cb6f2..f0234e22ccf 100644 --- a/ndb/include/kernel/signaldata/TcCommit.hpp +++ b/ndb/include/kernel/signaldata/TcCommit.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcContinueB.hpp b/ndb/include/kernel/signaldata/TcContinueB.hpp index b87b982e49b..b21b4bb4e46 100644 --- a/ndb/include/kernel/signaldata/TcContinueB.hpp +++ b/ndb/include/kernel/signaldata/TcContinueB.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcHbRep.hpp b/ndb/include/kernel/signaldata/TcHbRep.hpp index 7e701b510f9..da3b8d583d3 100644 --- a/ndb/include/kernel/signaldata/TcHbRep.hpp +++ b/ndb/include/kernel/signaldata/TcHbRep.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcIndx.hpp b/ndb/include/kernel/signaldata/TcIndx.hpp index c5e7d2489ba..4dc54e9b188 100644 --- a/ndb/include/kernel/signaldata/TcIndx.hpp +++ b/ndb/include/kernel/signaldata/TcIndx.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcKeyConf.hpp b/ndb/include/kernel/signaldata/TcKeyConf.hpp index c23e94951dc..b8562875ef5 100644 --- a/ndb/include/kernel/signaldata/TcKeyConf.hpp +++ b/ndb/include/kernel/signaldata/TcKeyConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcKeyFailConf.hpp b/ndb/include/kernel/signaldata/TcKeyFailConf.hpp index 7c0a766df40..076f4f22a51 100644 --- a/ndb/include/kernel/signaldata/TcKeyFailConf.hpp +++ b/ndb/include/kernel/signaldata/TcKeyFailConf.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcKeyRef.hpp b/ndb/include/kernel/signaldata/TcKeyRef.hpp index c773920713a..2846ce3854f 100644 --- a/ndb/include/kernel/signaldata/TcKeyRef.hpp +++ b/ndb/include/kernel/signaldata/TcKeyRef.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcKeyReq.hpp b/ndb/include/kernel/signaldata/TcKeyReq.hpp index f611d2c1567..bd2677549e4 100644 --- a/ndb/include/kernel/signaldata/TcKeyReq.hpp +++ b/ndb/include/kernel/signaldata/TcKeyReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcRollbackRep.hpp b/ndb/include/kernel/signaldata/TcRollbackRep.hpp index febbd4f86b1..3b5e2f3d3cb 100644 --- a/ndb/include/kernel/signaldata/TcRollbackRep.hpp +++ b/ndb/include/kernel/signaldata/TcRollbackRep.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TcSizeAltReq.hpp b/ndb/include/kernel/signaldata/TcSizeAltReq.hpp index 34eacfe5a93..12bf9b3c72d 100644 --- a/ndb/include/kernel/signaldata/TcSizeAltReq.hpp +++ b/ndb/include/kernel/signaldata/TcSizeAltReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TestOrd.hpp b/ndb/include/kernel/signaldata/TestOrd.hpp index 1600df08884..44368a213fe 100644 --- a/ndb/include/kernel/signaldata/TestOrd.hpp +++ b/ndb/include/kernel/signaldata/TestOrd.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TransIdAI.hpp b/ndb/include/kernel/signaldata/TransIdAI.hpp index 5beaf6eba4b..a2af9ed89cc 100755 --- a/ndb/include/kernel/signaldata/TransIdAI.hpp +++ b/ndb/include/kernel/signaldata/TransIdAI.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TrigAttrInfo.hpp b/ndb/include/kernel/signaldata/TrigAttrInfo.hpp index e2c029b9033..79371258b3d 100644 --- a/ndb/include/kernel/signaldata/TrigAttrInfo.hpp +++ b/ndb/include/kernel/signaldata/TrigAttrInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TupCommit.hpp b/ndb/include/kernel/signaldata/TupCommit.hpp index 7c5a7931e6c..976aa590659 100644 --- a/ndb/include/kernel/signaldata/TupCommit.hpp +++ b/ndb/include/kernel/signaldata/TupCommit.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TupFrag.hpp b/ndb/include/kernel/signaldata/TupFrag.hpp index c9f2ad5382f..1bb50b86084 100644 --- a/ndb/include/kernel/signaldata/TupFrag.hpp +++ b/ndb/include/kernel/signaldata/TupFrag.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TupKey.hpp b/ndb/include/kernel/signaldata/TupKey.hpp index ffd57d81e64..c89f5e74b99 100644 --- a/ndb/include/kernel/signaldata/TupKey.hpp +++ b/ndb/include/kernel/signaldata/TupKey.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TupSizeAltReq.hpp b/ndb/include/kernel/signaldata/TupSizeAltReq.hpp index 215493bc188..1fb4eae8f51 100644 --- a/ndb/include/kernel/signaldata/TupSizeAltReq.hpp +++ b/ndb/include/kernel/signaldata/TupSizeAltReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TuxBound.hpp b/ndb/include/kernel/signaldata/TuxBound.hpp index 7e12897407b..c0f8fd82038 100644 --- a/ndb/include/kernel/signaldata/TuxBound.hpp +++ b/ndb/include/kernel/signaldata/TuxBound.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TuxContinueB.hpp b/ndb/include/kernel/signaldata/TuxContinueB.hpp index 385d85715e2..87ac4d89211 100644 --- a/ndb/include/kernel/signaldata/TuxContinueB.hpp +++ b/ndb/include/kernel/signaldata/TuxContinueB.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TuxMaint.hpp b/ndb/include/kernel/signaldata/TuxMaint.hpp index 4518f0531ea..3c758ebc8b6 100644 --- a/ndb/include/kernel/signaldata/TuxMaint.hpp +++ b/ndb/include/kernel/signaldata/TuxMaint.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp b/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp index 5d5a0e102ba..bf2314d7159 100644 --- a/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp +++ b/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/UpdateTo.hpp b/ndb/include/kernel/signaldata/UpdateTo.hpp index 0fa5f31b6b4..e46fe1c1556 100644 --- a/ndb/include/kernel/signaldata/UpdateTo.hpp +++ b/ndb/include/kernel/signaldata/UpdateTo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/UpgradeStartup.hpp b/ndb/include/kernel/signaldata/UpgradeStartup.hpp index 93fef323789..80f6a161e05 100644 --- a/ndb/include/kernel/signaldata/UpgradeStartup.hpp +++ b/ndb/include/kernel/signaldata/UpgradeStartup.hpp @@ -1,3 +1,18 @@ +/* Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #ifndef NDB_UPGRADE_STARTUP #define NDB_UPGRADE_STARTUP diff --git a/ndb/include/kernel/signaldata/UtilDelete.hpp b/ndb/include/kernel/signaldata/UtilDelete.hpp index 67c13b8c2d5..fb5c0ece0fd 100644 --- a/ndb/include/kernel/signaldata/UtilDelete.hpp +++ b/ndb/include/kernel/signaldata/UtilDelete.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/UtilExecute.hpp b/ndb/include/kernel/signaldata/UtilExecute.hpp index 551fb172cac..172fe4302b3 100644 --- a/ndb/include/kernel/signaldata/UtilExecute.hpp +++ b/ndb/include/kernel/signaldata/UtilExecute.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/UtilLock.hpp b/ndb/include/kernel/signaldata/UtilLock.hpp index 318024fd706..75a697714f0 100644 --- a/ndb/include/kernel/signaldata/UtilLock.hpp +++ b/ndb/include/kernel/signaldata/UtilLock.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/UtilPrepare.hpp b/ndb/include/kernel/signaldata/UtilPrepare.hpp index 8508487ce15..4de9e61f699 100644 --- a/ndb/include/kernel/signaldata/UtilPrepare.hpp +++ b/ndb/include/kernel/signaldata/UtilPrepare.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/UtilRelease.hpp b/ndb/include/kernel/signaldata/UtilRelease.hpp index d2864f02f47..97623670399 100644 --- a/ndb/include/kernel/signaldata/UtilRelease.hpp +++ b/ndb/include/kernel/signaldata/UtilRelease.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/UtilSequence.hpp b/ndb/include/kernel/signaldata/UtilSequence.hpp index 50e5d673e99..b24a6f83b7d 100644 --- a/ndb/include/kernel/signaldata/UtilSequence.hpp +++ b/ndb/include/kernel/signaldata/UtilSequence.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/signaldata/WaitGCP.hpp b/ndb/include/kernel/signaldata/WaitGCP.hpp index be2a5b9d5f0..7e62debdf18 100644 --- a/ndb/include/kernel/signaldata/WaitGCP.hpp +++ b/ndb/include/kernel/signaldata/WaitGCP.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/kernel/trigger_definitions.h b/ndb/include/kernel/trigger_definitions.h index 11410654a15..05d0e871f76 100644 --- a/ndb/include/kernel/trigger_definitions.h +++ b/ndb/include/kernel/trigger_definitions.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/logger/ConsoleLogHandler.hpp b/ndb/include/logger/ConsoleLogHandler.hpp index ae77b13d3b7..cfcb598fb5e 100644 --- a/ndb/include/logger/ConsoleLogHandler.hpp +++ b/ndb/include/logger/ConsoleLogHandler.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/logger/FileLogHandler.hpp b/ndb/include/logger/FileLogHandler.hpp index 8fb25e72be7..36a35399ac8 100644 --- a/ndb/include/logger/FileLogHandler.hpp +++ b/ndb/include/logger/FileLogHandler.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -102,7 +101,7 @@ private: bool setMaxFiles(const BaseString &files); int m_maxNoFiles; - long m_maxFileSize; + off_t m_maxFileSize; unsigned int m_maxLogEntries; File_class* m_pLogFile; }; diff --git a/ndb/include/logger/LogHandler.hpp b/ndb/include/logger/LogHandler.hpp index 8b9aa43d7a9..98809280d0c 100644 --- a/ndb/include/logger/LogHandler.hpp +++ b/ndb/include/logger/LogHandler.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -135,7 +134,7 @@ public: * * @param str the error string. */ - void setErrorStr(char* str); + void setErrorStr(const char* str); /** * Parse logstring parameters diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp index 3414468d42d..c4ce1870c6f 100644 --- a/ndb/include/logger/Logger.hpp +++ b/ndb/include/logger/Logger.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/logger/SysLogHandler.hpp b/ndb/include/logger/SysLogHandler.hpp index 0dfc1cb2d43..e2d4af54e7a 100644 --- a/ndb/include/logger/SysLogHandler.hpp +++ b/ndb/include/logger/SysLogHandler.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 208e8aead8d..e5889a1ee6d 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -17,6 +16,8 @@ #ifndef MGMAPI_H #define MGMAPI_H +#define NDB_MGM_MAX_LOGLEVEL 15 + /** * @mainpage MySQL Cluster Management API * @@ -542,6 +543,16 @@ extern "C" { const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz); /** + * Sets the number of seconds to wait for connect(2) during ndb_mgm_connect + * Default is no timeout + * + * @param handle NdbMgmHandle + * @param seconds number of seconds + * @return non-zero on success + */ + int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds); + + /** * Connects to a management server. Connectstring is set by * ndb_mgm_set_connectstring(). * @@ -873,6 +884,15 @@ extern "C" { enum ndb_mgm_event_category category, int level, struct ndb_mgm_reply* reply); + /** + * get log category and levels + * + * @param handle NDB management handle. + * @return A vector of twelve elements, + * where each element contains + * loglevel of corresponding category + */ + const unsigned int *ndb_mgm_get_clusterlog_loglevel(NdbMgmHandle handle); /** @} *********************************************************************/ /** @@ -1083,6 +1103,19 @@ extern "C" { int ndb_mgm_end_session(NdbMgmHandle handle); /** + * ndb_mgm_get_fd + * + * get the file descriptor of the handle. + * INTERNAL ONLY. + * USE FOR TESTING. OTHER USES ARE NOT A GOOD IDEA. + * + * @param handle NDB management handle + * @return handle->socket + * + */ + int ndb_mgm_get_fd(NdbMgmHandle handle); + + /** * Get the node id of the mgm server we're connected to */ Uint32 ndb_mgm_get_mgmd_nodeid(NdbMgmHandle handle); @@ -1152,6 +1185,11 @@ extern "C" { enum ndb_mgm_event_category c, int l, struct ndb_mgm_reply* r) { return ndb_mgm_set_clusterlog_loglevel(h,n,c,l,r); } + + inline + const unsigned int *ndb_mgm_get_loglevel_clusterlog(NdbMgmHandle h) + { return ndb_mgm_get_clusterlog_loglevel(h); } + #endif #ifdef __cplusplus diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h index 410c811213b..dc15dfba548 100644 --- a/ndb/include/mgmapi/mgmapi_config_parameters.h +++ b/ndb/include/mgmapi/mgmapi_config_parameters.h @@ -1,3 +1,18 @@ +/* Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #ifndef MGMAPI_CONFIG_PARAMTERS_H #define MGMAPI_CONFIG_PARAMTERS_H diff --git a/ndb/include/mgmapi/mgmapi_config_parameters_debug.h b/ndb/include/mgmapi/mgmapi_config_parameters_debug.h index 0241dca90ef..20e10fb52db 100644 --- a/ndb/include/mgmapi/mgmapi_config_parameters_debug.h +++ b/ndb/include/mgmapi/mgmapi_config_parameters_debug.h @@ -1,3 +1,18 @@ +/* Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #ifndef MGMAPI_CONFIG_PARAMTERS_DEBUG_H #define MGMAPI_CONFIG_PARAMTERS_DEBUG_H diff --git a/ndb/include/mgmapi/mgmapi_debug.h b/ndb/include/mgmapi/mgmapi_debug.h index e86d9d4b768..b881cf4ca98 100644 --- a/ndb/include/mgmapi/mgmapi_debug.h +++ b/ndb/include/mgmapi/mgmapi_debug.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/mgmapi/ndb_logevent.h b/ndb/include/mgmapi/ndb_logevent.h index d57646c14db..76e4c31baa2 100644 --- a/ndb/include/mgmapi/ndb_logevent.h +++ b/ndb/include/mgmapi/ndb_logevent.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/mgmapi/ndbd_exit_codes.h b/ndb/include/mgmapi/ndbd_exit_codes.h index 1016234c513..1051fd9e394 100644 --- a/ndb/include/mgmapi/ndbd_exit_codes.h +++ b/ndb/include/mgmapi/ndbd_exit_codes.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -65,6 +64,7 @@ typedef ndbd_exit_status_enum ndbd_exit_status; typedef ndbd_exit_classification_enum ndbd_exit_classification; /* Errorcodes before block division was used */ +#define NDBD_EXIT_GENERIC 2300 #define NDBD_EXIT_PRGERR 2301 #define NDBD_EXIT_NODE_NOT_IN_CONFIG 2302 #define NDBD_EXIT_SYSTEM_ERROR 2303 @@ -78,6 +78,9 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification; #define NDBD_EXIT_SR_RESTARTCONFLICT 2311 #define NDBD_EXIT_NO_MORE_UNDOLOG 2312 #define NDBD_EXIT_SR_UNDOLOG 2313 +#define NDBD_EXIT_SINGLE_USER_MODE 2314 +#define NDBD_EXIT_NODE_DECLARED_DEAD 2315 +#define NDBD_EXIT_SR_SCHEMAFILE 2316 #define NDBD_EXIT_MEMALLOC 2327 #define NDBD_EXIT_BLOCK_JBUFCONGESTION 2334 #define NDBD_EXIT_TIME_QUEUE_SHORT 2335 diff --git a/ndb/include/mgmcommon/ConfigRetriever.hpp b/ndb/include/mgmcommon/ConfigRetriever.hpp index 89a1eb976c8..221e24d0572 100644 --- a/ndb/include/mgmcommon/ConfigRetriever.hpp +++ b/ndb/include/mgmcommon/ConfigRetriever.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/mgmcommon/IPCConfig.hpp b/ndb/include/mgmcommon/IPCConfig.hpp index 1e23cdf9807..8e8b99eda73 100644 --- a/ndb/include/mgmcommon/IPCConfig.hpp +++ b/ndb/include/mgmcommon/IPCConfig.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/mgmcommon/MgmtErrorReporter.hpp b/ndb/include/mgmcommon/MgmtErrorReporter.hpp index 0d980aa7245..2b5f2c9a6fd 100644 --- a/ndb/include/mgmcommon/MgmtErrorReporter.hpp +++ b/ndb/include/mgmcommon/MgmtErrorReporter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndb_constants.h b/ndb/include/ndb_constants.h index c292880749b..e37392ca80e 100644 --- a/ndb/include/ndb_constants.h +++ b/ndb/include/ndb_constants.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -69,4 +68,11 @@ #define NDB_TYPE_MAX 31 +/* + * Table single user mode + */ +#define NDB_SUM_LOCKED 0 +#define NDB_SUM_READONLY 1 +#define NDB_SUM_READ_WRITE 2 + #endif diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index 43f90e1f8b5..4e400e75fa5 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -128,12 +127,14 @@ extern "C" { #include "ndb_init.h" -#ifdef SCO - #ifndef PATH_MAX #define PATH_MAX 1024 #endif -#endif /* SCO */ +#if defined(_lint) || defined(FORCE_INIT_OF_VARS) +#define LINT_SET_PTR = {0,0} +#else +#define LINT_SET_PTR +#endif #endif diff --git a/ndb/include/ndb_init.h b/ndb/include/ndb_init.h index 0ff53e6a2af..02db89adac4 100644 --- a/ndb/include/ndb_init.h +++ b/ndb/include/ndb_init.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndb_net.h b/ndb/include/ndb_net.h index 279beb471a7..3bb63f7e432 100644 --- a/ndb/include/ndb_net.h +++ b/ndb/include/ndb_net.h @@ -1,3 +1,17 @@ +/* Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef NDBNET_H #define NDBNET_H diff --git a/ndb/include/ndb_types.h.in b/ndb/include/ndb_types.h.in index 2a5d576ffea..02db659e961 100644 --- a/ndb/include/ndb_types.h.in +++ b/ndb/include/ndb_types.h.in @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndb_version.h.in b/ndb/include/ndb_version.h.in index c112a69c5f2..ce07b03cd7f 100644 --- a/ndb/include/ndb_version.h.in +++ b/ndb/include/ndb_version.h.in @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -64,5 +63,8 @@ char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ]; #define NDBD_UPDATE_FRAG_DIST_KEY_50 MAKE_VERSION(5,0,26) #define NDBD_UPDATE_FRAG_DIST_KEY_51 MAKE_VERSION(5,1,12) + +#define NDBD_QMGR_SINGLEUSER_VERSION_5 MAKE_VERSION(5,0,25) + #endif diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index e7c1e85c02a..b3c9acd4e20 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -1052,6 +1051,7 @@ class Ndb friend class NdbDictionaryImpl; friend class NdbDictInterface; friend class NdbBlob; + friend class NdbImpl; #endif public: @@ -1092,7 +1092,7 @@ public: * * @param aCatalogName is the new name of the current catalog */ - void setCatalogName(const char * aCatalogName); + int setCatalogName(const char * aCatalogName); /** * The current schema name can be fetched by getSchemaName. @@ -1106,7 +1106,7 @@ public: * * @param aSchemaName is the new name of the current schema */ - void setSchemaName(const char * aSchemaName); + int setSchemaName(const char * aSchemaName); #endif /** @@ -1121,7 +1121,7 @@ public: * * @param aDatabaseName is the new name of the current database */ - void setDatabaseName(const char * aDatabaseName); + int setDatabaseName(const char * aDatabaseName); /** * The current database schema name can be fetched by getDatabaseSchemaName. @@ -1135,7 +1135,7 @@ public: * * @param aDatabaseSchemaName is the new name of the current database schema */ - void setDatabaseSchemaName(const char * aDatabaseSchemaName); + int setDatabaseSchemaName(const char * aDatabaseSchemaName); /** * Initializes the Ndb object diff --git a/ndb/include/ndbapi/NdbApi.hpp b/ndb/include/ndbapi/NdbApi.hpp index c8400ed78ce..c54df196d13 100644 --- a/ndb/include/ndbapi/NdbApi.hpp +++ b/ndb/include/ndbapi/NdbApi.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/NdbBlob.hpp b/ndb/include/ndbapi/NdbBlob.hpp index 6d2c493d1ed..7d06e714d66 100644 --- a/ndb/include/ndbapi/NdbBlob.hpp +++ b/ndb/include/ndbapi/NdbBlob.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index db84c3715a5..445bb513ffc 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -359,7 +358,7 @@ public: * Set name of column * @param name Name of the column */ - void setName(const char * name); + int setName(const char * name); /** * Set whether column is nullable or not @@ -447,7 +446,7 @@ public: void setAutoIncrement(bool); bool getAutoIncrement() const; void setAutoIncrementInitialValue(Uint64 val); - void setDefaultValue(const char*); + int setDefaultValue(const char*); const char* getDefaultValue() const; static const Column * FRAGMENT; @@ -498,6 +497,15 @@ public: */ class Table : public Object { public: + /* + * Single user mode specifies access rights to table during single user mode + */ + enum SingleUserMode { + SingleUserModeLocked = NDB_SUM_LOCKED, + SingleUserModeReadOnly = NDB_SUM_READONLY, + SingleUserModeReadWrite = NDB_SUM_READ_WRITE + }; + /** * @name General * @{ @@ -653,13 +661,13 @@ public: * Name of table * @param name Name of table */ - void setName(const char * name); + int setName(const char * name); /** * Add a column definition to a table * @note creates a copy */ - void addColumn(const Column &); + int addColumn(const Column &); /** * @see NdbDictionary::Table::getLogging. @@ -715,7 +723,7 @@ public: /** * Set frm file to store with this table */ - void setFrm(const void* data, Uint32 len); + int setFrm(const void* data, Uint32 len); /** * Set table object type @@ -736,6 +744,13 @@ public: void setMinRows(Uint64 minRows); Uint64 getMinRows() const; + /** + * Set/Get SingleUserMode + */ + void setSingleUserMode(enum SingleUserMode); + enum SingleUserMode getSingleUserMode() const; + + /** @} *******************************************************************/ #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL @@ -860,26 +875,26 @@ public: /** * Set the name of an index */ - void setName(const char * name); + int setName(const char * name); /** * Define the name of the table to be indexed */ - void setTable(const char * name); + int setTable(const char * name); /** * Add a column to the index definition * Note that the order of columns will be in * the order they are added (only matters for ordered indexes). */ - void addColumn(const Column & c); + int addColumn(const Column & c); /** * Add a column name to the index definition * Note that the order of indexes will be in * the order they are added (only matters for ordered indexes). */ - void addColumnName(const char * name); + int addColumnName(const char * name); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** @@ -888,7 +903,7 @@ public: * the order they are added (only matters for ordered indexes). * Depricated, use addColumnName instead. */ - void addIndexColumn(const char * name); + int addIndexColumn(const char * name); #endif /** @@ -896,7 +911,7 @@ public: * Note that the order of indexes will be in * the order they are added (only matters for ordered indexes). */ - void addColumnNames(unsigned noOfNames, const char ** names); + int addColumnNames(unsigned noOfNames, const char ** names); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** @@ -905,7 +920,7 @@ public: * the order they are added (only matters for ordered indexes). * Depricated, use addColumnNames instead. */ - void addIndexColumns(int noOfNames, const char ** names); + int addIndexColumns(int noOfNames, const char ** names); #endif /** diff --git a/ndb/include/ndbapi/NdbError.hpp b/ndb/include/ndbapi/NdbError.hpp index f67b3c4ccaa..6b03714adb2 100644 --- a/ndb/include/ndbapi/NdbError.hpp +++ b/ndb/include/ndbapi/NdbError.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/NdbEventOperation.hpp b/ndb/include/ndbapi/NdbEventOperation.hpp index 55ee96b3144..ce146eeede3 100644 --- a/ndb/include/ndbapi/NdbEventOperation.hpp +++ b/ndb/include/ndbapi/NdbEventOperation.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/NdbIndexOperation.hpp b/ndb/include/ndbapi/NdbIndexOperation.hpp index d16cd071f77..0f06d8041ee 100644 --- a/ndb/include/ndbapi/NdbIndexOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexOperation.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/NdbIndexScanOperation.hpp b/ndb/include/ndbapi/NdbIndexScanOperation.hpp index 7ef66f9a30b..8c20fd58f43 100644 --- a/ndb/include/ndbapi/NdbIndexScanOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexScanOperation.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -64,12 +63,14 @@ public: bool order_by, bool order_desc = false, bool read_range_no = false, - bool keyinfo = false) { + bool keyinfo = false, + bool multi_range = false) { Uint32 scan_flags = (SF_OrderBy & -(Int32)order_by) | (SF_Descending & -(Int32)order_desc) | (SF_ReadRangeNo & -(Int32)read_range_no) | - (SF_KeyInfo & -(Int32)keyinfo); + (SF_KeyInfo & -(Int32)keyinfo) | + (SF_MultiRange & -(Int32)multi_range); return readTuples(lock_mode, scan_flags, parallel, batch); } diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp index dbc343d2238..d4e300be15e 100644 --- a/ndb/include/ndbapi/NdbOperation.hpp +++ b/ndb/include/ndbapi/NdbOperation.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -909,6 +908,8 @@ protected: // get table or index key from prepared signals int getKeyFromTCREQ(Uint32* data, unsigned size); + virtual void setReadLockMode(LockMode lockMode); + /****************************************************************************** * These are the private variables that are defined in the operation objects. *****************************************************************************/ diff --git a/ndb/include/ndbapi/NdbPool.hpp b/ndb/include/ndbapi/NdbPool.hpp index 64cba5a008c..1963bf26448 100644 --- a/ndb/include/ndbapi/NdbPool.hpp +++ b/ndb/include/ndbapi/NdbPool.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index 3607a64f3b3..9679d3995d3 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -148,6 +147,13 @@ public: /** * Get value stored in NdbRecAttr object. + * + * @return Medium value. + */ + Int32 medium_value() const; + + /** + * Get value stored in NdbRecAttr object. * * @return Short value. */ @@ -163,6 +169,13 @@ public: /** * Get value stored in NdbRecAttr object. * + * @return Int8 value. + */ + Int8 int8_value() const; + + /** + * Get value stored in NdbRecAttr object. + * * @return 64 bit unsigned value. */ Uint64 u_64_value() const; @@ -177,6 +190,13 @@ public: /** * Get value stored in NdbRecAttr object. * + * @return Unsigned medium value. + */ + Uint32 u_medium_value() const; + + /** + * Get value stored in NdbRecAttr object. + * * @return Unsigned short value. */ Uint16 u_short_value() const; @@ -191,6 +211,13 @@ public: /** * Get value stored in NdbRecAttr object. * + * @return Uint8 value. + */ + Uint8 u_8_value() const; + + /** + * Get value stored in NdbRecAttr object. + * * @return Float value. */ float float_value() const; @@ -334,6 +361,13 @@ NdbRecAttr::char_value() const } inline +Int8 +NdbRecAttr::int8_value() const +{ + return *(Int8*)theRef; +} + +inline Uint32 NdbRecAttr::u_32_value() const { @@ -355,6 +389,13 @@ NdbRecAttr::u_char_value() const } inline +Uint8 +NdbRecAttr::u_8_value() const +{ + return *(Uint8*)theRef; +} + +inline void NdbRecAttr::release() { @@ -442,6 +483,25 @@ NdbRecAttr::isNULL() const class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &); +class NdbRecordPrintFormat +{ +public: + NdbRecordPrintFormat(); + virtual ~NdbRecordPrintFormat(); + const char *lines_terminated_by; + const char *fields_terminated_by; + const char *start_array_enclosure; + const char *end_array_enclosure; + const char *fields_enclosed_by; + const char *fields_optionally_enclosed_by; + const char *hex_prefix; + const char *null_string; + int hex_format; +}; +NdbOut& +ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, + const NdbRecordPrintFormat &f); + #endif // ifndef DOXYGEN_SHOULD_SKIP_INTERNAL #endif diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp index ff6debc7fd3..b8abd281496 100644 --- a/ndb/include/ndbapi/NdbReceiver.hpp +++ b/ndb/include/ndbapi/NdbReceiver.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -39,7 +38,7 @@ public: }; NdbReceiver(Ndb *aNdb); - void init(ReceiverType type, void* owner); + int init(ReceiverType type, void* owner); void release(); ~NdbReceiver(); @@ -58,7 +57,7 @@ public: bool checkMagicNumber() const; - inline void next(NdbReceiver* next) { m_next = next;} + inline void next(NdbReceiver* next_arg) { m_next = next_arg;} inline NdbReceiver* next() { return m_next; } void setErrorCode(int); @@ -76,7 +75,7 @@ private: * At setup */ class NdbRecAttr * getValue(const class NdbColumnImpl*, char * user_dst_ptr); - void do_get_value(NdbReceiver*, Uint32 rows, Uint32 key_size, Uint32 range); + int do_get_value(NdbReceiver*, Uint32 rows, Uint32 key_size, Uint32 range); void prepareSend(); void calculate_batch_size(Uint32, Uint32, Uint32&, Uint32&, Uint32&); diff --git a/ndb/include/ndbapi/NdbScanFilter.hpp b/ndb/include/ndbapi/NdbScanFilter.hpp index b5457bab99b..1ef62558560 100644 --- a/ndb/include/ndbapi/NdbScanFilter.hpp +++ b/ndb/include/ndbapi/NdbScanFilter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp index beaf9402b77..9117207b72c 100644 --- a/ndb/include/ndbapi/NdbScanOperation.hpp +++ b/ndb/include/ndbapi/NdbScanOperation.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -38,13 +37,15 @@ class NdbScanOperation : public NdbOperation { public: /** * Scan flags. OR-ed together and passed as second argument to - * readTuples. + * readTuples. Note that SF_MultiRange has to be set if several + * ranges (bounds) are to be passed. */ enum ScanFlag { SF_TupScan = (1 << 16), // scan TUP SF_OrderBy = (1 << 24), // index scan in order SF_Descending = (2 << 24), // index scan in descending order SF_ReadRangeNo = (4 << 24), // enable @ref get_range_no + SF_MultiRange = (8 << 24), // scan is part of multi-range scan SF_KeyInfo = 1 // request KeyInfo to be sent back }; @@ -71,7 +72,8 @@ public: */ #ifdef ndb_readtuples_impossible_overload int readTuples(LockMode lock_mode = LM_Read, - Uint32 batch = 0, Uint32 parallel = 0, bool keyinfo = false); + Uint32 batch = 0, Uint32 parallel = 0, + bool keyinfo = false, bool multi_range = false); #endif inline int readTuples(int parallell){ @@ -210,6 +212,7 @@ protected: int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId); int doSend(int ProcessorId); void checkForceSend(bool forceSend); + virtual void setReadLockMode(LockMode lockMode); virtual void setErrorCode(int aErrorCode); virtual void setErrorCodeAbort(int aErrorCode); @@ -263,6 +266,7 @@ protected: bool m_descending; Uint32 m_read_range_no; NdbRecAttr *m_curr_row; // Pointer to last returned row + bool m_multi_range; // Mark if operation is part of multi-range scan }; inline diff --git a/ndb/include/ndbapi/NdbTransaction.hpp b/ndb/include/ndbapi/NdbTransaction.hpp index 257956d4fc2..966872755ca 100644 --- a/ndb/include/ndbapi/NdbTransaction.hpp +++ b/ndb/include/ndbapi/NdbTransaction.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -140,6 +139,7 @@ class NdbTransaction friend class NdbIndexOperation; friend class NdbIndexScanOperation; friend class NdbBlob; + friend class ha_ndbcluster; #endif public: @@ -379,14 +379,16 @@ public: void executeAsynch(ExecType aTypeOfExec, NdbAsynchCallback aCallback, void* anyObject, - AbortOption abortOption = AbortOnError); + AbortOption abortOption = AbortOnError, + int forceSend= 0); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED void executeAsynch(::ExecType aTypeOfExec, NdbAsynchCallback aCallback, void* anyObject, - ::AbortOption abortOption= ::AbortOnError) + ::AbortOption abortOption= ::AbortOnError, + int forceSend= 0) { executeAsynch((ExecType)aTypeOfExec, aCallback, anyObject, - (AbortOption)abortOption); } + (AbortOption)abortOption, forceSend); } #endif #endif /** @@ -585,7 +587,7 @@ private: NdbTransaction(Ndb* aNdb); ~NdbTransaction(); - void init(); // Initialize connection object for new transaction + int init(); // Initialize connection object for new transaction int executeNoBlobs(ExecType execType, AbortOption abortOption = AbortOnError, @@ -794,6 +796,7 @@ private: // optim: any blobs bool theBlobFlag; Uint8 thePendingBlobOps; + inline bool hasBlobOperation() { return theBlobFlag; } static void sendTC_COMMIT_ACK(NdbApiSignal *, Uint32 transId1, Uint32 transId2, diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index fcce53c90a0..5c6818fad11 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/ndb_opt_defaults.h b/ndb/include/ndbapi/ndb_opt_defaults.h index d03a9dcc36f..f29e2cb40d5 100644 --- a/ndb/include/ndbapi/ndb_opt_defaults.h +++ b/ndb/include/ndbapi/ndb_opt_defaults.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h index 5c4db71b747..63399e4bd0a 100644 --- a/ndb/include/ndbapi/ndbapi_limits.h +++ b/ndb/include/ndbapi/ndbapi_limits.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/ndbapi/ndberror.h b/ndb/include/ndbapi/ndberror.h index 2225f68f08d..cb5a2bc27dc 100644 --- a/ndb/include/ndbapi/ndberror.h +++ b/ndb/include/ndbapi/ndberror.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -93,7 +92,7 @@ typedef ndberror_classification_enum ndberror_classification; const char *ndberror_status_message(ndberror_status); const char *ndberror_classification_message(ndberror_classification); void ndberror_update(ndberror_struct *); -int ndb_error_string(int err_no, char *str, unsigned int size); +int ndb_error_string(int err_no, char *str, int size); #endif /* doxygen skip internal*/ diff --git a/ndb/include/newtonapi/dba.h b/ndb/include/newtonapi/dba.h index 4cfc0ec8eb9..b0231378a2b 100644 --- a/ndb/include/newtonapi/dba.h +++ b/ndb/include/newtonapi/dba.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/newtonapi/defs/pcn_types.h b/ndb/include/newtonapi/defs/pcn_types.h index eae6c67899d..9e8b2285023 100644 --- a/ndb/include/newtonapi/defs/pcn_types.h +++ b/ndb/include/newtonapi/defs/pcn_types.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbCondition.h b/ndb/include/portlib/NdbCondition.h index 3d959a0db41..dbc35b0b4ab 100644 --- a/ndb/include/portlib/NdbCondition.h +++ b/ndb/include/portlib/NdbCondition.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbConfig.h b/ndb/include/portlib/NdbConfig.h index 1bca825ab8d..2b6c931da72 100644 --- a/ndb/include/portlib/NdbConfig.h +++ b/ndb/include/portlib/NdbConfig.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbDaemon.h b/ndb/include/portlib/NdbDaemon.h index 74ea3f06419..b6e39321e38 100644 --- a/ndb/include/portlib/NdbDaemon.h +++ b/ndb/include/portlib/NdbDaemon.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbEnv.h b/ndb/include/portlib/NdbEnv.h index 1611bf3152e..c6590264e23 100644 --- a/ndb/include/portlib/NdbEnv.h +++ b/ndb/include/portlib/NdbEnv.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbHost.h b/ndb/include/portlib/NdbHost.h index 90e7b781137..5464a024a62 100644 --- a/ndb/include/portlib/NdbHost.h +++ b/ndb/include/portlib/NdbHost.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbMain.h b/ndb/include/portlib/NdbMain.h index 7cc7a877750..c0211c2ea43 100644 --- a/ndb/include/portlib/NdbMain.h +++ b/ndb/include/portlib/NdbMain.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbMem.h b/ndb/include/portlib/NdbMem.h index 2afb1845112..d271c976862 100644 --- a/ndb/include/portlib/NdbMem.h +++ b/ndb/include/portlib/NdbMem.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbMutex.h b/ndb/include/portlib/NdbMutex.h index b0b985ecef5..8f3d768c6c8 100644 --- a/ndb/include/portlib/NdbMutex.h +++ b/ndb/include/portlib/NdbMutex.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbSleep.h b/ndb/include/portlib/NdbSleep.h index 3b26710154f..a17f3e6a8b0 100644 --- a/ndb/include/portlib/NdbSleep.h +++ b/ndb/include/portlib/NdbSleep.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 9ed5b5e7f96..c81e3ec499c 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbThread.h b/ndb/include/portlib/NdbThread.h index e86deee4354..144abaa87d7 100644 --- a/ndb/include/portlib/NdbThread.h +++ b/ndb/include/portlib/NdbThread.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/NdbTick.h b/ndb/include/portlib/NdbTick.h index 9bd8eca22bd..b1026a8672d 100644 --- a/ndb/include/portlib/NdbTick.h +++ b/ndb/include/portlib/NdbTick.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/PortDefs.h b/ndb/include/portlib/PortDefs.h index a115c60cfe1..87b87b497a2 100644 --- a/ndb/include/portlib/PortDefs.h +++ b/ndb/include/portlib/PortDefs.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/portlib/prefetch.h b/ndb/include/portlib/prefetch.h index 729c80bd93e..f098c2ba6c0 100644 --- a/ndb/include/portlib/prefetch.h +++ b/ndb/include/portlib/prefetch.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/transporter/TransporterCallback.hpp b/ndb/include/transporter/TransporterCallback.hpp index ef9be8c5a69..076d0de44c0 100644 --- a/ndb/include/transporter/TransporterCallback.hpp +++ b/ndb/include/transporter/TransporterCallback.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp index e9c5ffa2c80..003824d01e8 100644 --- a/ndb/include/transporter/TransporterDefinitions.hpp +++ b/ndb/include/transporter/TransporterDefinitions.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -117,6 +116,11 @@ struct SegmentedSectionPtr { Uint32 i; struct SectionSegment * p; + SegmentedSectionPtr() {} + SegmentedSectionPtr(Uint32 sz_arg, Uint32 i_arg, + struct SectionSegment *p_arg) + :sz(sz_arg), i(i_arg), p(p_arg) + {} void setNull() { p = 0;} bool isNull() const { return p == 0;} }; diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index 0bb9733e8c4..0070c49baaf 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp index 02a6a3b3e66..34ca2d2be3d 100644 --- a/ndb/include/util/BaseString.hpp +++ b/ndb/include/util/BaseString.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -186,6 +185,7 @@ public: private: char* m_chr; unsigned m_len; + friend bool operator!(const BaseString& str); }; inline const char* @@ -250,6 +250,12 @@ BaseString::operator!=(const char *str) const return strcmp(m_chr, str) != 0; } +inline bool +operator!(const BaseString& str) +{ + return str.m_chr == NULL; +} + inline BaseString& BaseString::assign(const BaseString& str) { diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp index 7957bf7a48d..3b3fe721cca 100644 --- a/ndb/include/util/Bitmask.hpp +++ b/ndb/include/util/Bitmask.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/ConfigValues.hpp b/ndb/include/util/ConfigValues.hpp index 8dfb3c83df3..af8e2d400cd 100644 --- a/ndb/include/util/ConfigValues.hpp +++ b/ndb/include/util/ConfigValues.hpp @@ -1,3 +1,18 @@ +/* Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #ifndef __CONFIG_VALUES_HPP #define __CONFIG_VALUES_HPP diff --git a/ndb/include/util/File.hpp b/ndb/include/util/File.hpp index 53ea88e0f52..b9d348683ec 100644 --- a/ndb/include/util/File.hpp +++ b/ndb/include/util/File.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -29,6 +28,14 @@ class File_class { public: /** + * Returns time for last contents modification of a file. + * + * @param aFileName a filename to check. + * @return the time for last contents modificaton of the file. + */ + static time_t mtime(const char* aFileName); + + /** * Returns true if the file exist. * * @param aFileName a filename to check. @@ -42,7 +49,7 @@ public: * @param f a pointer to a FILE descriptor. * @return the size of the file. */ - static long size(FILE* f); + static off_t size(FILE* f); /** * Renames a file. @@ -174,7 +181,7 @@ public: * * @return the file size. */ - long size() const; + off_t size() const; /** * Returns the filename. diff --git a/ndb/include/util/InputStream.hpp b/ndb/include/util/InputStream.hpp index b2a56b1e433..7bd2494afe8 100644 --- a/ndb/include/util/InputStream.hpp +++ b/ndb/include/util/InputStream.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -25,7 +24,9 @@ */ class InputStream { public: + virtual ~InputStream() {} virtual char* gets(char * buf, int bufLen) = 0; + InputStream() {} }; class FileInputStream : public InputStream { @@ -40,6 +41,7 @@ extern FileInputStream Stdin; class SocketInputStream : public InputStream { NDB_SOCKET_TYPE m_socket; unsigned m_timeout; + bool m_startover; public: SocketInputStream(NDB_SOCKET_TYPE socket, unsigned readTimeout = 1000); char* gets(char * buf, int bufLen); diff --git a/ndb/include/util/NdbAutoPtr.hpp b/ndb/include/util/NdbAutoPtr.hpp index ff747e3de68..5210fbc6dde 100644 --- a/ndb/include/util/NdbAutoPtr.hpp +++ b/ndb/include/util/NdbAutoPtr.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/NdbOut.hpp b/ndb/include/util/NdbOut.hpp index d85d5cc6305..29f15dac8d5 100644 --- a/ndb/include/util/NdbOut.hpp +++ b/ndb/include/util/NdbOut.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/NdbSqlUtil.hpp b/ndb/include/util/NdbSqlUtil.hpp index ff2d9766f81..8d063f1908b 100644 --- a/ndb/include/util/NdbSqlUtil.hpp +++ b/ndb/include/util/NdbSqlUtil.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/OutputStream.hpp b/ndb/include/util/OutputStream.hpp index c7e009d4537..39fbca45ccf 100644 --- a/ndb/include/util/OutputStream.hpp +++ b/ndb/include/util/OutputStream.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -25,6 +24,8 @@ */ class OutputStream { public: + OutputStream() {} + virtual ~OutputStream() {} virtual int print(const char * fmt, ...) = 0; virtual int println(const char * fmt, ...) = 0; virtual void flush() {}; @@ -34,7 +35,8 @@ class FileOutputStream : public OutputStream { FILE * f; public: FileOutputStream(FILE * file = stdout); - + FILE *getFile() { return f; } + int print(const char * fmt, ...); int println(const char * fmt, ...); void flush() { fflush(f); } @@ -42,10 +44,10 @@ public: class SocketOutputStream : public OutputStream { NDB_SOCKET_TYPE m_socket; - unsigned m_timeout; + unsigned m_timeout_ms; public: - SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned writeTimeout = 1000); - + SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned write_timeout_ms = 1000); + int print(const char * fmt, ...); int println(const char * fmt, ...); }; @@ -60,6 +62,7 @@ public: class NullOutputStream : public OutputStream { public: + NullOutputStream() {} int print(const char * /* unused */, ...) { return 1;} int println(const char * /* unused */, ...) { return 1;} }; diff --git a/ndb/include/util/Parser.hpp b/ndb/include/util/Parser.hpp index 3baf7601a6c..3188e447afd 100644 --- a/ndb/include/util/Parser.hpp +++ b/ndb/include/util/Parser.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/Properties.hpp b/ndb/include/util/Properties.hpp index e6668744211..3533d710662 100644 --- a/ndb/include/util/Properties.hpp +++ b/ndb/include/util/Properties.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp index 438426fb62b..82900ff48eb 100644 --- a/ndb/include/util/SimpleProperties.hpp +++ b/ndb/include/util/SimpleProperties.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -151,6 +150,7 @@ public: ValueType m_type; protected: Reader(); + virtual ~Reader() {} virtual void reset() = 0; virtual bool step(Uint32 len) = 0; @@ -168,7 +168,9 @@ public: bool add(Uint16 key, Uint32 value); bool add(Uint16 key, const char * value); bool add(Uint16 key, const void* value, int len); + Writer() {} protected: + virtual ~Writer() {} virtual bool reset() = 0; virtual bool putWord(Uint32 val) = 0; virtual bool putWords(const Uint32 * src, Uint32 len) = 0; @@ -184,6 +186,7 @@ class SimplePropertiesLinearReader : public SimpleProperties::Reader { public: SimplePropertiesLinearReader(const Uint32 * src, Uint32 len); + virtual ~SimplePropertiesLinearReader() {} virtual void reset(); virtual bool step(Uint32 len); virtual bool getWord(Uint32 * dst); @@ -202,6 +205,7 @@ class LinearWriter : public SimpleProperties::Writer { public: LinearWriter(Uint32 * src, Uint32 len); + virtual ~LinearWriter() {} virtual bool reset(); virtual bool putWord(Uint32 val); virtual bool putWords(const Uint32 * src, Uint32 len); @@ -219,6 +223,7 @@ class UtilBufferWriter : public SimpleProperties::Writer { public: UtilBufferWriter(class UtilBuffer & buf); + virtual ~UtilBufferWriter() {} virtual bool reset(); virtual bool putWord(Uint32 val); virtual bool putWords(const Uint32 * src, Uint32 len); @@ -238,6 +243,7 @@ public: SimplePropertiesSectionReader(struct SegmentedSectionPtr &, class SectionSegmentPool &); + virtual ~SimplePropertiesSectionReader() {} virtual void reset(); virtual bool step(Uint32 len); virtual bool getWord(Uint32 * dst); @@ -270,6 +276,7 @@ class SimplePropertiesSectionWriter : public SimpleProperties::Writer { public: SimplePropertiesSectionWriter(class SectionSegmentPool &); + virtual ~SimplePropertiesSectionWriter() {} virtual bool reset(); virtual bool putWord(Uint32 val); virtual bool putWords(const Uint32 * src, Uint32 len); diff --git a/ndb/include/util/SocketAuthenticator.hpp b/ndb/include/util/SocketAuthenticator.hpp index 1b82567feaa..e76af30dc35 100644 --- a/ndb/include/util/SocketAuthenticator.hpp +++ b/ndb/include/util/SocketAuthenticator.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -20,6 +19,7 @@ class SocketAuthenticator { public: + SocketAuthenticator() {} virtual ~SocketAuthenticator() {}; virtual bool client_authenticate(int sockfd) = 0; virtual bool server_authenticate(int sockfd) = 0; diff --git a/ndb/include/util/SocketClient.hpp b/ndb/include/util/SocketClient.hpp index 422560c8a78..bb8d9b9ac41 100644 --- a/ndb/include/util/SocketClient.hpp +++ b/ndb/include/util/SocketClient.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -24,6 +23,7 @@ class SocketClient { NDB_SOCKET_TYPE m_sockfd; struct sockaddr_in m_servaddr; + unsigned int m_connect_timeout_sec; unsigned short m_port; char *m_server_name; SocketAuthenticator *m_auth; @@ -35,6 +35,9 @@ public: m_port = port; m_servaddr.sin_port = htons(m_port); }; + void set_connect_timeout(unsigned int s) { + m_connect_timeout_sec= s; + } unsigned short get_port() { return m_port; }; char *get_server_name() { return m_server_name; }; int bind(const char* toaddress, unsigned short toport); diff --git a/ndb/include/util/SocketServer.hpp b/ndb/include/util/SocketServer.hpp index ea709bfecae..8b49dc6db4e 100644 --- a/ndb/include/util/SocketServer.hpp +++ b/ndb/include/util/SocketServer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -60,6 +59,7 @@ public: */ class Service { public: + Service() {} virtual ~Service(){} /** diff --git a/ndb/include/util/UtilBuffer.hpp b/ndb/include/util/UtilBuffer.hpp index f43fc960a16..537d901d9bb 100644 --- a/ndb/include/util/UtilBuffer.hpp +++ b/ndb/include/util/UtilBuffer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -73,11 +72,15 @@ public: } int assign(const void * d, size_t l) { - if (data) free(data); + /* Free the old data only after copying, in case d==data. */ + void *old_data= data; data = NULL; len = 0; alloc_size = 0; - return append(d, l); + int ret= append(d, l); + if (old_data) + free(old_data); + return ret; } void clear() { diff --git a/ndb/include/util/Vector.hpp b/ndb/include/util/Vector.hpp index 480dddf8243..8f403b435dd 100644 --- a/ndb/include/util/Vector.hpp +++ b/ndb/include/util/Vector.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -30,14 +29,14 @@ public: const T& operator[](unsigned i) const; unsigned size() const { return m_size; }; - void push_back(const T &); + int push_back(const T &); T& back(); void erase(unsigned index); void clear(); - void fill(unsigned new_size, T & obj); + int fill(unsigned new_size, T & obj); Vector<T>& operator=(const Vector<T>&); @@ -53,6 +52,14 @@ private: template<class T> Vector<T>::Vector(int i){ m_items = new T[i]; + if (m_items == NULL) + { + errno = ENOMEM; + m_size = 0; + m_arraySize = 0; + m_incSize = 0; + return; + } m_size = 0; m_arraySize = i; m_incSize = 50; @@ -90,10 +97,15 @@ Vector<T>::back(){ } template<class T> -void +int Vector<T>::push_back(const T & t){ if(m_size == m_arraySize){ T * tmp = new T [m_arraySize + m_incSize]; + if(tmp == NULL) + { + errno = ENOMEM; + return -1; + } for (unsigned k = 0; k < m_size; k++) tmp[k] = m_items[k]; delete[] m_items; @@ -102,6 +114,8 @@ Vector<T>::push_back(const T & t){ } m_items[m_size] = t; m_size++; + + return 0; } template<class T> @@ -122,10 +136,12 @@ Vector<T>::clear(){ } template<class T> -void +int Vector<T>::fill(unsigned new_size, T & obj){ while(m_size <= new_size) - push_back(obj); + if (push_back(obj)) + return -1; + return 0; } template<class T> @@ -149,8 +165,8 @@ struct MutexVector : public NdbLockable { const T& operator[](unsigned i) const; unsigned size() const { return m_size; }; - void push_back(const T &); - void push_back(const T &, bool lockMutex); + int push_back(const T &); + int push_back(const T &, bool lockMutex); T& back(); void erase(unsigned index); @@ -159,7 +175,7 @@ struct MutexVector : public NdbLockable { void clear(); void clear(bool lockMutex); - void fill(unsigned new_size, T & obj); + int fill(unsigned new_size, T & obj); private: T * m_items; unsigned m_size; @@ -170,6 +186,14 @@ private: template<class T> MutexVector<T>::MutexVector(int i){ m_items = new T[i]; + if (m_items == NULL) + { + errno = ENOMEM; + m_size = 0; + m_arraySize = 0; + m_incSize = 0; + return; + } m_size = 0; m_arraySize = i; m_incSize = 50; @@ -207,11 +231,17 @@ MutexVector<T>::back(){ } template<class T> -void +int MutexVector<T>::push_back(const T & t){ lock(); if(m_size == m_arraySize){ T * tmp = new T [m_arraySize + m_incSize]; + if (tmp == NULL) + { + errno = ENOMEM; + unlock(); + return -1; + } for (unsigned k = 0; k < m_size; k++) tmp[k] = m_items[k]; delete[] m_items; @@ -221,15 +251,23 @@ MutexVector<T>::push_back(const T & t){ m_items[m_size] = t; m_size++; unlock(); + return 0; } template<class T> -void +int MutexVector<T>::push_back(const T & t, bool lockMutex){ if(lockMutex) lock(); if(m_size == m_arraySize){ T * tmp = new T [m_arraySize + m_incSize]; + if (tmp == NULL) + { + errno = ENOMEM; + if(lockMutex) + unlock(); + return -1; + } for (unsigned k = 0; k < m_size; k++) tmp[k] = m_items[k]; delete[] m_items; @@ -240,6 +278,7 @@ MutexVector<T>::push_back(const T & t, bool lockMutex){ m_size++; if(lockMutex) unlock(); + return 0; } template<class T> @@ -287,10 +326,12 @@ MutexVector<T>::clear(bool l){ } template<class T> -void +int MutexVector<T>::fill(unsigned new_size, T & obj){ while(m_size <= new_size) - push_back(obj); + if (push_back(obj)) + return -1; + return 0; } #endif diff --git a/ndb/include/util/basestring_vsnprintf.h b/ndb/include/util/basestring_vsnprintf.h index 7c804f22841..ade90b3f678 100644 --- a/ndb/include/util/basestring_vsnprintf.h +++ b/ndb/include/util/basestring_vsnprintf.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/md5_hash.hpp b/ndb/include/util/md5_hash.hpp index b79dce3b5a9..932d71ee22e 100644 --- a/ndb/include/util/md5_hash.hpp +++ b/ndb/include/util/md5_hash.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h index 08ab4a2e9df..d4d07302967 100644 --- a/ndb/include/util/ndb_opts.h +++ b/ndb/include/util/ndb_opts.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -58,7 +57,7 @@ const char *opt_debug= 0; { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \ "Set connect string for connecting to ndb_mgmd. " \ "Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \ - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ + "Overrides specifying entries in NDB_CONNECTSTRING and my.cnf", \ (gptr*) &opt_ndb_connectstring, (gptr*) &opt_ndb_connectstring, \ 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ { "ndb-mgmd-host", OPT_NDB_MGMD, \ diff --git a/ndb/include/util/random.h b/ndb/include/util/random.h index 1b83e5fec93..b448e9c2b01 100644 --- a/ndb/include/util/random.h +++ b/ndb/include/util/random.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/socket_io.h b/ndb/include/util/socket_io.h index a0e6c4e369d..a748515031d 100644 --- a/ndb/include/util/socket_io.h +++ b/ndb/include/util/socket_io.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/uucode.h b/ndb/include/util/uucode.h index f5569d033a5..3c10888a395 100644 --- a/ndb/include/util/uucode.h +++ b/ndb/include/util/uucode.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/include/util/version.h b/ndb/include/util/version.h index 62dc07d905a..42513d00442 100644 --- a/ndb/include/util/version.h +++ b/ndb/include/util/version.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/ndbapi-examples/mgmapi_logevent_example/mgmapi_logevent.cpp b/ndb/ndbapi-examples/mgmapi_logevent_example/mgmapi_logevent.cpp index 5ec1fba6314..592f7e3acc6 100644 --- a/ndb/ndbapi-examples/mgmapi_logevent_example/mgmapi_logevent.cpp +++ b/ndb/ndbapi-examples/mgmapi_logevent_example/mgmapi_logevent.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/ndbapi-examples/ndbapi_async_example/ndbapi_async.cpp b/ndb/ndbapi-examples/ndbapi_async_example/ndbapi_async.cpp index aa745f4d28d..31377ae08e8 100644 --- a/ndb/ndbapi-examples/ndbapi_async_example/ndbapi_async.cpp +++ b/ndb/ndbapi-examples/ndbapi_async_example/ndbapi_async.cpp @@ -4,8 +4,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/ndbapi-examples/ndbapi_async_example1/ndbapi_async1.cpp b/ndb/ndbapi-examples/ndbapi_async_example1/ndbapi_async1.cpp index e8bc19e267b..9a1c56a9808 100644 --- a/ndb/ndbapi-examples/ndbapi_async_example1/ndbapi_async1.cpp +++ b/ndb/ndbapi-examples/ndbapi_async_example1/ndbapi_async1.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/ndbapi-examples/ndbapi_event_example/ndbapi_event.cpp b/ndb/ndbapi-examples/ndbapi_event_example/ndbapi_event.cpp index 286f6fafbab..1e1c3e9ea21 100644 --- a/ndb/ndbapi-examples/ndbapi_event_example/ndbapi_event.cpp +++ b/ndb/ndbapi-examples/ndbapi_event_example/ndbapi_event.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/ndbapi-examples/ndbapi_retries_example/ndbapi_retries.cpp b/ndb/ndbapi-examples/ndbapi_retries_example/ndbapi_retries.cpp index 8c29fe31446..b76075a0cb7 100644 --- a/ndb/ndbapi-examples/ndbapi_retries_example/ndbapi_retries.cpp +++ b/ndb/ndbapi-examples/ndbapi_retries_example/ndbapi_retries.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/ndbapi-examples/ndbapi_scan_example/ndbapi_scan.cpp b/ndb/ndbapi-examples/ndbapi_scan_example/ndbapi_scan.cpp index 69ffd99b8ca..1e3fa131d0e 100644 --- a/ndb/ndbapi-examples/ndbapi_scan_example/ndbapi_scan.cpp +++ b/ndb/ndbapi-examples/ndbapi_scan_example/ndbapi_scan.cpp @@ -3,8 +3,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/ndbapi-examples/ndbapi_simple_example/ndbapi_simple.cpp b/ndb/ndbapi-examples/ndbapi_simple_example/ndbapi_simple.cpp index 152d4fa44af..08d6d7ff9ff 100644 --- a/ndb/ndbapi-examples/ndbapi_simple_example/ndbapi_simple.cpp +++ b/ndb/ndbapi-examples/ndbapi_simple_example/ndbapi_simple.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/ndbapi-examples/ndbapi_simple_index_example/ndbapi_simple_index.cpp b/ndb/ndbapi-examples/ndbapi_simple_index_example/ndbapi_simple_index.cpp index 5afaf6078d1..8a45b5e6867 100644 --- a/ndb/ndbapi-examples/ndbapi_simple_index_example/ndbapi_simple_index.cpp +++ b/ndb/ndbapi-examples/ndbapi_simple_index_example/ndbapi_simple_index.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index d35790a2e43..3df7ccd8469 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SUBDIRS = common mgmapi ndbapi . kernel mgmclient mgmsrv cw include $(top_srcdir)/ndb/config/common.mk.am @@ -6,6 +21,8 @@ ndblib_LTLIBRARIES = libndbclient.la libndbclient_la_SOURCES = +libndbclient_la_LDFLAGS = -version-info @NDB_SHARED_LIB_VERSION@ @NDB_LD_VERSION_SCRIPT@ + libndbclient_la_LIBADD = \ ndbapi/libndbapi.la \ common/transporter/libtransporter.la \ @@ -31,3 +48,6 @@ libndbclient.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-sources $@ dummy.cpp @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(libndbclient_la_LIBADD) @touch dummy.cpp + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/src/common/Makefile.am b/ndb/src/common/Makefile.am index 0059f3fb210..9d601c7a18a 100644 --- a/ndb/src/common/Makefile.am +++ b/ndb/src/common/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SUBDIRS = portlib debugger util logger transporter mgmcommon noinst_LTLIBRARIES = libcommon.la @@ -13,3 +28,6 @@ libcommon_la_LIBADD = \ util/libgeneral.la windoze-dsp: + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/src/common/debugger/BlockNames.cpp b/ndb/src/common/debugger/BlockNames.cpp index 0c61b6327ef..0f368ab222d 100644 --- a/ndb/src/common/debugger/BlockNames.cpp +++ b/ndb/src/common/debugger/BlockNames.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/DebuggerNames.cpp b/ndb/src/common/debugger/DebuggerNames.cpp index 8571b8ece86..ba32ac6e6b8 100644 --- a/ndb/src/common/debugger/DebuggerNames.cpp +++ b/ndb/src/common/debugger/DebuggerNames.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 2defdfc8de5..6280d5bb9b3 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -17,6 +16,7 @@ #include <ndb_global.h> #include "EventLogger.hpp" +#include <TransporterCallback.hpp> #include <NdbConfig.h> #include <kernel/BlockNumbers.h> @@ -116,7 +116,7 @@ void getTextNDBStopForced(QQQQ) { int sphase = theData[4]; int extra = theData[5]; getRestartAction(theData[1],action_str); - if (signal) + if (signum) reason_str.appfmt(" Initiated by signal %d.", signum); if (error) { @@ -529,10 +529,100 @@ void getTextUndoLogBlocked(QQQQ) { theData[2]); } void getTextTransporterError(QQQQ) { - BaseString::snprintf(m_text, m_text_len, - "Transporter to node %d reported error 0x%x", - theData[1], - theData[2]); + struct myTransporterError{ + Uint32 errorNum; + char errorString[256]; + }; + int i = 0; + int lenth = 0; + static const struct myTransporterError TransporterErrorString[]= + { + //TE_NO_ERROR = 0 + {TE_NO_ERROR,"No error"}, + //TE_ERROR_CLOSING_SOCKET = 0x1 + {TE_ERROR_CLOSING_SOCKET,"Error found during closing of socket"}, + //TE_ERROR_IN_SELECT_BEFORE_ACCEPT = 0x2 + {TE_ERROR_IN_SELECT_BEFORE_ACCEPT,"Error found before accept. The transporter will retry"}, + //TE_INVALID_MESSAGE_LENGTH = 0x3 | TE_DO_DISCONNECT + {TE_INVALID_MESSAGE_LENGTH,"Error found in message (invalid message length)"}, + //TE_INVALID_CHECKSUM = 0x4 | TE_DO_DISCONNECT + {TE_INVALID_CHECKSUM,"Error found in message (checksum)"}, + //TE_COULD_NOT_CREATE_SOCKET = 0x5 + {TE_COULD_NOT_CREATE_SOCKET,"Error found while creating socket(can't create socket)"}, + //TE_COULD_NOT_BIND_SOCKET = 0x6 + {TE_COULD_NOT_BIND_SOCKET,"Error found while binding server socket"}, + //TE_LISTEN_FAILED = 0x7 + {TE_LISTEN_FAILED,"Error found while listening to server socket"}, + //TE_ACCEPT_RETURN_ERROR = 0x8 + {TE_ACCEPT_RETURN_ERROR,"Error found during accept(accept return error)"}, + //TE_SHM_DISCONNECT = 0xb | TE_DO_DISCONNECT + {TE_SHM_DISCONNECT,"The remote node has disconnected"}, + //TE_SHM_IPC_STAT = 0xc | TE_DO_DISCONNECT + {TE_SHM_IPC_STAT,"Unable to check shm segment"}, + //TE_SHM_UNABLE_TO_CREATE_SEGMENT = 0xd + {TE_SHM_UNABLE_TO_CREATE_SEGMENT,"Unable to create shm segment"}, + //TE_SHM_UNABLE_TO_ATTACH_SEGMENT = 0xe + {TE_SHM_UNABLE_TO_ATTACH_SEGMENT,"Unable to attach shm segment"}, + //TE_SHM_UNABLE_TO_REMOVE_SEGMENT = 0xf + {TE_SHM_UNABLE_TO_REMOVE_SEGMENT,"Unable to remove shm segment"}, + //TE_TOO_SMALL_SIGID = 0x10 + {TE_TOO_SMALL_SIGID,"Sig ID too small"}, + //TE_TOO_LARGE_SIGID = 0x11 + {TE_TOO_LARGE_SIGID,"Sig ID too large"}, + //TE_WAIT_STACK_FULL = 0x12 | TE_DO_DISCONNECT + {TE_WAIT_STACK_FULL,"Wait stack was full"}, + //TE_RECEIVE_BUFFER_FULL = 0x13 | TE_DO_DISCONNECT + {TE_RECEIVE_BUFFER_FULL,"Receive buffer was full"}, + //TE_SIGNAL_LOST_SEND_BUFFER_FULL = 0x14 | TE_DO_DISCONNECT + {TE_SIGNAL_LOST_SEND_BUFFER_FULL,"Send buffer was full,and trying to force send fails"}, + //TE_SIGNAL_LOST = 0x15 + {TE_SIGNAL_LOST,"Send failed for unknown reason(signal lost)"}, + //TE_SEND_BUFFER_FULL = 0x16 + {TE_SEND_BUFFER_FULL,"The send buffer was full, but sleeping for a while solved"}, + //TE_SCI_LINK_ERROR = 0x0017 + {TE_SCI_LINK_ERROR,"There is no link from this node to the switch"}, + //TE_SCI_UNABLE_TO_START_SEQUENCE = 0x18 | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_START_SEQUENCE,"Could not start a sequence, because system resources are exumed or no sequence has been created"}, + //TE_SCI_UNABLE_TO_REMOVE_SEQUENCE = 0x19 | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_REMOVE_SEQUENCE,"Could not remove a sequence"}, + //TE_SCI_UNABLE_TO_CREATE_SEQUENCE = 0x1a | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_CREATE_SEQUENCE,"Could not create a sequence, because system resources are exempted. Must reboot"}, + //TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR = 0x1b | TE_DO_DISCONNECT + {TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR,"Tried to send data on redundant link but failed"}, + //TE_SCI_CANNOT_INIT_LOCALSEGMENT = 0x1c | TE_DO_DISCONNECT + {TE_SCI_CANNOT_INIT_LOCALSEGMENT,"Cannot initialize local segment"}, + //TE_SCI_CANNOT_MAP_REMOTESEGMENT = 0x1d | TE_DO_DISCONNEC + {TE_SCI_CANNOT_MAP_REMOTESEGMENT,"Cannot map remote segment"}, + //TE_SCI_UNABLE_TO_UNMAP_SEGMENT = 0x1e | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_UNMAP_SEGMENT,"Cannot free the resources used by this segment (step 1)"}, + //TE_SCI_UNABLE_TO_REMOVE_SEGMENT = 0x1f | TE_DO_DISCONNEC + {TE_SCI_UNABLE_TO_REMOVE_SEGMENT,"Cannot free the resources used by this segment (step 2)"}, + //TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT = 0x20 | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT,"Cannot disconnect from a remote segment"}, + //TE_SHM_IPC_PERMANENT = 0x21 + {TE_SHM_IPC_PERMANENT,"Shm ipc Permanent error"}, + //TE_SCI_UNABLE_TO_CLOSE_CHANNEL = 0x22 + {TE_SCI_UNABLE_TO_CLOSE_CHANNEL,"Unable to close the sci channel and the resources allocated"} + }; + + lenth = sizeof(TransporterErrorString)/sizeof(struct myTransporterError); + for(i=0; i<lenth; i++) + { + if(theData[2] == TransporterErrorString[i].errorNum) + { + BaseString::snprintf(m_text, m_text_len, + "Transporter to node %d reported error 0x%x: %s", + theData[1], + theData[2], + TransporterErrorString[i].errorString); + break; + } + } + if(i == lenth) + BaseString::snprintf(m_text, m_text_len, + "Transporter to node %d reported error 0x%x: unknown error", + theData[1], + theData[2]); } void getTextTransporterWarning(QQQQ) { getTextTransporterError(m_text, m_text_len, theData); @@ -914,6 +1004,8 @@ EventLogger::close() removeAllHandlers(); } +#ifdef NOT_USED + static NdbOut& operator<<(NdbOut& out, const LogLevel & ll) { @@ -923,6 +1015,7 @@ operator<<(NdbOut& out, const LogLevel & ll) out << "]"; return out; } +#endif int EventLoggerBase::event_lookup(int eventType, diff --git a/ndb/src/common/debugger/GrepError.cpp b/ndb/src/common/debugger/GrepError.cpp index 20aeaa6dd77..091c7da0978 100644 --- a/ndb/src/common/debugger/GrepError.cpp +++ b/ndb/src/common/debugger/GrepError.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/Makefile.am b/ndb/src/common/debugger/Makefile.am index e25a11c9bee..9b30e8bc278 100644 --- a/ndb/src/common/debugger/Makefile.am +++ b/ndb/src/common/debugger/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SUBDIRS = signaldata noinst_LTLIBRARIES = libtrace.la diff --git a/ndb/src/common/debugger/SignalLoggerManager.cpp b/ndb/src/common/debugger/SignalLoggerManager.cpp index 67e13dc805a..471bea64f64 100644 --- a/ndb/src/common/debugger/SignalLoggerManager.cpp +++ b/ndb/src/common/debugger/SignalLoggerManager.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/AccLock.cpp b/ndb/src/common/debugger/signaldata/AccLock.cpp index affed431957..0b37e1bd0d7 100644 --- a/ndb/src/common/debugger/signaldata/AccLock.cpp +++ b/ndb/src/common/debugger/signaldata/AccLock.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/AlterIndx.cpp b/ndb/src/common/debugger/signaldata/AlterIndx.cpp index e1865136fc3..1ac5b7fb3e8 100644 --- a/ndb/src/common/debugger/signaldata/AlterIndx.cpp +++ b/ndb/src/common/debugger/signaldata/AlterIndx.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/AlterTab.cpp b/ndb/src/common/debugger/signaldata/AlterTab.cpp index f9521984095..f9b6df1f4c0 100644 --- a/ndb/src/common/debugger/signaldata/AlterTab.cpp +++ b/ndb/src/common/debugger/signaldata/AlterTab.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/AlterTable.cpp b/ndb/src/common/debugger/signaldata/AlterTable.cpp index 59909c8e490..8e23bd72db3 100644 --- a/ndb/src/common/debugger/signaldata/AlterTable.cpp +++ b/ndb/src/common/debugger/signaldata/AlterTable.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/AlterTrig.cpp b/ndb/src/common/debugger/signaldata/AlterTrig.cpp index d488fd6e348..cdd7ee2fbf2 100644 --- a/ndb/src/common/debugger/signaldata/AlterTrig.cpp +++ b/ndb/src/common/debugger/signaldata/AlterTrig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/BackupImpl.cpp b/ndb/src/common/debugger/signaldata/BackupImpl.cpp index 855db0834bc..c419bf2729f 100644 --- a/ndb/src/common/debugger/signaldata/BackupImpl.cpp +++ b/ndb/src/common/debugger/signaldata/BackupImpl.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/BackupSignalData.cpp b/ndb/src/common/debugger/signaldata/BackupSignalData.cpp index 27fed22ac72..6f6b21460a8 100644 --- a/ndb/src/common/debugger/signaldata/BackupSignalData.cpp +++ b/ndb/src/common/debugger/signaldata/BackupSignalData.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -124,6 +123,9 @@ printABORT_BACKUP_ORD(FILE * out, const Uint32 * data, Uint32 len, Uint16 b){ sig->backupPtr, sig->backupId); return true; break; + case AbortBackupOrd::AbortScan: + case AbortBackupOrd::IncompatibleVersions: + return false; } return false; } diff --git a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp index 84410a2b2db..76284517ac7 100644 --- a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp +++ b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/CntrStart.cpp b/ndb/src/common/debugger/signaldata/CntrStart.cpp index 154013f40b0..813bcef96d6 100644 --- a/ndb/src/common/debugger/signaldata/CntrStart.cpp +++ b/ndb/src/common/debugger/signaldata/CntrStart.cpp @@ -1,3 +1,18 @@ +/* Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include <signaldata/CntrStart.hpp> bool diff --git a/ndb/src/common/debugger/signaldata/ContinueB.cpp b/ndb/src/common/debugger/signaldata/ContinueB.cpp index c295041bc01..cd94abd6f2c 100644 --- a/ndb/src/common/debugger/signaldata/ContinueB.cpp +++ b/ndb/src/common/debugger/signaldata/ContinueB.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/CopyGCI.cpp b/ndb/src/common/debugger/signaldata/CopyGCI.cpp index 173b3f6708f..6ea5f422fda 100644 --- a/ndb/src/common/debugger/signaldata/CopyGCI.cpp +++ b/ndb/src/common/debugger/signaldata/CopyGCI.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/CreateEvnt.cpp b/ndb/src/common/debugger/signaldata/CreateEvnt.cpp index 7b497d6a974..d957b5039ca 100644 --- a/ndb/src/common/debugger/signaldata/CreateEvnt.cpp +++ b/ndb/src/common/debugger/signaldata/CreateEvnt.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp b/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp index 027f743b5ea..5da6fcc2508 100644 --- a/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp +++ b/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/CreateIndx.cpp b/ndb/src/common/debugger/signaldata/CreateIndx.cpp index 8fcbb9279ed..a72d51aa4e2 100644 --- a/ndb/src/common/debugger/signaldata/CreateIndx.cpp +++ b/ndb/src/common/debugger/signaldata/CreateIndx.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/CreateTrig.cpp b/ndb/src/common/debugger/signaldata/CreateTrig.cpp index db5344cfbe7..14a980ed5f7 100644 --- a/ndb/src/common/debugger/signaldata/CreateTrig.cpp +++ b/ndb/src/common/debugger/signaldata/CreateTrig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp index a1d8d82474d..5520d0f4d9f 100644 --- a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp +++ b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -52,6 +51,7 @@ DictTabInfo::TableMapping[] = { DTIMAP(Table, MaxRowsHigh, MaxRowsHigh), DTIMAP(Table, MinRowsLow, MinRowsLow), DTIMAP(Table, MinRowsHigh, MinRowsHigh), + DTIMAP(Table, SingleUserMode, SingleUserMode), DTIBREAK(AttributeName) }; @@ -132,6 +132,8 @@ DictTabInfo::Table::init(){ MaxRowsHigh = 0; MinRowsLow = 0; MinRowsHigh = 0; + + SingleUserMode = 0; } void diff --git a/ndb/src/common/debugger/signaldata/DihContinueB.cpp b/ndb/src/common/debugger/signaldata/DihContinueB.cpp index 9fece17315c..30b15fe7de1 100644 --- a/ndb/src/common/debugger/signaldata/DihContinueB.cpp +++ b/ndb/src/common/debugger/signaldata/DihContinueB.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/DihSwitchReplicaReq.cpp b/ndb/src/common/debugger/signaldata/DihSwitchReplicaReq.cpp index 2e4318f4033..ce8c05b61e0 100644 --- a/ndb/src/common/debugger/signaldata/DihSwitchReplicaReq.cpp +++ b/ndb/src/common/debugger/signaldata/DihSwitchReplicaReq.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/DisconnectRep.cpp b/ndb/src/common/debugger/signaldata/DisconnectRep.cpp index 3a73747a978..10efb20f393 100644 --- a/ndb/src/common/debugger/signaldata/DisconnectRep.cpp +++ b/ndb/src/common/debugger/signaldata/DisconnectRep.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/DropIndx.cpp b/ndb/src/common/debugger/signaldata/DropIndx.cpp index 0d59a981a18..39d0333399e 100644 --- a/ndb/src/common/debugger/signaldata/DropIndx.cpp +++ b/ndb/src/common/debugger/signaldata/DropIndx.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/DropTab.cpp b/ndb/src/common/debugger/signaldata/DropTab.cpp index 83c95b0e344..2715239119d 100644 --- a/ndb/src/common/debugger/signaldata/DropTab.cpp +++ b/ndb/src/common/debugger/signaldata/DropTab.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/DropTrig.cpp b/ndb/src/common/debugger/signaldata/DropTrig.cpp index 54e8734439f..6e4caae01ab 100644 --- a/ndb/src/common/debugger/signaldata/DropTrig.cpp +++ b/ndb/src/common/debugger/signaldata/DropTrig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/FailRep.cpp b/ndb/src/common/debugger/signaldata/FailRep.cpp index d70912fe8c7..fa2a431e7c5 100644 --- a/ndb/src/common/debugger/signaldata/FailRep.cpp +++ b/ndb/src/common/debugger/signaldata/FailRep.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/FireTrigOrd.cpp b/ndb/src/common/debugger/signaldata/FireTrigOrd.cpp index d86aa2e06de..b1bf52542b7 100644 --- a/ndb/src/common/debugger/signaldata/FireTrigOrd.cpp +++ b/ndb/src/common/debugger/signaldata/FireTrigOrd.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/FsAppendReq.cpp b/ndb/src/common/debugger/signaldata/FsAppendReq.cpp index 6e443ffe5fc..a574a83b7ab 100644 --- a/ndb/src/common/debugger/signaldata/FsAppendReq.cpp +++ b/ndb/src/common/debugger/signaldata/FsAppendReq.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/FsCloseReq.cpp b/ndb/src/common/debugger/signaldata/FsCloseReq.cpp index df9f3cc9fbc..da1f37ddb42 100644 --- a/ndb/src/common/debugger/signaldata/FsCloseReq.cpp +++ b/ndb/src/common/debugger/signaldata/FsCloseReq.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/FsConf.cpp b/ndb/src/common/debugger/signaldata/FsConf.cpp index f0ab57aadcf..ed9124fcfeb 100644 --- a/ndb/src/common/debugger/signaldata/FsConf.cpp +++ b/ndb/src/common/debugger/signaldata/FsConf.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/FsOpenReq.cpp b/ndb/src/common/debugger/signaldata/FsOpenReq.cpp index 31d351a8a84..0029be79fdd 100644 --- a/ndb/src/common/debugger/signaldata/FsOpenReq.cpp +++ b/ndb/src/common/debugger/signaldata/FsOpenReq.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp index a9f240d3cb4..cc01fed2178 100644 --- a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp +++ b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/FsRef.cpp b/ndb/src/common/debugger/signaldata/FsRef.cpp index ff659208d20..3d9eccc9407 100644 --- a/ndb/src/common/debugger/signaldata/FsRef.cpp +++ b/ndb/src/common/debugger/signaldata/FsRef.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/GCPSave.cpp b/ndb/src/common/debugger/signaldata/GCPSave.cpp index 7566f004bfd..b1dbb5887dd 100644 --- a/ndb/src/common/debugger/signaldata/GCPSave.cpp +++ b/ndb/src/common/debugger/signaldata/GCPSave.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/IndxAttrInfo.cpp b/ndb/src/common/debugger/signaldata/IndxAttrInfo.cpp index 2ef5feaada7..a4bc3f04c04 100755 --- a/ndb/src/common/debugger/signaldata/IndxAttrInfo.cpp +++ b/ndb/src/common/debugger/signaldata/IndxAttrInfo.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/IndxKeyInfo.cpp b/ndb/src/common/debugger/signaldata/IndxKeyInfo.cpp index 6fe5567188d..78e3a98f6ce 100755 --- a/ndb/src/common/debugger/signaldata/IndxKeyInfo.cpp +++ b/ndb/src/common/debugger/signaldata/IndxKeyInfo.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/LCP.cpp b/ndb/src/common/debugger/signaldata/LCP.cpp index 6b4bb13e2cd..946c43c8d7e 100644 --- a/ndb/src/common/debugger/signaldata/LCP.cpp +++ b/ndb/src/common/debugger/signaldata/LCP.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/LqhFrag.cpp b/ndb/src/common/debugger/signaldata/LqhFrag.cpp index 3175582c3a2..0d7a2cf1e4d 100644 --- a/ndb/src/common/debugger/signaldata/LqhFrag.cpp +++ b/ndb/src/common/debugger/signaldata/LqhFrag.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/LqhKey.cpp b/ndb/src/common/debugger/signaldata/LqhKey.cpp index 2796437fd8b..235aa870ac7 100644 --- a/ndb/src/common/debugger/signaldata/LqhKey.cpp +++ b/ndb/src/common/debugger/signaldata/LqhKey.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/LqhTrans.cpp b/ndb/src/common/debugger/signaldata/LqhTrans.cpp index 8282530cae6..f413ccc6311 100644 --- a/ndb/src/common/debugger/signaldata/LqhTrans.cpp +++ b/ndb/src/common/debugger/signaldata/LqhTrans.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/Makefile.am b/ndb/src/common/debugger/signaldata/Makefile.am index 9146d552568..7d58399a66e 100644 --- a/ndb/src/common/debugger/signaldata/Makefile.am +++ b/ndb/src/common/debugger/signaldata/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LTLIBRARIES = libsignaldataprint.la diff --git a/ndb/src/common/debugger/signaldata/MasterLCP.cpp b/ndb/src/common/debugger/signaldata/MasterLCP.cpp index 078b92f6f2e..620695a91a4 100644 --- a/ndb/src/common/debugger/signaldata/MasterLCP.cpp +++ b/ndb/src/common/debugger/signaldata/MasterLCP.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp index f2d6f2f104a..800dc074aa7 100644 --- a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp +++ b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/NdbSttor.cpp b/ndb/src/common/debugger/signaldata/NdbSttor.cpp index 9fd081313be..3a67e2e7806 100644 --- a/ndb/src/common/debugger/signaldata/NdbSttor.cpp +++ b/ndb/src/common/debugger/signaldata/NdbSttor.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/NdbfsContinueB.cpp b/ndb/src/common/debugger/signaldata/NdbfsContinueB.cpp index 9f55efae017..cd592533638 100644 --- a/ndb/src/common/debugger/signaldata/NdbfsContinueB.cpp +++ b/ndb/src/common/debugger/signaldata/NdbfsContinueB.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/PackedSignal.cpp b/ndb/src/common/debugger/signaldata/PackedSignal.cpp index f0f7aee74e4..a5f585c23f0 100644 --- a/ndb/src/common/debugger/signaldata/PackedSignal.cpp +++ b/ndb/src/common/debugger/signaldata/PackedSignal.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -97,6 +96,8 @@ printPACKED_SIGNAL(FILE * output, const Uint32 * theData, Uint32 len, Uint16 rec } default: fprintf(output, "Unknown signal type\n"); + i = len; // terminate printing + break; } }//for fprintf(output, "--------- End Packed Signals ----------\n"); diff --git a/ndb/src/common/debugger/signaldata/PrepDropTab.cpp b/ndb/src/common/debugger/signaldata/PrepDropTab.cpp index 59001bcd6f6..112b92f3fcc 100644 --- a/ndb/src/common/debugger/signaldata/PrepDropTab.cpp +++ b/ndb/src/common/debugger/signaldata/PrepDropTab.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp index 2e900de8f70..cea7c65485d 100644 --- a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp +++ b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/ReadNodesConf.cpp b/ndb/src/common/debugger/signaldata/ReadNodesConf.cpp index 103f4a884f1..d8f8344ea95 100644 --- a/ndb/src/common/debugger/signaldata/ReadNodesConf.cpp +++ b/ndb/src/common/debugger/signaldata/ReadNodesConf.cpp @@ -1,3 +1,18 @@ +/* Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include <signaldata/ReadNodesConf.hpp> bool diff --git a/ndb/src/common/debugger/signaldata/ScanFrag.cpp b/ndb/src/common/debugger/signaldata/ScanFrag.cpp index 4d19a325637..de05426d40b 100644 --- a/ndb/src/common/debugger/signaldata/ScanFrag.cpp +++ b/ndb/src/common/debugger/signaldata/ScanFrag.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/ScanTab.cpp b/ndb/src/common/debugger/signaldata/ScanTab.cpp index d78beb4740a..39589542800 100644 --- a/ndb/src/common/debugger/signaldata/ScanTab.cpp +++ b/ndb/src/common/debugger/signaldata/ScanTab.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp index 572d8f6e3ca..0194f15457f 100644 --- a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp +++ b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/SignalDroppedRep.cpp b/ndb/src/common/debugger/signaldata/SignalDroppedRep.cpp index be31b4edb22..e812efc85a6 100644 --- a/ndb/src/common/debugger/signaldata/SignalDroppedRep.cpp +++ b/ndb/src/common/debugger/signaldata/SignalDroppedRep.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/SignalNames.cpp b/ndb/src/common/debugger/signaldata/SignalNames.cpp index ecc9fc83153..66e7a10cdb7 100644 --- a/ndb/src/common/debugger/signaldata/SignalNames.cpp +++ b/ndb/src/common/debugger/signaldata/SignalNames.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -381,15 +380,10 @@ const GsnName SignalNames [] = { ,{ GSN_TUP_WRITELOG_REQ, "TUP_WRITELOG_REQ" } ,{ GSN_LQH_WRITELOG_REQ, "LQH_WRITELOG_REQ" } - ,{ GSN_STATISTICS_REQ, "STATISTICS_REQ" } ,{ GSN_START_ORD, "START_ORD" } ,{ GSN_STOP_ORD, "STOP_ORD" } ,{ GSN_TAMPER_ORD, "TAMPER_ORD" } - ,{ GSN_SET_VAR_REQ, "SET_VAR_REQ" } - ,{ GSN_SET_VAR_CONF, "SET_VAR_CONF" } - ,{ GSN_SET_VAR_REF, "SET_VAR_REF" } - ,{ GSN_STATISTICS_CONF, "STATISTICS_CONF" } - + ,{ GSN_EVENT_SUBSCRIBE_REQ, "EVENT_SUBSCRIBE_REQ" } ,{ GSN_EVENT_SUBSCRIBE_CONF, "EVENT_SUBSCRIBE_CONF" } ,{ GSN_EVENT_SUBSCRIBE_REF, "EVENT_SUBSCRIBE_REF" } diff --git a/ndb/src/common/debugger/signaldata/StartRec.cpp b/ndb/src/common/debugger/signaldata/StartRec.cpp index 54830e533c5..69054528d95 100644 --- a/ndb/src/common/debugger/signaldata/StartRec.cpp +++ b/ndb/src/common/debugger/signaldata/StartRec.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/SumaImpl.cpp b/ndb/src/common/debugger/signaldata/SumaImpl.cpp index e50a3040fe3..3af825dbefb 100644 --- a/ndb/src/common/debugger/signaldata/SumaImpl.cpp +++ b/ndb/src/common/debugger/signaldata/SumaImpl.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/SystemError.cpp b/ndb/src/common/debugger/signaldata/SystemError.cpp index 549c34710a0..c1acde0b6ad 100644 --- a/ndb/src/common/debugger/signaldata/SystemError.cpp +++ b/ndb/src/common/debugger/signaldata/SystemError.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/TcIndx.cpp b/ndb/src/common/debugger/signaldata/TcIndx.cpp index b0578f5b646..8efbf106534 100644 --- a/ndb/src/common/debugger/signaldata/TcIndx.cpp +++ b/ndb/src/common/debugger/signaldata/TcIndx.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/TcKeyConf.cpp b/ndb/src/common/debugger/signaldata/TcKeyConf.cpp index 652c2b8a557..65589f8cd6e 100644 --- a/ndb/src/common/debugger/signaldata/TcKeyConf.cpp +++ b/ndb/src/common/debugger/signaldata/TcKeyConf.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/TcKeyRef.cpp b/ndb/src/common/debugger/signaldata/TcKeyRef.cpp index 0dba9909caf..eb512de52e6 100644 --- a/ndb/src/common/debugger/signaldata/TcKeyRef.cpp +++ b/ndb/src/common/debugger/signaldata/TcKeyRef.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/TcKeyReq.cpp b/ndb/src/common/debugger/signaldata/TcKeyReq.cpp index 3918bd5db26..0265ed823dd 100644 --- a/ndb/src/common/debugger/signaldata/TcKeyReq.cpp +++ b/ndb/src/common/debugger/signaldata/TcKeyReq.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/TcRollbackRep.cpp b/ndb/src/common/debugger/signaldata/TcRollbackRep.cpp index 961f0c3619d..92191619982 100644 --- a/ndb/src/common/debugger/signaldata/TcRollbackRep.cpp +++ b/ndb/src/common/debugger/signaldata/TcRollbackRep.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/TrigAttrInfo.cpp b/ndb/src/common/debugger/signaldata/TrigAttrInfo.cpp index 7a8d176ec61..14329c66c2a 100644 --- a/ndb/src/common/debugger/signaldata/TrigAttrInfo.cpp +++ b/ndb/src/common/debugger/signaldata/TrigAttrInfo.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/TupCommit.cpp b/ndb/src/common/debugger/signaldata/TupCommit.cpp index d0391b2a8e6..a796d87bd91 100644 --- a/ndb/src/common/debugger/signaldata/TupCommit.cpp +++ b/ndb/src/common/debugger/signaldata/TupCommit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/TupKey.cpp b/ndb/src/common/debugger/signaldata/TupKey.cpp index 134b5fde8bc..03811bfd7c9 100644 --- a/ndb/src/common/debugger/signaldata/TupKey.cpp +++ b/ndb/src/common/debugger/signaldata/TupKey.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/TuxMaint.cpp b/ndb/src/common/debugger/signaldata/TuxMaint.cpp index ba6a299b77d..52e223f261d 100644 --- a/ndb/src/common/debugger/signaldata/TuxMaint.cpp +++ b/ndb/src/common/debugger/signaldata/TuxMaint.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/UtilDelete.cpp b/ndb/src/common/debugger/signaldata/UtilDelete.cpp index b6ba53559ac..38f5b8a7c06 100644 --- a/ndb/src/common/debugger/signaldata/UtilDelete.cpp +++ b/ndb/src/common/debugger/signaldata/UtilDelete.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/UtilExecute.cpp b/ndb/src/common/debugger/signaldata/UtilExecute.cpp index 2c88fa174d4..6d92acf2e01 100644 --- a/ndb/src/common/debugger/signaldata/UtilExecute.cpp +++ b/ndb/src/common/debugger/signaldata/UtilExecute.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/UtilLock.cpp b/ndb/src/common/debugger/signaldata/UtilLock.cpp index 34e37c3e2d8..3004f9d0975 100644 --- a/ndb/src/common/debugger/signaldata/UtilLock.cpp +++ b/ndb/src/common/debugger/signaldata/UtilLock.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/UtilPrepare.cpp b/ndb/src/common/debugger/signaldata/UtilPrepare.cpp index adc2e299380..36591d18a54 100644 --- a/ndb/src/common/debugger/signaldata/UtilPrepare.cpp +++ b/ndb/src/common/debugger/signaldata/UtilPrepare.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/UtilSequence.cpp b/ndb/src/common/debugger/signaldata/UtilSequence.cpp index e91999d9abf..164987a9720 100644 --- a/ndb/src/common/debugger/signaldata/UtilSequence.cpp +++ b/ndb/src/common/debugger/signaldata/UtilSequence.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/debugger/signaldata/print.awk b/ndb/src/common/debugger/signaldata/print.awk index 9730fb4a236..3c289e59f63 100644 --- a/ndb/src/common/debugger/signaldata/print.awk +++ b/ndb/src/common/debugger/signaldata/print.awk @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + BEGIN { m_curr=""; m_count=0; diff --git a/ndb/src/common/logger/ConsoleLogHandler.cpp b/ndb/src/common/logger/ConsoleLogHandler.cpp index 94367d2fc45..d0cafcb3590 100644 --- a/ndb/src/common/logger/ConsoleLogHandler.cpp +++ b/ndb/src/common/logger/ConsoleLogHandler.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp index 3d29e63ac1f..a4f610777eb 100644 --- a/ndb/src/common/logger/FileLogHandler.cpp +++ b/ndb/src/common/logger/FileLogHandler.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -125,8 +124,6 @@ FileLogHandler::writeFooter() } callCount++; - // Needed on Cello since writes to the flash disk does not happen until - // we flush and fsync. m_pLogFile->flush(); } @@ -147,6 +144,7 @@ FileLogHandler::createNewFile() bool rc = true; int fileNo = 1; char newName[PATH_MAX]; + time_t newMtime, preMtime = 0; do { @@ -159,7 +157,15 @@ FileLogHandler::createNewFile() } BaseString::snprintf(newName, sizeof(newName), "%s.%d", m_pLogFile->getName(), fileNo++); - + newMtime = File_class::mtime(newName); + if (newMtime < preMtime) + { + break; + } + else + { + preMtime = newMtime; + } } while (File_class::exists(newName)); m_pLogFile->close(); diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp index c11f962d4fb..b746bcc3cd7 100644 --- a/ndb/src/common/logger/LogHandler.cpp +++ b/ndb/src/common/logger/LogHandler.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -164,9 +163,9 @@ LogHandler::getErrorStr() } void -LogHandler::setErrorStr(char* str) +LogHandler::setErrorStr(const char* str) { - m_errorStr= str; + m_errorStr= (char*) str; } bool diff --git a/ndb/src/common/logger/LogHandlerList.cpp b/ndb/src/common/logger/LogHandlerList.cpp index 62495d7566b..376e96c3c8c 100644 --- a/ndb/src/common/logger/LogHandlerList.cpp +++ b/ndb/src/common/logger/LogHandlerList.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/logger/LogHandlerList.hpp b/ndb/src/common/logger/LogHandlerList.hpp index 21344023560..ad87c0294cf 100644 --- a/ndb/src/common/logger/LogHandlerList.hpp +++ b/ndb/src/common/logger/LogHandlerList.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index 48e084a782b..1bb7062474f 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/logger/Makefile.am b/ndb/src/common/logger/Makefile.am index 0af21f9fbde..b344b5bf833 100644 --- a/ndb/src/common/logger/Makefile.am +++ b/ndb/src/common/logger/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LTLIBRARIES = liblogger.la diff --git a/ndb/src/common/logger/SysLogHandler.cpp b/ndb/src/common/logger/SysLogHandler.cpp index c7fcb102dd4..3178ef6e1c7 100644 --- a/ndb/src/common/logger/SysLogHandler.cpp +++ b/ndb/src/common/logger/SysLogHandler.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp index 7de9ee46479..e478573a094 100644 --- a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp +++ b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.hpp b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.hpp index e98a2722b8d..ae7846af19e 100644 --- a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.hpp +++ b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp index 990d2e0eada..9ee021f935b 100644 --- a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp +++ b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/logger/loggertest/LoggerUnitTest.hpp b/ndb/src/common/logger/loggertest/LoggerUnitTest.hpp index 79f560750d5..e7d25292aab 100644 --- a/ndb/src/common/logger/loggertest/LoggerUnitTest.hpp +++ b/ndb/src/common/logger/loggertest/LoggerUnitTest.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index a0e3a4b74f3..bfc9ff8e384 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -155,12 +154,13 @@ ConfigRetriever::getConfig() { } ndb_mgm_configuration * -ConfigRetriever::getConfig(NdbMgmHandle m_handle) +ConfigRetriever::getConfig(NdbMgmHandle m_handle_arg) { - ndb_mgm_configuration * conf = ndb_mgm_get_configuration(m_handle,m_version); + ndb_mgm_configuration * conf = ndb_mgm_get_configuration(m_handle_arg, + m_version); if(conf == 0) { - setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle)); + setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle_arg)); return 0; } return conf; diff --git a/ndb/src/common/mgmcommon/IPCConfig.cpp b/ndb/src/common/mgmcommon/IPCConfig.cpp index bc442ffc3ef..9ac5931ae77 100644 --- a/ndb/src/common/mgmcommon/IPCConfig.cpp +++ b/ndb/src/common/mgmcommon/IPCConfig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am index 104bf0b29f2..cef2aedfc37 100644 --- a/ndb/src/common/mgmcommon/Makefile.am +++ b/ndb/src/common/mgmcommon/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LTLIBRARIES = libmgmsrvcommon.la libmgmsrvcommon_la_SOURCES = \ diff --git a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp index 7cedbb451e2..348075a6cd2 100644 --- a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp +++ b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am index 1e27d713495..10f10a059f4 100644 --- a/ndb/src/common/portlib/Makefile.am +++ b/ndb/src/common/portlib/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004, 2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LTLIBRARIES = libportlib.la libportlib_la_SOURCES = \ @@ -39,3 +54,6 @@ libportlib.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(WIN_src) @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/src/common/portlib/NdbCondition.c b/ndb/src/common/portlib/NdbCondition.c index df312c7cc24..da1d67e660e 100644 --- a/ndb/src/common/portlib/NdbCondition.c +++ b/ndb/src/common/portlib/NdbCondition.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/NdbConfig.c b/ndb/src/common/portlib/NdbConfig.c index c3f37727024..193b3429a3d 100644 --- a/ndb/src/common/portlib/NdbConfig.c +++ b/ndb/src/common/portlib/NdbConfig.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/NdbDaemon.c b/ndb/src/common/portlib/NdbDaemon.c index 3f1c1998501..d440b68290e 100644 --- a/ndb/src/common/portlib/NdbDaemon.c +++ b/ndb/src/common/portlib/NdbDaemon.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/NdbEnv.c b/ndb/src/common/portlib/NdbEnv.c index d294e0b52ca..faa9a20a516 100644 --- a/ndb/src/common/portlib/NdbEnv.c +++ b/ndb/src/common/portlib/NdbEnv.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/NdbHost.c b/ndb/src/common/portlib/NdbHost.c index 4749bb39ea7..26563a65d9c 100644 --- a/ndb/src/common/portlib/NdbHost.c +++ b/ndb/src/common/portlib/NdbHost.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/NdbMem.c b/ndb/src/common/portlib/NdbMem.c index 0d2021aaf0a..7c95e02cd0c 100644 --- a/ndb/src/common/portlib/NdbMem.c +++ b/ndb/src/common/portlib/NdbMem.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/NdbMutex.c b/ndb/src/common/portlib/NdbMutex.c index 4a170d87e5c..c9184e5d1f2 100644 --- a/ndb/src/common/portlib/NdbMutex.c +++ b/ndb/src/common/portlib/NdbMutex.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -28,7 +27,7 @@ NdbMutex* NdbMutex_Create(void) DBUG_ENTER("NdbMutex_Create"); pNdbMutex = (NdbMutex*)NdbMem_Allocate(sizeof(NdbMutex)); - DBUG_PRINT("info",("NdbMem_Allocate 0x%lx",pNdbMutex)); + DBUG_PRINT("info",("NdbMem_Allocate 0x%lx", (long) pNdbMutex)); if (pNdbMutex == NULL) DBUG_RETURN(NULL); @@ -50,7 +49,7 @@ int NdbMutex_Destroy(NdbMutex* p_mutex) result = pthread_mutex_destroy(p_mutex); - DBUG_PRINT("info",("NdbMem_Free 0x%lx",p_mutex)); + DBUG_PRINT("info",("NdbMem_Free 0x%lx", (long) p_mutex)); NdbMem_Free(p_mutex); DBUG_RETURN(result); diff --git a/ndb/src/common/portlib/NdbPortLibTest.cpp b/ndb/src/common/portlib/NdbPortLibTest.cpp index d7892411851..b1602578acd 100644 --- a/ndb/src/common/portlib/NdbPortLibTest.cpp +++ b/ndb/src/common/portlib/NdbPortLibTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/NdbSleep.c b/ndb/src/common/portlib/NdbSleep.c index 44bafe98a37..b3251939938 100644 --- a/ndb/src/common/portlib/NdbSleep.c +++ b/ndb/src/common/portlib/NdbSleep.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/NdbTCP.cpp b/ndb/src/common/portlib/NdbTCP.cpp index 41471548b7e..72892b93e62 100644 --- a/ndb/src/common/portlib/NdbTCP.cpp +++ b/ndb/src/common/portlib/NdbTCP.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index 48d00956ec2..d5d0f462f4f 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -122,7 +121,7 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, assert(result==0); pthread_attr_destroy(&thread_attr); - DBUG_PRINT("exit",("ret: %lx", tmpThread)); + DBUG_PRINT("exit",("ret: 0x%lx", (long) tmpThread)); DBUG_RETURN(tmpThread); } @@ -131,7 +130,7 @@ void NdbThread_Destroy(struct NdbThread** p_thread) { DBUG_ENTER("NdbThread_Destroy"); if (*p_thread != NULL){ - DBUG_PRINT("enter",("*p_thread: %lx", * p_thread)); + DBUG_PRINT("enter",("*p_thread: 0x%lx", (long) *p_thread)); free(* p_thread); * p_thread = 0; } diff --git a/ndb/src/common/portlib/NdbTick.c b/ndb/src/common/portlib/NdbTick.c index d8f0b6ec27a..238e9b1956d 100644 --- a/ndb/src/common/portlib/NdbTick.c +++ b/ndb/src/common/portlib/NdbTick.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -61,9 +60,9 @@ NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros){ int res = gettimeofday(&tick_time, 0); if(secs==0) { - NDB_TICKS secs = tick_time.tv_sec; + NDB_TICKS local_secs = tick_time.tv_sec; *micros = tick_time.tv_usec; - *micros = secs*1000000+*micros; + *micros = local_secs*1000000+*micros; } else { * secs = tick_time.tv_sec; * micros = tick_time.tv_usec; diff --git a/ndb/src/common/portlib/memtest.c b/ndb/src/common/portlib/memtest.c index 673f23fa803..b9ad2cee315 100644 --- a/ndb/src/common/portlib/memtest.c +++ b/ndb/src/common/portlib/memtest.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/mmslist.cpp b/ndb/src/common/portlib/mmslist.cpp index 05538785293..ed453bd35cd 100644 --- a/ndb/src/common/portlib/mmslist.cpp +++ b/ndb/src/common/portlib/mmslist.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/mmstest.cpp b/ndb/src/common/portlib/mmstest.cpp index 9cc7d810985..3ffb2e1a5aa 100644 --- a/ndb/src/common/portlib/mmstest.cpp +++ b/ndb/src/common/portlib/mmstest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/munmaptest.cpp b/ndb/src/common/portlib/munmaptest.cpp index b1d84131810..57f1756f1ee 100644 --- a/ndb/src/common/portlib/munmaptest.cpp +++ b/ndb/src/common/portlib/munmaptest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c b/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c index 73a2dbc5d66..070f35e8dea 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h b/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h index bd0306261cc..a285eed3fcc 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h +++ b/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c b/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c index e2ac4d879d2..1a8d9ac4897 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbHost.c b/ndb/src/common/portlib/old_dirs/ose/NdbHost.c index f5e1e511c16..d3353ee57d4 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbHost.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbHost.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbMem.c b/ndb/src/common/portlib/old_dirs/ose/NdbMem.c index 0e38024bbb4..5eb27b560fc 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbMem.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbMem.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp b/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp index cad22c0474b..b3fa8d70619 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp +++ b/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c b/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c index 253c0e412ff..2202c090aff 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp b/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp index eb81bc9d971..33ae1972cdc 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp +++ b/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c b/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c index 70fd83117ef..b1e494c505b 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c b/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c index 9994697b3f8..78c57d815cf 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbThread.c b/ndb/src/common/portlib/old_dirs/ose/NdbThread.c index e46903a5cce..630fd24bbbe 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbThread.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbThread.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/ose/NdbTick.c b/ndb/src/common/portlib/old_dirs/ose/NdbTick.c index c3deae2bec3..233b8469564 100644 --- a/ndb/src/common/portlib/old_dirs/ose/NdbTick.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbTick.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c b/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c index 77869b673de..81aa86a6123 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c b/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c index 972fb1b88d8..7c1533aab70 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c b/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c index 0df703a5e97..a4046503627 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbHost.c b/ndb/src/common/portlib/old_dirs/win32/NdbHost.c index f91dd1a531c..6d18eb014f3 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbHost.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbHost.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbMem.c b/ndb/src/common/portlib/old_dirs/win32/NdbMem.c index ab7123b0a29..434cf1837e5 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbMem.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbMem.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c b/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c index e797024d5bb..e7d1b7512a3 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c b/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c index ac0f44dd07f..cbdc959d56b 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c b/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c index 483a53bd606..4970b0d5533 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbThread.c b/ndb/src/common/portlib/old_dirs/win32/NdbThread.c index 1f052f034e8..20e70fb93f4 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbThread.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbThread.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/old_dirs/win32/NdbTick.c b/ndb/src/common/portlib/old_dirs/win32/NdbTick.c index e3a67d8437d..7e9300a89c9 100644 --- a/ndb/src/common/portlib/old_dirs/win32/NdbTick.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbTick.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c index 4046db1d60a..1a68572297c 100644 --- a/ndb/src/common/portlib/win32/NdbCondition.c +++ b/ndb/src/common/portlib/win32/NdbCondition.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/win32/NdbDaemon.c index b96d4c20260..6cfffbd8600 100644 --- a/ndb/src/common/portlib/win32/NdbDaemon.c +++ b/ndb/src/common/portlib/win32/NdbDaemon.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/win32/NdbEnv.c index f42e685fe15..dedd9c9c1fe 100644 --- a/ndb/src/common/portlib/win32/NdbEnv.c +++ b/ndb/src/common/portlib/win32/NdbEnv.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbHost.c b/ndb/src/common/portlib/win32/NdbHost.c index 7df96c45991..34977942eb6 100644 --- a/ndb/src/common/portlib/win32/NdbHost.c +++ b/ndb/src/common/portlib/win32/NdbHost.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c index 313ca9dff66..39c84f4717a 100644 --- a/ndb/src/common/portlib/win32/NdbMem.c +++ b/ndb/src/common/portlib/win32/NdbMem.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c index e6d1f081e9a..af04531543e 100644 --- a/ndb/src/common/portlib/win32/NdbMutex.c +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbSleep.c b/ndb/src/common/portlib/win32/NdbSleep.c index 8f5bdc49acd..9c3df0ec0ca 100644 --- a/ndb/src/common/portlib/win32/NdbSleep.c +++ b/ndb/src/common/portlib/win32/NdbSleep.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/win32/NdbTCP.c index 5d6c0ae5c7d..e1d9bf91009 100644 --- a/ndb/src/common/portlib/win32/NdbTCP.c +++ b/ndb/src/common/portlib/win32/NdbTCP.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c index 98db0d5c287..3cd57b40422 100644 --- a/ndb/src/common/portlib/win32/NdbThread.c +++ b/ndb/src/common/portlib/win32/NdbThread.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/win32/NdbTick.c index 4430cbf419b..3e9c6f47349 100644 --- a/ndb/src/common/portlib/win32/NdbTick.c +++ b/ndb/src/common/portlib/win32/NdbTick.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/Makefile.am b/ndb/src/common/transporter/Makefile.am index 4c277097a91..ad1db7526aa 100644 --- a/ndb/src/common/transporter/Makefile.am +++ b/ndb/src/common/transporter/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LTLIBRARIES = libtransporter.la diff --git a/ndb/src/common/transporter/OSE_Receiver.cpp b/ndb/src/common/transporter/OSE_Receiver.cpp index 63a33fc8f24..697d9ceb049 100644 --- a/ndb/src/common/transporter/OSE_Receiver.cpp +++ b/ndb/src/common/transporter/OSE_Receiver.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/OSE_Receiver.hpp b/ndb/src/common/transporter/OSE_Receiver.hpp index 1812ab51065..68e0b7122bc 100644 --- a/ndb/src/common/transporter/OSE_Receiver.hpp +++ b/ndb/src/common/transporter/OSE_Receiver.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/OSE_Signals.hpp b/ndb/src/common/transporter/OSE_Signals.hpp index 3f6cc07b473..89bd1050ffd 100644 --- a/ndb/src/common/transporter/OSE_Signals.hpp +++ b/ndb/src/common/transporter/OSE_Signals.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/OSE_Transporter.cpp b/ndb/src/common/transporter/OSE_Transporter.cpp index ad67791fc0c..0abf480875f 100644 --- a/ndb/src/common/transporter/OSE_Transporter.cpp +++ b/ndb/src/common/transporter/OSE_Transporter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/OSE_Transporter.hpp b/ndb/src/common/transporter/OSE_Transporter.hpp index 898352366ba..d8b2bfa470f 100644 --- a/ndb/src/common/transporter/OSE_Transporter.hpp +++ b/ndb/src/common/transporter/OSE_Transporter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/Packer.cpp b/ndb/src/common/transporter/Packer.cpp index 1c98ad87834..d471167b0e7 100644 --- a/ndb/src/common/transporter/Packer.cpp +++ b/ndb/src/common/transporter/Packer.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/Packer.hpp b/ndb/src/common/transporter/Packer.hpp index 5c191203201..8a1feb87ed7 100644 --- a/ndb/src/common/transporter/Packer.hpp +++ b/ndb/src/common/transporter/Packer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp index 1fe276249e5..0720fe84973 100644 --- a/ndb/src/common/transporter/SCI_Transporter.cpp +++ b/ndb/src/common/transporter/SCI_Transporter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -66,13 +65,10 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg, m_initLocal=false; - m_swapCounter=0; m_failCounter=0; m_remoteNodes[0]=remoteSciNodeId0; m_remoteNodes[1]=remoteSciNodeId1; m_adapters = nAdapters; - // The maximum number of times to try and create, - // start and destroy a sequence m_ActiveAdapterId=0; m_StandbyAdapterId=1; @@ -103,8 +99,6 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg, DBUG_VOID_RETURN; } - - void SCI_Transporter::disconnectImpl() { DBUG_ENTER("SCI_Transporter::disconnectImpl"); @@ -130,7 +124,8 @@ void SCI_Transporter::disconnectImpl() if(err != SCI_ERR_OK) { report_error(TE_SCI_UNABLE_TO_CLOSE_CHANNEL); - DBUG_PRINT("error", ("Cannot close channel to the driver. Error code 0x%x", + DBUG_PRINT("error", + ("Cannot close channel to the driver. Error code 0x%x", err)); } } @@ -165,19 +160,18 @@ bool SCI_Transporter::initTransporter() { m_sendBuffer.m_buffer = new Uint32[m_sendBuffer.m_sendBufferSize / 4]; m_sendBuffer.m_dataSize = 0; - DBUG_PRINT("info", ("Created SCI Send Buffer with buffer size %d and packet size %d", + DBUG_PRINT("info", + ("Created SCI Send Buffer with buffer size %d and packet size %d", m_sendBuffer.m_sendBufferSize, m_PacketSize * 4)); if(!getLinkStatus(m_ActiveAdapterId) || (m_adapters > 1 && !getLinkStatus(m_StandbyAdapterId))) { - DBUG_PRINT("error", ("The link is not fully operational. Check the cables and the switches")); - //reportDisconnect(remoteNodeId, 0); - //doDisconnect(); + DBUG_PRINT("error", + ("The link is not fully operational. Check the cables and the switches")); //NDB should terminate report_error(TE_SCI_LINK_ERROR); DBUG_RETURN(false); } - DBUG_RETURN(true); } // initTransporter() @@ -236,7 +230,8 @@ sci_error_t SCI_Transporter::initLocalSegment() { DBUG_PRINT("info", ("SCInode iD %d adapter %d\n", sciAdapters[i].localSciNodeId, i)); if(err != SCI_ERR_OK) { - DBUG_PRINT("error", ("Cannot open an SCI virtual device. Error code 0x%x", + DBUG_PRINT("error", + ("Cannot open an SCI virtual device. Error code 0x%x", err)); DBUG_RETURN(err); } @@ -270,7 +265,8 @@ sci_error_t SCI_Transporter::initLocalSegment() { &err); if(err != SCI_ERR_OK) { - DBUG_PRINT("error", ("Local Segment is not accessible by an SCI adapter. Error code 0x%x\n", + DBUG_PRINT("error", + ("Local Segment is not accessible by an SCI adapter. Error code 0x%x\n", err)); DBUG_RETURN(err); } @@ -304,15 +300,13 @@ sci_error_t SCI_Transporter::initLocalSegment() { &err); if(err != SCI_ERR_OK) { - DBUG_PRINT("error", ("Local Segment is not available for remote connections. Error code 0x%x\n", + DBUG_PRINT("error", + ("Local Segment is not available for remote connections. Error code 0x%x\n", err)); DBUG_RETURN(err); } } - - setupLocalSegment(); - DBUG_RETURN(err); } // initLocalSegment() @@ -344,12 +338,6 @@ bool SCI_Transporter::doSend() { if(sizeToSend==4097) i4097++; #endif - if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) { - DBUG_PRINT("error", ("Start sequence failed")); - report_error(TE_SCI_UNABLE_TO_START_SEQUENCE); - return false; - } - tryagain: retry++; @@ -375,119 +363,36 @@ bool SCI_Transporter::doSend() { SCI_FLAG_ERROR_CHECK, &err); - if (err != SCI_ERR_OK) { - if(err == SCI_ERR_OUT_OF_RANGE) { - DBUG_PRINT("error", ("Data transfer : out of range error")); - goto tryagain; - } - if(err == SCI_ERR_SIZE_ALIGNMENT) { - DBUG_PRINT("error", ("Data transfer : alignment error")); - DBUG_PRINT("info", ("sendPtr 0x%x, sizeToSend = %d", sendPtr, sizeToSend)); - goto tryagain; - } - if(err == SCI_ERR_OFFSET_ALIGNMENT) { - DBUG_PRINT("error", ("Data transfer : offset alignment")); - goto tryagain; - } - if(err == SCI_ERR_TRANSFER_FAILED) { - //(m_TargetSegm[m_StandbyAdapterId].writer)->heavyLock(); - if(getLinkStatus(m_ActiveAdapterId)) { - goto tryagain; - } - if (m_adapters == 1) { - DBUG_PRINT("error", ("SCI Transfer failed")); + if (err == SCI_ERR_OUT_OF_RANGE || + err == SCI_ERR_SIZE_ALIGNMENT || + err == SCI_ERR_OFFSET_ALIGNMENT) { + DBUG_PRINT("error", ("Data transfer error = %d", err)); report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); return false; - } - m_failCounter++; - Uint32 temp=m_ActiveAdapterId; - switch(m_swapCounter) { - case 0: - /**swap from active (0) to standby (1)*/ - if(getLinkStatus(m_StandbyAdapterId)) { - DBUG_PRINT("error", ("Swapping from adapter 0 to 1")); + } + if(err == SCI_ERR_TRANSFER_FAILED) { + if(getLinkStatus(m_ActiveAdapterId)) + goto tryagain; + if (m_adapters == 1) { + DBUG_PRINT("error", ("SCI Transfer failed")); + report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); + return false; + } + m_failCounter++; + Uint32 temp=m_ActiveAdapterId; + if (getLinkStatus(m_StandbyAdapterId)) { failoverShmWriter(); SCIStoreBarrier(m_TargetSegm[m_StandbyAdapterId].sequence,0); m_ActiveAdapterId=m_StandbyAdapterId; m_StandbyAdapterId=temp; - SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence), - FLAGS, - &err); - if(err!=SCI_ERR_OK) { - report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE); - DBUG_PRINT("error", ("Unable to remove sequence")); - return false; - } - if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) { - DBUG_PRINT("error", ("Start sequence failed")); - report_error(TE_SCI_UNABLE_TO_START_SEQUENCE); - return false; - } - m_swapCounter++; - DBUG_PRINT("info", ("failover complete")); - goto tryagain; - } else { - report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); - DBUG_PRINT("error", ("SCI Transfer failed")); - return false; - } - return false; - break; - case 1: - /** swap back from 1 to 0 - must check that the link is up */ - - if(getLinkStatus(m_StandbyAdapterId)) { - failoverShmWriter(); - m_ActiveAdapterId=m_StandbyAdapterId; - m_StandbyAdapterId=temp; - DBUG_PRINT("info", ("Swapping from 1 to 0")); - if(createSequence(m_ActiveAdapterId)!=SCI_ERR_OK) { - DBUG_PRINT("error", ("Unable to create sequence")); - report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE); - return false; - } - if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) { - DBUG_PRINT("error", ("startSequence failed... disconnecting")); - report_error(TE_SCI_UNABLE_TO_START_SEQUENCE); - return false; - } - - SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence) - , FLAGS, - &err); - if(err!=SCI_ERR_OK) { - DBUG_PRINT("error", ("Unable to remove sequence")); - report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE); - return false; - } - - if(createSequence(m_StandbyAdapterId)!=SCI_ERR_OK) { - DBUG_PRINT("error", ("Unable to create sequence on standby")); - report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE); - return false; - } - - m_swapCounter=0; - - DBUG_PRINT("info", ("failover complete..")); - goto tryagain; - + DBUG_PRINT("error", ("Swapping from adapter %u to %u", + m_StandbyAdapterId, m_ActiveAdapterId)); } else { - DBUG_PRINT("error", ("Unrecoverable data transfer error")); report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); - return false; + DBUG_PRINT("error", ("SCI Transfer failed")); } - - break; - default: - DBUG_PRINT("error", ("Unrecoverable data transfer error")); - report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); - return false; - break; - } - } + } } else { SHM_Writer * writer = (m_TargetSegm[m_ActiveAdapterId].writer); writer->updateWritePtr(sizeToSend); @@ -498,7 +403,6 @@ bool SCI_Transporter::doSend() { m_sendBuffer.m_dataSize = 0; m_sendBuffer.m_forceSendLimit = sendLimit; } - } else { /** * If we end up here, the SCI segment is full. @@ -553,15 +457,12 @@ void SCI_Transporter::setupLocalSegment() DBUG_VOID_RETURN; } //setupLocalSegment - - void SCI_Transporter::setupRemoteSegment() { DBUG_ENTER("SCI_Transporter::setupRemoteSegment"); Uint32 sharedSize = 0; sharedSize =4096; //start of the buffer is page aligned - Uint32 sizeOfBuffer = m_BufferSize; const Uint32 slack = MAX_MESSAGE_SIZE; sizeOfBuffer -= sharedSize; @@ -667,7 +568,6 @@ SCI_Transporter::init_remote() DBUG_PRINT("error", ("Error connecting segment, err 0x%x", err)); DBUG_RETURN(false); } - } // Map the remote memory segment into program space for(Uint32 i=0; i < m_adapters ; i++) { @@ -680,13 +580,14 @@ SCI_Transporter::init_remote() FLAGS, &err); - - if(err!= SCI_ERR_OK) { - DBUG_PRINT("error", ("Cannot map a segment to the remote node %d. Error code 0x%x",m_RemoteSciNodeId, err)); - //NDB SHOULD TERMINATE AND COMPUTER REBOOTED! - report_error(TE_SCI_CANNOT_MAP_REMOTESEGMENT); - DBUG_RETURN(false); - } + if(err!= SCI_ERR_OK) { + DBUG_PRINT("error", + ("Cannot map a segment to the remote node %d. Error code 0x%x", + m_RemoteSciNodeId, err)); + //NDB SHOULD TERMINATE AND COMPUTER REBOOTED! + report_error(TE_SCI_CANNOT_MAP_REMOTESEGMENT); + DBUG_RETURN(false); + } } m_mapped=true; setupRemoteSegment(); @@ -714,7 +615,6 @@ SCI_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) NDB_CLOSE_SOCKET(sockfd); DBUG_RETURN(false); } - if (!init_local()) { NDB_CLOSE_SOCKET(sockfd); DBUG_RETURN(false); @@ -789,29 +689,9 @@ sci_error_t SCI_Transporter::createSequence(Uint32 adapterid) { &(m_TargetSegm[adapterid].sequence), SCI_FLAG_FAST_BARRIER, &err); - - return err; } // createSequence() - -sci_error_t SCI_Transporter::startSequence(Uint32 adapterid) { - - sci_error_t err; - /** Perform preliminary error check on an SCI adapter before starting a - * sequence of read and write operations on the mapped segment. - */ - m_SequenceStatus = SCIStartSequence( - (m_TargetSegm[adapterid].sequence), - FLAGS, &err); - - - // If there still is an error then data cannot be safely send - return err; -} // startSequence() - - - bool SCI_Transporter::disconnectLocal() { DBUG_ENTER("SCI_Transporter::disconnectLocal"); @@ -879,9 +759,6 @@ SCI_Transporter::~SCI_Transporter() { DBUG_VOID_RETURN; } // ~SCI_Transporter() - - - void SCI_Transporter::closeSCI() { // Termination of SCI sci_error_t err; @@ -898,8 +775,9 @@ void SCI_Transporter::closeSCI() { SCIClose(activeSCIDescriptor, FLAGS, &err); if(err != SCI_ERR_OK) { - DBUG_PRINT("error", ("Cannot close SCI channel to the driver. Error code 0x%x", - err)); + DBUG_PRINT("error", + ("Cannot close SCI channel to the driver. Error code 0x%x", + err)); } SCITerminate(); DBUG_VOID_RETURN; @@ -974,7 +852,6 @@ SCI_Transporter::getConnectionStatus() { return false; } - void SCI_Transporter::setConnected() { *m_remoteStatusFlag = SCICONNECTED; @@ -984,7 +861,6 @@ SCI_Transporter::setConnected() { *m_localStatusFlag = SCICONNECTED; } - void SCI_Transporter::setDisconnect() { if(getLinkStatus(m_ActiveAdapterId)) @@ -995,7 +871,6 @@ SCI_Transporter::setDisconnect() { } } - bool SCI_Transporter::checkConnected() { if (*m_localStatusFlag == SCIDISCONNECT) { @@ -1016,8 +891,9 @@ SCI_Transporter::initSCI() { SCIInitialize(0, &error); if(error != SCI_ERR_OK) { DBUG_PRINT("error", ("Cannot initialize SISCI library.")); - DBUG_PRINT("error", ("Inconsistency between SISCI library and SISCI driver. Error code 0x%x", - error)); + DBUG_PRINT("error", + ("Inconsistency between SISCI library and SISCI driver. Error code 0x%x", + error)); DBUG_RETURN(false); } init = true; @@ -1030,3 +906,4 @@ SCI_Transporter::get_free_buffer() const { return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer(); } + diff --git a/ndb/src/common/transporter/SCI_Transporter.hpp b/ndb/src/common/transporter/SCI_Transporter.hpp index cb42e437118..f774186f238 100644 --- a/ndb/src/common/transporter/SCI_Transporter.hpp +++ b/ndb/src/common/transporter/SCI_Transporter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -55,12 +54,12 @@ * local segment, the SCI transporter connects to a segment created by another * transporter at a remote node, and the maps the remote segment into its * virtual address space. However, since NDB Cluster relies on redundancy - * at the network level, by using dual SCI adapters communica - * + * at the network level, by using dual SCI adapters communication can be + * maintained even if one of the adapter cards fails (or anything on the + * network this adapter card exists in e.g. an SCI switch failure). * */ - /** * class SCITransporter * @brief - main class for the SCI transporter. @@ -85,16 +84,6 @@ public: sci_error_t createSequence(Uint32 adapterid); - /** - * starts a sequence for error checking. - * The actual checking that a sequence is correct is done implicitly - * in SCIMemCpy (in doSend). - * @param adapterid the adapter on which to start the sequence. - * @return SCI_ERR_OK if ok, otherwize something else. - */ - sci_error_t startSequence(Uint32 adapterid); - - /** Initiate Local Segment: create a memory segment, * prepare a memory segment, map the local segment * into memory space and make segment available. @@ -160,7 +149,6 @@ private: bool m_mapped; bool m_initLocal; bool m_sciinit; - Uint32 m_swapCounter; Uint32 m_failCounter; /** * For statistics on transfered packets @@ -196,7 +184,6 @@ private: */ Uint32 m_reportFreq; - Uint32 m_adapters; Uint32 m_numberOfRemoteNodes; diff --git a/ndb/src/common/transporter/SHM_Buffer.hpp b/ndb/src/common/transporter/SHM_Buffer.hpp index 27321a3191f..aecadf23943 100644 --- a/ndb/src/common/transporter/SHM_Buffer.hpp +++ b/ndb/src/common/transporter/SHM_Buffer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index 93d718b8713..3ce21940254 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -32,7 +31,7 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, const char *lHostName, const char *rHostName, int r_port, - bool isMgmConnection, + bool isMgmConnection_arg, NodeId lNodeId, NodeId rNodeId, NodeId serverNodeId, @@ -41,7 +40,7 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, key_t _shmKey, Uint32 _shmSize) : Transporter(t_reg, tt_SHM_TRANSPORTER, - lHostName, rHostName, r_port, isMgmConnection, + lHostName, rHostName, r_port, isMgmConnection_arg, lNodeId, rNodeId, serverNodeId, 0, false, checksum, signalId), shmKey(_shmKey), diff --git a/ndb/src/common/transporter/SHM_Transporter.hpp b/ndb/src/common/transporter/SHM_Transporter.hpp index b25f9e538db..bdb31298b8b 100644 --- a/ndb/src/common/transporter/SHM_Transporter.hpp +++ b/ndb/src/common/transporter/SHM_Transporter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/SHM_Transporter.unix.cpp b/ndb/src/common/transporter/SHM_Transporter.unix.cpp index 7277f9e13ef..5cab98aa075 100644 --- a/ndb/src/common/transporter/SHM_Transporter.unix.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.unix.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/SHM_Transporter.win32.cpp b/ndb/src/common/transporter/SHM_Transporter.win32.cpp index 86029b17885..5a753179b59 100644 --- a/ndb/src/common/transporter/SHM_Transporter.win32.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.win32.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/SendBuffer.cpp b/ndb/src/common/transporter/SendBuffer.cpp index 8f69eb4bd40..c0cf81ba823 100644 --- a/ndb/src/common/transporter/SendBuffer.cpp +++ b/ndb/src/common/transporter/SendBuffer.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/SendBuffer.hpp b/ndb/src/common/transporter/SendBuffer.hpp index 7ebeb6d890e..73dda433493 100644 --- a/ndb/src/common/transporter/SendBuffer.hpp +++ b/ndb/src/common/transporter/SendBuffer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp index 5db12d3985c..c8095defd86 100644 --- a/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/ndb/src/common/transporter/TCP_Transporter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -68,14 +67,14 @@ TCP_Transporter::TCP_Transporter(TransporterRegistry &t_reg, const char *lHostName, const char *rHostName, int r_port, - bool isMgmConnection, + bool isMgmConnection_arg, NodeId lNodeId, NodeId rNodeId, NodeId serverNodeId, bool chksm, bool signalId, Uint32 _reportFreq) : Transporter(t_reg, tt_TCP_TRANSPORTER, - lHostName, rHostName, r_port, isMgmConnection, + lHostName, rHostName, r_port, isMgmConnection_arg, lNodeId, rNodeId, serverNodeId, 0, false, chksm, signalId), m_sendBuffer(sendBufSize) @@ -156,6 +155,8 @@ TCP_Transporter::initTransporter() { void TCP_Transporter::setSocketOptions(){ + int sockOptKeepAlive = 1; + if (setsockopt(theSocket, SOL_SOCKET, SO_RCVBUF, (char*)&sockOptRcvBufSize, sizeof(sockOptRcvBufSize)) < 0) { #ifdef DEBUG_TRANSPORTER @@ -170,6 +171,11 @@ TCP_Transporter::setSocketOptions(){ #endif }//if + if (setsockopt(theSocket, SOL_SOCKET, SO_KEEPALIVE, + (char*)&sockOptKeepAlive, sizeof(sockOptKeepAlive)) < 0) { + ndbout_c("The setsockopt SO_KEEPALIVE error code = %d", InetErrno); + }//if + //----------------------------------------------- // Set the TCP_NODELAY option so also small packets are sent // as soon as possible diff --git a/ndb/src/common/transporter/TCP_Transporter.hpp b/ndb/src/common/transporter/TCP_Transporter.hpp index 8223cbc6c25..7b6fd0b2323 100644 --- a/ndb/src/common/transporter/TCP_Transporter.hpp +++ b/ndb/src/common/transporter/TCP_Transporter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -34,6 +33,7 @@ struct ReceiveBuffer { Uint32 sizeOfData; // In bytes Uint32 sizeOfBuffer; + ReceiveBuffer() {} bool init(int bytes); void destroy(); diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index 383456f1077..cec018575e0 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -39,8 +38,8 @@ Transporter::Transporter(TransporterRegistry &t_reg, int _byteorder, bool _compression, bool _checksum, bool _signalId) : m_s_port(s_port), remoteNodeId(rNodeId), localNodeId(lNodeId), - isServer(lNodeId==serverNodeId), isMgmConnection(_isMgmConnection), - m_packer(_signalId, _checksum), + isServer(lNodeId==serverNodeId), + m_packer(_signalId, _checksum), isMgmConnection(_isMgmConnection), m_type(_type), m_transporter_registry(t_reg) { @@ -80,9 +79,13 @@ Transporter::Transporter(TransporterRegistry &t_reg, if (isServer) m_socket_client= 0; else + { m_socket_client= new SocketClient(remoteHostName, s_port, new SocketAuthSimple("ndbd", "ndbd passwd")); + + m_socket_client->set_connect_timeout((m_timeOutMillis+999)/1000); + } DBUG_VOID_RETURN; } @@ -104,7 +107,7 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { { struct sockaddr_in addr; SOCKET_SIZE_TYPE addrlen= sizeof(addr); - int r= getpeername(sockfd, (struct sockaddr*)&addr, &addrlen); + getpeername(sockfd, (struct sockaddr*)&addr, &addrlen); m_connect_address= (&addr)->sin_addr; } @@ -141,9 +144,9 @@ Transporter::connect_client() { } sockfd= m_socket_client->connect(); } - + return connect_client(sockfd); -} +} bool Transporter::connect_client(NDB_SOCKET_TYPE sockfd) { @@ -210,7 +213,7 @@ Transporter::connect_client(NDB_SOCKET_TYPE sockfd) { { struct sockaddr_in addr; SOCKET_SIZE_TYPE addrlen= sizeof(addr); - int r= getpeername(sockfd, (struct sockaddr*)&addr, &addrlen); + getpeername(sockfd, (struct sockaddr*)&addr, &addrlen); m_connect_address= (&addr)->sin_addr; } diff --git a/ndb/src/common/transporter/Transporter.hpp b/ndb/src/common/transporter/Transporter.hpp index 9e8bbd687ee..1a979207b0c 100644 --- a/ndb/src/common/transporter/Transporter.hpp +++ b/ndb/src/common/transporter/Transporter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp index 624b495422f..b06a41724db 100644 --- a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp +++ b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index 8294430191d..55b31becd8f 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -1418,8 +1417,6 @@ TransporterRegistry::add_transporter_interface(NodeId remoteNodeId, bool TransporterRegistry::start_service(SocketServer& socket_server) { - struct ndb_mgm_reply mgm_reply; - DBUG_ENTER("TransporterRegistry::start_service"); if (m_transporter_interface.size() > 0 && !nodeIdSpecified) { diff --git a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp index c0a437c4907..acac08155b8 100644 --- a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp +++ b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/buddy.cpp b/ndb/src/common/transporter/buddy.cpp index dc25e2dc66c..3c33f5c8f55 100644 --- a/ndb/src/common/transporter/buddy.cpp +++ b/ndb/src/common/transporter/buddy.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/buddy.hpp b/ndb/src/common/transporter/buddy.hpp index f720e9e61a1..7bb7d626c6d 100644 --- a/ndb/src/common/transporter/buddy.hpp +++ b/ndb/src/common/transporter/buddy.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp index 803029ee565..b4eca4e6ddd 100644 --- a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp +++ b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp index 71df9f12a4c..e76f8dff559 100644 --- a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp +++ b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/priotest/prioSCI/prioSCI.cpp b/ndb/src/common/transporter/priotest/prioSCI/prioSCI.cpp index 6218b764e09..ae0773eace4 100644 --- a/ndb/src/common/transporter/priotest/prioSCI/prioSCI.cpp +++ b/ndb/src/common/transporter/priotest/prioSCI/prioSCI.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/priotest/prioSHM/prioSHM.cpp b/ndb/src/common/transporter/priotest/prioSHM/prioSHM.cpp index 4c1701a91e4..ecbd53067d3 100644 --- a/ndb/src/common/transporter/priotest/prioSHM/prioSHM.cpp +++ b/ndb/src/common/transporter/priotest/prioSHM/prioSHM.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/priotest/prioTCP/prioTCP.cpp b/ndb/src/common/transporter/priotest/prioTCP/prioTCP.cpp index f993dd05ac8..ffbad231474 100644 --- a/ndb/src/common/transporter/priotest/prioTCP/prioTCP.cpp +++ b/ndb/src/common/transporter/priotest/prioTCP/prioTCP.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp index 6c5623a49a6..bc860b31872 100644 --- a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp +++ b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/transporter/priotest/prioTransporterTest.hpp b/ndb/src/common/transporter/priotest/prioTransporterTest.hpp index 787a9f46433..35bab63ef61 100644 --- a/ndb/src/common/transporter/priotest/prioTransporterTest.hpp +++ b/ndb/src/common/transporter/priotest/prioTransporterTest.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/BaseString.cpp b/ndb/src/common/util/BaseString.cpp index dbff44c377d..7e5adf0e9ef 100644 --- a/ndb/src/common/util/BaseString.cpp +++ b/ndb/src/common/util/BaseString.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -17,19 +16,36 @@ /* -*- c-basic-offset: 4; -*- */ #include <ndb_global.h> #include <BaseString.hpp> -#include <basestring_vsnprintf.h> +#include "basestring_vsnprintf.h" BaseString::BaseString() { m_chr = new char[1]; + if (m_chr == NULL) + { + errno = ENOMEM; + m_len = 0; + return; + } m_chr[0] = 0; m_len = 0; } BaseString::BaseString(const char* s) { + if (s == NULL) + { + m_chr = NULL; + m_len = 0; + } const size_t n = strlen(s); m_chr = new char[n + 1]; + if (m_chr == NULL) + { + errno = ENOMEM; + m_len = 0; + return; + } memcpy(m_chr, s, n + 1); m_len = n; } @@ -38,7 +54,20 @@ BaseString::BaseString(const BaseString& str) { const char* const s = str.m_chr; const size_t n = str.m_len; + if (s == NULL) + { + m_chr = NULL; + m_len = 0; + return; + } char* t = new char[n + 1]; + if (t == NULL) + { + errno = ENOMEM; + m_chr = NULL; + m_len = 0; + return; + } memcpy(t, s, n + 1); m_chr = t; m_len = n; @@ -52,9 +81,23 @@ BaseString::~BaseString() BaseString& BaseString::assign(const char* s) { - const size_t n = strlen(s); + if (s == NULL) + { + m_chr = NULL; + m_len = 0; + return *this; + } + size_t n = strlen(s); char* t = new char[n + 1]; - memcpy(t, s, n + 1); + if (t) + { + memcpy(t, s, n + 1); + } + else + { + errno = ENOMEM; + n = 0; + } delete[] m_chr; m_chr = t; m_len = n; @@ -65,8 +108,16 @@ BaseString& BaseString::assign(const char* s, size_t n) { char* t = new char[n + 1]; - memcpy(t, s, n); - t[n] = 0; + if (t) + { + memcpy(t, s, n); + t[n] = 0; + } + else + { + errno = ENOMEM; + n = 0; + } delete[] m_chr; m_chr = t; m_len = n; @@ -84,10 +135,19 @@ BaseString::assign(const BaseString& str, size_t n) BaseString& BaseString::append(const char* s) { - const size_t n = strlen(s); + size_t n = strlen(s); char* t = new char[m_len + n + 1]; - memcpy(t, m_chr, m_len); - memcpy(t + m_len, s, n + 1); + if (t) + { + memcpy(t, m_chr, m_len); + memcpy(t + m_len, s, n + 1); + } + else + { + errno = ENOMEM; + m_len = 0; + n = 0; + } delete[] m_chr; m_chr = t; m_len += n; @@ -131,8 +191,14 @@ BaseString::assfmt(const char *fmt, ...) l = basestring_vsnprintf(buf, sizeof(buf), fmt, ap) + 1; va_end(ap); if(l > (int)m_len) { + char *t = new char[l]; + if (t == NULL) + { + errno = ENOMEM; + return *this; + } delete[] m_chr; - m_chr = new char[l]; + m_chr = t; } va_start(ap, fmt); basestring_vsnprintf(m_chr, l, fmt, ap); @@ -156,6 +222,11 @@ BaseString::appfmt(const char *fmt, ...) l = basestring_vsnprintf(buf, sizeof(buf), fmt, ap) + 1; va_end(ap); char *tmp = new char[l]; + if (tmp == NULL) + { + errno = ENOMEM; + return *this; + } va_start(ap, fmt); basestring_vsnprintf(tmp, l, fmt, ap); va_end(ap); @@ -243,9 +314,28 @@ BaseString::argify(const char *argv0, const char *src) { Vector<char *> vargv; if(argv0 != NULL) - vargv.push_back(strdup(argv0)); + { + char *t = strdup(argv0); + if (t == NULL) + { + errno = ENOMEM; + return NULL; + } + if (vargv.push_back(t)) + { + free(t); + return NULL; + } + } char *tmp = new char[strlen(src)+1]; + if (tmp == NULL) + { + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + errno = ENOMEM; + return NULL; + } char *dst = tmp; const char *end = src + strlen(src); /* Copy characters from src to destination, while compacting them @@ -288,20 +378,48 @@ BaseString::argify(const char *argv0, const char *src) { /* Make sure the string is properly terminated */ *dst++ = '\0'; src++; - - vargv.push_back(strdup(begin)); + + { + char *t = strdup(begin); + if (t == NULL) + { + delete[] tmp; + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + errno = ENOMEM; + return NULL; + } + if (vargv.push_back(t)) + { + free(t); + delete[] tmp; + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + return NULL; + } + } } end: delete[] tmp; - vargv.push_back(NULL); + if (vargv.push_back(NULL)) + { + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + return NULL; + } /* Convert the C++ Vector into a C-vector of strings, suitable for * calling execv(). */ char **argv = (char **)malloc(sizeof(*argv) * (vargv.size())); if(argv == NULL) + { + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + errno = ENOMEM; return NULL; + } for(size_t i = 0; i < vargv.size(); i++){ argv[i] = vargv[i]; diff --git a/ndb/src/common/util/Bitmask.cpp b/ndb/src/common/util/Bitmask.cpp index 0aa39a37204..4b90e5a01f4 100644 --- a/ndb/src/common/util/Bitmask.cpp +++ b/ndb/src/common/util/Bitmask.cpp @@ -1,21 +1,21 @@ +/* Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include <Bitmask.hpp> #include <NdbOut.hpp> -static -void print(const Uint32 src[], Uint32 len, Uint32 pos = 0) -{ - printf("b'"); - for(unsigned i = 0; i<len; i++) - { - if(BitmaskImpl::get((pos + len + 31) >> 5, src, i+pos)) - printf("1"); - else - printf("0"); - if((i & 31) == 31) - printf(" "); - } -} - #ifndef __TEST_BITMASK__ void @@ -80,6 +80,21 @@ BitmaskImpl::setFieldImpl(Uint32 dst[], } #else +static +void print(const Uint32 src[], Uint32 len, Uint32 pos = 0) +{ + printf("b'"); + for(unsigned i = 0; i<len; i++) + { + if(BitmaskImpl::get((pos + len + 31) >> 5, src, i+pos)) + printf("1"); + else + printf("0"); + if((i & 31) == 31) + printf(" "); + } +} + #define DEBUG 0 #include <Vector.hpp> static void do_test(int bitmask_size); diff --git a/ndb/src/common/util/ConfigValues.cpp b/ndb/src/common/util/ConfigValues.cpp index 49fd6dd9a28..9309fe3fbd6 100644 --- a/ndb/src/common/util/ConfigValues.cpp +++ b/ndb/src/common/util/ConfigValues.cpp @@ -1,11 +1,23 @@ +/* Copyright (C) 2004, 2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <ndb_global.h> #include <ConfigValues.hpp> #include <NdbOut.hpp> #include <NdbTCP.h> -static Uint32 hash(Uint32 key, Uint32 size); -static Uint32 nextHash(Uint32 key, Uint32 size, Uint32 pos, Uint32 count); static bool findKey(const Uint32 * vals, Uint32 sz, Uint32 key, Uint32 * pos); /** @@ -76,18 +88,18 @@ bool ConfigValues::getByPos(Uint32 pos, Entry * result) const { assert(pos < (2 * m_size)); Uint32 keypart = m_values[pos]; - Uint32 val = m_values[pos+1]; + Uint32 val2 = m_values[pos+1]; switch(::getTypeOf(keypart)){ case IntType: case SectionType: - result->m_int = val; + result->m_int = val2; break; case StringType: - result->m_string = * getString(val); + result->m_string = * getString(val2); break; case Int64Type: - result->m_int64 = * get64(val); + result->m_int64 = * get64(val2); break; case InvalidType: default: diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index 52ad3a4a51e..a75fa5ae463 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -24,6 +23,18 @@ // // PUBLIC // +time_t +File_class::mtime(const char* aFileName) +{ + MY_STAT stmp; + time_t rc = 0; + + if (my_stat(aFileName, &stmp, MYF(0)) != NULL) { + rc = stmp.st_mtime; + } + + return rc; +} bool File_class::exists(const char* aFileName) @@ -33,17 +44,16 @@ File_class::exists(const char* aFileName) return (my_stat(aFileName, &stmp, MYF(0))!=NULL); } -long +off_t File_class::size(FILE* f) { - long cur_pos = 0, length = 0; - - cur_pos = ::ftell(f); - ::fseek(f, 0, SEEK_END); - length = ::ftell(f); - ::fseek(f, cur_pos, SEEK_SET); // restore original position + MY_STAT s; - return length; + // Note that my_fstat behaves *differently* than my_stat. ARGGGHH! + if(my_fstat(::fileno(f), &s, MYF(0))) + return 0; + + return s.st_size; } bool @@ -111,13 +121,25 @@ bool File_class::close() { bool rc = true; + int retval = 0; + if (m_file != NULL) { ::fflush(m_file); - rc = (::fclose(m_file) == 0 ? true : false); - m_file = NULL; // Try again? + retval = ::fclose(m_file); + while ( (retval != 0) && (errno == EINTR) ){ + retval = ::fclose(m_file); + } + if( retval == 0){ + rc = true; + } + else { + rc = false; + ndbout_c("ERROR: Close file error in File.cpp for %s",strerror(errno)); + } } - + m_file = NULL; + return rc; } @@ -140,9 +162,9 @@ File_class::readChar(char* buf) } int -File_class::write(const void* buf, size_t size, size_t nitems) +File_class::write(const void* buf, size_t size_arg, size_t nitems) { - return ::fwrite(buf, size, nitems, m_file); + return ::fwrite(buf, size_arg, nitems, m_file); } int @@ -156,8 +178,8 @@ File_class::writeChar(const char* buf) { return writeChar(buf, 0, ::strlen(buf)); } - -long + +off_t File_class::size() const { return File_class::size(m_file); @@ -176,10 +198,6 @@ File_class::flush() const ::fflush(m_file); return ::fsync(::fileno(m_file)); #else - return 0; + return ::fflush(m_file);; #endif } - -// -// PRIVATE -// diff --git a/ndb/src/common/util/InputStream.cpp b/ndb/src/common/util/InputStream.cpp index befd5cbf82a..b74144dc135 100644 --- a/ndb/src/common/util/InputStream.cpp +++ b/ndb/src/common/util/InputStream.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -36,20 +35,34 @@ FileInputStream::gets(char * buf, int bufLen){ SocketInputStream::SocketInputStream(NDB_SOCKET_TYPE socket, unsigned readTimeout) - : m_socket(socket) { - m_timeout = readTimeout; + : m_socket(socket) { + m_startover= true; + m_timeout = readTimeout; } -char* +char* SocketInputStream::gets(char * buf, int bufLen) { - buf[0] = 77; assert(bufLen >= 2); - int res = readln_socket(m_socket, m_timeout, buf, bufLen - 1); + int offset= 0; + if(m_startover) + { + buf[0]= '\0'; + m_startover= false; + } + else + offset= strlen(buf); + + int res = readln_socket(m_socket, m_timeout, buf+offset, bufLen-offset); + + if(res == 0) + { + buf[0]=0; + return buf; + } + + m_startover= true; + if(res == -1) return 0; - if(res == 0 && buf[0] == 77) - { // select return 0 - buf[0] = 0; - } return buf; } diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am index 75a1d970f7a..4cc2e49f9ec 100644 --- a/ndb/src/common/util/Makefile.am +++ b/ndb/src/common/util/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LTLIBRARIES = libgeneral.la diff --git a/ndb/src/common/util/NdbErrHnd.cpp b/ndb/src/common/util/NdbErrHnd.cpp index 38a67f29853..bfe163453ae 100644 --- a/ndb/src/common/util/NdbErrHnd.cpp +++ b/ndb/src/common/util/NdbErrHnd.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/NdbOut.cpp b/ndb/src/common/util/NdbOut.cpp index e20119a7987..7ca7c91e266 100644 --- a/ndb/src/common/util/NdbOut.cpp +++ b/ndb/src/common/util/NdbOut.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index ba451c4dd8b..0f62d66c149 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -682,8 +681,6 @@ int NdbSqlUtil::cmpBit(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full) { Uint32 n = (n1 < n2) ? n1 : n2; - char* c1 = (char*)p1; - char* c2 = (char*)p2; int ret = memcmp(p1, p2, n); return ret; } diff --git a/ndb/src/common/util/OutputStream.cpp b/ndb/src/common/util/OutputStream.cpp index a41eef649dd..eada1452f02 100644 --- a/ndb/src/common/util/OutputStream.cpp +++ b/ndb/src/common/util/OutputStream.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -43,16 +42,16 @@ FileOutputStream::println(const char * fmt, ...){ } SocketOutputStream::SocketOutputStream(NDB_SOCKET_TYPE socket, - unsigned timeout){ + unsigned write_timeout_ms){ m_socket = socket; - m_timeout = timeout; + m_timeout_ms = write_timeout_ms; } int SocketOutputStream::print(const char * fmt, ...){ va_list ap; va_start(ap, fmt); - const int ret = vprint_socket(m_socket, m_timeout, fmt, ap); + const int ret = vprint_socket(m_socket, m_timeout_ms, fmt, ap); va_end(ap); return ret; } @@ -60,7 +59,7 @@ int SocketOutputStream::println(const char * fmt, ...){ va_list ap; va_start(ap, fmt); - const int ret = vprintln_socket(m_socket, m_timeout, fmt, ap); + const int ret = vprintln_socket(m_socket, m_timeout_ms, fmt, ap); va_end(ap); return ret; } diff --git a/ndb/src/common/util/Parser.cpp b/ndb/src/common/util/Parser.cpp index 3a86ae8f318..499b4471751 100644 --- a/ndb/src/common/util/Parser.cpp +++ b/ndb/src/common/util/Parser.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -148,21 +147,26 @@ ParserImpl::run(Context * ctx, const class Properties ** pDst, bool ownStop = false; if(stop == 0) stop = &ownStop; - + ctx->m_aliasUsed.clear(); - + const unsigned sz = sizeof(ctx->m_tokenBuffer); ctx->m_currentToken = input.gets(ctx->m_tokenBuffer, sz); if(Eof(ctx->m_currentToken)){ ctx->m_status = Parser<Dummy>::Eof; DBUG_RETURN(false); } - - if(ctx->m_currentToken[0] == 0){ + + int last= strlen(ctx->m_currentToken); + if(last>0) + last--; + + if(ctx->m_currentToken[last] !='\n'){ ctx->m_status = Parser<Dummy>::NoLine; + ctx->m_tokenBuffer[0]= '\0'; DBUG_RETURN(false); } - + if(Empty(ctx->m_currentToken)){ ctx->m_status = Parser<Dummy>::EmptyLine; DBUG_RETURN(false); @@ -174,14 +178,14 @@ ParserImpl::run(Context * ctx, const class Properties ** pDst, ctx->m_status = Parser<Dummy>::UnknownCommand; DBUG_RETURN(false); } - + Properties * p = new Properties(); - + bool invalidArgument = false; ctx->m_currentToken = input.gets(ctx->m_tokenBuffer, sz); - - while((! * stop) && - !Eof(ctx->m_currentToken) && + + while((! * stop) && + !Eof(ctx->m_currentToken) && !Empty(ctx->m_currentToken)){ if(ctx->m_currentToken[0] != 0){ trim(ctx->m_currentToken); @@ -193,7 +197,7 @@ ParserImpl::run(Context * ctx, const class Properties ** pDst, } ctx->m_currentToken = input.gets(ctx->m_tokenBuffer, sz); } - + if(invalidArgument){ char buf[sz]; char * tmp; @@ -204,13 +208,13 @@ ParserImpl::run(Context * ctx, const class Properties ** pDst, } DBUG_RETURN(false); } - + if(* stop){ delete p; ctx->m_status = Parser<Dummy>::ExternalStop; DBUG_RETURN(false); } - + if(!checkMandatory(ctx, p)){ ctx->m_status = Parser<Dummy>::MissingMandatoryArgument; delete p; @@ -226,9 +230,9 @@ ParserImpl::run(Context * ctx, const class Properties ** pDst, tmp.put("name", alias->name); tmp.put("realName", alias->realName); p->put("$ALIAS", i, &tmp); - } + } p->put("$ALIAS", ctx->m_aliasUsed.size()); - + ctx->m_status = Parser<Dummy>::Ok; * pDst = p; DBUG_RETURN(true); diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp index 0edcda0e726..11a1d8690ae 100644 --- a/ndb/src/common/util/Properties.cpp +++ b/ndb/src/common/util/Properties.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -628,11 +627,11 @@ PropertiesImpl::getPropsPut(const char * name, if(nvp == 0){ Properties * tmpP = new Properties(); PropertyImpl * tmpPI = new PropertyImpl(tmp2, tmpP); - PropertyImpl * nvp = put(tmpPI); + PropertyImpl * nvp2 = put(tmpPI); delete tmpP; free(tmp2); - return ((Properties*)nvp->value)->impl->getPropsPut(tmp+1, impl); + return ((Properties*)nvp2->value)->impl->getPropsPut(tmp+1, impl); } free(tmp2); if(nvp->valueType != PropertiesType_Properties){ diff --git a/ndb/src/common/util/SimpleProperties.cpp b/ndb/src/common/util/SimpleProperties.cpp index c9251c6a854..813b38dffd7 100644 --- a/ndb/src/common/util/SimpleProperties.cpp +++ b/ndb/src/common/util/SimpleProperties.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -267,7 +266,7 @@ SimpleProperties::pack(Writer & it, const void * __src, const char * src_len = _src + _map[i].Length_Offset; Uint32 len = *((Uint32*)src_len); if(!ignoreMinMax){ - if(len == _map[i].maxValue) + if(len > _map[i].maxValue) return ValueTooHigh; } ok = it.add(_map[i].Key, src, len); @@ -276,7 +275,7 @@ SimpleProperties::pack(Writer & it, const void * __src, case SimpleProperties::StringValue: if(!ignoreMinMax){ size_t len = strlen(src); - if(len == _map[i].maxValue) + if(len > _map[i].maxValue) return ValueTooHigh; } ok = it.add(_map[i].Key, src); diff --git a/ndb/src/common/util/SocketAuthenticator.cpp b/ndb/src/common/util/SocketAuthenticator.cpp index aed4db39231..2f939da6387 100644 --- a/ndb/src/common/util/SocketAuthenticator.cpp +++ b/ndb/src/common/util/SocketAuthenticator.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/SocketClient.cpp b/ndb/src/common/util/SocketClient.cpp index f4f2babf312..3d1fd07d581 100644 --- a/ndb/src/common/util/SocketClient.cpp +++ b/ndb/src/common/util/SocketClient.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -27,6 +26,7 @@ SocketClient::SocketClient(const char *server_name, unsigned short port, SocketA m_port= port; m_server_name= server_name ? strdup(server_name) : 0; m_sockfd= NDB_INVALID_SOCKET; + m_connect_timeout_sec= 0; } SocketClient::~SocketClient() @@ -59,7 +59,7 @@ SocketClient::init() if (m_sockfd == NDB_INVALID_SOCKET) { return false; } - + DBUG_PRINT("info",("NDB_SOCKET: %d", m_sockfd)); return true; @@ -88,7 +88,7 @@ SocketClient::bind(const char* bindaddress, unsigned short localport) int ret = errno; NDB_CLOSE_SOCKET(m_sockfd); m_sockfd= NDB_INVALID_SOCKET; - return errno; + return ret; } if (::bind(m_sockfd, (struct sockaddr*)&local, sizeof(local)) == -1) @@ -105,6 +105,13 @@ SocketClient::bind(const char* bindaddress, unsigned short localport) NDB_SOCKET_TYPE SocketClient::connect(const char *toaddress, unsigned short toport) { + fd_set rset, wset; + struct timeval tval; + int r; + bool use_timeout; + SOCKOPT_OPTLEN_TYPE len; + int flags; + if (m_sockfd == NDB_INVALID_SOCKET) { if (!init()) { @@ -128,14 +135,58 @@ SocketClient::connect(const char *toaddress, unsigned short toport) if (Ndb_getInAddr(&m_servaddr.sin_addr, m_server_name)) return NDB_INVALID_SOCKET; } - - const int r = ::connect(m_sockfd, (struct sockaddr*) &m_servaddr, sizeof(m_servaddr)); - if (r == -1) { + + flags= fcntl(m_sockfd, F_GETFL, 0); + fcntl(m_sockfd, F_SETFL, flags | O_NONBLOCK); + + r= ::connect(m_sockfd, (struct sockaddr*) &m_servaddr, sizeof(m_servaddr)); + + if (r == 0) + goto done; // connected immediately. + + if (r < 0 && (errno != EINPROGRESS)) { + NDB_CLOSE_SOCKET(m_sockfd); + m_sockfd= NDB_INVALID_SOCKET; + return NDB_INVALID_SOCKET; + } + + FD_ZERO(&rset); + FD_SET(m_sockfd, &rset); + wset= rset; + tval.tv_sec= m_connect_timeout_sec; + tval.tv_usec= 0; + use_timeout= m_connect_timeout_sec; + + if ((r= select(m_sockfd+1, &rset, &wset, NULL, + use_timeout? &tval : NULL)) == 0) + { NDB_CLOSE_SOCKET(m_sockfd); m_sockfd= NDB_INVALID_SOCKET; return NDB_INVALID_SOCKET; } + if (FD_ISSET(m_sockfd, &rset) || FD_ISSET(m_sockfd, &wset)) + { + len= sizeof(r); + if (getsockopt(m_sockfd, SOL_SOCKET, SO_ERROR, &r, &len) < 0 || r) + { + // Solaris got an error... different than others + NDB_CLOSE_SOCKET(m_sockfd); + m_sockfd= NDB_INVALID_SOCKET; + return NDB_INVALID_SOCKET; + } + } + else + { + // select error, probably m_sockfd not set. + NDB_CLOSE_SOCKET(m_sockfd); + m_sockfd= NDB_INVALID_SOCKET; + return NDB_INVALID_SOCKET; + } + +done: + fcntl(m_sockfd, F_SETFL, flags); + if (m_auth) { if (!m_auth->client_authenticate(m_sockfd)) { diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp index f9d2c7463be..ab05a988c14 100644 --- a/ndb/src/common/util/SocketServer.cpp +++ b/ndb/src/common/util/SocketServer.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c index f5d01fb1532..07762a4e503 100644 --- a/ndb/src/common/util/basestring_vsnprintf.c +++ b/ndb/src/common/util/basestring_vsnprintf.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/filetest/FileUnitTest.cpp b/ndb/src/common/util/filetest/FileUnitTest.cpp index b6e7b7e8ec0..35b86623351 100644 --- a/ndb/src/common/util/filetest/FileUnitTest.cpp +++ b/ndb/src/common/util/filetest/FileUnitTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/filetest/FileUnitTest.hpp b/ndb/src/common/util/filetest/FileUnitTest.hpp index a589615e9b2..231c5919244 100644 --- a/ndb/src/common/util/filetest/FileUnitTest.hpp +++ b/ndb/src/common/util/filetest/FileUnitTest.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/md5_hash.cpp b/ndb/src/common/util/md5_hash.cpp index d4eedbc40fb..4b5c5623886 100644 --- a/ndb/src/common/util/md5_hash.cpp +++ b/ndb/src/common/util/md5_hash.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/ndb_init.c b/ndb/src/common/util/ndb_init.c index f3aa734d7f9..8b5bbf79bb2 100644 --- a/ndb/src/common/util/ndb_init.c +++ b/ndb/src/common/util/ndb_init.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/new.cpp b/ndb/src/common/util/new.cpp index 643800f1582..bc9db0d749f 100644 --- a/ndb/src/common/util/new.cpp +++ b/ndb/src/common/util/new.cpp @@ -1,3 +1,17 @@ +/* Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <ndb_global.h> #include <NdbMem.h> diff --git a/ndb/src/common/util/random.c b/ndb/src/common/util/random.c index 21235763793..20ef537d89a 100644 --- a/ndb/src/common/util/random.c +++ b/ndb/src/common/util/random.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -198,7 +197,7 @@ int initSequence(RandomSequence *seq, SequenceValues *inputValues) unsigned int i; unsigned int j; unsigned int totalLength; - unsigned int index; + unsigned int idx; if( !seq || !inputValues ) return(-1); @@ -220,12 +219,12 @@ int initSequence(RandomSequence *seq, SequenceValues *inputValues) /*----------------------*/ /* set the array values */ /*----------------------*/ - index = 0; + idx = 0; for(i = 0; inputValues[i].length != 0; i++) { for(j = 0; j < inputValues[i].length; j++ ) { - seq->values[index] = inputValues[i].value; - index++; + seq->values[idx] = inputValues[i].value; + idx++; } } diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp index 9401d1cd6d0..2dd2a9f31a8 100644 --- a/ndb/src/common/util/socket_io.cpp +++ b/ndb/src/common/util/socket_io.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -165,8 +164,8 @@ write_socket(NDB_SOCKET_TYPE socket, int timeout_millis, FD_SET(socket, &writeset); timeout.tv_sec = 1; timeout.tv_usec = 0; - const int selectRes = select(socket + 1, 0, &writeset, 0, &timeout); - if(selectRes != 1){ + const int selectRes2 = select(socket + 1, 0, &writeset, 0, &timeout); + if(selectRes2 != 1){ return -1; } } diff --git a/ndb/src/common/util/strdup.c b/ndb/src/common/util/strdup.c index d8f4d99bd28..d26b94fdb25 100644 --- a/ndb/src/common/util/strdup.c +++ b/ndb/src/common/util/strdup.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/testConfigValues/testConfigValues.cpp b/ndb/src/common/util/testConfigValues/testConfigValues.cpp index 362deb1ddad..b887808c62e 100644 --- a/ndb/src/common/util/testConfigValues/testConfigValues.cpp +++ b/ndb/src/common/util/testConfigValues/testConfigValues.cpp @@ -1,3 +1,18 @@ +/* Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include <ConfigValues.hpp> #include <NdbOut.hpp> #include <stdlib.h> diff --git a/ndb/src/common/util/testProperties/testProperties.cpp b/ndb/src/common/util/testProperties/testProperties.cpp index e445f7ca3e4..c4120e92400 100644 --- a/ndb/src/common/util/testProperties/testProperties.cpp +++ b/ndb/src/common/util/testProperties/testProperties.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/testSimpleProperties/sp_test.cpp b/ndb/src/common/util/testSimpleProperties/sp_test.cpp index d4052b64132..ebc445a77ad 100644 --- a/ndb/src/common/util/testSimpleProperties/sp_test.cpp +++ b/ndb/src/common/util/testSimpleProperties/sp_test.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/uucode.c b/ndb/src/common/util/uucode.c index da34d565153..ad2db2fcbbe 100644 --- a/ndb/src/common/util/uucode.c +++ b/ndb/src/common/util/uucode.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 8076db576c2..e3c9f104efa 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/Makefile.am b/ndb/src/cw/Makefile.am index 7348fc9eab6..d9a40002062 100644 --- a/ndb/src/cw/Makefile.am +++ b/ndb/src/cw/Makefile.am @@ -1,4 +1,21 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SUBDIRS = cpcd windoze-dsp: +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/src/cw/cpcc-win32/C++/CPC_GUI.cpp b/ndb/src/cw/cpcc-win32/C++/CPC_GUI.cpp index 59ee3e90451..b1d599dda63 100644 --- a/ndb/src/cw/cpcc-win32/C++/CPC_GUI.cpp +++ b/ndb/src/cw/cpcc-win32/C++/CPC_GUI.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcc-win32/C++/CPC_GUI.h b/ndb/src/cw/cpcc-win32/C++/CPC_GUI.h index cf7670948a7..692248cf9ea 100644 --- a/ndb/src/cw/cpcc-win32/C++/CPC_GUI.h +++ b/ndb/src/cw/cpcc-win32/C++/CPC_GUI.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcc-win32/C++/CPC_GUI.vcproj b/ndb/src/cw/cpcc-win32/C++/CPC_GUI.vcproj index 56f9f3a8511..fb1e2fd601c 100644 --- a/ndb/src/cw/cpcc-win32/C++/CPC_GUI.vcproj +++ b/ndb/src/cw/cpcc-win32/C++/CPC_GUI.vcproj @@ -12,8 +12,8 @@ <Configurations> <Configuration Name="Release|Win32" - OutputDirectory=".\Release" - IntermediateDirectory=".\Release" + OutputDirectory=".\release_obj" + IntermediateDirectory=".\release_obj" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" @@ -27,10 +27,10 @@ EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" PrecompiledHeaderThrough="stdafx.h" - PrecompiledHeaderFile=".\Release/CPC_GUI.pch" - AssemblerListingLocation=".\Release/" - ObjectFile=".\Release/" - ProgramDataBaseFileName=".\Release/" + PrecompiledHeaderFile=".\release_obj/CPC_GUI.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE"/> <Tool @@ -39,10 +39,10 @@ Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" AdditionalDependencies="mfc42.lib" - OutputFile=".\Release/CPC_GUI.exe" + OutputFile=".\release_obj/CPC_GUI.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" - ProgramDatabaseFile=".\Release/CPC_GUI.pdb" + ProgramDatabaseFile=".\release_obj/CPC_GUI.pdb" SubSystem="2"/> <Tool Name="VCMIDLTool" @@ -50,7 +50,7 @@ MkTypLibCompatible="TRUE" SuppressStartupBanner="TRUE" TargetEnvironment="1" - TypeLibraryName=".\Release/CPC_GUI.tlb"/> + TypeLibraryName=".\release_obj/CPC_GUI.tlb"/> <Tool Name="VCPostBuildEventTool"/> <Tool @@ -68,8 +68,8 @@ </Configuration> <Configuration Name="Debug|Win32" - OutputDirectory=".\Debug" - IntermediateDirectory=".\Debug" + OutputDirectory=".\debug_obj" + IntermediateDirectory=".\debug_obj" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" @@ -82,10 +82,10 @@ RuntimeLibrary="5" UsePrecompiledHeader="3" PrecompiledHeaderThrough="stdafx.h" - PrecompiledHeaderFile=".\Debug/CPC_GUI.pch" - AssemblerListingLocation=".\Debug/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" + PrecompiledHeaderFile=".\debug_obj/CPC_GUI.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="TRUE" @@ -96,11 +96,11 @@ Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" AdditionalDependencies="comctl32.lib mfc70d.lib" - OutputFile=".\Debug/CPC_GUI.exe" - LinkIncremental="2" + OutputFile=".\debug_obj/CPC_GUI.exe" + LinkIncremental="1" SuppressStartupBanner="TRUE" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\Debug/CPC_GUI.pdb" + ProgramDatabaseFile=".\debug_obj/CPC_GUI.pdb" SubSystem="2"/> <Tool Name="VCMIDLTool" @@ -108,7 +108,7 @@ MkTypLibCompatible="TRUE" SuppressStartupBanner="TRUE" TargetEnvironment="1" - TypeLibraryName=".\Debug/CPC_GUI.tlb"/> + TypeLibraryName=".\debug_obj/CPC_GUI.tlb"/> <Tool Name="VCPostBuildEventTool"/> <Tool diff --git a/ndb/src/cw/cpcc-win32/C++/NdbControls.cpp b/ndb/src/cw/cpcc-win32/C++/NdbControls.cpp index 6bbc9a9859b..8feadf9462c 100644 --- a/ndb/src/cw/cpcc-win32/C++/NdbControls.cpp +++ b/ndb/src/cw/cpcc-win32/C++/NdbControls.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcc-win32/C++/StdAfx.cpp b/ndb/src/cw/cpcc-win32/C++/StdAfx.cpp index 8fcdb4ce158..2515c6f1b54 100644 --- a/ndb/src/cw/cpcc-win32/C++/StdAfx.cpp +++ b/ndb/src/cw/cpcc-win32/C++/StdAfx.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcc-win32/C++/StdAfx.h b/ndb/src/cw/cpcc-win32/C++/StdAfx.h index 370d04fb466..830735d4c09 100644 --- a/ndb/src/cw/cpcc-win32/C++/StdAfx.h +++ b/ndb/src/cw/cpcc-win32/C++/StdAfx.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcc-win32/C++/TreeView.cpp b/ndb/src/cw/cpcc-win32/C++/TreeView.cpp index db5c62f14bb..28cd75550c8 100644 --- a/ndb/src/cw/cpcc-win32/C++/TreeView.cpp +++ b/ndb/src/cw/cpcc-win32/C++/TreeView.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcc-win32/C++/TreeView.h b/ndb/src/cw/cpcc-win32/C++/TreeView.h index 595f9bd6cdc..6e87f3819de 100644 --- a/ndb/src/cw/cpcc-win32/C++/TreeView.h +++ b/ndb/src/cw/cpcc-win32/C++/TreeView.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcc-win32/C++/resource.h b/ndb/src/cw/cpcc-win32/C++/resource.h index 0bec552edf6..9bcd7d53b6f 100644 --- a/ndb/src/cw/cpcc-win32/C++/resource.h +++ b/ndb/src/cw/cpcc-win32/C++/resource.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcd/APIService.cpp b/ndb/src/cw/cpcd/APIService.cpp index e7a2092c15d..1c1cfb94cd4 100644 --- a/ndb/src/cw/cpcd/APIService.cpp +++ b/ndb/src/cw/cpcd/APIService.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -390,7 +389,6 @@ CPCDAPISession::listProcesses(Parser_t::Context & /* unused */, void CPCDAPISession::showVersion(Parser_t::Context & /* unused */, const class Properties & args){ - Uint32 id; CPCD::RequestStatus rs; m_output->println("show version"); diff --git a/ndb/src/cw/cpcd/APIService.hpp b/ndb/src/cw/cpcd/APIService.hpp index 3586d64187e..c13d0d886b4 100644 --- a/ndb/src/cw/cpcd/APIService.hpp +++ b/ndb/src/cw/cpcd/APIService.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcd/CPCD.cpp b/ndb/src/cw/cpcd/CPCD.cpp index 69a7b840528..24afb0ea0b5 100644 --- a/ndb/src/cw/cpcd/CPCD.cpp +++ b/ndb/src/cw/cpcd/CPCD.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcd/CPCD.hpp b/ndb/src/cw/cpcd/CPCD.hpp index aecc43150c4..2cada43b609 100644 --- a/ndb/src/cw/cpcd/CPCD.hpp +++ b/ndb/src/cw/cpcd/CPCD.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -63,6 +62,7 @@ struct CPCEvent { struct EventSubscriber { virtual void report(const CPCEvent &) = 0; + virtual ~EventSubscriber() {} }; /** diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am index 75f557b2af7..a4fc65a8403 100644 --- a/ndb/src/cw/cpcd/Makefile.am +++ b/ndb/src/cw/cpcd/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ndbbin_PROGRAMS = ndb_cpcd diff --git a/ndb/src/cw/cpcd/Monitor.cpp b/ndb/src/cw/cpcd/Monitor.cpp index 141de926d4d..7afbb8d7959 100644 --- a/ndb/src/cw/cpcd/Monitor.cpp +++ b/ndb/src/cw/cpcd/Monitor.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp index 431c96e3320..de61e54888d 100644 --- a/ndb/src/cw/cpcd/Process.cpp +++ b/ndb/src/cw/cpcd/Process.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcd/common.cpp b/ndb/src/cw/cpcd/common.cpp index 53c0e4d5a64..aaadaeed2e3 100644 --- a/ndb/src/cw/cpcd/common.cpp +++ b/ndb/src/cw/cpcd/common.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcd/common.hpp b/ndb/src/cw/cpcd/common.hpp index 4f5f702762f..044a7eb67c3 100644 --- a/ndb/src/cw/cpcd/common.hpp +++ b/ndb/src/cw/cpcd/common.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/cpcd/main.cpp b/ndb/src/cw/cpcd/main.cpp index c320f07ef04..f23a92b8010 100644 --- a/ndb/src/cw/cpcd/main.cpp +++ b/ndb/src/cw/cpcd/main.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -75,13 +74,13 @@ extern "C" static void sig_child(int signo, siginfo_t*, void*); const char *progname = "ndb_cpcd"; int main(int argc, char** argv){ - int save_argc= argc; - char** save_argv= argv; const char *load_default_groups[]= { "ndb_cpcd",0 }; MY_INIT(argv[0]); load_defaults("ndb_cpcd",load_default_groups,&argc,&argv); if (handle_options(&argc, &argv, my_long_options, get_one_option)) { + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); exit(1); diff --git a/ndb/src/cw/test/socketclient/socketClientTest.cpp b/ndb/src/cw/test/socketclient/socketClientTest.cpp index 423c196aa43..a3da256a7ad 100644 --- a/ndb/src/cw/test/socketclient/socketClientTest.cpp +++ b/ndb/src/cw/test/socketclient/socketClientTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/util/ClientInterface.cpp b/ndb/src/cw/util/ClientInterface.cpp index 627b622f1dd..bc74698de76 100644 --- a/ndb/src/cw/util/ClientInterface.cpp +++ b/ndb/src/cw/util/ClientInterface.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/util/ClientInterface.hpp b/ndb/src/cw/util/ClientInterface.hpp index 66ecfe05197..3496595145e 100644 --- a/ndb/src/cw/util/ClientInterface.hpp +++ b/ndb/src/cw/util/ClientInterface.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/util/SocketRegistry.cpp b/ndb/src/cw/util/SocketRegistry.cpp index 1dbb402f7c9..ab94f772501 100644 --- a/ndb/src/cw/util/SocketRegistry.cpp +++ b/ndb/src/cw/util/SocketRegistry.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/util/SocketRegistry.hpp b/ndb/src/cw/util/SocketRegistry.hpp index 2b079156967..0166232d4c8 100644 --- a/ndb/src/cw/util/SocketRegistry.hpp +++ b/ndb/src/cw/util/SocketRegistry.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/util/SocketService.cpp b/ndb/src/cw/util/SocketService.cpp index b993ec8c2c1..7b423e5546e 100644 --- a/ndb/src/cw/util/SocketService.cpp +++ b/ndb/src/cw/util/SocketService.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/cw/util/SocketService.hpp b/ndb/src/cw/util/SocketService.hpp index 7a0c3a2fd91..770d5d8ec96 100644 --- a/ndb/src/cw/util/SocketService.hpp +++ b/ndb/src/cw/util/SocketService.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am index 389cb85c1d8..860acf39830 100644 --- a/ndb/src/kernel/Makefile.am +++ b/ndb/src/kernel/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SUBDIRS = error blocks vm include $(top_srcdir)/ndb/config/common.mk.am @@ -9,21 +24,21 @@ ndbd_SOURCES = main.cpp SimBlockList.cpp include $(top_srcdir)/ndb/config/type_kernel.mk.am INCLUDES += \ - -Iblocks/cmvmi \ - -Iblocks/dbacc \ - -Iblocks/dbdict \ - -Iblocks/dbdih \ - -Iblocks/dblqh \ - -Iblocks/dbtc \ - -Iblocks/dbtup \ - -Iblocks/ndbfs \ - -Iblocks/ndbcntr \ - -Iblocks/qmgr \ - -Iblocks/trix \ - -Iblocks/backup \ - -Iblocks/dbutil \ - -Iblocks/suma \ - -Iblocks/dbtux + -I$(srcdir)/blocks/cmvmi \ + -I$(srcdir)/blocks/dbacc \ + -I$(srcdir)/blocks/dbdict \ + -I$(srcdir)/blocks/dbdih \ + -I$(srcdir)/blocks/dblqh \ + -I$(srcdir)/blocks/dbtc \ + -I$(srcdir)/blocks/dbtup \ + -I$(srcdir)/blocks/ndbfs \ + -I$(srcdir)/blocks/ndbcntr \ + -I$(srcdir)/blocks/qmgr \ + -I$(srcdir)/blocks/trix \ + -I$(srcdir)/blocks/backup \ + -I$(srcdir)/blocks/dbutil \ + -I$(srcdir)/blocks/suma \ + -I$(srcdir)/blocks/dbtux LDADD += \ blocks/cmvmi/libcmvmi.a \ diff --git a/ndb/src/kernel/SimBlockList.cpp b/ndb/src/kernel/SimBlockList.cpp index 271d515dc92..b585a3a17d1 100644 --- a/ndb/src/kernel/SimBlockList.cpp +++ b/ndb/src/kernel/SimBlockList.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/Makefile.am b/ndb/src/kernel/blocks/Makefile.am index 8addf257003..9c7227fa0bf 100644 --- a/ndb/src/kernel/blocks/Makefile.am +++ b/ndb/src/kernel/blocks/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SUBDIRS = \ cmvmi \ dbacc \ @@ -16,3 +31,6 @@ SUBDIRS = \ dbtux windoze-dsp: + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp index ed06413f8e0..70721bfca56 100644 --- a/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/ndb/src/kernel/blocks/backup/Backup.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -272,38 +271,50 @@ Backup::execCONTINUEB(Signal* signal) Uint32 tabPtr_I = Tdata2; Uint32 fragPtr_I = signal->theData[3]; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptr_I); - TablePtr tabPtr; - ptr.p->tables.getPtr(tabPtr, tabPtr_I); - FragmentPtr fragPtr; - tabPtr.p->fragments.getPtr(fragPtr, fragPtr_I); - - BackupFilePtr filePtr; - ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr); - const Uint32 sz = sizeof(BackupFormat::CtlFile::FragmentInfo) >> 2; - Uint32 * dst; - if (!filePtr.p->operation.dataBuffer.getWritePtr(&dst, sz)) + if (tabPtr_I == RNIL) { - sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 4); + closeFiles(signal, ptr); return; } + jam(); + TablePtr tabPtr; + ptr.p->tables.getPtr(tabPtr, tabPtr_I); + jam(); + if(tabPtr.p->fragments.getSize()) + { + FragmentPtr fragPtr; + tabPtr.p->fragments.getPtr(fragPtr, fragPtr_I); + + BackupFilePtr filePtr; + ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr); + + const Uint32 sz = sizeof(BackupFormat::CtlFile::FragmentInfo) >> 2; + Uint32 * dst; + if (!filePtr.p->operation.dataBuffer.getWritePtr(&dst, sz)) + { + sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 4); + return; + } - BackupFormat::CtlFile::FragmentInfo * fragInfo = - (BackupFormat::CtlFile::FragmentInfo*)dst; - fragInfo->SectionType = htonl(BackupFormat::FRAGMENT_INFO); - fragInfo->SectionLength = htonl(sz); - fragInfo->TableId = htonl(fragPtr.p->tableId); - fragInfo->FragmentNo = htonl(fragPtr_I); - fragInfo->NoOfRecordsLow = htonl(fragPtr.p->noOfRecords & 0xFFFFFFFF); - fragInfo->NoOfRecordsHigh = htonl(fragPtr.p->noOfRecords >> 32); - fragInfo->FilePosLow = htonl(0 & 0xFFFFFFFF); - fragInfo->FilePosHigh = htonl(0 >> 32); + BackupFormat::CtlFile::FragmentInfo * fragInfo = + (BackupFormat::CtlFile::FragmentInfo*)dst; + fragInfo->SectionType = htonl(BackupFormat::FRAGMENT_INFO); + fragInfo->SectionLength = htonl(sz); + fragInfo->TableId = htonl(fragPtr.p->tableId); + fragInfo->FragmentNo = htonl(fragPtr_I); + fragInfo->NoOfRecordsLow = htonl(fragPtr.p->noOfRecords & 0xFFFFFFFF); + fragInfo->NoOfRecordsHigh = htonl(fragPtr.p->noOfRecords >> 32); + fragInfo->FilePosLow = htonl(0 & 0xFFFFFFFF); + fragInfo->FilePosHigh = htonl(0); - filePtr.p->operation.dataBuffer.updateWritePtr(sz); + filePtr.p->operation.dataBuffer.updateWritePtr(sz); + + fragPtr_I++; + } - fragPtr_I++; if (fragPtr_I == tabPtr.p->fragments.getSize()) { signal->theData[0] = tabPtr.p->tableId; @@ -329,7 +340,7 @@ Backup::execCONTINUEB(Signal* signal) case BackupContinueB::BUFFER_UNDERFLOW: { jam(); - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, Tdata1); checkFile(signal, filePtr); return; @@ -338,7 +349,7 @@ Backup::execCONTINUEB(Signal* signal) case BackupContinueB::BUFFER_FULL_SCAN: { jam(); - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, Tdata1); checkScan(signal, filePtr); return; @@ -347,7 +358,7 @@ Backup::execCONTINUEB(Signal* signal) case BackupContinueB::BUFFER_FULL_FRAG_COMPLETE: { jam(); - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, Tdata1); fragmentCompleted(signal, filePtr); return; @@ -356,7 +367,7 @@ Backup::execCONTINUEB(Signal* signal) case BackupContinueB::BUFFER_FULL_META: { jam(); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, Tdata1); BackupFilePtr filePtr; @@ -365,7 +376,7 @@ Backup::execCONTINUEB(Signal* signal) if(buf.getFreeSize() + buf.getMinRead() < buf.getUsableSize()) { jam(); - TablePtr tabPtr; + TablePtr tabPtr LINT_SET_PTR; c_tablePool.getPtr(tabPtr, Tdata2); DEBUG_OUT("Backup - Buffer full - " << buf.getFreeSize() @@ -380,7 +391,7 @@ Backup::execCONTINUEB(Signal* signal) return; }//if - TablePtr tabPtr; + TablePtr tabPtr LINT_SET_PTR; c_tablePool.getPtr(tabPtr, Tdata2); GetTabInfoReq * req = (GetTabInfoReq *)signal->getDataPtrSend(); req->senderRef = reference(); @@ -900,6 +911,9 @@ Backup::checkNodeFail(Signal* signal, #endif Uint32 gsn, len, pos; + LINT_INIT(gsn); + LINT_INIT(len); + LINT_INIT(pos); ptr.p->nodes.bitANDC(mask); switch(ptr.p->masterData.gsn){ case GSN_DEFINE_BACKUP_REQ: @@ -1087,7 +1101,7 @@ Backup::execBACKUP_REQ(Signal* signal) void Backup::execUTIL_SEQUENCE_REF(Signal* signal) { - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; jamEntry(); UtilSequenceRef * utilRef = (UtilSequenceRef*)signal->getDataPtr(); ptr.i = utilRef->senderData; @@ -1141,7 +1155,7 @@ Backup::execUTIL_SEQUENCE_CONF(Signal* signal) return; } - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; ptr.i = conf->senderData; c_backupPool.getPtr(ptr); @@ -1182,7 +1196,7 @@ Backup::defineBackupMutex_locked(Signal* signal, Uint32 ptrI, Uint32 retVal){ jamEntry(); ndbrequire(retVal == 0); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; ptr.i = ptrI; c_backupPool.getPtr(ptr); @@ -1203,7 +1217,7 @@ Backup::dictCommitTableMutex_locked(Signal* signal, Uint32 ptrI,Uint32 retVal) /** * We now have both the mutexes */ - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; ptr.i = ptrI; c_backupPool.getPtr(ptr); @@ -1308,7 +1322,7 @@ Backup::execDEFINE_BACKUP_REF(Signal* signal) //const Uint32 backupId = ref->backupId; const Uint32 nodeId = ref->nodeId; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); ptr.p->setErrorCode(ref->errorCode); @@ -1325,7 +1339,7 @@ Backup::execDEFINE_BACKUP_CONF(Signal* signal) //const Uint32 backupId = conf->backupId; const Uint32 nodeId = refToNode(signal->senderBlockRef()); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); if (ERROR_INSERTED(10024)) @@ -1496,7 +1510,7 @@ Backup::execCREATE_TRIG_REF(Signal* signal) const Uint32 ptrI = ref->getConnectionPtr(); const Uint32 tableId = ref->getTableId(); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); /** @@ -1611,7 +1625,7 @@ Backup::execSTART_BACKUP_REF(Signal* signal) const Uint32 signalNo = ref->signalNo; const Uint32 nodeId = ref->nodeId; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); ptr.p->setErrorCode(ref->errorCode); @@ -1629,7 +1643,7 @@ Backup::execSTART_BACKUP_CONF(Signal* signal) const Uint32 signalNo = conf->signalNo; const Uint32 nodeId = refToNode(signal->senderBlockRef()); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); startBackupReply(signal, ptr, nodeId, signalNo); @@ -1659,7 +1673,7 @@ Backup::startBackupReply(Signal* signal, BackupRecordPtr ptr, return; } - TablePtr tabPtr; + TablePtr tabPtr LINT_SET_PTR; c_tablePool.getPtr(tabPtr, ptr.p->masterData.startBackup.tablePtr); for(Uint32 i = 0; i<StartBackupReq::MaxTableTriggers; i++) { jam(); @@ -1753,7 +1767,7 @@ Backup::execALTER_TRIG_CONF(Signal* signal) AlterTrigConf* conf = (AlterTrigConf*)signal->getDataPtr(); const Uint32 ptrI = conf->getConnectionPtr(); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); alterTrigReply(signal, ptr); @@ -1767,7 +1781,7 @@ Backup::execALTER_TRIG_REF(Signal* signal) AlterTrigRef* ref = (AlterTrigRef*)signal->getDataPtr(); const Uint32 ptrI = ref->getConnectionPtr(); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); ptr.p->setErrorCode(ref->getErrorCode()); @@ -1811,7 +1825,7 @@ Backup::execWAIT_GCP_REF(Signal* signal) WaitGCPRef * ref = (WaitGCPRef*)signal->getDataPtr(); const Uint32 ptrI = ref->senderData; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); ndbrequire(ptr.p->masterRef == reference()); @@ -1835,7 +1849,7 @@ Backup::execWAIT_GCP_CONF(Signal* signal){ const Uint32 ptrI = conf->senderData; const Uint32 gcp = conf->gcp; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); ndbrequire(ptr.p->masterRef == reference()); @@ -2045,7 +2059,7 @@ Backup::execBACKUP_FRAGMENT_REF(Signal* signal) //const Uint32 backupId = ref->backupId; const Uint32 nodeId = ref->nodeId; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); TablePtr tabPtr; @@ -2194,7 +2208,7 @@ Backup::execDROP_TRIG_REF(Signal* signal) DropTrigRef* ref = (DropTrigRef*)signal->getDataPtr(); const Uint32 ptrI = ref->getConnectionPtr(); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); //ndbrequire(ref->getErrorCode() == DropTrigRef::NoSuchTrigger); @@ -2209,7 +2223,7 @@ Backup::execDROP_TRIG_CONF(Signal* signal) DropTrigConf* conf = (DropTrigConf*)signal->getDataPtr(); const Uint32 ptrI = conf->getConnectionPtr(); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); dropTrigReply(signal, ptr); @@ -2249,7 +2263,7 @@ Backup::execSTOP_BACKUP_REF(Signal* signal) //const Uint32 backupId = ref->backupId; const Uint32 nodeId = ref->nodeId; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); ptr.p->setErrorCode(ref->errorCode); @@ -2284,7 +2298,7 @@ Backup::execSTOP_BACKUP_CONF(Signal* signal) //const Uint32 backupId = conf->backupId; const Uint32 nodeId = refToNode(signal->senderBlockRef()); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); ptr.p->noOfLogBytes += conf->noOfLogBytes; @@ -2473,7 +2487,7 @@ Backup::execDEFINE_BACKUP_REQ(Signal* signal) DefineBackupReq* req = (DefineBackupReq*)signal->getDataPtr(); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; const Uint32 ptrI = req->backupPtr; const Uint32 backupId = req->backupId; const BlockReference senderRef = req->senderRef; @@ -2651,7 +2665,7 @@ Backup::execLIST_TABLES_CONF(Signal* signal) ListTablesConf* conf = (ListTablesConf*)signal->getDataPtr(); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, conf->senderData); const Uint32 len = signal->length() - ListTablesConf::HeaderLength; @@ -2699,7 +2713,7 @@ Backup::openFiles(Signal* signal, BackupRecordPtr ptr) { jam(); - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; FsOpenReq * req = (FsOpenReq *)signal->getDataPtrSend(); req->userReference = reference(); @@ -2764,10 +2778,10 @@ Backup::execFSOPENREF(Signal* signal) const Uint32 userPtr = ref->userPointer; - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, userPtr); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, filePtr.p->backupPtr); ptr.p->setErrorCode(ref->errorCode); openFilesReply(signal, ptr, filePtr); @@ -2783,11 +2797,11 @@ Backup::execFSOPENCONF(Signal* signal) const Uint32 userPtr = conf->userPointer; const Uint32 filePointer = conf->filePointer; - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, userPtr); filePtr.p->filePointer = filePointer; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, filePtr.p->backupPtr); ndbrequire(filePtr.p->fileOpened == 0); @@ -2945,7 +2959,7 @@ Backup::execGET_TABINFOREF(Signal* signal) GetTabInfoRef * ref = (GetTabInfoRef*)signal->getDataPtr(); const Uint32 senderData = ref->senderData; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, senderData); defineBackupRef(signal, ptr, ref->errorCode); @@ -2966,7 +2980,7 @@ Backup::execGET_TABINFO_CONF(Signal* signal) const Uint32 len = conf->totalLen; const Uint32 senderData = conf->senderData; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, senderData); SegmentedSectionPtr dictTabInfoPtr; @@ -3200,7 +3214,7 @@ Backup::execDI_FCOUNTCONF(Signal* signal) fragPtr.p->scanned = 0; fragPtr.p->scanning = 0; fragPtr.p->tableId = tableId; - fragPtr.p->node = RNIL; + fragPtr.p->node = 0; }//for /** @@ -3409,7 +3423,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) /** * Get file */ - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, ptr.p->dataFilePtr); ndbrequire(filePtr.p->backupPtr == ptrI); @@ -3541,12 +3555,12 @@ Backup::execTRANSID_AI(Signal* signal) //const Uint32 transId2 = signal->theData[2]; const Uint32 dataLen = signal->length() - 3; - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, filePtrI); OperationRecord & op = filePtr.p->operation; - TablePtr tabPtr; + TablePtr tabPtr LINT_SET_PTR; c_tablePool.getPtr(tabPtr, op.tablePtr); Table & table = * tabPtr.p; @@ -3740,7 +3754,7 @@ Backup::execSCAN_FRAGREF(Signal* signal) ScanFragRef * ref = (ScanFragRef*)signal->getDataPtr(); const Uint32 filePtrI = ref->senderData; - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, filePtrI); filePtr.p->errorCode = ref->errorCode; @@ -3759,7 +3773,7 @@ Backup::execSCAN_FRAGCONF(Signal* signal) ScanFragConf * conf = (ScanFragConf*)signal->getDataPtr(); const Uint32 filePtrI = conf->senderData; - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, filePtrI); OperationRecord & op = filePtr.p->operation; @@ -3800,7 +3814,7 @@ Backup::fragmentCompleted(Signal* signal, BackupFilePtr filePtr) filePtr.p->scanRunning = 0; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, filePtr.p->backupPtr); BackupFragmentConf * conf = (BackupFragmentConf*)signal->getDataPtrSend(); @@ -3823,7 +3837,7 @@ Backup::fragmentCompleted(Signal* signal, BackupFilePtr filePtr) void Backup::backupFragmentRef(Signal * signal, BackupFilePtr filePtr) { - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, filePtr.p->backupPtr); ptr.p->m_gsn = GSN_BACKUP_FRAGMENT_REF; @@ -3879,7 +3893,7 @@ Backup::checkScan(Signal* signal, BackupFilePtr filePtr) sendSignalWithDelay(DBLQH_REF, GSN_SCAN_NEXTREQ, signal, 10000, ScanFragNextReq::SignalLength); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, filePtr.p->backupPtr); AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); ord->backupId = ptr.p->backupId; @@ -3910,7 +3924,8 @@ Backup::execFSAPPENDREF(Signal* signal) const Uint32 filePtrI = ref->userPointer; const Uint32 errCode = ref->errorCode; - BackupFilePtr filePtr; + + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, filePtrI); filePtr.p->fileRunning = 0; @@ -3930,7 +3945,7 @@ Backup::execFSAPPENDCONF(Signal* signal) const Uint32 filePtrI = signal->theData[0]; //conf->userPointer; const Uint32 bytes = signal->theData[1]; //conf->bytes; - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, filePtrI); OperationRecord & op = filePtr.p->operation; @@ -4018,8 +4033,8 @@ Backup::execBACKUP_TRIG_REQ(Signal* signal) /* TUP asks if this trigger is to be fired on this node. */ - TriggerPtr trigPtr; - TablePtr tabPtr; + TriggerPtr trigPtr LINT_SET_PTR; + TablePtr tabPtr LINT_SET_PTR; FragmentPtr fragPtr; Uint32 trigger_id = signal->theData[0]; Uint32 frag_id = signal->theData[1]; @@ -4047,7 +4062,7 @@ Backup::execTRIG_ATTRINFO(Signal* signal) { TrigAttrInfo * trg = (TrigAttrInfo*)signal->getDataPtr(); - TriggerPtr trigPtr; + TriggerPtr trigPtr LINT_SET_PTR; c_triggerPool.getPtr(trigPtr, trg->getTriggerId()); ndbrequire(trigPtr.p->event != ILLEGAL_TRIGGER_ID); // Online... @@ -4078,7 +4093,7 @@ Backup::execTRIG_ATTRINFO(Signal* signal) { jam(); Uint32 save[TrigAttrInfo::StaticLength]; memcpy(save, signal->getDataPtr(), 4*TrigAttrInfo::StaticLength); - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, trigPtr.p->backupPtr); trigPtr.p->errorCode = AbortBackupOrd::LogBufferFull; AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); @@ -4119,7 +4134,7 @@ Backup::execFIRE_TRIG_ORD(Signal* signal) const Uint32 gci = trg->getGCI(); const Uint32 trI = trg->getTriggerId(); - TriggerPtr trigPtr; + TriggerPtr trigPtr LINT_SET_PTR; c_triggerPool.getPtr(trigPtr, trI); ndbrequire(trigPtr.p->event != ILLEGAL_TRIGGER_ID); @@ -4132,7 +4147,7 @@ Backup::execFIRE_TRIG_ORD(Signal* signal) ndbrequire(trigPtr.p->logEntry != 0); Uint32 len = trigPtr.p->logEntry->Length; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, trigPtr.p->backupPtr); if(gci != ptr.p->currGCP) { @@ -4203,7 +4218,7 @@ Backup::execSTOP_BACKUP_REQ(Signal* signal) /** * Get backup record */ - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); ptr.p->slaveState.setState(STOPPING); @@ -4216,6 +4231,7 @@ Backup::execSTOP_BACKUP_REQ(Signal* signal) BackupFilePtr filePtr; ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr); Uint32 * dst; + LINT_INIT(dst); ndbrequire(filePtr.p->operation.dataBuffer.getWritePtr(&dst, 1)); * dst = 0; filePtr.p->operation.dataBuffer.updateWritePtr(1); @@ -4228,6 +4244,7 @@ Backup::execSTOP_BACKUP_REQ(Signal* signal) const Uint32 gcpSz = sizeof(BackupFormat::CtlFile::GCPEntry) >> 2; Uint32 * dst; + LINT_INIT(dst); ndbrequire(filePtr.p->operation.dataBuffer.getWritePtr(&dst, gcpSz)); BackupFormat::CtlFile::GCPEntry * gcp = @@ -4243,6 +4260,12 @@ Backup::execSTOP_BACKUP_REQ(Signal* signal) TablePtr tabPtr; ptr.p->tables.first(tabPtr); + if (tabPtr.i == RNIL) + { + closeFiles(signal, ptr); + return; + } + signal->theData[0] = BackupContinueB::BACKUP_FRAGMENT_INFO; signal->theData[1] = ptr.i; signal->theData[2] = tabPtr.i; @@ -4313,7 +4336,7 @@ Backup::execFSCLOSEREF(Signal* signal) FsRef * ref = (FsRef*)signal->getDataPtr(); const Uint32 filePtrI = ref->userPointer; - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, filePtrI); BackupRecordPtr ptr; @@ -4334,7 +4357,7 @@ Backup::execFSCLOSECONF(Signal* signal) FsConf * conf = (FsConf*)signal->getDataPtr(); const Uint32 filePtrI = conf->userPointer; - BackupFilePtr filePtr; + BackupFilePtr filePtr LINT_SET_PTR; c_backupFilePool.getPtr(filePtr, filePtrI); #ifdef DEBUG_ABORT @@ -4348,7 +4371,7 @@ Backup::execFSCLOSECONF(Signal* signal) filePtr.p->fileOpened = 0; - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, filePtr.p->backupPtr); for(ptr.p->files.first(filePtr); filePtr.i!=RNIL;ptr.p->files.next(filePtr)) { @@ -4414,7 +4437,7 @@ Backup::execABORT_BACKUP_ORD(Signal* signal) dumpUsedResources(); #endif - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; if(requestType == AbortBackupOrd::ClientAbort) { if (getOwnNodeId() != getMasterNodeId()) { jam(); @@ -4543,7 +4566,7 @@ Backup::dumpUsedResources() jam(); for(Uint32 j = 0; j<3; j++) { jam(); - TriggerPtr trigPtr; + TriggerPtr trigPtr LINT_SET_PTR; if(tabPtr.p->triggerAllocated[j]) { jam(); c_triggerPool.getPtr(trigPtr, tabPtr.p->triggerIds[j]); @@ -4582,7 +4605,7 @@ Backup::cleanup(Signal* signal, BackupRecordPtr ptr) tabPtr.p->fragments.release(); for(Uint32 j = 0; j<3; j++) { jam(); - TriggerPtr trigPtr; + TriggerPtr trigPtr LINT_SET_PTR; if(tabPtr.p->triggerAllocated[j]) { jam(); c_triggerPool.getPtr(trigPtr, tabPtr.p->triggerIds[j]); @@ -4662,7 +4685,7 @@ Backup::execFSREMOVECONF(Signal* signal){ /** * Get backup record */ - BackupRecordPtr ptr; + BackupRecordPtr ptr LINT_SET_PTR; c_backupPool.getPtr(ptr, ptrI); c_backups.release(ptr); } diff --git a/ndb/src/kernel/blocks/backup/Backup.hpp b/ndb/src/kernel/blocks/backup/Backup.hpp index e869cbf9544..8b0c27727b0 100644 --- a/ndb/src/kernel/blocks/backup/Backup.hpp +++ b/ndb/src/kernel/blocks/backup/Backup.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/backup/BackupFormat.hpp b/ndb/src/kernel/blocks/backup/BackupFormat.hpp index b8ffff3a294..f8069ba3f37 100644 --- a/ndb/src/kernel/blocks/backup/BackupFormat.hpp +++ b/ndb/src/kernel/blocks/backup/BackupFormat.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index 96c11468939..5d65a68bab2 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/backup/FsBuffer.hpp b/ndb/src/kernel/blocks/backup/FsBuffer.hpp index 2f3c7daae43..a6cfe9f86e0 100644 --- a/ndb/src/kernel/blocks/backup/FsBuffer.hpp +++ b/ndb/src/kernel/blocks/backup/FsBuffer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/backup/Makefile.am b/ndb/src/kernel/blocks/backup/Makefile.am index c8f44f31292..6f04a5c1158 100644 --- a/ndb/src/kernel/blocks/backup/Makefile.am +++ b/ndb/src/kernel/blocks/backup/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LIBRARIES = libbackup.a diff --git a/ndb/src/kernel/blocks/backup/read.cpp b/ndb/src/kernel/blocks/backup/read.cpp index 89cc08ee9de..3c1af930f4f 100644 --- a/ndb/src/kernel/blocks/backup/read.cpp +++ b/ndb/src/kernel/blocks/backup/read.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 8b9fc6c489a..1b5e7a27a0c 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -78,11 +77,7 @@ Cmvmi::Cmvmi(const Configuration & conf) : addRecSignal(GSN_OPEN_COMREQ, &Cmvmi::execOPEN_COMREQ); addRecSignal(GSN_TEST_ORD, &Cmvmi::execTEST_ORD); - addRecSignal(GSN_STATISTICS_REQ, &Cmvmi::execSTATISTICS_REQ); addRecSignal(GSN_TAMPER_ORD, &Cmvmi::execTAMPER_ORD); - addRecSignal(GSN_SET_VAR_REQ, &Cmvmi::execSET_VAR_REQ); - addRecSignal(GSN_SET_VAR_CONF, &Cmvmi::execSET_VAR_CONF); - addRecSignal(GSN_SET_VAR_REF, &Cmvmi::execSET_VAR_REF); addRecSignal(GSN_STOP_ORD, &Cmvmi::execSTOP_ORD); addRecSignal(GSN_START_ORD, &Cmvmi::execSTART_ORD); addRecSignal(GSN_EVENT_SUBSCRIBE_REQ, @@ -715,29 +710,12 @@ Cmvmi::execTEST_ORD(Signal * signal){ // Do nothing break; } + globalSignalLoggers.flushSignalLog(); } #endif } -void Cmvmi::execSTATISTICS_REQ(Signal* signal) -{ - // TODO Note ! This is only a test implementation... - - static int stat1 = 0; - jamEntry(); - - //ndbout << "data 1: " << signal->theData[1]; - - int x = signal->theData[0]; - stat1++; - signal->theData[0] = stat1; - sendSignal(x, GSN_STATISTICS_CONF, signal, 7, JBB); - -}//execSTATISTICS_REQ() - - - void Cmvmi::execSTOP_ORD(Signal* signal) { jamEntry(); @@ -856,7 +834,7 @@ void Cmvmi::execTAMPER_ORD(Signal* signal) // to be able to indicate if we really introduced an error. #ifdef ERROR_INSERT TamperOrd* const tamperOrd = (TamperOrd*)&signal->theData[0]; - + signal->theData[2] = 0; signal->theData[1] = tamperOrd->errorNo; signal->theData[0] = 5; sendSignal(DBDIH_REF, GSN_DIHNDBTAMPER, signal, 3,JBB); @@ -864,160 +842,6 @@ void Cmvmi::execTAMPER_ORD(Signal* signal) }//execTAMPER_ORD() - - -void Cmvmi::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - jamEntry(); - switch (var) { - - // NDBCNTR_REF - - // DBTC - case TransactionDeadlockDetectionTimeout: - case TransactionInactiveTime: - case NoOfConcurrentProcessesHandleTakeover: - sendSignal(DBTC_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBDIH - case TimeBetweenLocalCheckpoints: - case TimeBetweenGlobalCheckpoints: - sendSignal(DBDIH_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBLQH - case NoOfConcurrentCheckpointsDuringRestart: - case NoOfConcurrentCheckpointsAfterRestart: - sendSignal(DBLQH_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBACC - case NoOfDiskPagesToDiskDuringRestartACC: - case NoOfDiskPagesToDiskAfterRestartACC: - sendSignal(DBACC_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBTUP - case NoOfDiskPagesToDiskDuringRestartTUP: - case NoOfDiskPagesToDiskAfterRestartTUP: - sendSignal(DBTUP_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBDICT - - // NDBCNTR - case TimeToWaitAlive: - - // QMGR - case HeartbeatIntervalDbDb: // TODO ev till Ndbcnt också - case HeartbeatIntervalDbApi: - case ArbitTimeout: - sendSignal(QMGR_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // NDBFS - - // CMVMI - case MaxNoOfSavedMessages: - case LockPagesInMainMemory: - case TimeBetweenWatchDogCheck: - case StopOnError: - handleSET_VAR_REQ(signal); - break; - - - // Not possible to update (this could of course be handled by each block - // instead but I havn't investigated where they belong) - case Id: - case ExecuteOnComputer: - case ShmKey: - case MaxNoOfConcurrentOperations: - case MaxNoOfConcurrentTransactions: - case MemorySpaceIndexes: - case MemorySpaceTuples: - case MemoryDiskPages: - case NoOfFreeDiskClusters: - case NoOfDiskClusters: - case NoOfFragmentLogFiles: - case NoOfDiskClustersPerDiskFile: - case NoOfDiskFiles: - case MaxNoOfSavedEvents: - default: - - int mgmtSrvr = setVarReq->mgmtSrvrBlockRef(); - sendSignal(mgmtSrvr, GSN_SET_VAR_REF, signal, 0, JBB); - } // switch - -#endif -}//execSET_VAR_REQ() - - -void Cmvmi::execSET_VAR_CONF(Signal* signal) -{ - int mgmtSrvr = signal->theData[0]; - sendSignal(mgmtSrvr, GSN_SET_VAR_CONF, signal, 0, JBB); - -}//execSET_VAR_CONF() - - -void Cmvmi::execSET_VAR_REF(Signal* signal) -{ - int mgmtSrvr = signal->theData[0]; - sendSignal(mgmtSrvr, GSN_SET_VAR_REF, signal, 0, JBB); - -}//execSET_VAR_REF() - - -void Cmvmi::handleSET_VAR_REQ(Signal* signal) { -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - switch (var) { - case MaxNoOfSavedMessages: - theConfig.maxNoOfErrorLogs(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case LockPagesInMainMemory: - int result; - if (val == 0) { - result = NdbMem_MemUnlockAll(); - } - else { - result = NdbMem_MemLockAll(); - } - if (result == 0) { - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - } - else { - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } - break; - - case TimeBetweenWatchDogCheck: - theConfig.timeBetweenWatchDogCheck(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case StopOnError: - theConfig.stopOnError(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - return; - } // switch -#endif -} - #ifdef VM_TRACE class RefSignalTest { public: @@ -1122,6 +946,24 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal) } } + if (arg == DumpStateOrd::CmvmiDumpSubscriptions) + { + SubscriberPtr ptr; + subscribers.first(ptr); + g_eventLogger.info("List subscriptions:"); + while(ptr.i != RNIL) + { + g_eventLogger.info("Subscription: %u, nodeId: %u, ref: 0x%x", + ptr.i, refToNode(ptr.p->blockRef), ptr.p->blockRef); + for(Uint32 i = 0; i < LogLevel::LOGLEVEL_CATEGORIES; i++) + { + Uint32 level = ptr.p->logLevel.getLogLevel((LogLevel::EventCategory)i); + g_eventLogger.info("Category %u Level %u", i, level); + } + subscribers.next(ptr); + } + } + if (arg == DumpStateOrd::CmvmiDumpLongSignalMemory){ infoEvent("Cmvmi: g_sectionSegmentPool size: %d free: %d", g_sectionSegmentPool.getSize(), @@ -1278,7 +1120,7 @@ Cmvmi::execTESTSIG(Signal* signal){ fprintf(stdout, "\n"); for(i = 0; i<signal->header.m_noOfSections; i++){ - SegmentedSectionPtr ptr; + SegmentedSectionPtr ptr(0,0,0); ndbout_c("-- Section %d --", i); signal->getSection(ptr, i); ndbrequire(ptr.p != 0); @@ -1336,7 +1178,7 @@ Cmvmi::execTESTSIG(Signal* signal){ LinearSectionPtr ptr[3]; const Uint32 secs = signal->getNoOfSections(); for(i = 0; i<secs; i++){ - SegmentedSectionPtr sptr; + SegmentedSectionPtr sptr(0,0,0); signal->getSection(sptr, i); ptr[i].sz = sptr.sz; ptr[i].p = new Uint32[sptr.sz]; @@ -1385,7 +1227,7 @@ Cmvmi::execTESTSIG(Signal* signal){ LinearSectionPtr ptr[3]; const Uint32 secs = signal->getNoOfSections(); for(i = 0; i<secs; i++){ - SegmentedSectionPtr sptr; + SegmentedSectionPtr sptr(0,0,0); signal->getSection(sptr, i); ptr[i].sz = sptr.sz; ptr[i].p = new Uint32[sptr.sz]; @@ -1451,7 +1293,7 @@ Cmvmi::execTESTSIG(Signal* signal){ const Uint32 secs = signal->getNoOfSections(); memset(g_test, 0, sizeof(g_test)); for(i = 0; i<secs; i++){ - SegmentedSectionPtr sptr; + SegmentedSectionPtr sptr(0,0,0); signal->getSection(sptr, i); g_test[i].sz = sptr.sz; g_test[i].p = new Uint32[sptr.sz]; diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp index d050587e91d..712e70039c9 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -56,20 +55,14 @@ private: void execSIZEALT_ACK(Signal* signal); void execTEST_ORD(Signal* signal); - void execSTATISTICS_REQ(Signal* signal); void execSTOP_ORD(Signal* signal); void execSTART_ORD(Signal* signal); void execTAMPER_ORD(Signal* signal); - void execSET_VAR_REQ(Signal* signal); - void execSET_VAR_CONF(Signal* signal); - void execSET_VAR_REF(Signal* signal); void execDUMP_STATE_ORD(Signal* signal); void execEVENT_SUBSCRIBE_REQ(Signal *); void cancelSubscription(NodeId nodeId); - - void handleSET_VAR_REQ(Signal* signal); void execTESTSIG(Signal* signal); void execNODE_START_REP(Signal* signal); diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile.am b/ndb/src/kernel/blocks/cmvmi/Makefile.am index dc2e12746fd..c3150080500 100644 --- a/ndb/src/kernel/blocks/cmvmi/Makefile.am +++ b/ndb/src/kernel/blocks/cmvmi/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LIBRARIES = libcmvmi.a diff --git a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp index 7f51a281f37..02a7e69b684 100644 --- a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp +++ b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -912,7 +911,6 @@ private: void execDROP_TAB_REQ(Signal* signal); void execFSREMOVECONF(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execDUMP_STATE_ORD(Signal* signal); // Statement blocks diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp index e560d924e5a..80664e8911a 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -179,7 +178,6 @@ Dbacc::Dbacc(const class Configuration & conf): addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ); addRecSignal(GSN_FSREMOVECONF, &Dbacc::execFSREMOVECONF); addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ, true); - addRecSignal(GSN_SET_VAR_REQ, &Dbacc::execSET_VAR_REQ); initData(); diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 2652da97aea..37f75d82710 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -11649,33 +11648,6 @@ Dbacc::execDUMP_STATE_ORD(Signal* signal) #endif }//Dbacc::execDUMP_STATE_ORD() -void Dbacc::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - - switch (var) { - - case NoOfDiskPagesToDiskAfterRestartACC: - clblPagesPerTick = val; - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case NoOfDiskPagesToDiskDuringRestartACC: - // Valid only during start so value not set. - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif - -}//execSET_VAR_REQ() - void Dbacc::execREAD_PSUEDO_REQ(Signal* signal){ jamEntry(); diff --git a/ndb/src/kernel/blocks/dbacc/Makefile.am b/ndb/src/kernel/blocks/dbacc/Makefile.am index ca1b1efac37..b8879677530 100644 --- a/ndb/src/kernel/blocks/dbacc/Makefile.am +++ b/ndb/src/kernel/blocks/dbacc/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LIBRARIES = libdbacc.a diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 3e2952c3f3d..d86f32dc8d1 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -80,6 +79,9 @@ #include <NdbSleep.h> #include <signaldata/ApiBroadcast.hpp> +#include <EventLogger.hpp> +extern EventLogger g_eventLogger; + #define ZNOT_FOUND 626 #define ZALREADYEXIST 630 @@ -290,7 +292,7 @@ Dbdict::packTableIntoPagesImpl(SimpleProperties::Writer & w, w.add(DictTabInfo::MaxRowsHigh, tablePtr.p->maxRowsHigh); w.add(DictTabInfo::MinRowsLow, tablePtr.p->minRowsLow); w.add(DictTabInfo::MinRowsHigh, tablePtr.p->minRowsHigh); - + w.add(DictTabInfo::SingleUserMode, tablePtr.p->singleUserMode); if(!signal) { w.add(DictTabInfo::FragmentCount, tablePtr.p->fragmentCount); @@ -1070,17 +1072,36 @@ void Dbdict::readSchemaConf(Signal* signal, for (Uint32 n = 0; n < xsf->noOfPages; n++) { SchemaFile * sf = &xsf->schemaPage[n]; - bool ok = - memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) == 0 && - sf->FileSize != 0 && - sf->FileSize % NDB_SF_PAGE_SIZE == 0 && - sf->FileSize == sf0->FileSize && - sf->PageNumber == n && - computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) == 0; - ndbrequire(ok || !crashInd); - if (! ok) { + bool ok = false; + const char *reason; + if (memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) != 0) + { jam(); reason = "magic code"; } + else if (sf->FileSize == 0) + { jam(); reason = "file size == 0"; } + else if (sf->FileSize % NDB_SF_PAGE_SIZE != 0) + { jam(); reason = "invalid size multiple"; } + else if (sf->FileSize != sf0->FileSize) + { jam(); reason = "invalid size"; } + else if (sf->PageNumber != n) + { jam(); reason = "invalid page number"; } + else if (computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) != 0) + { jam(); reason = "invalid checksum"; } + else + ok = true; + + if (!ok) + { + char reason_msg[128]; + snprintf(reason_msg, sizeof(reason_msg), + "schema file corrupt, page %u (%s, " + "sz=%u sz0=%u pn=%u)", + n, reason, sf->FileSize, sf0->FileSize, sf->PageNumber); + if (crashInd) + progError(__LINE__, NDBD_EXIT_SR_SCHEMAFILE, reason_msg); + ndbrequireErr(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1, + NDBD_EXIT_SR_SCHEMAFILE); jam(); - ndbrequire(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1); + infoEvent("primary %s, trying backup", reason_msg); readSchemaRef(signal, fsPtr); return; } @@ -1501,6 +1522,7 @@ void Dbdict::initialiseTableRecord(TableRecordPtr tablePtr) tablePtr.p->maxRowsHigh = 0; tablePtr.p->minRowsLow = 0; tablePtr.p->minRowsHigh = 0; + tablePtr.p->singleUserMode = 0; tablePtr.p->storedTable = true; tablePtr.p->tableType = DictTabInfo::UserTable; tablePtr.p->primaryTableId = RNIL; @@ -2911,6 +2933,13 @@ Dbdict::execCREATE_TABLE_REQ(Signal* signal){ break; } + if (checkSingleUserMode(signal->getSendersBlockRef())) + { + jam(); + parseRecord.errorCode = CreateTableRef::SingleUser; + break; + } + CreateTableRecordPtr createTabPtr; c_opCreateTable.seize(createTabPtr); @@ -3073,6 +3102,13 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal) return; } + if (checkSingleUserMode(signal->getSendersBlockRef())) + { + jam(); + alterTableRef(signal, req, AlterTableRef::SingleUser); + return; + } + const TableRecord::TabState tabState = tablePtr.p->tabState; bool ok = false; switch(tabState){ @@ -4701,8 +4737,9 @@ Dbdict::execTAB_COMMITCONF(Signal* signal){ signal->theData[4] = (Uint32)tabPtr.p->tableType; signal->theData[5] = createTabPtr.p->key; signal->theData[6] = (Uint32)tabPtr.p->noOfPrimkey; - - sendSignal(DBTC_REF, GSN_TC_SCHVERREQ, signal, 7, JBB); + signal->theData[7] = (Uint32)tabPtr.p->singleUserMode; + + sendSignal(DBTC_REF, GSN_TC_SCHVERREQ, signal, 8, JBB); return; } @@ -5067,11 +5104,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it, tablePtr.p->maxRowsHigh = tableDesc.MaxRowsHigh; tablePtr.p->minRowsLow = tableDesc.MinRowsLow; tablePtr.p->minRowsHigh = tableDesc.MinRowsHigh; - - Uint64 maxRows = - (((Uint64)tablePtr.p->maxRowsHigh) << 32) + tablePtr.p->maxRowsLow; - Uint64 minRows = - (((Uint64)tablePtr.p->minRowsHigh) << 32) + tablePtr.p->minRowsLow; + tablePtr.p->singleUserMode = tableDesc.SingleUserMode; tablePtr.p->frmLen = tableDesc.FrmLen; memcpy(tablePtr.p->frmData, tableDesc.FrmData, tableDesc.FrmLen); @@ -5402,6 +5435,13 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){ return; } + if (checkSingleUserMode(signal->getSendersBlockRef())) + { + jam(); + dropTableRef(signal, req, DropTableRef::SingleUser); + return; + } + const TableRecord::TabState tabState = tablePtr.p->tabState; bool ok = false; switch(tabState){ @@ -6521,9 +6561,23 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal) } if (signal->getLength() == CreateIndxReq::SignalLength) { jam(); + CreateIndxRef::ErrorCode tmperr = CreateIndxRef::NoError; if (getOwnNodeId() != c_masterNodeId) { jam(); - + tmperr = CreateIndxRef::NotMaster; + } else if (c_blockState == BS_NODE_RESTART) { + jam(); + tmperr = CreateIndxRef::BusyWithNR; + } else if (c_blockState != BS_IDLE) { + jam(); + tmperr = CreateIndxRef::Busy; + } + else if (checkSingleUserMode(senderRef)) + { + jam(); + tmperr = CreateIndxRef::SingleUser; + } + if (tmperr != CreateIndxRef::NoError) { releaseSections(signal); OpCreateIndex opBusy; opPtr.p = &opBusy; @@ -6531,13 +6585,12 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal) opPtr.p->m_isMaster = (senderRef == reference()); opPtr.p->key = 0; opPtr.p->m_requestType = CreateIndxReq::RT_DICT_PREPARE; - opPtr.p->m_errorCode = CreateIndxRef::NotMaster; + opPtr.p->m_errorCode = tmperr; opPtr.p->m_errorLine = __LINE__; opPtr.p->m_errorNode = c_masterNodeId; createIndex_sendReply(signal, opPtr, true); return; } - // forward initial request plus operation key to all req->setOpKey(++c_opRecordSequence); NodeReceiverGroup rg(DBDICT, c_aliveNodes); @@ -6852,6 +6905,7 @@ Dbdict::createIndex_toCreateTable(Signal* signal, OpCreateIndexPtr opPtr) w.add(DictTabInfo::NoOfKeyAttr, indexPtr.p->noOfPrimkey); w.add(DictTabInfo::NoOfNullable, indexPtr.p->noOfNullAttr); w.add(DictTabInfo::KeyLength, indexPtr.p->tupKeyLength); + w.add(DictTabInfo::SingleUserMode, (Uint32)NDB_SUM_READ_WRITE); // write index key attributes AttributeRecordPtr aRecPtr; c_attributeRecordPool.getPtr(aRecPtr, tablePtr.p->firstAttribute); @@ -7083,10 +7137,24 @@ Dbdict::execDROP_INDX_REQ(Signal* signal) jam(); if (signal->getLength() == DropIndxReq::SignalLength) { jam(); + DropIndxRef::ErrorCode tmperr = DropIndxRef::NoError; if (getOwnNodeId() != c_masterNodeId) { jam(); - - err = DropIndxRef::NotMaster; + tmperr = DropIndxRef::NotMaster; + } else if (c_blockState == BS_NODE_RESTART) { + jam(); + tmperr = DropIndxRef::BusyWithNR; + } else if (c_blockState != BS_IDLE) { + jam(); + tmperr = DropIndxRef::Busy; + } + else if (checkSingleUserMode(senderRef)) + { + jam(); + tmperr = DropIndxRef::SingleUser; + } + if (tmperr != DropIndxRef::NoError) { + err = tmperr; goto error; } // forward initial request plus operation key to all @@ -10037,8 +10105,8 @@ Dbdict::getDictLockType(Uint32 lockType) static const DictLockType lt[] = { { DictLockReq::NodeRestartLock, BS_NODE_RESTART, "NodeRestart" } }; - for (int i = 0; i < sizeof(lt)/sizeof(lt[0]); i++) { - if (lt[i].lockType == lockType) + for (unsigned int i = 0; i < sizeof(lt)/sizeof(lt[0]); i++) { + if ((Uint32) lt[i].lockType == lockType) return <[i]; } return NULL; @@ -10131,6 +10199,17 @@ Dbdict::execDICT_LOCK_REQ(Signal* signal) sendDictLockInfoEvent(lockPtr, "lock request by node"); } +// only table and index ops are checked +bool +Dbdict::hasDictLockSchemaOp() +{ + return + ! c_opCreateTable.isEmpty() || + ! c_opDropTable.isEmpty() || + ! c_opCreateIndex.isEmpty() || + ! c_opDropIndex.isEmpty(); +} + void Dbdict::checkDictLockQueue(Signal* signal, bool poll) { @@ -10151,7 +10230,7 @@ Dbdict::checkDictLockQueue(Signal* signal, bool poll) break; } - if (c_opRecordPool.getNoOfFree() != c_opRecordPool.getSize()) { + if (hasDictLockSchemaOp()) { jam(); break; } @@ -10188,12 +10267,12 @@ Dbdict::execDICT_UNLOCK_ORD(Signal* signal) DictLockPtr lockPtr; c_dictLockQueue.getPtr(lockPtr, ord->lockPtr); - ndbrequire(lockPtr.p->lt->lockType == ord->lockType); + ndbrequire((Uint32) lockPtr.p->lt->lockType == ord->lockType); if (lockPtr.p->locked) { jam(); ndbrequire(c_blockState == lockPtr.p->lt->blockState); - ndbrequire(c_opRecordPool.getNoOfFree() == c_opRecordPool.getSize()); + ndbrequire(! hasDictLockSchemaOp()); ndbrequire(! c_dictLockQueue.hasPrev(lockPtr)); c_blockState = BS_IDLE; @@ -10289,7 +10368,7 @@ Dbdict::removeStaleDictLocks(Signal* signal, const Uint32* theFailedNodes) if (lockPtr.p->locked) { jam(); ndbrequire(c_blockState == lockPtr.p->lt->blockState); - ndbrequire(c_opRecordPool.getNoOfFree() == c_opRecordPool.getSize()); + ndbrequire(! hasDictLockSchemaOp()); ndbrequire(! c_dictLockQueue.hasPrev(lockPtr)); c_blockState = BS_IDLE; @@ -10511,4 +10590,20 @@ Dbdict::getMetaAttribute(MetaData::Attribute& attr, const MetaData::Table& table return 0; } +/* + return 1 if all of the below is true + a) node in single user mode + b) senderRef is not a db node + c) senderRef nodeid is not the singleUserApi +*/ + +int Dbdict::checkSingleUserMode(Uint32 senderRef) +{ + Uint32 nodeId = refToNode(senderRef); + return + getNodeState().getSingleUserMode() && + (getNodeInfo(nodeId).m_type != NodeInfo::DB) && + (nodeId != getNodeState().getSingleUserApi()); +} + CArray<KeyDescriptor> g_key_descriptor_pool; diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index ed8b7e3b822..254c55a1c01 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -132,6 +131,7 @@ public: * on disk. Index trigger ids are volatile. */ struct TableRecord : public MetaData::Table { + TableRecord() {} Uint32 maxRowsLow; Uint32 maxRowsHigh; Uint32 minRowsLow; @@ -238,6 +238,11 @@ public: char frmData[MAX_FRM_DATA_SIZE]; Uint32 fragmentCount; + + /* + * Access rights to table during single user mode + */ + Uint8 singleUserMode; }; typedef Ptr<TableRecord> TableRecordPtr; @@ -251,6 +256,7 @@ public: * attributes. This is wrong but convenient. */ struct AttributeRecord : public MetaData::Attribute { + AttributeRecord() {} union { /** Pointer to the next attribute used by ArrayPool */ Uint32 nextPool; @@ -286,6 +292,7 @@ public: * trigger online creates the trigger in TC (if index) and LQH-TUP. */ struct TriggerRecord { + TriggerRecord() {} /** Trigger state */ enum TriggerState { @@ -865,6 +872,7 @@ private: * seize/release invokes ctor/dtor automatically. */ struct OpRecordCommon { + OpRecordCommon() {} Uint32 key; // key shared between master and slaves Uint32 nextHash; Uint32 prevHash; @@ -880,6 +888,7 @@ private: * Create table record */ struct CreateTableRecord : OpRecordCommon { + CreateTableRecord() {} Uint32 m_senderRef; Uint32 m_senderData; Uint32 m_coordinatorRef; @@ -918,6 +927,7 @@ private: * Drop table record */ struct DropTableRecord : OpRecordCommon { + DropTableRecord() {} DropTableReq m_request; Uint32 m_requestType; @@ -1650,6 +1660,9 @@ private: void sendDictLockInfoEvent(Uint32 pollCount); void sendDictLockInfoEvent(DictLockPtr lockPtr, const char* text); + // check if any schema op exists (conflicting with dict lock) + bool hasDictLockSchemaOp(); + void checkDictLockQueue(Signal* signal, bool poll); void sendDictLockConf(Signal* signal, DictLockPtr lockPtr); void sendDictLockRef(Signal* signal, DictLockReq req, Uint32 errorCode); @@ -1995,6 +2008,8 @@ private: int getMetaTable(MetaData::Table& table, const char* tableName); int getMetaAttribute(MetaData::Attribute& attribute, const MetaData::Table& table, Uint32 attributeId); int getMetaAttribute(MetaData::Attribute& attribute, const MetaData::Table& table, const char* attributeName); + + int checkSingleUserMode(Uint32 senderRef); }; #endif diff --git a/ndb/src/kernel/blocks/dbdict/Makefile.am b/ndb/src/kernel/blocks/dbdict/Makefile.am index 3c1cf6735d9..b43a938dc49 100644 --- a/ndb/src/kernel/blocks/dbdict/Makefile.am +++ b/ndb/src/kernel/blocks/dbdict/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libdbdict.a EXTRA_PROGRAMS = printSchemaFile diff --git a/ndb/src/kernel/blocks/dbdict/Master_AddTable.sfl b/ndb/src/kernel/blocks/dbdict/Master_AddTable.sfl index 1bcec156ef7..89dfd56fd40 100644 --- a/ndb/src/kernel/blocks/dbdict/Master_AddTable.sfl +++ b/ndb/src/kernel/blocks/dbdict/Master_AddTable.sfl @@ -1,8 +1,21 @@ +// Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // --------------------------------------------------------------------------- // This file contains a signal log trace for DBDICT at the master for a // create table. Another file contains the signal log for the participant // node. Master node is 2, participant node 4 and api node is 3. -// // --------------------------------------------------------------------------- // First arrives the table description in a number of DICTTABINFO signals. diff --git a/ndb/src/kernel/blocks/dbdict/SchemaFile.hpp b/ndb/src/kernel/blocks/dbdict/SchemaFile.hpp index 0226991a073..b8af0f2b5de 100644 --- a/ndb/src/kernel/blocks/dbdict/SchemaFile.hpp +++ b/ndb/src/kernel/blocks/dbdict/SchemaFile.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbdict/Slave_AddTable.sfl b/ndb/src/kernel/blocks/dbdict/Slave_AddTable.sfl index 8740be9595d..4c018ea5460 100644 --- a/ndb/src/kernel/blocks/dbdict/Slave_AddTable.sfl +++ b/ndb/src/kernel/blocks/dbdict/Slave_AddTable.sfl @@ -1,3 +1,22 @@ +// Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// --------------------------------------------------------------------------- +// This file contains a signal log trace for DBDICT at the master for a +// create table. Another file contains the signal log for the participant +// node. Master node is 2, participant node 4 and api node is 3. + // --------------------------------------------------------------------------- // This file contains a signal log trace for DBDICT at the participant for a // add table. Another file contains the signal log for the master diff --git a/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp b/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp index f73654fd9d5..1e0faf59275 100644 --- a/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp +++ b/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 97c123ae3f4..ca91f56909d 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -694,7 +693,6 @@ private: void execFSREADREF(Signal *); void execFSWRITECONF(Signal *); void execFSWRITEREF(Signal *); - void execSET_VAR_REQ(Signal *); void execCHECKNODEGROUPSREQ(Signal *); void execSTART_INFOREQ(Signal*); void execSTART_INFOREF(Signal*); @@ -1289,6 +1287,7 @@ public: private: struct LcpState { + LcpState() {} LcpStatus lcpStatus; Uint32 lcpStatusUpdatedPlace; @@ -1396,6 +1395,7 @@ public: private: class MasterTakeOverState { public: + MasterTakeOverState() {} void set(LcpMasterTakeOverState s, Uint32 line) { state = s; updatePlace = line; } @@ -1483,6 +1483,7 @@ private: * SwitchReplicaRecord - Should only be used by master */ struct SwitchReplicaRecord { + SwitchReplicaRecord() {} void clear(){} Uint32 nodeId; diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index 4e71ecd5fe2..f3228b36dde 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -218,7 +217,6 @@ Dbdih::Dbdih(const class Configuration & config): addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF, true); addRecSignal(GSN_FSWRITECONF, &Dbdih::execFSWRITECONF); addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF, true); - addRecSignal(GSN_SET_VAR_REQ, &Dbdih::execSET_VAR_REQ); addRecSignal(GSN_START_INFOREQ, &Dbdih::execSTART_INFOREQ); diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 967c00ea50f..cebf350021f 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -1798,8 +1797,8 @@ void Dbdih::execSTART_PERMREQ(Signal* signal) return; }//if if (getNodeStatus(nodeId) != NodeRecord::DEAD){ - ndbout << "nodeStatus in START_PERMREQ = " - << (Uint32) getNodeStatus(nodeId) << endl; + g_eventLogger.error("nodeStatus in START_PERMREQ = %u", + (Uint32) getNodeStatus(nodeId)); ndbrequire(false); }//if @@ -4041,9 +4040,9 @@ void Dbdih::checkCopyTab(NodeRecordPtr failedNodePtr) jam(); break; default: - ndbout_c("outstanding gsn: %s(%d)", - getSignalName(c_nodeStartMaster.m_outstandingGsn), - c_nodeStartMaster.m_outstandingGsn); + g_eventLogger.error("outstanding gsn: %s(%d)", + getSignalName(c_nodeStartMaster.m_outstandingGsn), + c_nodeStartMaster.m_outstandingGsn); ndbrequire(false); } @@ -4484,9 +4483,10 @@ void Dbdih::failedNodeLcpHandling(Signal* signal, NodeRecordPtr failedNodePtr) failedNodePtr.p->activeStatus = Sysfile::NS_NotActive_NotTakenOver; break; default: - ndbout << "activeStatus = " << (Uint32) failedNodePtr.p->activeStatus; - ndbout << " at failure after NODE_FAILREP of node = "; - ndbout << failedNodePtr.i << endl; + g_eventLogger.error("activeStatus = %u " + "at failure after NODE_FAILREP of node = %u", + (Uint32) failedNodePtr.p->activeStatus, + failedNodePtr.i); ndbrequire(false); break; }//switch @@ -4643,7 +4643,7 @@ Dbdih::startLcpMasterTakeOver(Signal* signal, Uint32 nodeId){ /** * Node failure during master take over... */ - ndbout_c("Nodefail during master take over (old: %d)", oldNode); + g_eventLogger.info("Nodefail during master take over (old: %d)", oldNode); } NodeRecordPtr nodePtr; @@ -4915,7 +4915,8 @@ void Dbdih::execMASTER_GCPCONF(Signal* signal) if (latestLcpId > SYSFILE->latestLCP_ID) { jam(); #if 0 - ndbout_c("Dbdih: Setting SYSFILE->latestLCP_ID to %d", latestLcpId); + g_eventLogger.info("Dbdih: Setting SYSFILE->latestLCP_ID to %d", + latestLcpId); SYSFILE->latestLCP_ID = latestLcpId; #endif SYSFILE->keepGCI = oldestKeepGci; @@ -5574,7 +5575,7 @@ Dbdih::checkLocalNodefailComplete(Signal* signal, Uint32 failedNodeId, if (ERROR_INSERTED(7030)) { - ndbout_c("Reenable GCP_PREPARE"); + g_eventLogger.info("Reenable GCP_PREPARE"); CLEAR_ERROR_INSERT_VALUE; } @@ -5755,7 +5756,7 @@ Dbdih::sendMASTER_LCPCONF(Signal * signal){ c_lcpState.setLcpStatus(LCP_STATUS_IDLE, __LINE__); #if 0 if(c_copyGCISlave.m_copyReason == CopyGCIReq::LOCAL_CHECKPOINT){ - ndbout_c("Dbdih: Also resetting c_copyGCISlave"); + g_eventLogger.info("Dbdih: Also resetting c_copyGCISlave"); c_copyGCISlave.m_copyReason = CopyGCIReq::IDLE; c_copyGCISlave.m_expectedNextWord = 0; } @@ -5844,7 +5845,7 @@ Dbdih::sendMASTER_LCPCONF(Signal * signal){ if(c_lcpState.lcpStatus == LCP_TAB_SAVED){ #ifdef VM_TRACE - ndbout_c("Sending extra GSN_LCP_COMPLETE_REP to new master"); + g_eventLogger.info("Sending extra GSN_LCP_COMPLETE_REP to new master"); #endif sendLCP_COMPLETE_REP(signal); } @@ -6002,7 +6003,7 @@ void Dbdih::execMASTER_LCPCONF(Signal* signal) CRASH_INSERTION(7180); #ifdef VM_TRACE - ndbout_c("MASTER_LCPCONF"); + g_eventLogger.info("MASTER_LCPCONF"); printMASTER_LCP_CONF(stdout, &signal->theData[0], 0, 0); #endif @@ -6079,7 +6080,7 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) // protocol. /* --------------------------------------------------------------------- */ #ifdef VM_TRACE - ndbout_c("MASTER_LCPhandling:: LMTOS_ALL_IDLE -> checkLcpStart"); + g_eventLogger.info("MASTER_LCPhandling:: LMTOS_ALL_IDLE -> checkLcpStart"); #endif checkLcpStart(signal, __LINE__); break; @@ -6090,7 +6091,7 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) // protocol by calculating the keep gci and storing the new lcp id. /* --------------------------------------------------------------------- */ #ifdef VM_TRACE - ndbout_c("MASTER_LCPhandling:: LMTOS_COPY_ONGOING -> storeNewLcpId"); + g_eventLogger.info("MASTER_LCPhandling:: LMTOS_COPY_ONGOING -> storeNewLcpId"); #endif if (c_lcpState.lcpStatus == LCP_STATUS_ACTIVE) { jam(); @@ -6101,7 +6102,7 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) /*---------------------------------------------------------------------*/ Uint32 lcpId = SYSFILE->latestLCP_ID; #ifdef VM_TRACE - ndbout_c("Decreasing latestLCP_ID from %d to %d", lcpId, lcpId - 1); + g_eventLogger.info("Decreasing latestLCP_ID from %d to %d", lcpId, lcpId - 1); #endif SYSFILE->latestLCP_ID--; }//if @@ -6118,10 +6119,10 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) * complete before finalising the LCP process. * ------------------------------------------------------------------ */ #ifdef VM_TRACE - ndbout_c("MASTER_LCPhandling:: LMTOS_ALL_ACTIVE -> " - "startLcpRoundLoopLab(table=%u, fragment=%u)", - c_lcpMasterTakeOverState.minTableId, - c_lcpMasterTakeOverState.minFragId); + g_eventLogger.info("MASTER_LCPhandling:: LMTOS_ALL_ACTIVE -> " + "startLcpRoundLoopLab(table=%u, fragment=%u)", + c_lcpMasterTakeOverState.minTableId, + c_lcpMasterTakeOverState.minFragId); #endif c_lcpState.keepGci = SYSFILE->keepGCI; @@ -6596,7 +6597,13 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal){ }//for } } - ndbrequire(count == (2 + noOfReplicas * noOfFragments)); + if(count != (2 + noOfReplicas * noOfFragments)){ + char buf[255]; + BaseString::snprintf(buf, sizeof(buf), + "Illegal configuration change: NoOfReplicas." + " Can't be applied online "); + progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf); + } CreateFragmentationConf * const conf = (CreateFragmentationConf*)signal->getDataPtrSend(); @@ -7426,8 +7433,8 @@ void Dbdih::checkGcpStopLab(Signal* signal) if (cgcpSameCounter == 1200) { jam(); #ifdef VM_TRACE - ndbout << "System crash due to GCP Stop in state = "; - ndbout << (Uint32) cgcpStatus << endl; + g_eventLogger.error("System crash due to GCP Stop in state = %u", + (Uint32) cgcpStatus); #endif crashSystemAtGcpStop(signal); return; @@ -7440,8 +7447,8 @@ void Dbdih::checkGcpStopLab(Signal* signal) if (cgcpSameCounter == 1200) { jam(); #ifdef VM_TRACE - ndbout << "System crash due to GCP Stop in state = "; - ndbout << (Uint32) cgcpStatus << endl; + g_eventLogger.error("System crash due to GCP Stop in state = %u", + (Uint32) cgcpStatus); #endif crashSystemAtGcpStop(signal); return; @@ -7632,7 +7639,7 @@ void Dbdih::GCP_SAVEhandling(Signal* signal, Uint32 nodeId) getNodeState().startLevel == NodeState::SL_STARTED){ jam(); #if 0 - ndbout_c("Dbdih: Clearing initial start ongoing"); + g_eventLogger.info("Dbdih: Clearing initial start ongoing"); #endif Sysfile::clearInitialStartOngoing(SYSFILE->systemRestartBits); } @@ -7651,7 +7658,7 @@ void Dbdih::execGCP_PREPARE(Signal* signal) if (ERROR_INSERTED(7030)) { cgckptflag = true; - ndbout_c("Delayed GCP_PREPARE 5s"); + g_eventLogger.info("Delayed GCP_PREPARE 5s"); sendSignalWithDelay(reference(), GSN_GCP_PREPARE, signal, 5000, signal->getLength()); return; @@ -7671,7 +7678,7 @@ void Dbdih::execGCP_PREPARE(Signal* signal) if (ERROR_INSERTED(7031)) { - ndbout_c("Crashing delayed in GCP_PREPARE 3s"); + g_eventLogger.info("Crashing delayed in GCP_PREPARE 3s"); signal->theData[0] = 9999; sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 3000, 1); return; @@ -8198,7 +8205,7 @@ void Dbdih::initLcpLab(Signal* signal, Uint32 senderRef, Uint32 tableId) * This is LCP master takeover */ #ifdef VM_TRACE - ndbout_c("initLcpLab aborted due to LCP master takeover - 1"); + g_eventLogger.info("initLcpLab aborted due to LCP master takeover - 1"); #endif c_lcpState.setLcpStatus(LCP_STATUS_IDLE, __LINE__); sendMASTER_LCPCONF(signal); @@ -8211,7 +8218,7 @@ void Dbdih::initLcpLab(Signal* signal, Uint32 senderRef, Uint32 tableId) * Master take over but has not yet received MASTER_LCPREQ */ #ifdef VM_TRACE - ndbout_c("initLcpLab aborted due to LCP master takeover - 2"); + g_eventLogger.info("initLcpLab aborted due to LCP master takeover - 2"); #endif return; } @@ -9442,9 +9449,10 @@ void Dbdih::checkTcCounterLab(Signal* signal) { CRASH_INSERTION(7009); if (c_lcpState.lcpStatus != LCP_STATUS_IDLE) { - ndbout << "lcpStatus = " << (Uint32) c_lcpState.lcpStatus; - ndbout << "lcpStatusUpdatedPlace = " << - c_lcpState.lcpStatusUpdatedPlace << endl; + g_eventLogger.error("lcpStatus = %u" + "lcpStatusUpdatedPlace = %d", + (Uint32) c_lcpState.lcpStatus, + c_lcpState.lcpStatusUpdatedPlace); ndbrequire(false); return; }//if @@ -9997,9 +10005,8 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal) if(tabPtr.p->tabStatus == TabRecord::TS_DROPPING){ jam(); - ndbout_c("TS_DROPPING - Neglecting to save Table: %d Frag: %d - ", - tableId, - fragId); + g_eventLogger.info("TS_DROPPING - Neglecting to save Table: %d Frag: %d - ", + tableId, fragId); } else { jam(); /** @@ -10127,7 +10134,7 @@ void Dbdih::findReplica(ReplicaRecordPtr& replicaPtr, }; #ifdef VM_TRACE - ndbout_c("Fragment Replica(node=%d) not found", nodeId); + g_eventLogger.info("Fragment Replica(node=%d) not found", nodeId); replicaPtr.i = fragPtrP->oldStoredReplicas; while(replicaPtr.i != RNIL){ ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord); @@ -10140,9 +10147,9 @@ void Dbdih::findReplica(ReplicaRecordPtr& replicaPtr, }//if }; if(replicaPtr.i != RNIL){ - ndbout_c("...But was found in oldStoredReplicas"); + g_eventLogger.info("...But was found in oldStoredReplicas"); } else { - ndbout_c("...And wasn't found in oldStoredReplicas"); + g_eventLogger.info("...And wasn't found in oldStoredReplicas"); } #endif ndbrequire(false); @@ -10176,8 +10183,8 @@ Dbdih::reportLcpCompletion(const LcpFragRep* lcpReport) ndbrequire(replicaPtr.p->lcpOngoingFlag == true); if(lcpNo != replicaPtr.p->nextLcp){ - ndbout_c("lcpNo = %d replicaPtr.p->nextLcp = %d", - lcpNo, replicaPtr.p->nextLcp); + g_eventLogger.error("lcpNo = %d replicaPtr.p->nextLcp = %d", + lcpNo, replicaPtr.p->nextLcp); ndbrequire(false); } ndbrequire(lcpNo == replicaPtr.p->nextLcp); @@ -10212,7 +10219,7 @@ Dbdih::reportLcpCompletion(const LcpFragRep* lcpReport) // Not all fragments in table have been checkpointed. /* ----------------------------------------------------------------- */ if(0) - ndbout_c("reportLcpCompletion: fragment %d not ready", fid); + g_eventLogger.info("reportLcpCompletion: fragment %d not ready", fid); return false; }//if }//for @@ -10340,7 +10347,7 @@ void Dbdih::execLCP_COMPLETE_REP(Signal* signal) jamEntry(); #if 0 - ndbout_c("LCP_COMPLETE_REP"); + g_eventLogger.info("LCP_COMPLETE_REP"); printLCP_COMPLETE_REP(stdout, signal->getDataPtr(), signal->length(), number()); @@ -10426,7 +10433,7 @@ void Dbdih::allNodesLcpCompletedLab(Signal* signal) if(c_lcpMasterTakeOverState.state != LMTOS_IDLE){ jam(); #ifdef VM_TRACE - ndbout_c("Exiting from allNodesLcpCompletedLab"); + g_eventLogger.info("Exiting from allNodesLcpCompletedLab"); #endif return; } @@ -10655,14 +10662,14 @@ void Dbdih::crashSystemAtGcpStop(Signal* signal) infoEvent("Detected GCP stop...sending kill to %s", c_GCP_SAVEREQ_Counter.getText()); - ndbout_c("Detected GCP stop...sending kill to %s", - c_GCP_SAVEREQ_Counter.getText()); + g_eventLogger.error("Detected GCP stop...sending kill to %s", + c_GCP_SAVEREQ_Counter.getText()); return; } case GCP_SAVE_LQH_FINISHED: - ndbout_c("m_copyReason: %d m_waiting: %d", - c_copyGCIMaster.m_copyReason, - c_copyGCIMaster.m_waiting); + g_eventLogger.error("m_copyReason: %d m_waiting: %d", + c_copyGCIMaster.m_copyReason, + c_copyGCIMaster.m_waiting); break; case GCP_READY: // shut up lint case GCP_PREPARE_SENT: @@ -10670,11 +10677,11 @@ void Dbdih::crashSystemAtGcpStop(Signal* signal) break; } - ndbout_c("c_copyGCISlave: sender{Data, Ref} %d %x reason: %d nextWord: %d", - c_copyGCISlave.m_senderData, - c_copyGCISlave.m_senderRef, - c_copyGCISlave.m_copyReason, - c_copyGCISlave.m_expectedNextWord); + g_eventLogger.error("c_copyGCISlave: sender{Data, Ref} %d %x reason: %d nextWord: %d", + c_copyGCISlave.m_senderData, + c_copyGCISlave.m_senderRef, + c_copyGCISlave.m_copyReason, + c_copyGCISlave.m_expectedNextWord); FileRecordPtr file0Ptr; file0Ptr.i = crestartInfoFile[0]; @@ -12877,9 +12884,9 @@ void Dbdih::setLcpActiveStatusEnd() nodePtr.i = getOwnNodeId(); ptrAss(nodePtr, nodeRecord); ndbrequire(nodePtr.p->activeStatus == Sysfile::NS_Active); - ndbout_c("NR: setLcpActiveStatusEnd - m_participatingLQH"); + g_eventLogger.info("NR: setLcpActiveStatusEnd - m_participatingLQH"); } else { - ndbout_c("NR: setLcpActiveStatusEnd - !m_participatingLQH"); + g_eventLogger.info("NR: setLcpActiveStatusEnd - !m_participatingLQH"); } } @@ -13710,8 +13717,8 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) } if(arg == DumpStateOrd::EnableUndoDelayDataWrite){ - ndbout << "Dbdih:: delay write of datapages for table = " - << dumpState->args[1]<< endl; + g_eventLogger.info("Dbdih:: delay write of datapages for table = %d", + dumpState->args[1]); // Send this dump to ACC and TUP EXECUTE_DIRECT(DBACC, GSN_DUMP_STATE_ORD, signal, 2); EXECUTE_DIRECT(DBTUP, GSN_DUMP_STATE_ORD, signal, 2); @@ -13728,13 +13735,13 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) }//if if (signal->theData[0] == DumpStateOrd::DihMinTimeBetweenLCP) { // Set time between LCP to min value - ndbout << "Set time between LCP to min value" << endl; + g_eventLogger.info("Set time between LCP to min value"); c_lcpState.clcpDelay = 0; // TimeBetweenLocalCheckpoints.min return; } if (signal->theData[0] == DumpStateOrd::DihMaxTimeBetweenLCP) { // Set time between LCP to max value - ndbout << "Set time between LCP to max value" << endl; + g_eventLogger.info("Set time between LCP to max value"); c_lcpState.clcpDelay = 31; // TimeBetweenLocalCheckpoints.max return; } @@ -13770,7 +13777,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) { cgcpDelay = signal->theData[1]; } - ndbout_c("Setting time between gcp : %d", cgcpDelay); + g_eventLogger.info("Setting time between gcp : %d", cgcpDelay); } if (arg == 7021 && signal->getLength() == 2) @@ -13893,7 +13900,7 @@ Dbdih::execPREP_DROP_TAB_REQ(Signal* signal){ while(index < count){ if(nodePtr.p->queuedChkpt[index].tableId == tabPtr.i){ jam(); - // ndbout_c("Unqueuing %d", index); + // g_eventLogger.info("Unqueuing %d", index); count--; for(Uint32 i = index; i<count; i++){ @@ -13933,7 +13940,7 @@ Dbdih::execPREP_DROP_TAB_REQ(Signal* signal){ if(checkLcpAllTablesDoneInLqh()){ jam(); - ndbout_c("This is the last table"); + g_eventLogger.info("This is the last table"); /** * Then check if saving of tab info is done for all tables @@ -13942,7 +13949,7 @@ Dbdih::execPREP_DROP_TAB_REQ(Signal* signal){ checkLcpCompletedLab(signal); if(a != c_lcpState.lcpStatus){ - ndbout_c("And all tables are written to already written disk"); + g_eventLogger.info("And all tables are written to already written disk"); } } break; @@ -14099,30 +14106,6 @@ Dbdih::execNDB_TAMPER(Signal* signal) return; }//Dbdih::execNDB_TAMPER() -void Dbdih::execSET_VAR_REQ(Signal* signal) { -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - - switch (var) { - case TimeBetweenLocalCheckpoints: - c_lcpState.clcpDelay = val; - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case TimeBetweenGlobalCheckpoints: - cgcpDelay = val; - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif -} - void Dbdih::execBLOCK_COMMIT_ORD(Signal* signal){ BlockCommitOrd* const block = (BlockCommitOrd *)&signal->theData[0]; diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am index 3b5ae716a63..0d9c7db4e69 100644 --- a/ndb/src/kernel/blocks/dbdih/Makefile.am +++ b/ndb/src/kernel/blocks/dbdih/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libdbdih.a EXTRA_PROGRAMS = ndbd_sysfile_reader diff --git a/ndb/src/kernel/blocks/dbdih/Sysfile.hpp b/ndb/src/kernel/blocks/dbdih/Sysfile.hpp index 3e2f3b0dd48..3502a6981bc 100644 --- a/ndb/src/kernel/blocks/dbdih/Sysfile.hpp +++ b/ndb/src/kernel/blocks/dbdih/Sysfile.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp index efa4b9c92c5..8ef69cff388 100644 --- a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp +++ b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index 3c0faff7236..4474d226a27 100644 --- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -510,6 +509,7 @@ public: typedef Ptr<Databuf> DatabufPtr; struct ScanRecord { + ScanRecord() {} enum ScanState { SCAN_FREE = 0, WAIT_STORED_PROC_COPY = 1, @@ -2205,7 +2205,6 @@ private: void execFSREADCONF(Signal* signal); void execFSREADREF(Signal* signal); void execSCAN_HBREP(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execTIME_SIGNAL(Signal* signal); void execFSSYNCCONF(Signal* signal); @@ -2903,6 +2902,7 @@ public: * */ struct CommitAckMarker { + CommitAckMarker() {} Uint32 transid1; Uint32 transid2; @@ -2929,6 +2929,7 @@ public: void scanMarkers(Signal* signal, Uint32 tcNodeFail, Uint32 bucket, Uint32 i); struct Counters { + Counters() {} Uint32 operations; inline void clear(){ diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp index ba18e20f4fb..3452269be51 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -315,7 +314,6 @@ Dblqh::Dblqh(const class Configuration & conf): addRecSignal(GSN_FSREADCONF, &Dblqh::execFSREADCONF); addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF, true); addRecSignal(GSN_ACC_ABORTCONF, &Dblqh::execACC_ABORTCONF); - addRecSignal(GSN_SET_VAR_REQ, &Dblqh::execSET_VAR_REQ); addRecSignal(GSN_TIME_SIGNAL, &Dblqh::execTIME_SIGNAL); addRecSignal(GSN_FSSYNCCONF, &Dblqh::execFSSYNCCONF); addRecSignal(GSN_REMOVE_MARKER_ORD, &Dblqh::execREMOVE_MARKER_ORD); diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index f4b99e8be2f..684598364ab 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -7570,7 +7569,6 @@ Dblqh::get_acc_ptr_from_scan_record(ScanRecord* scanP, bool crash_flag) { Uint32* acc_ptr; - Uint32 attr_buf_rec, attr_buf_index; if (!((index < MAX_PARALLEL_OP_PER_SCAN) && index < scanP->scan_acc_index)) { ndbrequire(crash_flag); @@ -7615,7 +7613,6 @@ void Dblqh::execSCAN_FRAGREQ(Signal* signal) const Uint32 scanLockMode = ScanFragReq::getLockMode(reqinfo); const Uint8 keyinfo = ScanFragReq::getKeyinfoFlag(reqinfo); const Uint8 rangeScan = ScanFragReq::getRangeScanFlag(reqinfo); - const Uint8 tupScan = ScanFragReq::getTupScanFlag(reqinfo); ptrCheckGuard(tabptr, ctabrecFileSize, tablerec); if(tabptr.p->tableStatus != Tablerec::TABLE_DEFINED){ @@ -9004,9 +9001,6 @@ Uint32 Dblqh::sendKeyinfo20(Signal* signal, const Uint32 scanOp = scanP->m_curr_batch_size_rows; const Uint32 nodeId = refToNode(ref); const bool connectedToNode = getNodeInfo(nodeId).m_connected; - const Uint32 type = getNodeInfo(nodeId).m_type; - const bool is_api = (type >= NodeInfo::API && type <= NodeInfo::REP); - const bool old_dest = (getNodeInfo(nodeId).m_version < MAKE_VERSION(3,5,0)); const bool longable = true; // TODO is_api && !old_dest; Uint32 * dst = keyInfo->keyData; @@ -9107,7 +9101,6 @@ void Dblqh::sendScanFragConf(Signal* signal, Uint32 scanCompleted) return; } ScanFragConf * conf = (ScanFragConf*)&signal->theData[0]; - NodeId tc_node_id= refToNode(tcConnectptr.p->clientBlockref); Uint32 trans_id1= tcConnectptr.p->transid[0]; Uint32 trans_id2= tcConnectptr.p->transid[1]; @@ -11409,7 +11402,6 @@ void Dblqh::sendAccContOp(Signal* signal) { LcpLocRecordPtr sacLcpLocptr; - int count = 0; sacLcpLocptr.i = lcpPtr.p->firstLcpLocAcc; do { ptrCheckGuard(sacLcpLocptr, clcpLocrecFileSize, lcpLocRecord); @@ -15117,8 +15109,6 @@ void Dblqh::execDEBUG_SIG(Signal* signal) 2.5 TEMPORARY VARIABLES ----------------------- */ - UintR tdebug; - jamEntry(); //logPagePtr.i = signal->theData[0]; //tdebug = logPagePtr.p->logPageWord[0]; @@ -18950,30 +18940,6 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal) }//Dblqh::execDUMP_STATE_ORD() -void Dblqh::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - - switch (var) { - - case NoOfConcurrentCheckpointsAfterRestart: - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case NoOfConcurrentCheckpointsDuringRestart: - // Valid only during start so value not set. - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif -}//execSET_VAR_REQ() - - /* **************************************************************** */ /* ---------------------------------------------------------------- */ /* ---------------------- TRIGGER HANDLING ------------------------ */ diff --git a/ndb/src/kernel/blocks/dblqh/Makefile.am b/ndb/src/kernel/blocks/dblqh/Makefile.am index bb8efe8c5b8..07c6ea1ea52 100644 --- a/ndb/src/kernel/blocks/dblqh/Makefile.am +++ b/ndb/src/kernel/blocks/dblqh/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libdblqh.a EXTRA_PROGRAMS = ndbd_redo_log_reader diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp index 6eadefe5df5..e164931eda3 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp index 06bf7a85d53..1559494684e 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp index 751d27db74e..e5df14aea9a 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index 1e8fcee759c..6934de76ad3 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -139,7 +138,6 @@ #define ZNOT_FOUND 626 #define ZALREADYEXIST 630 -#define ZINCONSISTENTHASHINDEX 892 #define ZNOTUNIQUE 893 #define ZINVALID_KEY 290 @@ -304,6 +302,7 @@ public: /* WHEN THE TRIGGER IS DEACTIVATED. */ /* **************************************** */ struct TcDefinedTriggerData { + TcDefinedTriggerData() {} /** * Trigger id, used to identify the trigger */ @@ -704,6 +703,7 @@ public: Uint8 tckeyrec; // Ändrad från R Uint8 tcindxrec; Uint8 apiFailState; // Ändrad från R + Uint8 singleUserMode; ReturnSignal returnsignal; Uint8 timeOutCounter; @@ -958,18 +958,30 @@ public: /* ALL TABLES IN THE SYSTEM. */ /********************************************************/ struct TableRecord { + TableRecord() {} Uint32 currentSchemaVersion; - Uint8 enabled; - Uint8 dropping; + Uint16 m_flags; Uint8 tableType; - Uint8 storedTable; + Uint8 singleUserMode; + + enum { + TR_ENABLED = 1 << 0, + TR_DROPPING = 1 << 1, + TR_STORED_TABLE = 1 << 2 + }; + Uint8 get_enabled() const { return (m_flags & TR_ENABLED) != 0; } + Uint8 get_dropping() const { return (m_flags & TR_DROPPING) != 0; } + Uint8 get_storedTable() const { return (m_flags & TR_STORED_TABLE) != 0; } + void set_enabled(Uint8 f) { f ? m_flags |= (Uint16)TR_ENABLED : m_flags &= ~(Uint16)TR_ENABLED; } + void set_dropping(Uint8 f) { f ? m_flags |= (Uint16)TR_DROPPING : m_flags &= ~(Uint16)TR_DROPPING; } + void set_storedTable(Uint8 f) { f ? m_flags |= (Uint16)TR_STORED_TABLE : m_flags &= ~(Uint16)TR_STORED_TABLE; } Uint8 noOfKeyAttr; Uint8 hasCharAttr; Uint8 noOfDistrKeys; bool checkTable(Uint32 schemaVersion) const { - return enabled && !dropping && + return get_enabled() && !get_dropping() && (table_version_major(schemaVersion) == table_version_major(currentSchemaVersion)); } @@ -1325,7 +1337,6 @@ private: void execTIME_SIGNAL(Signal* signal); void execAPI_FAILREQ(Signal* signal); void execSCAN_HBREP(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execABORT_ALL_REQ(Signal* signal); @@ -1667,6 +1678,7 @@ private: UintR tcheckGcpId; struct TransCounters { + TransCounters() {} enum { Off, Timer, Started } c_trans_status; UintR cattrinfoCount; UintR ctransCount; @@ -1805,6 +1817,7 @@ private: */ public: struct CommitAckMarker { + CommitAckMarker() {} Uint32 transid1; Uint32 transid2; union { Uint32 nextPool; Uint32 nextHash; }; @@ -1837,9 +1850,14 @@ private: Uint32 transid2); void removeMarkerForFailedAPI(Signal* signal, Uint32 nodeId, Uint32 bucket); - bool getAllowStartTransaction() const { - if(getNodeState().getSingleUserMode()) - return true; + bool getAllowStartTransaction(Uint32 nodeId, Uint32 table_single_user_mode) const { + if (unlikely(getNodeState().getSingleUserMode())) + { + if (getNodeState().getSingleUserApi() == nodeId || table_single_user_mode) + return true; + else + return false; + } return getNodeState().startLevel < NodeState::SL_STOPPING_2; } diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp index 098373fb3de..73149f0b6fd 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -257,7 +256,6 @@ Dbtc::Dbtc(const class Configuration & conf): addRecSignal(GSN_INCL_NODEREQ, &Dbtc::execINCL_NODEREQ); addRecSignal(GSN_TIME_SIGNAL, &Dbtc::execTIME_SIGNAL); addRecSignal(GSN_API_FAILREQ, &Dbtc::execAPI_FAILREQ); - addRecSignal(GSN_SET_VAR_REQ, &Dbtc::execSET_VAR_REQ); addRecSignal(GSN_TC_COMMIT_ACK, &Dbtc::execTC_COMMIT_ACK); addRecSignal(GSN_ABORT_ALL_REQ, &Dbtc::execABORT_ALL_REQ); diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 1185b790bdd..e78dc47cbb2 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -328,19 +327,21 @@ void Dbtc::execTC_SCHVERREQ(Signal* signal) tabptr.i = signal->theData[0]; ptrCheckGuard(tabptr, ctabrecFilesize, tableRecord); tabptr.p->currentSchemaVersion = signal->theData[1]; - tabptr.p->storedTable = (bool)signal->theData[2]; + tabptr.p->m_flags = 0; + tabptr.p->set_storedTable((bool)signal->theData[2]); BlockReference retRef = signal->theData[3]; tabptr.p->tableType = (Uint8)signal->theData[4]; BlockReference retPtr = signal->theData[5]; Uint32 noOfKeyAttr = signal->theData[6]; + tabptr.p->singleUserMode = (Uint8)signal->theData[7]; ndbrequire(noOfKeyAttr <= MAX_ATTRIBUTES_IN_INDEX); const KeyDescriptor* desc = g_key_descriptor_pool.getPtr(tabptr.i); ndbrequire(noOfKeyAttr == desc->noOfKeyAttr); - ndbrequire(tabptr.p->enabled == false); - tabptr.p->enabled = true; - tabptr.p->dropping = false; + ndbrequire(tabptr.p->get_enabled() == false); + tabptr.p->set_enabled(true); + tabptr.p->set_dropping(false); tabptr.p->noOfKeyAttr = desc->noOfKeyAttr; tabptr.p->hasCharAttr = desc->hasCharAttr; tabptr.p->noOfDistrKeys = desc->noOfDistrKeys; @@ -364,7 +365,7 @@ Dbtc::execPREP_DROP_TAB_REQ(Signal* signal) Uint32 senderRef = req->senderRef; Uint32 senderData = req->senderData; - if(!tabPtr.p->enabled){ + if(!tabPtr.p->get_enabled()){ jam(); PrepDropTabRef* ref = (PrepDropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); @@ -376,7 +377,7 @@ Dbtc::execPREP_DROP_TAB_REQ(Signal* signal) return; } - if(tabPtr.p->dropping){ + if(tabPtr.p->get_dropping()){ jam(); PrepDropTabRef* ref = (PrepDropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); @@ -388,7 +389,7 @@ Dbtc::execPREP_DROP_TAB_REQ(Signal* signal) return; } - tabPtr.p->dropping = true; + tabPtr.p->set_dropping(true); tabPtr.p->dropTable.senderRef = senderRef; tabPtr.p->dropTable.senderData = senderData; @@ -424,7 +425,7 @@ Dbtc::execWAIT_DROP_TAB_CONF(Signal* signal) tabPtr.i = conf->tableId; ptrCheckGuard(tabPtr, ctabrecFilesize, tableRecord); - ndbrequire(tabPtr.p->dropping == true); + ndbrequire(tabPtr.p->get_dropping() == true); Uint32 nodeId = refToNode(conf->senderRef); tabPtr.p->dropTable.waitDropTabCount.clearWaitingFor(nodeId); @@ -454,7 +455,7 @@ Dbtc::execWAIT_DROP_TAB_REF(Signal* signal) tabPtr.i = ref->tableId; ptrCheckGuard(tabPtr, ctabrecFilesize, tableRecord); - ndbrequire(tabPtr.p->dropping == true); + ndbrequire(tabPtr.p->get_dropping() == true); Uint32 nodeId = refToNode(ref->senderRef); tabPtr.p->dropTable.waitDropTabCount.clearWaitingFor(nodeId); @@ -491,7 +492,7 @@ Dbtc::checkWaitDropTabFailedLqh(Signal* signal, Uint32 nodeId, Uint32 tableId) for(Uint32 i = 0; i<RT_BREAK && tabPtr.i < ctabrecFilesize; i++, tabPtr.i++){ jam(); ptrAss(tabPtr, tableRecord); - if(tabPtr.p->enabled && tabPtr.p->dropping){ + if(tabPtr.p->get_enabled() && tabPtr.p->get_dropping()){ if(tabPtr.p->dropTable.waitDropTabCount.isWaitingFor(nodeId)){ jam(); conf->senderRef = calcLqhBlockRef(nodeId); @@ -532,7 +533,7 @@ Dbtc::execDROP_TAB_REQ(Signal* signal) Uint32 senderData = req->senderData; DropTabReq::RequestType rt = (DropTabReq::RequestType)req->requestType; - if(!tabPtr.p->enabled && rt == DropTabReq::OnlineDropTab){ + if(!tabPtr.p->get_enabled() && rt == DropTabReq::OnlineDropTab){ jam(); DropTabRef* ref = (DropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); @@ -544,7 +545,7 @@ Dbtc::execDROP_TAB_REQ(Signal* signal) return; } - if(!tabPtr.p->dropping && rt == DropTabReq::OnlineDropTab){ + if(!tabPtr.p->get_dropping() && rt == DropTabReq::OnlineDropTab){ jam(); DropTabRef* ref = (DropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); @@ -556,8 +557,8 @@ Dbtc::execDROP_TAB_REQ(Signal* signal) return; } - tabPtr.p->enabled = false; - tabPtr.p->dropping = false; + tabPtr.p->set_enabled(false); + tabPtr.p->set_dropping(false); DropTabConf * conf = (DropTabConf*)signal->getDataPtrSend(); conf->tableId = tabPtr.i; @@ -1200,16 +1201,14 @@ void Dbtc::execTCSEIZEREQ(Signal* signal) const NodeId senderNodeId = refToNode(tapiBlockref); const bool local = senderNodeId == getOwnNodeId() || senderNodeId == 0; - if(!(senderNodeId == getNodeState().getSingleUserApi()) && - !getNodeState().getSingleUserMode()) { - if(!(sl==NodeState::SL_SINGLEUSER && - senderNodeId == getNodeState().getSingleUserApi())) { + { + { if (!(sl == NodeState::SL_STARTED || (sl == NodeState::SL_STARTING && local == true))) { jam(); - Uint32 errCode; - if(!(sl == NodeState::SL_SINGLEUSER && local)) + Uint32 errCode = 0; + if(!local) { switch(sl){ case NodeState::SL_STARTING: @@ -1217,6 +1216,8 @@ void Dbtc::execTCSEIZEREQ(Signal* signal) break; case NodeState::SL_STOPPING_1: case NodeState::SL_STOPPING_2: + if (getNodeState().getSingleUserMode()) + break; case NodeState::SL_STOPPING_3: case NodeState::SL_STOPPING_4: if(getNodeState().stopping.systemShutdown) @@ -1225,16 +1226,18 @@ void Dbtc::execTCSEIZEREQ(Signal* signal) errCode = ZNODE_SHUTDOWN_IN_PROGRESS; break; case NodeState::SL_SINGLEUSER: - errCode = ZCLUSTER_IN_SINGLEUSER_MODE; break; default: errCode = ZWRONG_STATE; break; } - signal->theData[0] = tapiPointer; - signal->theData[1] = errCode; - sendSignal(tapiBlockref, GSN_TCSEIZEREF, signal, 2, JBB); - return; + if (errCode) + { + signal->theData[0] = tapiPointer; + signal->theData[1] = errCode; + sendSignal(tapiBlockref, GSN_TCSEIZEREF, signal, 2, JBB); + return; + } }//if (!(sl == SL_SINGLEUSER)) } //if } @@ -1721,8 +1724,14 @@ Dbtc::TCKEY_abort(Signal* signal, int place) * Initialize object before starting error handling */ initApiConnectRec(signal, apiConnectptr.p, true); +start_failure: switch(getNodeState().startLevel){ case NodeState::SL_STOPPING_2: + if (getNodeState().getSingleUserMode()) + { + terrorCode = ZCLUSTER_IN_SINGLEUSER_MODE; + break; + } case NodeState::SL_STOPPING_3: case NodeState::SL_STOPPING_4: if(getNodeState().stopping.systemShutdown) @@ -1733,6 +1742,12 @@ Dbtc::TCKEY_abort(Signal* signal, int place) case NodeState::SL_SINGLEUSER: terrorCode = ZCLUSTER_IN_SINGLEUSER_MODE; break; + case NodeState::SL_STOPPING_1: + if (getNodeState().getSingleUserMode()) + { + terrorCode = ZCLUSTER_IN_SINGLEUSER_MODE; + break; + } default: terrorCode = ZWRONG_STATE; break; @@ -1754,6 +1769,13 @@ Dbtc::TCKEY_abort(Signal* signal, int place) return; } + case 60: + { + jam(); + initApiConnectRec(signal, apiConnectptr.p, true); + apiConnectptr.p->m_exec_flag = 1; + goto start_failure; + } default: jam(); systemErrorLab(signal, __LINE__); @@ -2373,6 +2395,7 @@ void Dbtc::initApiConnectRec(Signal* signal, regApiPtr->buddyPtr = RNIL; regApiPtr->currSavePointId = 0; regApiPtr->m_transaction_nodes.clear(); + regApiPtr->singleUserMode = 0; // Trigger data releaseFiredTriggerData(®ApiPtr->theFiredTriggers), // Index data @@ -2482,6 +2505,7 @@ Dbtc::seizeCacheRecord(Signal* signal) /*****************************************************************************/ void Dbtc::execTCKEYREQ(Signal* signal) { + Uint32 sendersNodeId = refToNode(signal->getSendersBlockRef()); UintR compare_transid1, compare_transid2; UintR titcLenAiInTckeyreq; UintR TkeyLength; @@ -2525,9 +2549,12 @@ void Dbtc::execTCKEYREQ(Signal* signal) bool isIndexOpReturn = regApiPtr->indexOpReturn; regApiPtr->isIndexOp = false; // Reset marker regApiPtr->m_exec_flag |= TexecFlag; + TableRecordPtr localTabptr; + localTabptr.i = TtabIndex; + localTabptr.p = &tableRecord[TtabIndex]; switch (regApiPtr->apiConnectstate) { case CS_CONNECTED:{ - if (TstartFlag == 1 && getAllowStartTransaction() == true){ + if (TstartFlag == 1 && getAllowStartTransaction(sendersNodeId, localTabptr.p->singleUserMode) == true){ //--------------------------------------------------------------------- // Initialise API connect record if transaction is started. //--------------------------------------------------------------------- @@ -2535,7 +2562,7 @@ void Dbtc::execTCKEYREQ(Signal* signal) initApiConnectRec(signal, regApiPtr); regApiPtr->m_exec_flag = TexecFlag; } else { - if(getAllowStartTransaction() == true){ + if(getAllowStartTransaction(sendersNodeId, localTabptr.p->singleUserMode) == true){ /*------------------------------------------------------------------ * WE EXPECTED A START TRANSACTION. SINCE NO OPERATIONS HAVE BEEN * RECEIVED WE INDICATE THIS BY SETTING FIRST_TC_CONNECT TO RNIL TO @@ -2545,9 +2572,9 @@ void Dbtc::execTCKEYREQ(Signal* signal) return; } else { /** - * getAllowStartTransaction() == false + * getAllowStartTransaction(sendersNodeId) == false */ - TCKEY_abort(signal, 57); + TCKEY_abort(signal, TexecFlag ? 60 : 57); return; }//if } @@ -2562,6 +2589,13 @@ void Dbtc::execTCKEYREQ(Signal* signal) * the state will be CS_STARTED */ jam(); + if (unlikely(getNodeState().getSingleUserMode()) && + getNodeState().getSingleUserApi() != sendersNodeId && + !localTabptr.p->singleUserMode) + { + TCKEY_abort(signal, TexecFlag ? 60 : 57); + return; + } initApiConnectRec(signal, regApiPtr); regApiPtr->m_exec_flag = TexecFlag; } else { @@ -2582,6 +2616,10 @@ void Dbtc::execTCKEYREQ(Signal* signal) case CS_ABORTING: if (regApiPtr->abortState == AS_IDLE) { if (TstartFlag == 1) { + if(getAllowStartTransaction(sendersNodeId, localTabptr.p->singleUserMode) == false){ + TCKEY_abort(signal, TexecFlag ? 60 : 57); + return; + } //-------------------------------------------------------------------- // Previous transaction had been aborted and the abort was completed. // It is then OK to start a new transaction again. @@ -2645,9 +2683,6 @@ void Dbtc::execTCKEYREQ(Signal* signal) return; }//switch - TableRecordPtr localTabptr; - localTabptr.i = TtabIndex; - localTabptr.p = &tableRecord[TtabIndex]; if (localTabptr.p->checkTable(tcKeyReq->tableSchemaVersion)) { ; } else { @@ -2706,6 +2741,8 @@ void Dbtc::execTCKEYREQ(Signal* signal) regTcPtr->savePointId = regApiPtr->currSavePointId; regApiPtr->executingIndexOp = RNIL; + regApiPtr->singleUserMode |= 1 << localTabptr.p->singleUserMode; + if (TcKeyReq::getExecutingTrigger(Treqinfo)) { // Save the TcOperationPtr for fireing operation regTcPtr->triggeringOperation = TsenderData; @@ -2837,7 +2874,7 @@ void Dbtc::execTCKEYREQ(Signal* signal) * THIS VARIABLE CONTROLS THE INTERVAL BETWEEN LCP'S AND * TEMP TABLES DON'T PARTICIPATE. * -------------------------------------------------------------------- */ - if (localTabptr.p->storedTable) { + if (localTabptr.p->get_storedTable()) { coperationsize = ((Toperationsize + TattrLen) + TkeyLength) + 17; } c_counters.cwriteCount = TwriteCount + 1; @@ -4696,6 +4733,7 @@ void Dbtc::copyApi(Signal* signal) regApiPtr->lqhkeyconfrec = Tlqhkeyconfrec; regApiPtr->commitAckMarker = TcommitAckMarker; regApiPtr->m_transaction_nodes = Tnodes; + regApiPtr->singleUserMode = 0; gcpPtr.i = TgcpPointer; ptrCheckGuard(gcpPtr, TgcpFilesize, localGcpRecord); @@ -4707,6 +4745,7 @@ void Dbtc::copyApi(Signal* signal) regTmpApiPtr->firstTcConnect = RNIL; regTmpApiPtr->lastTcConnect = RNIL; regTmpApiPtr->m_transaction_nodes.clear(); + regTmpApiPtr->singleUserMode = 0; releaseAllSeizedIndexOperations(regTmpApiPtr); }//Dbtc::copyApi() @@ -6162,9 +6201,11 @@ and otherwise we spread it out 310 ms. void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) { Uint32 end_ptr, time_passed, time_out_value, mask_value; + Uint32 old_mask_value= 0; const Uint32 api_con_sz= capiConnectFilesize; const Uint32 tc_timer= ctcTimer; const Uint32 time_out_param= ctimeOutValue; + const Uint32 old_time_out_param= c_abortRec.oldTimeOutValue; ctimeOutCheckHeartbeat = tc_timer; @@ -6185,16 +6226,50 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) jam(); mask_value= 31; } + if (time_out_param != old_time_out_param && + getNodeState().getSingleUserMode()) + { + // abort during single user mode, use old_mask_value as flag + // and calculate value to be used for connections with allowed api + if (old_time_out_param > 300) { + jam(); + old_mask_value= 63; + } else if (old_time_out_param < 30) { + jam(); + old_mask_value= 7; + } else { + jam(); + old_mask_value= 31; + } + } for ( ; api_con_ptr < end_ptr; api_con_ptr++) { Uint32 api_timer= getApiConTimer(api_con_ptr); jam(); if (api_timer != 0) { + Uint32 error= ZTIME_OUT_ERROR; time_out_value= time_out_param + (api_con_ptr & mask_value); + if (unlikely(old_mask_value)) // abort during single user mode + { + apiConnectptr.i = api_con_ptr; + ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); + if ((getNodeState().getSingleUserApi() == + refToNode(apiConnectptr.p->ndbapiBlockref)) || + !(apiConnectptr.p->singleUserMode & (1 << NDB_SUM_LOCKED))) + { + // api allowed during single user, use original timeout + time_out_value= + old_time_out_param + (api_con_ptr & old_mask_value); + } + else + { + error= ZCLUSTER_IN_SINGLEUSER_MODE; + } + } time_passed= tc_timer - api_timer; if (time_passed > time_out_value) { jam(); - timeOutFoundLab(signal, api_con_ptr, ZTIME_OUT_ERROR); + timeOutFoundLab(signal, api_con_ptr, error); api_con_ptr++; break; } @@ -6234,7 +6309,8 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr, Uint32 errCode) << " code: " << errCode); switch (apiConnectptr.p->apiConnectstate) { case CS_STARTED: - if(apiConnectptr.p->lqhkeyreqrec == apiConnectptr.p->lqhkeyconfrec){ + if(apiConnectptr.p->lqhkeyreqrec == apiConnectptr.p->lqhkeyconfrec && + errCode != ZCLUSTER_IN_SINGLEUSER_MODE){ jam(); /* We are waiting for application to continue the transaction. In this @@ -6806,6 +6882,33 @@ void Dbtc::timeOutFoundFragLab(Signal* signal, UintR TscanConPtr) c_scan_frag_pool.getPtr(ptr, TscanConPtr); DEBUG(TscanConPtr << " timeOutFoundFragLab: scanFragState = "<< ptr.p->scanFragState); + const Uint32 time_out_param= ctimeOutValue; + const Uint32 old_time_out_param= c_abortRec.oldTimeOutValue; + + if (unlikely(time_out_param != old_time_out_param && + getNodeState().getSingleUserMode())) + { + jam(); + ScanRecordPtr scanptr; + scanptr.i = ptr.p->scanRec; + ptrCheckGuard(scanptr, cscanrecFileSize, scanRecord); + ApiConnectRecordPtr TlocalApiConnectptr; + TlocalApiConnectptr.i = scanptr.p->scanApiRec; + ptrCheckGuard(TlocalApiConnectptr, capiConnectFilesize, apiConnectRecord); + + if (refToNode(TlocalApiConnectptr.p->ndbapiBlockref) == + getNodeState().getSingleUserApi()) + { + jam(); + Uint32 val = ctcTimer - ptr.p->scanFragTimer; + if (val <= old_time_out_param) + { + jam(); + goto next; + } + } + } + /*-------------------------------------------------------------------------*/ // The scan fragment has expired its timeout. Check its state to decide // what to do. @@ -6867,6 +6970,7 @@ void Dbtc::timeOutFoundFragLab(Signal* signal, UintR TscanConPtr) break; }//switch +next: signal->theData[0] = TcContinueB::ZCONTINUE_TIME_OUT_FRAG_CONTROL; signal->theData[1] = TscanConPtr + 1; sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB); @@ -6946,7 +7050,6 @@ void Dbtc::execGCP_NOMORETRANS(Signal* signal) /*****************************************************************************/ void Dbtc::execNODE_FAILREP(Signal* signal) { - HostRecordPtr tmpHostptr; jamEntry(); NodeFailRep * const nodeFail = (NodeFailRep *)&signal->theData[0]; @@ -8099,6 +8202,7 @@ void Dbtc::initApiConnectFail(Signal* signal) apiConnectptr.p->ndbapiConnect = 0; apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; setApiConTimer(apiConnectptr.i, 0, __LINE__); switch(ttransStatus){ case LqhTransConf::Committed: @@ -8698,6 +8802,14 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) } } + if (getNodeState().startLevel == NodeState::SL_SINGLEUSER && + getNodeState().getSingleUserApi() != + refToNode(apiConnectptr.p->ndbapiBlockref)) + { + errCode = ZCLUSTER_IN_SINGLEUSER_MODE; + goto SCAN_TAB_error; + } + seizeTcConnect(signal); tcConnectptr.p->apiConnect = apiConnectptr.i; tcConnectptr.p->tcConnectstate = OS_WAIT_SCAN; @@ -9987,6 +10099,7 @@ void Dbtc::initApiConnect(Signal* signal) apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->currSavePointId = 0; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; }//for apiConnectptr.i = tiacTmp - 1; ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); @@ -10015,6 +10128,7 @@ void Dbtc::initApiConnect(Signal* signal) apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->currSavePointId = 0; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; }//for apiConnectptr.i = (2 * tiacTmp) - 1; ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); @@ -10043,6 +10157,7 @@ void Dbtc::initApiConnect(Signal* signal) apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->currSavePointId = 0; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; }//for apiConnectptr.i = (3 * tiacTmp) - 1; ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); @@ -10227,10 +10342,11 @@ void Dbtc::initTable(Signal* signal) refresh_watch_dog(); ptrAss(tabptr, tableRecord); tabptr.p->currentSchemaVersion = 0; - tabptr.p->storedTable = true; + tabptr.p->m_flags = 0; + tabptr.p->set_storedTable(true); tabptr.p->tableType = 0; - tabptr.p->enabled = false; - tabptr.p->dropping = false; + tabptr.p->set_enabled(false); + tabptr.p->set_dropping(false); tabptr.p->noOfKeyAttr = 0; tabptr.p->hasCharAttr = 0; tabptr.p->noOfDistrKeys = 0; @@ -10363,6 +10479,7 @@ void Dbtc::releaseAbortResources(Signal* signal) apiConnectptr.p->firstTcConnect = RNIL; apiConnectptr.p->lastTcConnect = RNIL; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; // MASV let state be CS_ABORTING until all // signals in the "air" have been received. Reset to CS_CONNECTED @@ -11002,36 +11119,6 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal) } }//Dbtc::execDUMP_STATE_ORD() -void Dbtc::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - - switch (var) { - - case TransactionInactiveTime: - jam(); - set_appl_timeout_value(val); - break; - case TransactionDeadlockDetectionTimeout: - set_timeout_value(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case NoOfConcurrentProcessesHandleTakeover: - set_no_parallel_takeover(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif -} - void Dbtc::execABORT_ALL_REQ(Signal* signal) { jamEntry(); @@ -11041,7 +11128,7 @@ void Dbtc::execABORT_ALL_REQ(Signal* signal) const Uint32 senderData = req->senderData; const BlockReference senderRef = req->senderRef; - if(getAllowStartTransaction() == true && !getNodeState().getSingleUserMode()){ + if(getAllowStartTransaction(refToNode(senderRef), 0) == true && !getNodeState().getSingleUserMode()){ jam(); ref->senderData = senderData; @@ -11469,6 +11556,17 @@ void Dbtc::execTCINDXREQ(Signal* signal) regApiPtr->transid[1] = tcIndxReq->transId2; }//if + if (getNodeState().startLevel == NodeState::SL_SINGLEUSER && + getNodeState().getSingleUserApi() != + refToNode(regApiPtr->ndbapiBlockref)) + { + terrorCode = ZCLUSTER_IN_SINGLEUSER_MODE; + regApiPtr->m_exec_flag |= TcKeyReq::getExecuteFlag(tcIndxRequestInfo); + apiConnectptr = transPtr; + abortErrorLab(signal); + return; + } + if (ERROR_INSERTED(8036) || !seizeIndexOperation(regApiPtr, indexOpPtr)) { jam(); // Failed to allocate index operation @@ -11869,8 +11967,6 @@ void Dbtc::execTCKEYREF(Signal* signal) } const UintR TconnectIndex = indexOp->connectionIndex; ApiConnectRecord * const regApiPtr = &apiConnectRecord[TconnectIndex]; - Uint32 tcKeyRequestInfo = indexOp->tcIndxReq.requestInfo; - Uint32 commitFlg = TcKeyReq::getCommitFlag(tcKeyRequestInfo); switch(indexOp->indexOpState) { case(IOS_NOOP): { @@ -13266,9 +13362,9 @@ void Dbtc::deleteFromIndexTable(Signal* signal, Uint32 Dbtc::TableRecord::getErrorCode(Uint32 schemaVersion) const { - if(!enabled) + if(!get_enabled()) return ZNO_SUCH_TABLE; - if(dropping) + if(get_dropping()) return ZDROP_TABLE_IN_PROGRESS; if(table_version_major(schemaVersion) != table_version_major(currentSchemaVersion)) return ZWRONG_SCHEMA_VERSION_ERROR; diff --git a/ndb/src/kernel/blocks/dbtc/Makefile.am b/ndb/src/kernel/blocks/dbtc/Makefile.am index 98ee2639bac..8d3cea09e33 100644 --- a/ndb/src/kernel/blocks/dbtc/Makefile.am +++ b/ndb/src/kernel/blocks/dbtc/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libdbtc.a libdbtc_a_SOURCES = DbtcInit.cpp DbtcMain.cpp diff --git a/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp b/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp index 2c62adab3e5..9445d5aa1cb 100644 --- a/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp +++ b/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index c068a993792..6fe0eefcdb5 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -748,6 +747,7 @@ typedef Ptr<RestartInfoRecord> RestartInfoRecordPtr; /* WHEN THE TRIGGER IS DEACTIVATED. */ /* **************************************** */ struct TupTriggerData { + TupTriggerData() {} /** * Trigger id, used by DICT/TRIX to identify the trigger @@ -1117,7 +1117,6 @@ private: void execFSREADCONF(Signal* signal); void execNDB_STTOR(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execDROP_TAB_REQ(Signal* signal); void execALTER_TAB_REQ(Signal* signal); void execFSREMOVECONF(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp b/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp index 07babd72ce1..ac1457ad977 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp b/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp index 6a478bea917..26fe74b3eed 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp b/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp index 37bf33f0313..71cfa98b68b 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp b/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp index 8c43de52a75..975b95f7f41 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index a94d2f70343..28f3b987e7b 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp b/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp index cdd54ba2337..1fe3fd22866 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index f5b4e1fb944..df8df2d29f3 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -105,7 +104,6 @@ Dbtup::Dbtup(const class Configuration & conf) addRecSignal(GSN_FSREADCONF, &Dbtup::execFSREADCONF); addRecSignal(GSN_NDB_STTOR, &Dbtup::execNDB_STTOR); addRecSignal(GSN_READ_CONFIG_REQ, &Dbtup::execREAD_CONFIG_REQ, true); - addRecSignal(GSN_SET_VAR_REQ, &Dbtup::execSET_VAR_REQ); // Trigger Signals addRecSignal(GSN_CREATE_TRIG_REQ, &Dbtup::execCREATE_TRIG_REQ); @@ -1316,32 +1314,5 @@ void Dbtup::seizePendingFileOpenInfoRecord(PendingFileOpenInfoPtr& pfoiPtr) pfoiPtr.p->pfoNextRec = RNIL; }//Dbtup::seizePendingFileOpenInfoRecord() -void Dbtup::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)signal->getDataPtrSend(); - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - switch (var) { - - case NoOfDiskPagesToDiskAfterRestartTUP: - clblPagesPerTick = val; - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case NoOfDiskPagesToDiskDuringRestartTUP: - // Valid only during start so value not set. - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif - -}//execSET_VAR_REQ() - - diff --git a/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp b/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp index ab6e0642e11..964d8578217 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -186,7 +185,6 @@ Dbtup::tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* data PagePtr pagePtr; pagePtr.i = pageId; ptrCheckGuard(pagePtr, cnoOfPage, page); - const Uint32 tabDescriptor = tablePtr.p->tabDescriptor; const Uint32* attrIds = &tableDescriptor[tablePtr.p->readKeyArray].tabDescr; const Uint32 numAttrs = tablePtr.p->noOfKeyAttr; // read pk attributes from original tuple @@ -240,7 +238,6 @@ Dbtup::accReadPk(Uint32 tableId, Uint32 fragId, Uint32 fragPageId, Uint32 pageIn FragrecordPtr fragPtr; getFragmentrec(fragPtr, fragId, tablePtr.p); // get real page id and tuple offset - PagePtr pagePtr; Uint32 pageId = getRealpid(fragPtr.p, fragPageId); ndbrequire((pageIndex & 0x1) == 0); Uint32 pageOffset = ZPAGE_HEADER_SIZE + (pageIndex >> 1) * tablePtr.p->tupheadsize; diff --git a/ndb/src/kernel/blocks/dbtup/DbtupLCP.cpp b/ndb/src/kernel/blocks/dbtup/DbtupLCP.cpp index 370ef4c4ba5..de98fece373 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupLCP.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupLCP.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index 7d2f7d56d48..2ae04078ae0 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp b/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp index 8a18fddae19..c6924c5d762 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp b/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp index e227ac8b5bf..49c7af4161a 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index 8a55777ac05..ae3bb0dcd7c 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp index 396404faa8c..59c1a1d1d78 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -90,7 +89,6 @@ Dbtup::execNEXT_SCANREQ(Signal* signal) FragrecordPtr fragPtr; fragPtr.i = scan.m_fragPtrI[0]; ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); - Fragrecord& frag = *fragPtr.p; switch (req->scanFlag) { case NextScanReq::ZSCAN_NEXT: jam(); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp b/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp index 3b957688a1c..37fcd3df317 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp b/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp index 35d1b75e573..364a8a0bba5 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -93,8 +92,6 @@ void Dbtup::rfrReadRestartInfoLab(Signal* signal, RestartInfoRecordPtr riPtr) seizeDiskBufferSegmentRecord(dbsiPtr); riPtr.p->sriDataBufferSegmentP = dbsiPtr.i; Uint32 retPageRef = RNIL; - Uint32 noAllocPages = 1; - Uint32 noOfPagesAllocated; { /** * Use low pages for 0-pages during SR diff --git a/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp b/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp index 3e96bc6c14a..76b5d6869c1 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp index 6652464dc0f..ba5e4d2ee7c 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/DbtupUndoLog.cpp b/ndb/src/kernel/blocks/dbtup/DbtupUndoLog.cpp index 869f399583f..64151cb7509 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupUndoLog.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupUndoLog.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtup/Makefile.am b/ndb/src/kernel/blocks/dbtup/Makefile.am index 2d14ad41025..27e46aceb2a 100644 --- a/ndb/src/kernel/blocks/dbtup/Makefile.am +++ b/ndb/src/kernel/blocks/dbtup/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libdbtup.a libdbtup_a_SOURCES = \ diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index d4a44b9e641..c5cde728ff7 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -23,6 +22,7 @@ #include <AttributeHeader.hpp> #include <ArrayPool.hpp> #include <DataBuffer.hpp> +#include <DLFifoList.hpp> #include <md5_hash.hpp> // big brother @@ -121,41 +121,17 @@ private: // forward declarations struct DescEnt; - /* - * Pointer to array of Uint32. - */ - struct Data { - private: - Uint32* m_data; - public: - Data(); - Data(Uint32* data); - Data& operator=(Uint32* data); - operator Uint32*() const; - Data& operator+=(size_t n); - AttributeHeader& ah() const; - }; - friend class Data; + // Pointer to array of Uint32 represents attribute data and bounds - /* - * Pointer to array of constant Uint32. - */ - struct ConstData; - friend struct ConstData; - struct ConstData { - private: - const Uint32* m_data; - public: - ConstData(); - ConstData(const Uint32* data); - ConstData& operator=(const Uint32* data); - operator const Uint32*() const; - ConstData& operator+=(size_t n); - const AttributeHeader& ah() const; - // non-const pointer can be cast to const pointer - ConstData(Data data); - ConstData& operator=(Data data); - }; + typedef Uint32 *Data; + inline AttributeHeader& ah(Data data) { + return *reinterpret_cast<AttributeHeader*>(data); + } + + typedef const Uint32* ConstData; + inline const AttributeHeader& ah(ConstData data) { + return *reinterpret_cast<const AttributeHeader*>(data); + } // AttributeHeader size is assumed to be 1 word STATIC_CONST( AttributeHeaderSize = 1 ); @@ -212,6 +188,7 @@ private: unsigned m_fragBit : 1; // which duplicated table fragment TreeEnt(); // methods + bool eqtuple(const TreeEnt ent) const; bool eq(const TreeEnt ent) const; int cmp(const TreeEnt ent) const; }; @@ -289,8 +266,7 @@ private: struct TreePos { TupLoc m_loc; // physical node address Uint16 m_pos; // position 0 to m_occup - Uint8 m_match; // at an existing entry - Uint8 m_dir; // see scanNext() + Uint8 m_dir; // see scanNext TreePos(); }; @@ -357,6 +333,18 @@ private: typedef DataBuffer<ScanBoundSegmentSize>::ConstDataBufferIterator ScanBoundIterator; typedef DataBuffer<ScanBoundSegmentSize>::DataBufferPool ScanBoundPool; ScanBoundPool c_scanBoundPool; + + // ScanLock + struct ScanLock { + Uint32 m_accLockOp; + union { + Uint32 nextPool; + Uint32 nextList; + }; + Uint32 prevList; + }; + typedef Ptr<ScanLock> ScanLockPtr; + ArrayPool<ScanLock> c_scanLockPool; /* * Scan operation. @@ -381,12 +369,13 @@ private: enum { Undef = 0, First = 1, // before first entry - Current = 2, // at current before locking - Blocked = 3, // at current waiting for ACC lock - Locked = 4, // at current and locked or no lock needed - Next = 5, // looking for next extry - Last = 6, // after last entry - Aborting = 7, // lock wait at scan close + Current = 2, // at some entry + Found = 3, // return current as next scan result + Blocked = 4, // found and waiting for ACC lock + Locked = 5, // found and locked or no lock needed + Next = 6, // looking for next extry + Last = 7, // after last entry + Aborting = 8, // lock wait at scan close Invalid = 9 // cannot return REF to LQH currently }; Uint16 m_state; @@ -402,6 +391,8 @@ private: Uint32 m_savePointId; // lock waited for or obtained and not yet passed to LQH Uint32 m_accLockOp; + // locks obtained and passed to LQH but not yet returned by LQH + DLFifoList<ScanLock>::Head m_accLockOps; Uint8 m_readCommitted; // no locking Uint8 m_lockMode; Uint8 m_descending; @@ -417,13 +408,6 @@ private: Uint32 nextList; }; Uint32 prevList; - /* - * Locks obtained and passed to LQH but not yet returned by LQH. - * The max was increased from 16 to 992 (default 64). Record max - * ever used in this scan. TODO fix quadratic behaviour - */ - Uint32 m_maxAccLockOps; - Uint32 m_accLockOps[MaxAccLockOps]; ScanOp(ScanBoundPool& scanBoundPool); }; typedef Ptr<ScanOp> ScanOpPtr; @@ -563,6 +547,7 @@ private: void readKeyAttrs(const Frag& frag, TreeEnt ent, unsigned start, Data keyData); void readTablePk(const Frag& frag, TreeEnt ent, Data pkData, unsigned& pkSize); void copyAttrs(const Frag& frag, ConstData data1, Data data2, unsigned maxlen2 = MaxAttrDataSize); + void unpackBound(const ScanBound& bound, Data data); /* * DbtuxMeta.cpp @@ -637,18 +622,21 @@ private: void execACCKEYREF(Signal* signal); void execACC_ABORTCONF(Signal* signal); void scanFirst(ScanOpPtr scanPtr); + void scanFind(ScanOpPtr scanPtr); void scanNext(ScanOpPtr scanPtr, bool fromMaintReq); + bool scanCheck(ScanOpPtr scanPtr, TreeEnt ent); bool scanVisible(ScanOpPtr scanPtr, TreeEnt ent); void scanClose(Signal* signal, ScanOpPtr scanPtr); - void addAccLockOp(ScanOp& scan, Uint32 accLockOp); - void removeAccLockOp(ScanOp& scan, Uint32 accLockOp); + void abortAccLockOps(Signal* signal, ScanOpPtr scanPtr); + void addAccLockOp(ScanOpPtr scanPtr, Uint32 accLockOp); + void removeAccLockOp(ScanOpPtr scanPtr, Uint32 accLockOp); void releaseScanOp(ScanOpPtr& scanPtr); /* * DbtuxSearch.cpp */ - void searchToAdd(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& treePos); - void searchToRemove(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& treePos); + bool searchToAdd(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& treePos); + bool searchToRemove(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& treePos); void searchToScan(Frag& frag, ConstData boundInfo, unsigned boundCount, bool descending, TreePos& treePos); void searchToScanAscending(Frag& frag, ConstData boundInfo, unsigned boundCount, TreePos& treePos); void searchToScanDescending(Frag& frag, ConstData boundInfo, unsigned boundCount, TreePos& treePos); @@ -694,7 +682,8 @@ private: DebugMeta = 1, // log create and drop index DebugMaint = 2, // log maintenance ops DebugTree = 4, // log and check tree after each op - DebugScan = 8 // log scans + DebugScan = 8, // log scans + DebugLock = 16 // log ACC locks }; STATIC_CONST( DataFillByte = 0xa2 ); STATIC_CONST( NodeFillByte = 0xa4 ); @@ -737,99 +726,6 @@ private: static unsigned max(unsigned x, unsigned y); }; -// Dbtux::Data - -inline -Dbtux::Data::Data() : - m_data(0) -{ -} - -inline -Dbtux::Data::Data(Uint32* data) : - m_data(data) -{ -} - -inline Dbtux::Data& -Dbtux::Data::operator=(Uint32* data) -{ - m_data = data; - return *this; -} - -inline -Dbtux::Data::operator Uint32*() const -{ - return m_data; -} - -inline Dbtux::Data& -Dbtux::Data::operator+=(size_t n) -{ - m_data += n; - return *this; -} - -inline AttributeHeader& -Dbtux::Data::ah() const -{ - return *reinterpret_cast<AttributeHeader*>(m_data); -} - -// Dbtux::ConstData - -inline -Dbtux::ConstData::ConstData() : - m_data(0) -{ -} - -inline -Dbtux::ConstData::ConstData(const Uint32* data) : - m_data(data) -{ -} - -inline Dbtux::ConstData& -Dbtux::ConstData::operator=(const Uint32* data) -{ - m_data = data; - return *this; -} - -inline -Dbtux::ConstData::operator const Uint32*() const -{ - return m_data; -} - -inline Dbtux::ConstData& -Dbtux::ConstData::operator+=(size_t n) -{ - m_data += n; - return *this; -} - -inline const AttributeHeader& -Dbtux::ConstData::ah() const -{ - return *reinterpret_cast<const AttributeHeader*>(m_data); -} - -inline -Dbtux::ConstData::ConstData(Data data) : - m_data(static_cast<Uint32*>(data)) -{ -} - -inline Dbtux::ConstData& -Dbtux::ConstData::operator=(Data data) -{ - m_data = static_cast<Uint32*>(data); - return *this; -} - // Dbtux::TupLoc inline @@ -899,6 +795,14 @@ Dbtux::TreeEnt::TreeEnt() : } inline bool +Dbtux::TreeEnt::eqtuple(const TreeEnt ent) const +{ + return + m_tupLoc == ent.m_tupLoc && + m_fragBit == ent.m_fragBit; +} + +inline bool Dbtux::TreeEnt::eq(const TreeEnt ent) const { return @@ -910,6 +814,11 @@ Dbtux::TreeEnt::eq(const TreeEnt ent) const inline int Dbtux::TreeEnt::cmp(const TreeEnt ent) const { + // compare frag first to improve cacheing in 5.0 + if (m_fragBit < ent.m_fragBit) + return -1; + if (m_fragBit > ent.m_fragBit) + return +1; if (m_tupLoc.getPageId() < ent.m_tupLoc.getPageId()) return -1; if (m_tupLoc.getPageId() > ent.m_tupLoc.getPageId()) @@ -918,14 +827,25 @@ Dbtux::TreeEnt::cmp(const TreeEnt ent) const return -1; if (m_tupLoc.getPageOffset() > ent.m_tupLoc.getPageOffset()) return +1; - if (m_tupVersion < ent.m_tupVersion) - return -1; - if (m_tupVersion > ent.m_tupVersion) - return +1; - if (m_fragBit < ent.m_fragBit) - return -1; - if (m_fragBit > ent.m_fragBit) - return +1; + /* + * Guess if one tuple version has wrapped around. This is well + * defined ordering on existing versions since versions are assigned + * consecutively and different versions exists only on uncommitted + * tuple. Assuming max 2**14 uncommitted ops on same tuple. + */ + const unsigned version_wrap_limit = (1 << (ZTUP_VERSION_BITS - 1)); + if (m_tupVersion < ent.m_tupVersion) { + if (ent.m_tupVersion - m_tupVersion < version_wrap_limit) + return -1; + else + return +1; + } + if (m_tupVersion > ent.m_tupVersion) { + if (m_tupVersion - ent.m_tupVersion < version_wrap_limit) + return +1; + else + return -1; + } return 0; } @@ -992,7 +912,6 @@ inline Dbtux::TreePos::TreePos() : m_loc(), m_pos(ZNIL), - m_match(false), m_dir(255) { } @@ -1028,6 +947,7 @@ Dbtux::ScanOp::ScanOp(ScanBoundPool& scanBoundPool) : m_transId2(0), m_savePointId(0), m_accLockOp(RNIL), + m_accLockOps(), m_readCommitted(0), m_lockMode(0), m_descending(0), @@ -1035,18 +955,12 @@ Dbtux::ScanOp::ScanOp(ScanBoundPool& scanBoundPool) : m_boundMax(scanBoundPool), m_scanPos(), m_scanEnt(), - m_nodeScan(RNIL), - m_maxAccLockOps(0) + m_nodeScan(RNIL) { m_bound[0] = &m_boundMin; m_bound[1] = &m_boundMax; m_boundCnt[0] = 0; m_boundCnt[1] = 0; -#ifdef VM_TRACE - for (unsigned i = 0; i < MaxAccLockOps; i++) { - m_accLockOps[i] = 0x1f1f1f1f; - } -#endif } // Dbtux::Index diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp index cf815b14c1a..95c7b417da9 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -34,7 +33,7 @@ Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, ConstData searchKey, Cons // skip to right position in search key only for (unsigned i = 0; i < start; i++) { jam(); - searchKey += AttributeHeaderSize + searchKey.ah().getDataSize(); + searchKey += AttributeHeaderSize + ah(searchKey).getDataSize(); } // number of words of entry data left unsigned len2 = maxlen; @@ -46,16 +45,16 @@ Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, ConstData searchKey, Cons break; } len2 -= AttributeHeaderSize; - if (! searchKey.ah().isNULL()) { - if (! entryData.ah().isNULL()) { + if (! ah(searchKey).isNULL()) { + if (! ah(entryData).isNULL()) { jam(); // verify attribute id const DescAttr& descAttr = descEnt.m_descAttr[start]; - ndbrequire(searchKey.ah().getAttributeId() == descAttr.m_primaryAttrId); - ndbrequire(entryData.ah().getAttributeId() == descAttr.m_primaryAttrId); + ndbrequire(ah(searchKey).getAttributeId() == descAttr.m_primaryAttrId); + ndbrequire(ah(entryData).getAttributeId() == descAttr.m_primaryAttrId); // sizes - const unsigned size1 = searchKey.ah().getDataSize(); - const unsigned size2 = min(entryData.ah().getDataSize(), len2); + const unsigned size1 = ah(searchKey).getDataSize(); + const unsigned size2 = min(ah(entryData).getDataSize(), len2); len2 -= size2; // compare NdbSqlUtil::Cmp* const cmp = c_sqlCmp[start]; @@ -74,15 +73,15 @@ Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, ConstData searchKey, Cons break; } } else { - if (! entryData.ah().isNULL()) { + if (! ah(entryData).isNULL()) { jam(); // NULL < not NULL ret = -1; break; } } - searchKey += AttributeHeaderSize + searchKey.ah().getDataSize(); - entryData += AttributeHeaderSize + entryData.ah().getDataSize(); + searchKey += AttributeHeaderSize + ah(searchKey).getDataSize(); + entryData += AttributeHeaderSize + ah(entryData).getDataSize(); start++; } return ret; @@ -130,17 +129,17 @@ Dbtux::cmpScanBound(const Frag& frag, unsigned idir, ConstData boundInfo, unsign // get and skip bound type (it is used after the loop) type = boundInfo[0]; boundInfo += 1; - if (! boundInfo.ah().isNULL()) { - if (! entryData.ah().isNULL()) { + if (! ah(boundInfo).isNULL()) { + if (! ah(entryData).isNULL()) { jam(); // verify attribute id - const Uint32 index = boundInfo.ah().getAttributeId(); + const Uint32 index = ah(boundInfo).getAttributeId(); ndbrequire(index < frag.m_numAttrs); const DescAttr& descAttr = descEnt.m_descAttr[index]; - ndbrequire(entryData.ah().getAttributeId() == descAttr.m_primaryAttrId); + ndbrequire(ah(entryData).getAttributeId() == descAttr.m_primaryAttrId); // sizes - const unsigned size1 = boundInfo.ah().getDataSize(); - const unsigned size2 = min(entryData.ah().getDataSize(), len2); + const unsigned size1 = ah(boundInfo).getDataSize(); + const unsigned size2 = min(ah(entryData).getDataSize(), len2); len2 -= size2; // compare NdbSqlUtil::Cmp* const cmp = c_sqlCmp[index]; @@ -159,14 +158,14 @@ Dbtux::cmpScanBound(const Frag& frag, unsigned idir, ConstData boundInfo, unsign } } else { jam(); - if (! entryData.ah().isNULL()) { + if (! ah(entryData).isNULL()) { jam(); // NULL < not NULL return -1; } } - boundInfo += AttributeHeaderSize + boundInfo.ah().getDataSize(); - entryData += AttributeHeaderSize + entryData.ah().getDataSize(); + boundInfo += AttributeHeaderSize + ah(boundInfo).getDataSize(); + entryData += AttributeHeaderSize + ah(entryData).getDataSize(); boundCount -= 1; } // all attributes were equal diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp index ed29dc57915..7827794082a 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -311,7 +310,6 @@ operator<<(NdbOut& out, const Dbtux::TreePos& pos) out << "[TreePos " << hex << &pos; out << " [loc " << pos.m_loc << "]"; out << " [pos " << dec << pos.m_pos << "]"; - out << " [match " << dec << pos.m_match << "]"; out << " [dir " << dec << pos.m_dir << "]"; out << "]"; return out; @@ -331,6 +329,7 @@ operator<<(NdbOut& out, const Dbtux::DescAttr& descAttr) NdbOut& operator<<(NdbOut& out, const Dbtux::ScanOp& scan) { + Dbtux* tux = (Dbtux*)globalData.getBlock(DBTUX); out << "[ScanOp " << hex << &scan; out << " [state " << dec << scan.m_state << "]"; out << " [lockwait " << dec << scan.m_lockwait << "]"; @@ -340,9 +339,15 @@ operator<<(NdbOut& out, const Dbtux::ScanOp& scan) out << " [savePointId " << dec << scan.m_savePointId << "]"; out << " [accLockOp " << hex << scan.m_accLockOp << "]"; out << " [accLockOps"; - for (unsigned i = 0; i < scan.m_maxAccLockOps; i++) { - if (scan.m_accLockOps[i] != RNIL) - out << " " << hex << scan.m_accLockOps[i]; + { + DLFifoList<Dbtux::ScanLock>::Head head = scan.m_accLockOps; + LocalDLFifoList<Dbtux::ScanLock> list(tux->c_scanLockPool, head); + Dbtux::ScanLockPtr lockPtr; + list.first(lockPtr); + while (lockPtr.i != RNIL) { + out << " " << hex << lockPtr.p->m_accLockOp; + list.next(lockPtr); + } } out << "]"; out << " [readCommitted " << dec << scan.m_readCommitted << "]"; @@ -368,13 +373,12 @@ operator<<(NdbOut& out, const Dbtux::ScanOp& scan) NdbOut& operator<<(NdbOut& out, const Dbtux::Index& index) { + Dbtux* tux = (Dbtux*)globalData.getBlock(DBTUX); out << "[Index " << hex << &index; out << " [tableId " << dec << index.m_tableId << "]"; out << " [numFrags " << dec << index.m_numFrags << "]"; for (unsigned i = 0; i < index.m_numFrags; i++) { out << " [frag " << dec << i << " "; - // dangerous and wrong - Dbtux* tux = (Dbtux*)globalData.getBlock(DBTUX); const Dbtux::Frag& frag = *tux->c_fragPool.getPtr(index.m_fragPtrI[i]); out << frag; out << "]"; diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp index 5640fdf2899..6c1ad8324f4 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -159,6 +158,7 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signal) Uint32 nFragment; Uint32 nAttribute; Uint32 nScanOp; + Uint32 nScanBatch; const ndb_mgm_configuration_iterator * p = theConfiguration.getOwnConfigIterator(); @@ -168,9 +168,11 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signal) ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_FRAGMENT, &nFragment)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_ATTRIBUTE, &nAttribute)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp)); + ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_BATCH_SIZE, &nScanBatch)); const Uint32 nDescPage = (nIndex * DescHeadSize + nAttribute * DescAttrSize + DescPageSize - 1) / DescPageSize; const Uint32 nScanBoundWords = nScanOp * ScanBoundSegmentSize * 4; + const Uint32 nScanLock = nScanOp * nScanBatch; c_indexPool.setSize(nIndex); c_fragPool.setSize(nFragment); @@ -178,6 +180,7 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signal) c_fragOpPool.setSize(MaxIndexFragments); c_scanOpPool.setSize(nScanOp); c_scanBoundPool.setSize(nScanBoundWords); + c_scanLockPool.setSize(nScanLock); /* * Index id is physical array index. We seize and initialize all * index records now. @@ -221,7 +224,7 @@ Dbtux::setKeyAttrs(const Frag& frag) const DescAttr& descAttr = descEnt.m_descAttr[i]; Uint32 size = AttributeDescriptor::getSizeInWords(descAttr.m_attrDesc); // set attr id and fixed size - keyAttrs.ah() = AttributeHeader(descAttr.m_primaryAttrId, size); + ah(keyAttrs) = AttributeHeader(descAttr.m_primaryAttrId, size); keyAttrs += 1; // set comparison method pointer const NdbSqlUtil::Type& sqlType = NdbSqlUtil::getTypeBinary(descAttr.m_typeId); @@ -251,8 +254,8 @@ Dbtux::readKeyAttrs(const Frag& frag, TreeEnt ent, unsigned start, Data keyData) ConstData data = keyData; Uint32 totalSize = 0; for (Uint32 i = start; i < frag.m_numAttrs; i++) { - Uint32 attrId = data.ah().getAttributeId(); - Uint32 dataSize = data.ah().getDataSize(); + Uint32 attrId = ah(data).getAttributeId(); + Uint32 dataSize = ah(data).getDataSize(); debugOut << i << " attrId=" << attrId << " size=" << dataSize; data += 1; for (Uint32 j = 0; j < dataSize; j++) { @@ -290,7 +293,7 @@ Dbtux::copyAttrs(const Frag& frag, ConstData data1, Data data2, unsigned maxlen2 unsigned len2 = maxlen2; while (n != 0) { jam(); - const unsigned dataSize = data1.ah().getDataSize(); + const unsigned dataSize = ah(data1).getDataSize(); // copy header if (len2 == 0) return; @@ -314,4 +317,17 @@ Dbtux::copyAttrs(const Frag& frag, ConstData data1, Data data2, unsigned maxlen2 #endif } +void +Dbtux::unpackBound(const ScanBound& bound, Data dest) +{ + ScanBoundIterator iter; + bound.first(iter); + const unsigned n = bound.getSize(); + unsigned j; + for (j = 0; j < n; j++) { + dest[j] = *iter.data; + bound.next(iter); + } +} + BLOCK_FUNCTIONS(Dbtux) diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp index 4b568badc67..b44b5fa7c29 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -113,16 +112,17 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal) // do the operation req->errorCode = 0; TreePos treePos; + bool ok; switch (opCode) { case TuxMaintReq::OpAdd: jam(); - searchToAdd(frag, c_searchKey, ent, treePos); + ok = searchToAdd(frag, c_searchKey, ent, treePos); #ifdef VM_TRACE if (debugFlags & DebugMaint) { - debugOut << treePos << (treePos.m_match ? " - error" : "") << endl; + debugOut << treePos << (! ok ? " - error" : "") << endl; } #endif - if (treePos.m_match) { + if (! ok) { jam(); // there is no "Building" state so this will have to do if (indexPtr.p->m_state == Index::Online) { @@ -152,13 +152,13 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal) break; case TuxMaintReq::OpRemove: jam(); - searchToRemove(frag, c_searchKey, ent, treePos); + ok = searchToRemove(frag, c_searchKey, ent, treePos); #ifdef VM_TRACE if (debugFlags & DebugMaint) { - debugOut << treePos << (! treePos.m_match ? " - error" : "") << endl; + debugOut << treePos << (! ok ? " - error" : "") << endl; } #endif - if (! treePos.m_match) { + if (! ok) { jam(); // there is no "Building" state so this will have to do if (indexPtr.p->m_state == Index::Online) { diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp index c85c8384081..9a66783525c 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp index 68a3e78ce9e..13485a31414 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -402,8 +401,6 @@ Dbtux::nodePopUpScans(NodeHandle& node, unsigned pos) void Dbtux::nodeSlide(NodeHandle& dstNode, NodeHandle& srcNode, unsigned cnt, unsigned i) { - Frag& frag = dstNode.m_frag; - TreeHead& tree = frag.m_tree; ndbrequire(i <= 1); while (cnt != 0) { TreeEnt ent; diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp index a61b7c1f5ca..7eae1486d43 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -312,7 +311,7 @@ Dbtux::execNEXT_SCANREQ(Signal* signal) EXECUTE_DIRECT(DBACC, GSN_ACC_LOCKREQ, signal, AccLockReq::UndoSignalLength); jamEntry(); ndbrequire(lockReq->returnCode == AccLockReq::Success); - removeAccLockOp(scan, req->accOperationPtr); + removeAccLockOp(scanPtr, req->accOperationPtr); } if (req->scanFlag == NextScanReq::ZSCAN_COMMIT) { jam(); @@ -421,21 +420,17 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) jam(); // search is done only once in single range scan scanFirst(scanPtr); -#ifdef VM_TRACE - if (debugFlags & DebugScan) { - debugOut << "First scan " << scanPtr.i << " " << scan << endl; - } -#endif } - if (scan.m_state == ScanOp::Next) { + if (scan.m_state == ScanOp::Current || + scan.m_state == ScanOp::Next) { jam(); // look for next - scanNext(scanPtr, false); + scanFind(scanPtr); } - // for reading tuple key in Current or Locked state + // for reading tuple key in Found or Locked state Data pkData = c_dataBuffer; unsigned pkSize = 0; // indicates not yet done - if (scan.m_state == ScanOp::Current) { + if (scan.m_state == ScanOp::Found) { // found an entry to return jam(); ndbrequire(scan.m_accLockOp == RNIL); @@ -470,7 +465,7 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) scan.m_state = ScanOp::Locked; scan.m_accLockOp = lockReq->accOpPtr; #ifdef VM_TRACE - if (debugFlags & DebugScan) { + if (debugFlags & (DebugScan | DebugLock)) { debugOut << "Lock immediate scan " << scanPtr.i << " " << scan << endl; } #endif @@ -482,7 +477,7 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) scan.m_lockwait = true; scan.m_accLockOp = lockReq->accOpPtr; #ifdef VM_TRACE - if (debugFlags & DebugScan) { + if (debugFlags & (DebugScan | DebugLock)) { debugOut << "Lock wait scan " << scanPtr.i << " " << scan << endl; } #endif @@ -509,8 +504,8 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) jam(); // max ops should depend on max scans (assert only) ndbassert(false); - // stay in Current state - scan.m_state = ScanOp::Current; + // stay in Found state + scan.m_state = ScanOp::Found; signal->theData[0] = scan.m_userPtr; signal->theData[1] = true; EXECUTE_DIRECT(DBLQH, GSN_CHECK_LCP_STOP, signal, 2); @@ -538,7 +533,7 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) if (accLockOp != RNIL) { scan.m_accLockOp = RNIL; // remember it until LQH unlocks it - addAccLockOp(scan, accLockOp); + addAccLockOp(scanPtr, accLockOp); } else { ndbrequire(scan.m_readCommitted); // operation RNIL in LQH would signal no tuple returned @@ -593,7 +588,7 @@ Dbtux::execACCKEYCONF(Signal* signal) c_scanOpPool.getPtr(scanPtr); ScanOp& scan = *scanPtr.p; #ifdef VM_TRACE - if (debugFlags & DebugScan) { + if (debugFlags & (DebugScan | DebugLock)) { debugOut << "Lock obtained scan " << scanPtr.i << " " << scan << endl; } #endif @@ -638,7 +633,7 @@ Dbtux::execACCKEYREF(Signal* signal) c_scanOpPool.getPtr(scanPtr); ScanOp& scan = *scanPtr.p; #ifdef VM_TRACE - if (debugFlags & DebugScan) { + if (debugFlags & (DebugScan | DebugLock)) { debugOut << "Lock refused scan " << scanPtr.i << " " << scan << endl; } #endif @@ -682,7 +677,7 @@ Dbtux::execACC_ABORTCONF(Signal* signal) c_scanOpPool.getPtr(scanPtr); ScanOp& scan = *scanPtr.p; #ifdef VM_TRACE - if (debugFlags & DebugScan) { + if (debugFlags & (DebugScan | DebugLock)) { debugOut << "ACC_ABORTCONF scan " << scanPtr.i << " " << scan << endl; } #endif @@ -697,44 +692,94 @@ Dbtux::execACC_ABORTCONF(Signal* signal) } /* - * Find start position for single range scan. If it exists, sets state - * to Next and links the scan to the node. The first entry is returned - * by scanNext. + * Find start position for single range scan. */ void Dbtux::scanFirst(ScanOpPtr scanPtr) { ScanOp& scan = *scanPtr.p; Frag& frag = *c_fragPool.getPtr(scan.m_fragPtrI); - TreeHead& tree = frag.m_tree; +#ifdef VM_TRACE + if (debugFlags & DebugScan) { + debugOut << "Enter first scan " << scanPtr.i << " " << scan << endl; + } +#endif // set up index keys for this operation setKeyAttrs(frag); // scan direction 0, 1 const unsigned idir = scan.m_descending; - // unpack start key into c_dataBuffer - const ScanBound& bound = *scan.m_bound[idir]; - ScanBoundIterator iter; - bound.first(iter); - for (unsigned j = 0; j < bound.getSize(); j++) { - jam(); - c_dataBuffer[j] = *iter.data; - bound.next(iter); - } + unpackBound(*scan.m_bound[idir], c_dataBuffer); TreePos treePos; searchToScan(frag, c_dataBuffer, scan.m_boundCnt[idir], scan.m_descending, treePos); - if (treePos.m_loc == NullTupLoc) { - // empty result set + if (treePos.m_loc != NullTupLoc) { + scan.m_scanPos = treePos; + // link the scan to node found + NodeHandle node(frag); + selectNode(node, treePos.m_loc); + linkScan(node, scanPtr); + if (treePos.m_dir == 3) { + jam(); + // check upper bound + TreeEnt ent = node.getEnt(treePos.m_pos); + if (scanCheck(scanPtr, ent)) + scan.m_state = ScanOp::Current; + else + scan.m_state = ScanOp::Last; + } else { + scan.m_state = ScanOp::Next; + } + } else { jam(); scan.m_state = ScanOp::Last; - return; } - // set position and state - scan.m_scanPos = treePos; - scan.m_state = ScanOp::Next; - // link the scan to node found - NodeHandle node(frag); - selectNode(node, treePos.m_loc); - linkScan(node, scanPtr); +#ifdef VM_TRACE + if (debugFlags & DebugScan) { + debugOut << "Leave first scan " << scanPtr.i << " " << scan << endl; + } +#endif +} + +/* + * Look for entry to return as scan result. + */ +void +Dbtux::scanFind(ScanOpPtr scanPtr) +{ + ScanOp& scan = *scanPtr.p; + Frag& frag = *c_fragPool.getPtr(scan.m_fragPtrI); +#ifdef VM_TRACE + if (debugFlags & DebugScan) { + debugOut << "Enter find scan " << scanPtr.i << " " << scan << endl; + } +#endif + ndbrequire(scan.m_state == ScanOp::Current || scan.m_state == ScanOp::Next); + while (1) { + jam(); + if (scan.m_state == ScanOp::Next) + scanNext(scanPtr, false); + if (scan.m_state == ScanOp::Current) { + jam(); + const TreePos pos = scan.m_scanPos; + NodeHandle node(frag); + selectNode(node, pos.m_loc); + const TreeEnt ent = node.getEnt(pos.m_pos); + if (scanVisible(scanPtr, ent)) { + jam(); + scan.m_state = ScanOp::Found; + scan.m_scanEnt = ent; + break; + } + } else { + jam(); + break; + } + scan.m_state = ScanOp::Next; + } +#ifdef VM_TRACE + if (debugFlags & DebugScan) { + debugOut << "Leave find scan " << scanPtr.i << " " << scan << endl; + } +#endif } /* @@ -752,6 +797,11 @@ Dbtux::scanFirst(ScanOpPtr scanPtr) * * If an entry was found, scan direction is 3. Therefore tree * re-organizations need not worry about scan direction. + * + * This method is also used to move a scan when its entry is removed + * (see moveScanList). If the scan is Blocked, we check if it remains + * Blocked on a different version of the tuple. Otherwise the tuple is + * lost and state becomes Current. */ void Dbtux::scanNext(ScanOpPtr scanPtr, bool fromMaintReq) @@ -759,8 +809,8 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool fromMaintReq) ScanOp& scan = *scanPtr.p; Frag& frag = *c_fragPool.getPtr(scan.m_fragPtrI); #ifdef VM_TRACE - if (debugFlags & DebugScan) { - debugOut << "Next in scan " << scanPtr.i << " " << scan << endl; + if (debugFlags & (DebugMaint | DebugScan)) { + debugOut << "Enter next scan " << scanPtr.i << " " << scan << endl; } #endif // cannot be moved away from tuple we have locked @@ -770,15 +820,6 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool fromMaintReq) // scan direction const unsigned idir = scan.m_descending; // 0, 1 const int jdir = 1 - 2 * (int)idir; // 1, -1 - // unpack end key into c_dataBuffer - const ScanBound& bound = *scan.m_bound[1 - idir]; - ScanBoundIterator iter; - bound.first(iter); - for (unsigned j = 0; j < bound.getSize(); j++) { - jam(); - c_dataBuffer[j] = *iter.data; - bound.next(iter); - } // use copy of position TreePos pos = scan.m_scanPos; // get and remember original node @@ -792,15 +833,14 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool fromMaintReq) while (true) { jam(); #ifdef VM_TRACE - if (debugFlags & DebugScan) { - debugOut << "Scan next pos " << pos << " " << node << endl; + if (debugFlags & (DebugMaint | DebugScan)) { + debugOut << "Current scan " << scanPtr.i << " pos " << pos << " node " << node << endl; } #endif if (pos.m_dir == 2) { // coming up from root ends the scan jam(); pos.m_loc = NullTupLoc; - scan.m_state = ScanOp::Last; break; } if (node.m_loc != pos.m_loc) { @@ -832,41 +872,22 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool fromMaintReq) if (pos.m_dir == idir) { // coming up from left child scan current node jam(); - pos.m_pos = idir == 0 ? 0 : occup - 1; - pos.m_match = false; + pos.m_pos = idir == 0 ? (Uint16)-1 : occup; pos.m_dir = 3; } if (pos.m_dir == 3) { - // within node + // before or within node jam(); - // advance position - if (! pos.m_match) - pos.m_match = true; - else - // becomes ZNIL (which is > occup) if 0 and scan descending - pos.m_pos += jdir; + // advance position - becomes ZNIL (> occup) if 0 and descending + pos.m_pos += jdir; if (pos.m_pos < occup) { jam(); - ent = node.getEnt(pos.m_pos); pos.m_dir = 3; // unchanged - // read and compare all attributes - readKeyAttrs(frag, ent, 0, c_entryKey); - int ret = cmpScanBound(frag, 1 - idir, c_dataBuffer, scan.m_boundCnt[1 - idir], c_entryKey); - ndbrequire(ret != NdbSqlUtil::CmpUnknown); - if (jdir * ret < 0) { + ent = node.getEnt(pos.m_pos); + if (! scanCheck(scanPtr, ent)) { jam(); - // hit upper bound of single range scan pos.m_loc = NullTupLoc; - scan.m_state = ScanOp::Last; - break; - } - // can we see it - if (! scanVisible(scanPtr, ent)) { - jam(); - continue; } - // found entry - scan.m_state = ScanOp::Current; break; } // after node proceed to right child @@ -892,31 +913,64 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool fromMaintReq) // copy back position scan.m_scanPos = pos; // relink - if (scan.m_state == ScanOp::Current) { - ndbrequire(pos.m_match == true && pos.m_dir == 3); + if (pos.m_loc != NullTupLoc) { + ndbrequire(pos.m_dir == 3); ndbrequire(pos.m_loc == node.m_loc); if (origNode.m_loc != node.m_loc) { jam(); unlinkScan(origNode, scanPtr); linkScan(node, scanPtr); } - // copy found entry - scan.m_scanEnt = ent; - } else if (scan.m_state == ScanOp::Last) { + if (scan.m_state != ScanOp::Blocked) { + scan.m_state = ScanOp::Current; + } else { + jam(); + ndbrequire(fromMaintReq); + TreeEnt& scanEnt = scan.m_scanEnt; + ndbrequire(scanEnt.m_tupLoc != NullTupLoc); + if (scanEnt.eqtuple(ent)) { + // remains blocked on another version + scanEnt = ent; + } else { + jam(); + scanEnt.m_tupLoc = NullTupLoc; + scan.m_state = ScanOp::Current; + } + } + } else { jam(); - ndbrequire(pos.m_loc == NullTupLoc); unlinkScan(origNode, scanPtr); - } else { - ndbrequire(false); + scan.m_state = ScanOp::Last; } #ifdef VM_TRACE - if (debugFlags & DebugScan) { - debugOut << "Next out scan " << scanPtr.i << " " << scan << endl; + if (debugFlags & (DebugMaint | DebugScan)) { + debugOut << "Leave next scan " << scanPtr.i << " " << scan << endl; } #endif } /* + * Check end key. Return true if scan is still within range. + */ +bool +Dbtux::scanCheck(ScanOpPtr scanPtr, TreeEnt ent) +{ + ScanOp& scan = *scanPtr.p; + Frag& frag = *c_fragPool.getPtr(scan.m_fragPtrI); + const unsigned idir = scan.m_descending; + const int jdir = 1 - 2 * (int)idir; + unpackBound(*scan.m_bound[1 - idir], c_dataBuffer); + unsigned boundCnt = scan.m_boundCnt[1 - idir]; + readKeyAttrs(frag, ent, 0, c_entryKey); + int ret = cmpScanBound(frag, 1 - idir, c_dataBuffer, boundCnt, c_entryKey); + ndbrequire(ret != NdbSqlUtil::CmpUnknown); + if (jdir * ret > 0) + return true; + // hit upper bound of single range scan + return false; +} + +/* * Check if an entry is visible to the scan. * * There is a special check to never accept same tuple twice in a row. @@ -930,7 +984,6 @@ Dbtux::scanVisible(ScanOpPtr scanPtr, TreeEnt ent) const Frag& frag = *c_fragPool.getPtr(scan.m_fragPtrI); Uint32 fragBit = ent.m_fragBit; Uint32 tableFragPtrI = frag.m_tupTableFragPtrI[fragBit]; - Uint32 fragId = frag.m_fragId | fragBit; Uint32 tupAddr = getTupAddr(frag, ent); Uint32 tupVersion = ent.m_tupVersion; // check for same tuple twice in row @@ -957,18 +1010,9 @@ Dbtux::scanClose(Signal* signal, ScanOpPtr scanPtr) ScanOp& scan = *scanPtr.p; ndbrequire(! scan.m_lockwait && scan.m_accLockOp == RNIL); // unlock all not unlocked by LQH - for (unsigned i = 0; i < scan.m_maxAccLockOps; i++) { - if (scan.m_accLockOps[i] != RNIL) { - jam(); - AccLockReq* const lockReq = (AccLockReq*)signal->getDataPtrSend(); - lockReq->returnCode = RNIL; - lockReq->requestInfo = AccLockReq::Abort; - lockReq->accOpPtr = scan.m_accLockOps[i]; - EXECUTE_DIRECT(DBACC, GSN_ACC_LOCKREQ, signal, AccLockReq::UndoSignalLength); - jamEntry(); - ndbrequire(lockReq->returnCode == AccLockReq::Success); - scan.m_accLockOps[i] = RNIL; - } + if (! scan.m_accLockOps.isEmpty()) { + jam(); + abortAccLockOps(signal, scanPtr); } // send conf NextScanConf* const conf = (NextScanConf*)signal->getDataPtrSend(); @@ -982,44 +1026,76 @@ Dbtux::scanClose(Signal* signal, ScanOpPtr scanPtr) } void -Dbtux::addAccLockOp(ScanOp& scan, Uint32 accLockOp) +Dbtux::abortAccLockOps(Signal* signal, ScanOpPtr scanPtr) { - ndbrequire(accLockOp != RNIL); - Uint32* list = scan.m_accLockOps; - bool ok = false; - for (unsigned i = 0; i < scan.m_maxAccLockOps; i++) { - ndbrequire(list[i] != accLockOp); - if (! ok && list[i] == RNIL) { - list[i] = accLockOp; - ok = true; - // continue check for duplicates - } + ScanOp& scan = *scanPtr.p; +#ifdef VM_TRACE + if (debugFlags & (DebugScan | DebugLock)) { + debugOut << "Abort locks in scan " << scanPtr.i << " " << scan << endl; } - if (! ok) { - unsigned i = scan.m_maxAccLockOps; - if (i < MaxAccLockOps) { - list[i] = accLockOp; - ok = true; - scan.m_maxAccLockOps = i + 1; - } +#endif + LocalDLFifoList<ScanLock> list(c_scanLockPool, scan.m_accLockOps); + ScanLockPtr lockPtr; + while (list.first(lockPtr)) { + jam(); + AccLockReq* const lockReq = (AccLockReq*)signal->getDataPtrSend(); + lockReq->returnCode = RNIL; + lockReq->requestInfo = AccLockReq::Abort; + lockReq->accOpPtr = lockPtr.p->m_accLockOp; + EXECUTE_DIRECT(DBACC, GSN_ACC_LOCKREQ, signal, AccLockReq::UndoSignalLength); + jamEntry(); + ndbrequire(lockReq->returnCode == AccLockReq::Success); + list.release(lockPtr); } - ndbrequire(ok); } void -Dbtux::removeAccLockOp(ScanOp& scan, Uint32 accLockOp) +Dbtux::addAccLockOp(ScanOpPtr scanPtr, Uint32 accLockOp) { + ScanOp& scan = *scanPtr.p; +#ifdef VM_TRACE + if (debugFlags & (DebugScan | DebugLock)) { + debugOut << "Add lock " << hex << accLockOp << dec + << " to scan " << scanPtr.i << " " << scan << endl; + } +#endif + LocalDLFifoList<ScanLock> list(c_scanLockPool, scan.m_accLockOps); + ScanLockPtr lockPtr; +#ifdef VM_TRACE + list.first(lockPtr); + while (lockPtr.i != RNIL) { + ndbrequire(lockPtr.p->m_accLockOp != accLockOp); + list.next(lockPtr); + } +#endif + bool ok = list.seize(lockPtr); + ndbrequire(ok); ndbrequire(accLockOp != RNIL); - Uint32* list = scan.m_accLockOps; - bool ok = false; - for (unsigned i = 0; i < scan.m_maxAccLockOps; i++) { - if (list[i] == accLockOp) { - list[i] = RNIL; - ok = true; + lockPtr.p->m_accLockOp = accLockOp; +} + +void +Dbtux::removeAccLockOp(ScanOpPtr scanPtr, Uint32 accLockOp) +{ + ScanOp& scan = *scanPtr.p; +#ifdef VM_TRACE + if (debugFlags & (DebugScan | DebugLock)) { + debugOut << "Remove lock " << hex << accLockOp << dec + << " from scan " << scanPtr.i << " " << scan << endl; + } +#endif + LocalDLFifoList<ScanLock> list(c_scanLockPool, scan.m_accLockOps); + ScanLockPtr lockPtr; + list.first(lockPtr); + while (lockPtr.i != RNIL) { + if (lockPtr.p->m_accLockOp == accLockOp) { + jam(); break; } + list.next(lockPtr); } - ndbrequire(ok); + ndbrequire(lockPtr.i != RNIL); + list.release(lockPtr); } /* diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp index b0e2a664bfd..f7b93401252 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -21,22 +20,18 @@ * Search for entry to add. * * Similar to searchToRemove (see below). - * - * TODO optimize for initial equal attrs in node min/max */ -void +bool Dbtux::searchToAdd(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& treePos) { const TreeHead& tree = frag.m_tree; const unsigned numAttrs = frag.m_numAttrs; NodeHandle currNode(frag); currNode.m_loc = tree.m_root; - // assume success - treePos.m_match = false; if (currNode.m_loc == NullTupLoc) { // empty tree jam(); - return; + return true; } NodeHandle glbNode(frag); // potential g.l.b of final node /* @@ -94,9 +89,8 @@ Dbtux::searchToAdd(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& jam(); treePos.m_loc = currNode.m_loc; treePos.m_pos = 0; - // failed - treePos.m_match = true; - return; + // entry found - error + return false; } break; } @@ -104,7 +98,7 @@ Dbtux::searchToAdd(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& treePos.m_loc = currNode.m_loc; // binary search int lo = -1; - unsigned hi = currNode.getOccup(); + int hi = currNode.getOccup(); int ret; while (1) { jam(); @@ -126,9 +120,8 @@ Dbtux::searchToAdd(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& lo = j; else { treePos.m_pos = j; - // failed - treePos.m_match = true; - return; + // entry found - error + return false; } if (hi - lo == 1) break; @@ -136,22 +129,23 @@ Dbtux::searchToAdd(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& if (ret < 0) { jam(); treePos.m_pos = hi; - return; + return true; } - if (hi < currNode.getOccup()) { + if ((uint) hi < currNode.getOccup()) { jam(); treePos.m_pos = hi; - return; + return true; } if (bottomNode.isNull()) { jam(); treePos.m_pos = hi; - return; + return true; } jam(); // backwards compatible for now treePos.m_loc = bottomNode.m_loc; treePos.m_pos = 0; + return true; } /* @@ -163,21 +157,17 @@ Dbtux::searchToAdd(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& * then the saved node is the g.l.b of the final node and we move back * to it. */ -void +bool Dbtux::searchToRemove(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePos& treePos) { const TreeHead& tree = frag.m_tree; const unsigned numAttrs = frag.m_numAttrs; NodeHandle currNode(frag); currNode.m_loc = tree.m_root; - // assume success - treePos.m_match = true; if (currNode.m_loc == NullTupLoc) { - // empty tree + // empty tree - failed jam(); - // failed - treePos.m_match = false; - return; + return false; } NodeHandle glbNode(frag); // potential g.l.b of final node while (true) { @@ -229,7 +219,7 @@ Dbtux::searchToRemove(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePo jam(); treePos.m_loc = currNode.m_loc; treePos.m_pos = 0; - return; + return true; } break; } @@ -242,12 +232,12 @@ Dbtux::searchToRemove(Frag& frag, ConstData searchKey, TreeEnt searchEnt, TreePo if (searchEnt.eq(currNode.getEnt(j))) { jam(); treePos.m_pos = j; - return; + return true; } } treePos.m_pos = currNode.getOccup(); - // failed - treePos.m_match = false; + // not found - failed + return false; } /* @@ -278,8 +268,6 @@ Dbtux::searchToScanAscending(Frag& frag, ConstData boundInfo, unsigned boundCoun currNode.m_loc = tree.m_root; NodeHandle glbNode(frag); // potential g.l.b of final node NodeHandle bottomNode(frag); - // always before entry - treePos.m_match = false; while (true) { jam(); selectNode(currNode, currNode.m_loc); @@ -315,7 +303,7 @@ Dbtux::searchToScanAscending(Frag& frag, ConstData boundInfo, unsigned boundCoun treePos.m_dir = 3; return; } - } else if (ret > 0) { + } else { // bound is at or right of this node jam(); const TupLoc loc = currNode.getLink(1); @@ -327,8 +315,6 @@ Dbtux::searchToScanAscending(Frag& frag, ConstData boundInfo, unsigned boundCoun currNode.m_loc = loc; continue; } - } else { - ndbrequire(false); } break; } @@ -369,8 +355,6 @@ Dbtux::searchToScanDescending(Frag& frag, ConstData boundInfo, unsigned boundCou currNode.m_loc = tree.m_root; NodeHandle glbNode(frag); // potential g.l.b of final node NodeHandle bottomNode(frag); - // always before entry - treePos.m_match = false; while (true) { jam(); selectNode(currNode, currNode.m_loc); @@ -403,7 +387,7 @@ Dbtux::searchToScanDescending(Frag& frag, ConstData boundInfo, unsigned boundCou // empty result set return; } - } else if (ret > 0) { + } else { // bound is at or right of this node jam(); const TupLoc loc = currNode.getLink(1); @@ -415,8 +399,6 @@ Dbtux::searchToScanDescending(Frag& frag, ConstData boundInfo, unsigned boundCou currNode.m_loc = loc; continue; } - } else { - ndbrequire(false); } break; } diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp index 5107a8d8e31..31772abadaf 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -213,7 +212,6 @@ Dbtux::treeRemove(Frag& frag, TreePos treePos) void Dbtux::treeRemoveInner(Frag& frag, NodeHandle lubNode, unsigned pos) { - TreeHead& tree = frag.m_tree; TreeEnt ent; // find g.l.b node NodeHandle glbNode(frag); diff --git a/ndb/src/kernel/blocks/dbtux/Makefile.am b/ndb/src/kernel/blocks/dbtux/Makefile.am index b5951e8ed37..cb2a0a0c51b 100644 --- a/ndb/src/kernel/blocks/dbtux/Makefile.am +++ b/ndb/src/kernel/blocks/dbtux/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libdbtux.a libdbtux_a_SOURCES = \ diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp index 0f45c407d83..55d36124476 100644 --- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp +++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.hpp b/ndb/src/kernel/blocks/dbutil/DbUtil.hpp index 983dd4402a4..e0d7d9df937 100644 --- a/ndb/src/kernel/blocks/dbutil/DbUtil.hpp +++ b/ndb/src/kernel/blocks/dbutil/DbUtil.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/dbutil/Makefile.am b/ndb/src/kernel/blocks/dbutil/Makefile.am index 925356c2f76..4848ae85082 100644 --- a/ndb/src/kernel/blocks/dbutil/Makefile.am +++ b/ndb/src/kernel/blocks/dbutil/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libdbutil.a libdbutil_a_SOURCES = DbUtil.cpp diff --git a/ndb/src/kernel/blocks/mutexes.hpp b/ndb/src/kernel/blocks/mutexes.hpp index 5c0276fc4fa..2eb248b3d5e 100644 --- a/ndb/src/kernel/blocks/mutexes.hpp +++ b/ndb/src/kernel/blocks/mutexes.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile.am b/ndb/src/kernel/blocks/ndbcntr/Makefile.am index 3f24675b2b3..dee66082f19 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile.am +++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libndbcntr.a libndbcntr_a_SOURCES = \ diff --git a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp index 7aa5be7a3cb..6db1d22a6d2 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp +++ b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -83,6 +82,7 @@ public: */ struct StartRecord { + StartRecord() {} Uint64 m_startTime; void reset(); @@ -191,7 +191,6 @@ private: void execNDB_STARTCONF(Signal* signal); void execREAD_NODESREQ(Signal* signal); void execNDB_STARTREF(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execSTOP_PERM_REF(Signal* signal); void execSTOP_PERM_CONF(Signal* signal); diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp index 08251348b2b..fdd6e7677d3 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -81,7 +80,6 @@ Ndbcntr::Ndbcntr(const class Configuration & conf): addRecSignal(GSN_NDB_STARTCONF, &Ndbcntr::execNDB_STARTCONF); addRecSignal(GSN_READ_NODESREQ, &Ndbcntr::execREAD_NODESREQ); addRecSignal(GSN_NDB_STARTREF, &Ndbcntr::execNDB_STARTREF); - addRecSignal(GSN_SET_VAR_REQ, &Ndbcntr::execSET_VAR_REQ); addRecSignal(GSN_STOP_PERM_REF, &Ndbcntr::execSTOP_PERM_REF); addRecSignal(GSN_STOP_PERM_CONF, &Ndbcntr::execSTOP_PERM_CONF); diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index c05f04d700c..69bd6329ff1 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -820,7 +819,6 @@ Ndbcntr::trySystemRestart(Signal* signal){ */ const bool allNodes = c_start.m_waiting.equal(c_allDefinedNodes); const bool allClusterNodes = c_start.m_waiting.equal(c_clusterNodes); - const Uint64 now = NdbTick_CurrentMillisecond(); if(!allClusterNodes){ jam(); @@ -1392,7 +1390,6 @@ void Ndbcntr::execNODE_FAILREP(Signal* signal) const bool tMasterFailed = allFailed.get(cmasterNodeId); const bool tStarted = !failedStarted.isclear(); const bool tStarting = !failedStarting.isclear(); - const bool tWaiting = !failedWaiting.isclear(); if(tMasterFailed){ jam(); @@ -1525,6 +1522,11 @@ void Ndbcntr::execNODE_FAILREP(Signal* signal) break; } + case StopRecord::SR_BLOCK_GCP_START_GCP: + case StopRecord::SR_WAIT_COMPLETE_GCP: + case StopRecord::SR_UNBLOCK_GCP_START_GCP: + case StopRecord::SR_CLUSTER_SHUTDOWN: + break; } } @@ -1642,6 +1644,7 @@ void Ndbcntr::createSystableLab(Signal* signal, unsigned index) //w.add(DictTabInfo::NoOfVariable, (Uint32)0); //w.add(DictTabInfo::KeyLength, 1); w.add(DictTabInfo::TableTypeVal, (Uint32)table.tableType); + w.add(DictTabInfo::SingleUserMode, (Uint32)NDB_SUM_READ_WRITE); for (unsigned i = 0; i < table.columnCount; i++) { const SysColumn& column = table.columnList[i]; @@ -2023,23 +2026,6 @@ Ndbcntr::execDUMP_STATE_ORD(Signal* signal) }//Ndbcntr::execDUMP_STATE_ORD() -void Ndbcntr::execSET_VAR_REQ(Signal* signal) { -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - - switch (var) { - case TimeToWaitAlive: - // Valid only during start so value not set. - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - }// switch -#endif -}//Ndbcntr::execSET_VAR_REQ() - void Ndbcntr::updateNodeState(Signal* signal, const NodeState& newState) const{ NodeStateRep * const stateRep = (NodeStateRep *)&signal->theData[0]; @@ -2274,7 +2260,33 @@ Ndbcntr::StopRecord::checkNodeFail(Signal* signal){ { NdbNodeBitmask tmp; tmp.assign(NdbNodeBitmask::Size, stopReq.nodes); + + NdbNodeBitmask ndbStopNodes; + ndbStopNodes.assign(NdbNodeBitmask::Size, stopReq.nodes); + ndbStopNodes.bitAND(ndbMask); + ndbStopNodes.copyto(NdbNodeBitmask::Size, stopReq.nodes); + ndbMask.bitANDC(tmp); + + bool allNodesStopped = true; + int i ; + for( i = 0; i < (int) NdbNodeBitmask::Size; i++ ){ + if ( stopReq.nodes[i] != 0 ){ + allNodesStopped = false; + break; + } + } + + if ( allNodesStopped ) { + StopConf * const stopConf = (StopConf *)&signal->theData[0]; + stopConf->senderData = stopReq.senderData; + stopConf->nodeState = (Uint32) NodeState::SL_NOTHING; + cntr.sendSignal(stopReq.senderRef, GSN_STOP_CONF, signal, + StopConf::SignalLength, JBB); + stopReq.senderRef = 0; + return false; + } + } else { @@ -2442,8 +2454,6 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){ void Ndbcntr::execABORT_ALL_REF(Signal* signal){ jamEntry(); - AbortAllRef *abortAllRef = (AbortAllRef *)&signal->theData[0]; - AbortAllRef::ErrorCode errorCode = (AbortAllRef::ErrorCode) abortAllRef->errorCode; StopRef * const stopRef = (StopRef *)&signal->theData[0]; stopRef->senderData = c_stopRec.stopReq.senderData; diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp index 2a65271a32a..8690fbe9448 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index ddf16024017..ee6ab49f1e5 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp index 997bf40fe2a..99dd4aea207 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -107,6 +106,8 @@ class AsyncFile; class Request { public: + Request() {} + enum Action { open, close, diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp index 004752c9543..45b53b2693e 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp b/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp index 30b40097c9b..1202d14d699 100644 --- a/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp +++ b/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp b/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp index 460ad3f614a..668b0e1b70e 100644 --- a/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp +++ b/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.cpp b/ndb/src/kernel/blocks/ndbfs/Filename.cpp index 238390f262c..83c1e2a4f5c 100644 --- a/ndb/src/kernel/blocks/ndbfs/Filename.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Filename.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.hpp b/ndb/src/kernel/blocks/ndbfs/Filename.hpp index 249c1b1ca10..8d664be5c10 100644 --- a/ndb/src/kernel/blocks/ndbfs/Filename.hpp +++ b/ndb/src/kernel/blocks/ndbfs/Filename.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile.am b/ndb/src/kernel/blocks/ndbfs/Makefile.am index a22386f8612..457a4fb5be5 100644 --- a/ndb/src/kernel/blocks/ndbfs/Makefile.am +++ b/ndb/src/kernel/blocks/ndbfs/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libndbfs.a libndbfs_a_SOURCES = \ diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.cpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.cpp index a1aebdef7a1..fa84a52414e 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.cpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp index f46cc66fe16..82e0855a57f 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp index ca90bc60153..aac1d3984a0 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp index b98c60693f4..2ef4d5019ab 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 5049c726315..353330929e5 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp index 17ce8fbd8aa..1f534433b81 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/OpenFiles.hpp b/ndb/src/kernel/blocks/ndbfs/OpenFiles.hpp index eacda6ec77d..636d9b78620 100644 --- a/ndb/src/kernel/blocks/ndbfs/OpenFiles.hpp +++ b/ndb/src/kernel/blocks/ndbfs/OpenFiles.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/Pool.hpp b/ndb/src/kernel/blocks/ndbfs/Pool.hpp index 0410673af6f..de0b4d1f437 100644 --- a/ndb/src/kernel/blocks/ndbfs/Pool.hpp +++ b/ndb/src/kernel/blocks/ndbfs/Pool.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp index 5a03d8bb1a0..e8ee1c9392d 100644 --- a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/qmgr/Makefile.am b/ndb/src/kernel/blocks/qmgr/Makefile.am index 278af2a7865..f25df91b165 100644 --- a/ndb/src/kernel/blocks/qmgr/Makefile.am +++ b/ndb/src/kernel/blocks/qmgr/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libqmgr.a libqmgr_a_SOURCES = \ diff --git a/ndb/src/kernel/blocks/qmgr/Qmgr.hpp b/ndb/src/kernel/blocks/qmgr/Qmgr.hpp index 0c4bdc5d3c1..21395a5d750 100644 --- a/ndb/src/kernel/blocks/qmgr/Qmgr.hpp +++ b/ndb/src/kernel/blocks/qmgr/Qmgr.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -102,6 +101,7 @@ public: }; struct StartRecord { + StartRecord() {} void reset(){ m_startKey++; m_startNode = 0; @@ -170,6 +170,7 @@ public: }; struct ArbitRec { + ArbitRec() {} ArbitState state; // state bool newstate; // flag to initialize new state unsigned thread; // identifies a continueB "thread" @@ -243,7 +244,6 @@ private: void execAPI_REGREQ(Signal* signal); void execAPI_FAILCONF(Signal* signal); void execREAD_NODESREQ(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execREAD_NODESREF(Signal* signal); void execREAD_NODESCONF(Signal* signal); diff --git a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp index f14cbd48695..a087fe38c1c 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -83,7 +82,6 @@ Qmgr::Qmgr(const class Configuration & conf) addRecSignal(GSN_DISCONNECT_REP, &Qmgr::execDISCONNECT_REP); addRecSignal(GSN_API_FAILCONF, &Qmgr::execAPI_FAILCONF); addRecSignal(GSN_READ_NODESREQ, &Qmgr::execREAD_NODESREQ); - addRecSignal(GSN_SET_VAR_REQ, &Qmgr::execSET_VAR_REQ); addRecSignal(GSN_API_BROADCAST_REP, &Qmgr::execAPI_BROADCAST_REP); // Arbitration signals diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index c5987ee8a57..a76838f7007 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -153,13 +152,14 @@ void Qmgr::execCONTINUEB(Signal* signal) return; } Uint64 now = NdbTick_CurrentMillisecond(); + if (now > (c_start_election_time + c_restartFailureTimeout)) { jam(); BaseString tmp; tmp.append("Shutting down node as total restart time exceeds " " StartFailureTimeout as set in config file "); - if(c_restartFailureTimeout == ~0) + if(c_restartFailureTimeout == (Uint32) ~0) tmp.append(" 0 (inifinite)"); else tmp.appfmt(" %d", c_restartFailureTimeout); @@ -698,7 +698,40 @@ void Qmgr::execCM_REGREQ(Signal* signal) sendCmRegrefLab(signal, Tblockref, CmRegRef::ZNOT_IN_CFG); return; } - + + if (getNodeState().getSingleUserMode()) + { + /** + * The cluster is in single user mode. + * Data node is not allowed to get added in the cluster + * while in single user mode. + */ + // handle rolling upgrade + { + unsigned int get_major = getMajor(startingVersion); + unsigned int get_minor = getMinor(startingVersion); + unsigned int get_build = getBuild(startingVersion); + + if (startingVersion < NDBD_QMGR_SINGLEUSER_VERSION_5) { + jam(); + + infoEvent("QMGR: detect upgrade: new node %u old version %u.%u.%u", + (unsigned int)addNodePtr.i, get_major, get_minor, get_build); + /** + * The new node is old version, send ZINCOMPATIBLE_VERSION instead + * of ZSINGLE_USER_MODE. + */ + sendCmRegrefLab(signal, Tblockref, CmRegRef::ZINCOMPATIBLE_VERSION); + } else { + jam(); + + sendCmRegrefLab(signal, Tblockref, CmRegRef::ZSINGLE_USER_MODE); + }//if + } + + return; + }//if + ptrCheckGuard(addNodePtr, MAX_NDB_NODES, nodeRec); Phase phase = addNodePtr.p->phase; if (phase != ZINIT) @@ -812,7 +845,6 @@ void Qmgr::execCM_REGCONF(Signal* signal) jamEntry(); const CmRegConf * const cmRegConf = (CmRegConf *)&signal->theData[0]; - Uint32 presidentNodeId = cmRegConf->presidentNodeId; if (!ndbCompatible_ndb_ndb(NDB_VERSION, cmRegConf->presidentVersion)) { jam(); @@ -1093,6 +1125,19 @@ void Qmgr::execCM_REGREF(Signal* signal) jam(); progError(__LINE__, NDBD_EXIT_NODE_NOT_DEAD); break; + case CmRegRef::ZSINGLE_USER_MODE: + jam(); + progError(__LINE__, NDBD_EXIT_SINGLE_USER_MODE); + break; + /** + * For generic refuse error. + * e.g. in online upgrade, we can use this error code instead + * of the incompatible error code. + */ + case CmRegRef::ZGENERIC: + jam(); + progError(__LINE__, NDBD_EXIT_GENERIC); + break; case CmRegRef::ZELECTION: jam(); if (candidate_gci > c_start.m_president_candidate_gci || @@ -1224,7 +1269,6 @@ Qmgr::check_startup(Signal* signal) /** * Check for missing node group directly */ - char buf[100]; NdbNodeBitmask check; check.assign(c_definedNodes); check.bitANDC(c_start.m_starting_nodes); // Not connected nodes @@ -1292,7 +1336,7 @@ Qmgr::check_startup(Signal* signal) if (now < partial_timeout) { jam(); - signal->theData[1] = c_restartPartialTimeout == ~0 ? 2 : 3; + signal->theData[1] = c_restartPartialTimeout == (Uint32) ~0 ? 2 : 3; signal->theData[2] = Uint32((partial_timeout - now + 500) / 1000); report_mask.assign(wait); retVal = 0; @@ -1309,7 +1353,7 @@ Qmgr::check_startup(Signal* signal) case CheckNodeGroups::Partitioning: if (now < partitioned_timeout && result != CheckNodeGroups::Win) { - signal->theData[1] = c_restartPartionedTimeout == ~0 ? 4 : 5; + signal->theData[1] = c_restartPartionedTimeout == (Uint32) ~0 ? 4 : 5; signal->theData[2] = Uint32((partitioned_timeout - now + 500) / 1000); report_mask.assign(c_definedNodes); report_mask.bitANDC(c_start.m_starting_nodes); @@ -1356,6 +1400,7 @@ missing_nodegroup: " starting: %s (missing fs for: %s)", mask1, mask2); progError(__LINE__, NDBD_EXIT_SR_RESTARTCONFLICT, buf); + return 0; // Deadcode } void @@ -2025,7 +2070,7 @@ void Qmgr::initData(Signal* signal) &c_restartPartionedTimeout); ndb_mgm_get_int_parameter(p, CFG_DB_START_FAILURE_TIMEOUT, &c_restartFailureTimeout); - + if(c_restartPartialTimeout == 0) { c_restartPartialTimeout = ~0; @@ -2771,7 +2816,7 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode, if (failedNodePtr.i == getOwnNodeId()) { jam(); - Uint32 code = 0; + Uint32 code = NDBD_EXIT_NODE_DECLARED_DEAD; const char * msg = 0; char extra[100]; switch(aFailCause){ @@ -4727,34 +4772,6 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal) #endif }//Qmgr::execDUMP_STATE_ORD() -void Qmgr::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - UintR val = setVarReq->value(); - - switch (var) { - case HeartbeatIntervalDbDb: - setHbDelay(val/10); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case HeartbeatIntervalDbApi: - setHbApiDelay(val/10); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case ArbitTimeout: - setArbitTimeout(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - }// switch -#endif -}//execSET_VAR_REQ() void Qmgr::execAPI_BROADCAST_REP(Signal* signal) diff --git a/ndb/src/kernel/blocks/qmgr/timer.hpp b/ndb/src/kernel/blocks/qmgr/timer.hpp index 9c35a23766c..09b6de7b0db 100644 --- a/ndb/src/kernel/blocks/qmgr/timer.hpp +++ b/ndb/src/kernel/blocks/qmgr/timer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/suma/Makefile.am b/ndb/src/kernel/blocks/suma/Makefile.am index 5a74dbb74eb..f52ea9f00d1 100644 --- a/ndb/src/kernel/blocks/suma/Makefile.am +++ b/ndb/src/kernel/blocks/suma/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libsuma.a libsuma_a_SOURCES = Suma.cpp SumaInit.cpp diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp index 449436331e4..006fb21bd77 100644 --- a/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/ndb/src/kernel/blocks/suma/Suma.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -1435,7 +1434,6 @@ SumaParticipant::SyncRecord::nextScan(Signal* signal){ LocalDataBuffer<15> attrBuf(suma.c_dataBufferPool, head); ScanFragReq * req = (ScanFragReq *)signal->getDataPtrSend(); - const Uint32 parallelism = 16; const Uint32 attrLen = 5 + attrBuf.getSize(); req->senderData = m_subscriptionPtrI; @@ -1611,10 +1609,6 @@ SumaParticipant::execSCAN_HBREP(Signal* signal){ static Uint32 f_bufferLock = 0; static Uint32 f_buffer[SUMA_BUF_SZ]; -static Uint32 f_trigBufferSize = 0; -static Uint32 b_bufferLock = 0; -static Uint32 b_buffer[SUMA_BUF_SZ]; -static Uint32 b_trigBufferSize = 0; void SumaParticipant::execTRANSID_AI(Signal* signal){ @@ -1718,7 +1712,6 @@ SumaParticipant::execSUB_REMOVE_REQ(Signal* signal) { return; } - int count = 0; { jam(); SubscriberPtr i_subbPtr; diff --git a/ndb/src/kernel/blocks/suma/Suma.hpp b/ndb/src/kernel/blocks/suma/Suma.hpp index 5cf1c4d543f..e479ebb7691 100644 --- a/ndb/src/kernel/blocks/suma/Suma.hpp +++ b/ndb/src/kernel/blocks/suma/Suma.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -209,6 +208,7 @@ public: friend struct SyncRecord; struct Subscription { + Subscription() {} Uint32 m_subscriberRef; Uint32 m_subscriberData; Uint32 m_senderRef; diff --git a/ndb/src/kernel/blocks/suma/SumaInit.cpp b/ndb/src/kernel/blocks/suma/SumaInit.cpp index ae7425da4bf..27a498be976 100644 --- a/ndb/src/kernel/blocks/suma/SumaInit.cpp +++ b/ndb/src/kernel/blocks/suma/SumaInit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/trix/Makefile.am b/ndb/src/kernel/blocks/trix/Makefile.am index 343063a6283..83822d967dd 100644 --- a/ndb/src/kernel/blocks/trix/Makefile.am +++ b/ndb/src/kernel/blocks/trix/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = libtrix.a libtrix_a_SOURCES = Trix.cpp diff --git a/ndb/src/kernel/blocks/trix/Trix.cpp b/ndb/src/kernel/blocks/trix/Trix.cpp index 1d6e5adad62..a5ccbb584cb 100644 --- a/ndb/src/kernel/blocks/trix/Trix.cpp +++ b/ndb/src/kernel/blocks/trix/Trix.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/blocks/trix/Trix.hpp b/ndb/src/kernel/blocks/trix/Trix.hpp index 78c5b8b35c3..c4e4c870bde 100644 --- a/ndb/src/kernel/blocks/trix/Trix.hpp +++ b/ndb/src/kernel/blocks/trix/Trix.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/error/ErrorHandlingMacros.hpp b/ndb/src/kernel/error/ErrorHandlingMacros.hpp index 8c3454b1ba1..de85127e638 100644 --- a/ndb/src/kernel/error/ErrorHandlingMacros.hpp +++ b/ndb/src/kernel/error/ErrorHandlingMacros.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp index 6c8bb1fe615..3d1b7fad7f3 100644 --- a/ndb/src/kernel/error/ErrorReporter.cpp +++ b/ndb/src/kernel/error/ErrorReporter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -185,6 +184,7 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line, int childReportError(ec); NdbShutdown(s_errorHandlerShutdownType); + exit(1); // Deadcode } void diff --git a/ndb/src/kernel/error/ErrorReporter.hpp b/ndb/src/kernel/error/ErrorReporter.hpp index 0ec84190238..a32270e85cf 100644 --- a/ndb/src/kernel/error/ErrorReporter.hpp +++ b/ndb/src/kernel/error/ErrorReporter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -29,7 +28,7 @@ public: static void setErrorHandlerShutdownType(NdbShutdownType nst = NST_ErrorHandler); static void handleAssert(const char* message, const char* file, - int line, int ec = NDBD_EXIT_PRGERR); + int line, int ec = NDBD_EXIT_PRGERR) __attribute__((__noreturn__)); static void handleError(int faultID, const char* problemData, diff --git a/ndb/src/kernel/error/Makefile.am b/ndb/src/kernel/error/Makefile.am index c58cdf80940..1cd8b0e8e3b 100644 --- a/ndb/src/kernel/error/Makefile.am +++ b/ndb/src/kernel/error/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + noinst_LIBRARIES = liberror.a liberror_a_SOURCES = TimeModule.cpp \ diff --git a/ndb/src/kernel/error/TimeModule.cpp b/ndb/src/kernel/error/TimeModule.cpp index c4e569e7221..2be734842ba 100644 --- a/ndb/src/kernel/error/TimeModule.cpp +++ b/ndb/src/kernel/error/TimeModule.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -19,7 +18,7 @@ #include <ndb_global.h> #include "TimeModule.hpp" -static const char* cMonth[] = { "x", "January", "February", "Mars", "April", "May", "June", +static const char* cMonth[] = { "x", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; static const char* cDay[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", diff --git a/ndb/src/kernel/error/TimeModule.hpp b/ndb/src/kernel/error/TimeModule.hpp index f1414c77af3..870e12eebc2 100644 --- a/ndb/src/kernel/error/TimeModule.hpp +++ b/ndb/src/kernel/error/TimeModule.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/error/ndbd_exit_codes.c b/ndb/src/kernel/error/ndbd_exit_codes.c index 07b276346a0..92bee522d24 100644 --- a/ndb/src/kernel/error/ndbd_exit_codes.c +++ b/ndb/src/kernel/error/ndbd_exit_codes.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -14,6 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <ndb_global.h> #include <ndbd_exit_codes.h> typedef struct ErrStruct { @@ -45,6 +45,7 @@ typedef struct ErrStruct { static const ErrStruct errArray[] = { + {NDBD_EXIT_GENERIC, XRE, "Generic error"}, {NDBD_EXIT_PRGERR, XIE, "Assertion"}, {NDBD_EXIT_NODE_NOT_IN_CONFIG, XCE, "node id in the configuration has the wrong type, (i.e. not an NDB node)"}, @@ -56,18 +57,23 @@ static const ErrStruct errArray[] = "error(s) on other node(s)"}, {NDBD_EXIT_PARTITIONED_SHUTDOWN, XAE, "Partitioned cluster detected. " "Please check if cluster is already running"}, + {NDBD_EXIT_NODE_DECLARED_DEAD, XAE, + "Node declared dead. See error log for details"}, {NDBD_EXIT_POINTER_NOTINRANGE, XIE, "Pointer too large"}, {NDBD_EXIT_SR_OTHERNODEFAILED, XRE, "Another node failed during system " "restart, please investigate error(s) on other node(s)"}, {NDBD_EXIT_NODE_NOT_DEAD, XRE, "Internal node state conflict, " "most probably resolved by restarting node again"}, {NDBD_EXIT_SR_REDOLOG, XFI, "Error while reading the REDO log"}, + {NDBD_EXIT_SR_SCHEMAFILE, XFI, "Error while reading the schema file"}, /* Currently unused? */ {2311, XIE, "Conflict when selecting restart type"}, {NDBD_EXIT_NO_MORE_UNDOLOG, XCR, "No more free UNDO log, increase UndoIndexBuffer"}, {NDBD_EXIT_SR_UNDOLOG, XFI, "Error while reading the datapages and UNDO log"}, + {NDBD_EXIT_SINGLE_USER_MODE, XRE, "Data node is not allowed to get added " + "to the cluster while it is in single user mode"}, {NDBD_EXIT_MEMALLOC, XCE, "Memory allocation failure, " "please decrease some configuration parameters"}, {NDBD_EXIT_BLOCK_JBUFCONGESTION, XIE, "Job buffer congestion"}, @@ -247,7 +253,7 @@ int ndbd_exit_string(int err_no, char *str, unsigned int size) ndbd_exit_classification cl; ndbd_exit_status st; const char *msg = ndbd_exit_message(err_no, &cl); - if (msg[0] != '\0') + if (msg[0] != '\0' && cl != XUE) { const char *cl_msg = ndbd_exit_classification_message(cl, &st); const char *st_msg = ndbd_exit_status_message(st); diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 649ae7cae3f..9c9581c9c42 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/Array.hpp b/ndb/src/kernel/vm/Array.hpp index 97b0a345cb4..770dd47f048 100644 --- a/ndb/src/kernel/vm/Array.hpp +++ b/ndb/src/kernel/vm/Array.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/ArrayFifoList.hpp b/ndb/src/kernel/vm/ArrayFifoList.hpp index b21bf449734..709f59324e9 100644 --- a/ndb/src/kernel/vm/ArrayFifoList.hpp +++ b/ndb/src/kernel/vm/ArrayFifoList.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/ArrayList.hpp b/ndb/src/kernel/vm/ArrayList.hpp index 4b46347a39b..7387c65afe7 100644 --- a/ndb/src/kernel/vm/ArrayList.hpp +++ b/ndb/src/kernel/vm/ArrayList.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/ArrayPool.hpp b/ndb/src/kernel/vm/ArrayPool.hpp index 3b1264af8be..17a170c6ce8 100644 --- a/ndb/src/kernel/vm/ArrayPool.hpp +++ b/ndb/src/kernel/vm/ArrayPool.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/CArray.hpp b/ndb/src/kernel/vm/CArray.hpp index 93f75056b50..b06a04bde24 100644 --- a/ndb/src/kernel/vm/CArray.hpp +++ b/ndb/src/kernel/vm/CArray.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/Callback.hpp b/ndb/src/kernel/vm/Callback.hpp index 6a619ba7859..4cf67858ca0 100644 --- a/ndb/src/kernel/vm/Callback.hpp +++ b/ndb/src/kernel/vm/Callback.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/ClusterConfiguration.cpp b/ndb/src/kernel/vm/ClusterConfiguration.cpp index 813407b497e..0f854f3504b 100644 --- a/ndb/src/kernel/vm/ClusterConfiguration.cpp +++ b/ndb/src/kernel/vm/ClusterConfiguration.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/ClusterConfiguration.hpp b/ndb/src/kernel/vm/ClusterConfiguration.hpp index cc7000a54ef..40509b63f19 100644 --- a/ndb/src/kernel/vm/ClusterConfiguration.hpp +++ b/ndb/src/kernel/vm/ClusterConfiguration.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index cbdd9494fd8..8a627e8b6cd 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -64,6 +63,8 @@ static const char* _bind_address = 0; extern Uint32 g_start_type; extern NdbNodeBitmask g_nowait_nodes; +const char *load_default_groups[]= { "mysql_cluster","ndbd",0 }; + /** * Arguments to NDB process */ @@ -113,6 +114,8 @@ static void usage() { short_usage_sub(); ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -120,7 +123,6 @@ static void usage() bool Configuration::init(int argc, char** argv) { - const char *load_default_groups[]= { "mysql_cluster","ndbd",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; diff --git a/ndb/src/kernel/vm/Configuration.hpp b/ndb/src/kernel/vm/Configuration.hpp index 13b31ad3538..934261e40af 100644 --- a/ndb/src/kernel/vm/Configuration.hpp +++ b/ndb/src/kernel/vm/Configuration.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/DLFifoList.hpp b/ndb/src/kernel/vm/DLFifoList.hpp index 963ab007b65..e4b8d67f71c 100644 --- a/ndb/src/kernel/vm/DLFifoList.hpp +++ b/ndb/src/kernel/vm/DLFifoList.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -34,6 +33,8 @@ public: Head(); Uint32 firstItem; Uint32 lastItem; + + inline bool isEmpty() const { return firstItem == RNIL;} }; DLFifoList(ArrayPool<T> & thePool); diff --git a/ndb/src/kernel/vm/DLHashTable.hpp b/ndb/src/kernel/vm/DLHashTable.hpp index 13a9632f8da..acf53944b07 100644 --- a/ndb/src/kernel/vm/DLHashTable.hpp +++ b/ndb/src/kernel/vm/DLHashTable.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/DLHashTable2.hpp b/ndb/src/kernel/vm/DLHashTable2.hpp index 6b166331631..ad03e8ed3ba 100644 --- a/ndb/src/kernel/vm/DLHashTable2.hpp +++ b/ndb/src/kernel/vm/DLHashTable2.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -147,6 +146,8 @@ public: * @param iter - An "uninitialized" iterator */ bool next(Uint32 bucket, Iterator & iter) const; + + inline bool isEmpty() const { Iterator iter; return ! first(iter); } private: Uint32 mask; diff --git a/ndb/src/kernel/vm/DLList.hpp b/ndb/src/kernel/vm/DLList.hpp index b7820eb9229..3e68d38aa5e 100644 --- a/ndb/src/kernel/vm/DLList.hpp +++ b/ndb/src/kernel/vm/DLList.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/DataBuffer.hpp b/ndb/src/kernel/vm/DataBuffer.hpp index 7f553898eb5..d86aa95dd7b 100644 --- a/ndb/src/kernel/vm/DataBuffer.hpp +++ b/ndb/src/kernel/vm/DataBuffer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index e203ec4bde8..3d240a204ba 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/Emulator.hpp b/ndb/src/kernel/vm/Emulator.hpp index cd194202d85..e90f9cadb65 100644 --- a/ndb/src/kernel/vm/Emulator.hpp +++ b/ndb/src/kernel/vm/Emulator.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/FastScheduler.cpp b/ndb/src/kernel/vm/FastScheduler.cpp index ad24a6795a4..588887d1f63 100644 --- a/ndb/src/kernel/vm/FastScheduler.cpp +++ b/ndb/src/kernel/vm/FastScheduler.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/FastScheduler.hpp b/ndb/src/kernel/vm/FastScheduler.hpp index dc707e47eef..0151007ea3e 100644 --- a/ndb/src/kernel/vm/FastScheduler.hpp +++ b/ndb/src/kernel/vm/FastScheduler.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/GlobalData.hpp b/ndb/src/kernel/vm/GlobalData.hpp index 99b65727374..712fac2ec68 100644 --- a/ndb/src/kernel/vm/GlobalData.hpp +++ b/ndb/src/kernel/vm/GlobalData.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/KeyDescriptor.hpp b/ndb/src/kernel/vm/KeyDescriptor.hpp index 456d64ce1d8..d12dc924ac9 100644 --- a/ndb/src/kernel/vm/KeyDescriptor.hpp +++ b/ndb/src/kernel/vm/KeyDescriptor.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/KeyTable.hpp b/ndb/src/kernel/vm/KeyTable.hpp index e78837b5c8a..72911886b03 100644 --- a/ndb/src/kernel/vm/KeyTable.hpp +++ b/ndb/src/kernel/vm/KeyTable.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/KeyTable2.hpp b/ndb/src/kernel/vm/KeyTable2.hpp index 5c2b3096abe..1076ffa420f 100644 --- a/ndb/src/kernel/vm/KeyTable2.hpp +++ b/ndb/src/kernel/vm/KeyTable2.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/LongSignal.hpp b/ndb/src/kernel/vm/LongSignal.hpp index 9818358011f..f5a64288030 100644 --- a/ndb/src/kernel/vm/LongSignal.hpp +++ b/ndb/src/kernel/vm/LongSignal.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/Makefile.am b/ndb/src/kernel/vm/Makefile.am index 8f9bf92cb01..abfef1541ac 100644 --- a/ndb/src/kernel/vm/Makefile.am +++ b/ndb/src/kernel/vm/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + #SUBDIRS = testCopy testDataBuffer testSimplePropertiesSection #ifneq ($(USE_EDITLINE), N) #DIRS += testLongSig diff --git a/ndb/src/kernel/vm/MetaData.cpp b/ndb/src/kernel/vm/MetaData.cpp index 51afbf21503..24a1ec8ef18 100644 --- a/ndb/src/kernel/vm/MetaData.cpp +++ b/ndb/src/kernel/vm/MetaData.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/MetaData.hpp b/ndb/src/kernel/vm/MetaData.hpp index 1000114a421..23d068354b5 100644 --- a/ndb/src/kernel/vm/MetaData.hpp +++ b/ndb/src/kernel/vm/MetaData.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -68,6 +67,7 @@ public: */ class Table { public: + Table() {} /* Table id (array index in DICT and other blocks) */ Uint32 tableId; diff --git a/ndb/src/kernel/vm/Mutex.cpp b/ndb/src/kernel/vm/Mutex.cpp index aab9e74312b..250eff19b64 100644 --- a/ndb/src/kernel/vm/Mutex.cpp +++ b/ndb/src/kernel/vm/Mutex.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/Mutex.hpp b/ndb/src/kernel/vm/Mutex.hpp index 7a16046188c..ec177a75707 100644 --- a/ndb/src/kernel/vm/Mutex.hpp +++ b/ndb/src/kernel/vm/Mutex.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/Prio.hpp b/ndb/src/kernel/vm/Prio.hpp index 4c9c22b0afe..3f14a3a6c74 100644 --- a/ndb/src/kernel/vm/Prio.hpp +++ b/ndb/src/kernel/vm/Prio.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/RequestTracker.hpp b/ndb/src/kernel/vm/RequestTracker.hpp index ac9ed85ae4b..cfd2a413231 100644 --- a/ndb/src/kernel/vm/RequestTracker.hpp +++ b/ndb/src/kernel/vm/RequestTracker.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SLList.hpp b/ndb/src/kernel/vm/SLList.hpp index 5fde41aa3e0..6cf91b80279 100644 --- a/ndb/src/kernel/vm/SLList.hpp +++ b/ndb/src/kernel/vm/SLList.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SafeCounter.cpp b/ndb/src/kernel/vm/SafeCounter.cpp index 542e43f9172..b6492ec929a 100644 --- a/ndb/src/kernel/vm/SafeCounter.cpp +++ b/ndb/src/kernel/vm/SafeCounter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SafeCounter.hpp b/ndb/src/kernel/vm/SafeCounter.hpp index 917a67f2508..093fd25c296 100644 --- a/ndb/src/kernel/vm/SafeCounter.hpp +++ b/ndb/src/kernel/vm/SafeCounter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SectionReader.cpp b/ndb/src/kernel/vm/SectionReader.cpp index dd474a49e50..44d70c2ec16 100644 --- a/ndb/src/kernel/vm/SectionReader.cpp +++ b/ndb/src/kernel/vm/SectionReader.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SectionReader.hpp b/ndb/src/kernel/vm/SectionReader.hpp index b51006b6128..6297b08f76a 100644 --- a/ndb/src/kernel/vm/SectionReader.hpp +++ b/ndb/src/kernel/vm/SectionReader.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SignalCounter.hpp b/ndb/src/kernel/vm/SignalCounter.hpp index 62242cb65bd..b72c88cbf29 100644 --- a/ndb/src/kernel/vm/SignalCounter.hpp +++ b/ndb/src/kernel/vm/SignalCounter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SimBlockList.hpp b/ndb/src/kernel/vm/SimBlockList.hpp index 40485a37425..09ec3dccc78 100644 --- a/ndb/src/kernel/vm/SimBlockList.hpp +++ b/ndb/src/kernel/vm/SimBlockList.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SimplePropertiesSection.cpp b/ndb/src/kernel/vm/SimplePropertiesSection.cpp index 070563be36b..1159ddd9ca7 100644 --- a/ndb/src/kernel/vm/SimplePropertiesSection.cpp +++ b/ndb/src/kernel/vm/SimplePropertiesSection.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index bbf13528c5c..b58e1feed9d 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -658,24 +657,26 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear) void * p = NULL; size_t size = n*s; + Uint64 real_size = (Uint64)((Uint64)n)*((Uint64)s); refresh_watch_dog(); - if (size > 0){ + if (real_size > 0){ #ifdef VM_TRACE_MEM - ndbout_c("%s::allocRecord(%s, %u, %u) = %u bytes", + ndbout_c("%s::allocRecord(%s, %u, %u) = %llu bytes", getBlockName(number()), type, s, n, - size); + real_size); #endif - p = ndbd_malloc(size); + if( real_size == (Uint64)size ) + p = ndbd_malloc(size); if (p == NULL){ char buf1[255]; char buf2[255]; BaseString::snprintf(buf1, sizeof(buf1), "%s could not allocate memory for %s", getBlockName(number()), type); - BaseString::snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %u bytes", - (Uint32)s, (Uint32)n, (Uint32)size); + BaseString::snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %llu bytes", + (Uint32)s, (Uint32)n, (Uint64)real_size); ERROR_SET(fatal, NDBD_EXIT_MEMALLOC, buf1, buf2); } diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index f7ca4ecbf38..3b705c7d497 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SuperPool.cpp b/ndb/src/kernel/vm/SuperPool.cpp index 65e5dd99629..354c5a2bd26 100644 --- a/ndb/src/kernel/vm/SuperPool.cpp +++ b/ndb/src/kernel/vm/SuperPool.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/SuperPool.hpp b/ndb/src/kernel/vm/SuperPool.hpp index 157c75aa0d5..84121af76dd 100644 --- a/ndb/src/kernel/vm/SuperPool.hpp +++ b/ndb/src/kernel/vm/SuperPool.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/ThreadConfig.cpp b/ndb/src/kernel/vm/ThreadConfig.cpp index 76fcc4ba84f..89fcea5c433 100644 --- a/ndb/src/kernel/vm/ThreadConfig.cpp +++ b/ndb/src/kernel/vm/ThreadConfig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/ThreadConfig.hpp b/ndb/src/kernel/vm/ThreadConfig.hpp index 91c2cafe0e0..64b22e46025 100644 --- a/ndb/src/kernel/vm/ThreadConfig.hpp +++ b/ndb/src/kernel/vm/ThreadConfig.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/TimeQueue.cpp b/ndb/src/kernel/vm/TimeQueue.cpp index 0b620c75d52..bb8c7a74edf 100644 --- a/ndb/src/kernel/vm/TimeQueue.cpp +++ b/ndb/src/kernel/vm/TimeQueue.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/TimeQueue.hpp b/ndb/src/kernel/vm/TimeQueue.hpp index 1203ace10f5..53e9c6ef95e 100644 --- a/ndb/src/kernel/vm/TimeQueue.hpp +++ b/ndb/src/kernel/vm/TimeQueue.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp index f315918b871..398b7965156 100644 --- a/ndb/src/kernel/vm/TransporterCallback.cpp +++ b/ndb/src/kernel/vm/TransporterCallback.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -56,7 +55,7 @@ const char *lookupConnectionError(Uint32 err) { int i= 0; while ((Uint32)connectionError[i].err != err && - (Uint32)connectionError[i].err != -1) + connectionError[i].err != -1) i++; return connectionError[i].text; } diff --git a/ndb/src/kernel/vm/VMSignal.cpp b/ndb/src/kernel/vm/VMSignal.cpp index e4eafb47ff7..cee9aa2911b 100644 --- a/ndb/src/kernel/vm/VMSignal.cpp +++ b/ndb/src/kernel/vm/VMSignal.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/VMSignal.hpp b/ndb/src/kernel/vm/VMSignal.hpp index 33f8a9f25c0..e92335dbfa2 100644 --- a/ndb/src/kernel/vm/VMSignal.hpp +++ b/ndb/src/kernel/vm/VMSignal.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/WaitQueue.hpp b/ndb/src/kernel/vm/WaitQueue.hpp index 4d7240b6866..fd9bf366d2a 100644 --- a/ndb/src/kernel/vm/WaitQueue.hpp +++ b/ndb/src/kernel/vm/WaitQueue.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/WatchDog.cpp b/ndb/src/kernel/vm/WatchDog.cpp index c80317e1725..d1abb709b1e 100644 --- a/ndb/src/kernel/vm/WatchDog.cpp +++ b/ndb/src/kernel/vm/WatchDog.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -23,7 +22,10 @@ #include <NdbOut.hpp> #include <NdbSleep.h> #include <ErrorHandlingMacros.hpp> - +#include <EventLogger.hpp> + +extern EventLogger g_eventLogger; + extern "C" void* runWatchDog(void* w){ @@ -126,7 +128,7 @@ WatchDog::run(){ last_stuck_action = "Unknown place"; break; }//switch - ndbout << "Ndb kernel is stuck in: " << last_stuck_action << endl; + g_eventLogger.warning("Ndb kernel is stuck in: %s", last_stuck_action); if(alerts == 3){ shutdownSystem(last_stuck_action); } diff --git a/ndb/src/kernel/vm/WatchDog.hpp b/ndb/src/kernel/vm/WatchDog.hpp index 65b23dafdb1..1d91c2451c3 100644 --- a/ndb/src/kernel/vm/WatchDog.hpp +++ b/ndb/src/kernel/vm/WatchDog.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/al_test/arrayListTest.cpp b/ndb/src/kernel/vm/al_test/arrayListTest.cpp index bb320106653..08a73084d53 100644 --- a/ndb/src/kernel/vm/al_test/arrayListTest.cpp +++ b/ndb/src/kernel/vm/al_test/arrayListTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp index e80905121e1..835b35994ce 100644 --- a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp +++ b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/al_test/main.cpp b/ndb/src/kernel/vm/al_test/main.cpp index 23193b50725..efdc16b1cbc 100644 --- a/ndb/src/kernel/vm/al_test/main.cpp +++ b/ndb/src/kernel/vm/al_test/main.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/ndbd_malloc.cpp b/ndb/src/kernel/vm/ndbd_malloc.cpp index 4bfccf828fc..21a26ff11d8 100644 --- a/ndb/src/kernel/vm/ndbd_malloc.cpp +++ b/ndb/src/kernel/vm/ndbd_malloc.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -23,12 +22,14 @@ #include <stdio.h> #endif +#ifdef TRACE_MALLOC static void xxx(size_t size, size_t *s_m, size_t *s_k, size_t *s_b) { *s_m = size/1024/1024; *s_k = (size - *s_m*1024*1024)/1024; *s_b = size - *s_m*1024*1024-*s_k*1024; } +#endif static Uint64 g_allocated_memory; void *ndbd_malloc(size_t size) diff --git a/ndb/src/kernel/vm/ndbd_malloc.hpp b/ndb/src/kernel/vm/ndbd_malloc.hpp index 136e9f0c372..dbdd6b53a0e 100644 --- a/ndb/src/kernel/vm/ndbd_malloc.hpp +++ b/ndb/src/kernel/vm/ndbd_malloc.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/pc.hpp b/ndb/src/kernel/vm/pc.hpp index 95839c48e4e..269719c44d0 100644 --- a/ndb/src/kernel/vm/pc.hpp +++ b/ndb/src/kernel/vm/pc.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/testCopy/rr.cpp b/ndb/src/kernel/vm/testCopy/rr.cpp index 1e8305dfe4c..362cd1d5136 100644 --- a/ndb/src/kernel/vm/testCopy/rr.cpp +++ b/ndb/src/kernel/vm/testCopy/rr.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/testCopy/testCopy.cpp b/ndb/src/kernel/vm/testCopy/testCopy.cpp index 78a1dab2619..521f93f4df5 100644 --- a/ndb/src/kernel/vm/testCopy/testCopy.cpp +++ b/ndb/src/kernel/vm/testCopy/testCopy.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp index 5ba59418223..1ebdd4c176b 100644 --- a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp +++ b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp index 1d1fb8ebc82..0d2a0e80113 100644 --- a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp +++ b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp index e16870edf11..feabe769a31 100644 --- a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp +++ b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/kernel/vm/testSuperPool.cpp b/ndb/src/kernel/vm/testSuperPool.cpp index 194b3a43fa0..22aa7a8b6eb 100644 --- a/ndb/src/kernel/vm/testSuperPool.cpp +++ b/ndb/src/kernel/vm/testSuperPool.cpp @@ -10,8 +10,7 @@ exit $? 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/libndb.ver.in b/ndb/src/libndb.ver.in new file mode 100644 index 00000000000..72bf93d196f --- /dev/null +++ b/ndb/src/libndb.ver.in @@ -0,0 +1,2 @@ +libndbclient_@NDB_SHARED_LIB_MAJOR_VERSION@ { global: *; }; + diff --git a/ndb/src/mgmapi/LocalConfig.cpp b/ndb/src/mgmapi/LocalConfig.cpp index 75ad8b40a1f..476e2d6dd84 100644 --- a/ndb/src/mgmapi/LocalConfig.cpp +++ b/ndb/src/mgmapi/LocalConfig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -74,9 +73,9 @@ LocalConfig::init(const char *connectString, //4. Check Ndb.cfg in NDB_HOME { bool fopenError; - char *buf= NdbConfig_NdbCfgName(1 /*true*/); - NdbAutoPtr<char> tmp_aptr(buf); - if(readFile(buf, fopenError)) + char *buf2= NdbConfig_NdbCfgName(1 /*true*/); + NdbAutoPtr<char> tmp_aptr(buf2); + if(readFile(buf2, fopenError)) DBUG_RETURN(true); if (!fopenError) DBUG_RETURN(false); @@ -85,9 +84,9 @@ LocalConfig::init(const char *connectString, //5. Check Ndb.cfg in cwd { bool fopenError; - char *buf= NdbConfig_NdbCfgName(0 /*false*/); - NdbAutoPtr<char> tmp_aptr(buf); - if(readFile(buf, fopenError)) + char *buf2= NdbConfig_NdbCfgName(0 /*false*/); + NdbAutoPtr<char> tmp_aptr(buf2); + if(readFile(buf2, fopenError)) DBUG_RETURN(true); if (!fopenError) DBUG_RETURN(false); @@ -95,9 +94,9 @@ LocalConfig::init(const char *connectString, //7. Check { - char buf[256]; - BaseString::snprintf(buf, sizeof(buf), "host=localhost:%s", NDB_PORT); - if(readConnectString(buf, "default connect string")) + char buf2[256]; + BaseString::snprintf(buf2, sizeof(buf2), "host=localhost:%s", NDB_PORT); + if(readConnectString(buf2, "default connect string")) DBUG_RETURN(true); } diff --git a/ndb/src/mgmapi/LocalConfig.hpp b/ndb/src/mgmapi/LocalConfig.hpp index c415ec1be91..7a583077913 100644 --- a/ndb/src/mgmapi/LocalConfig.hpp +++ b/ndb/src/mgmapi/LocalConfig.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmapi/Makefile.am b/ndb/src/mgmapi/Makefile.am index efe1b8ea2d5..a222ac9ee96 100644 --- a/ndb/src/mgmapi/Makefile.am +++ b/ndb/src/mgmapi/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LTLIBRARIES = libmgmapi.la diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 6287e53541d..42e78b8afc2 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -94,6 +93,7 @@ struct ndb_mgm_handle { char last_error_desc[NDB_MGM_MAX_ERR_DESC_SIZE]; int read_timeout; int write_timeout; + unsigned int connect_timeout; NDB_SOCKET_TYPE socket; @@ -160,6 +160,7 @@ ndb_mgm_create_handle() h->socket = NDB_INVALID_SOCKET; h->read_timeout = 50000; h->write_timeout = 100; + h->connect_timeout = 0; h->cfg_i = -1; h->errstream = stdout; h->m_name = 0; @@ -178,7 +179,7 @@ ndb_mgm_create_handle() h->mgmd_version_minor= -1; h->mgmd_version_build= -1; - DBUG_PRINT("info", ("handle=0x%x", (UintPtr)h)); + DBUG_PRINT("info", ("handle: 0x%lx", (long)h)); DBUG_RETURN(h); } @@ -195,7 +196,7 @@ int ndb_mgm_set_connectstring(NdbMgmHandle handle, const char * mgmsrv) { DBUG_ENTER("ndb_mgm_set_connectstring"); - DBUG_PRINT("info", ("handle=0x%x", (UintPtr)handle)); + DBUG_PRINT("info", ("handle: 0x%lx", (long)handle)); handle->cfg.~LocalConfig(); new (&(handle->cfg)) LocalConfig; if (!handle->cfg.init(mgmsrv, 0) || @@ -237,7 +238,7 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle) DBUG_ENTER("ndb_mgm_destroy_handle"); if(!handle) DBUG_VOID_RETURN; - DBUG_PRINT("info", ("handle=0x%x", (UintPtr)(* handle))); + DBUG_PRINT("info", ("handle: 0x%lx", (long)(* handle))); /** * important! only disconnect if connected * other code relies on this @@ -427,6 +428,16 @@ int ndb_mgm_is_connected(NdbMgmHandle handle) return handle->connected; } +extern "C" +int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds) +{ + if(!handle) + return -1; + + handle->connect_timeout= seconds; + return 0; +} + /** * Connect to a management server */ @@ -455,8 +466,8 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries, LocalConfig &cfg= handle->cfg; NDB_SOCKET_TYPE sockfd= NDB_INVALID_SOCKET; Uint32 i; - int binderror = 0; SocketClient s(0, 0); + s.set_connect_timeout(handle->connect_timeout); if (!s.init()) { fprintf(handle->errstream, @@ -565,6 +576,18 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries, } /** + * Only used for low level testing + * Never to be used by end user. + * Or anybody who doesn't know exactly what they're doing. + */ +extern "C" +int +ndb_mgm_get_fd(NdbMgmHandle handle) +{ + return handle->socket; +} + +/** * Disconnect from a mgm server */ extern "C" @@ -754,22 +777,16 @@ ndb_mgm_get_status(NdbMgmHandle handle) SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, "Probably disconnected"); return NULL; } - if(buf[strlen(buf)-1] == '\n') - buf[strlen(buf)-1] = '\0'; - - if(strcmp("node status", buf) != 0) { + if(strcmp("node status\n", buf) != 0) { SET_ERROR(handle, NDB_MGM_ILLEGAL_NODE_STATUS, buf); return NULL; } - if(!in.gets(buf, sizeof(buf))) { SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, "Probably disconnected"); return NULL; } - if(buf[strlen(buf)-1] == '\n') - buf[strlen(buf)-1] = '\0'; - + BaseString tmp(buf); Vector<BaseString> split; tmp.split(split, ":"); @@ -777,7 +794,7 @@ ndb_mgm_get_status(NdbMgmHandle handle) SET_ERROR(handle, NDB_MGM_ILLEGAL_NODE_STATUS, buf); return NULL; } - + if(!(split[0].trim() == "nodes")){ SET_ERROR(handle, NDB_MGM_ILLEGAL_NODE_STATUS, buf); return NULL; @@ -818,12 +835,12 @@ ndb_mgm_get_status(NdbMgmHandle handle) break; } - Vector<BaseString> split; - tmp.split(split, ":.", 4); - if(split.size() != 4) + Vector<BaseString> split2; + tmp.split(split2, ":.", 4); + if(split2.size() != 4) break; - const int id = atoi(split[1].c_str()); + const int id = atoi(split2[1].c_str()); if(id != nodeId){ ptr++; i++; @@ -831,9 +848,9 @@ ndb_mgm_get_status(NdbMgmHandle handle) ptr->node_id = id; } - split[3].trim(" \t\n"); + split2[3].trim(" \t\n"); - if(status_ackumulate(ptr,split[2].c_str(), split[3].c_str()) != 0) { + if(status_ackumulate(ptr,split2[2].c_str(), split2[3].c_str()) != 0) { break; } } @@ -1362,6 +1379,45 @@ ndb_mgm_get_event_category_string(enum ndb_mgm_event_category status) return 0; } +static const char *clusterlog_names[]= + { "startup", "shutdown", "statistics", "checkpoint", "noderestart", "connection", "info", "warning", "error", "congestion", "debug", "backup" }; + +extern "C" +const unsigned int * +ndb_mgm_get_clusterlog_loglevel(NdbMgmHandle handle) +{ + SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_clusterlog_loglevel"); + int loglevel_count = CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1 ; + static unsigned int loglevel[CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1] = {0,0,0,0,0,0,0,0,0,0,0,0}; + const ParserRow<ParserDummy> getloglevel_reply[] = { + MGM_CMD("get cluster loglevel", NULL, ""), + MGM_ARG(clusterlog_names[0], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[1], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[2], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[3], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[4], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[5], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[6], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[7], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[8], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[9], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[10], Int, Mandatory, ""), + MGM_ARG(clusterlog_names[11], Int, Mandatory, ""), + }; + CHECK_HANDLE(handle, NULL); + CHECK_CONNECTED(handle, NULL); + + Properties args; + const Properties *reply; + reply = ndb_mgm_call(handle, getloglevel_reply, "get cluster loglevel", &args); + CHECK_REPLY(reply, NULL); + + for(int i=0; i < loglevel_count; i++) { + reply->get(clusterlog_names[i], &loglevel[i]); + } + return loglevel; +} + extern "C" int ndb_mgm_set_clusterlog_loglevel(NdbMgmHandle handle, int nodeId, @@ -1451,7 +1507,7 @@ ndb_mgm_listen_event_internal(NdbMgmHandle handle, const int filter[], MGM_END() }; CHECK_HANDLE(handle, -1); - + const char *hostname= ndb_mgm_get_connected_host(handle); int port= ndb_mgm_get_connected_port(handle); SocketClient s(hostname, port); @@ -1473,19 +1529,20 @@ ndb_mgm_listen_event_internal(NdbMgmHandle handle, const int filter[], } args.put("filter", tmp.c_str()); } - + int tmp = handle->socket; handle->socket = sockfd; - + const Properties *reply; reply = ndb_mgm_call(handle, stat_reply, "listen event", &args); - + handle->socket = tmp; - + if(reply == NULL) { close(sockfd); CHECK_REPLY(reply, -1); } + delete reply; return sockfd; } @@ -2129,43 +2186,6 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype, return nodeid; } -/***************************************************************************** - * Global Replication - ******************************************************************************/ -extern "C" -int -ndb_mgm_rep_command(NdbMgmHandle handle, unsigned int request, - unsigned int* replication_id, - struct ndb_mgm_reply* /*reply*/) -{ - SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_rep_command"); - const ParserRow<ParserDummy> replication_reply[] = { - MGM_CMD("global replication reply", NULL, ""), - MGM_ARG("result", String, Mandatory, "Error message"), - MGM_ARG("id", Int, Optional, "Id of global replication"), - MGM_END() - }; - CHECK_HANDLE(handle, -1); - CHECK_CONNECTED(handle, -1); - - Properties args; - args.put("request", request); - const Properties *reply; - reply = ndb_mgm_call(handle, replication_reply, "rep", &args); - CHECK_REPLY(reply, -1); - - const char * result; - reply->get("result", &result); - reply->get("id", replication_id); - if(strcmp(result,"Ok")!=0) { - delete reply; - return -1; - } - - delete reply; - return 0; -} - extern "C" int ndb_mgm_set_int_parameter(NdbMgmHandle handle, @@ -2341,7 +2361,6 @@ ndb_mgm_check_connection(NdbMgmHandle handle){ SocketOutputStream out(handle->socket); SocketInputStream in(handle->socket, handle->read_timeout); char buf[32]; - if (out.println("check connection")) goto ndb_mgm_check_connection_error; @@ -2520,8 +2539,8 @@ int ndb_mgm_report_event(NdbMgmHandle handle, Uint32 *data, Uint32 length) args.put("length", length); BaseString data_string; - for (int i = 0; i < length; i++) - data_string.appfmt(" %u", data[i]); + for (int i = 0; i < (int) length; i++) + data_string.appfmt(" %lu", (ulong) data[i]); args.put("data", data_string.c_str()); @@ -2551,7 +2570,6 @@ int ndb_mgm_end_session(NdbMgmHandle handle) SocketInputStream in(handle->socket, handle->read_timeout); char buf[32]; - in.gets(buf, sizeof(buf)); DBUG_RETURN(0); diff --git a/ndb/src/mgmapi/mgmapi_configuration.cpp b/ndb/src/mgmapi/mgmapi_configuration.cpp index 80ab428c05a..e0ae23e508f 100644 --- a/ndb/src/mgmapi/mgmapi_configuration.cpp +++ b/ndb/src/mgmapi/mgmapi_configuration.cpp @@ -1,3 +1,18 @@ +/* Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include <ndb_types.h> #include <mgmapi.h> #include "mgmapi_configuration.hpp" diff --git a/ndb/src/mgmapi/mgmapi_configuration.hpp b/ndb/src/mgmapi/mgmapi_configuration.hpp index 7d60a4842a1..6088114016e 100644 --- a/ndb/src/mgmapi/mgmapi_configuration.hpp +++ b/ndb/src/mgmapi/mgmapi_configuration.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmapi/mgmapi_internal.h b/ndb/src/mgmapi/mgmapi_internal.h index 90f93129f2a..d30be221dcd 100644 --- a/ndb/src/mgmapi/mgmapi_internal.h +++ b/ndb/src/mgmapi/mgmapi_internal.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmapi/ndb_logevent.cpp b/ndb/src/mgmapi/ndb_logevent.cpp index 2472a434590..3885bb79536 100644 --- a/ndb/src/mgmapi/ndb_logevent.cpp +++ b/ndb/src/mgmapi/ndb_logevent.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmapi/ndb_logevent.hpp b/ndb/src/mgmapi/ndb_logevent.hpp index cb1a0e388e5..df0a657e9b1 100644 --- a/ndb/src/mgmapi/ndb_logevent.hpp +++ b/ndb/src/mgmapi/ndb_logevent.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmapi/test/keso.c b/ndb/src/mgmapi/test/keso.c index d2675b2ca8a..922bace6b91 100644 --- a/ndb/src/mgmapi/test/keso.c +++ b/ndb/src/mgmapi/test/keso.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmapi/test/mgmSrvApi.cpp b/ndb/src/mgmapi/test/mgmSrvApi.cpp index 4a8e38c9ba5..5a8acbfadc5 100644 --- a/ndb/src/mgmapi/test/mgmSrvApi.cpp +++ b/ndb/src/mgmapi/test/mgmSrvApi.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 58b98671b14..2265579ad1e 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -55,11 +54,11 @@ public: * * @return true until quit/bye/exit has been typed */ - int execute(const char *_line, int _try_reconnect=-1, int *error= 0); + int execute(const char *_line, int _try_reconnect=-1, bool interactive=1, int *error= 0); private: void printError(); - int execute_impl(const char *_line); + int execute_impl(const char *_line, bool interactive=1); /** * Analyse the command line, after the first token. @@ -68,10 +67,11 @@ private: * command will be sent to all DB processes. * @param allAfterFirstToken: What the client gave after the * first token on the command line + * @return: 0 if analyseAfterFirstToken succeeds, otherwise -1 */ - void analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr); + int analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr); - void executeCommand(Vector<BaseString> &command_list, + int executeCommand(Vector<BaseString> &command_list, unsigned command_pos, int *node_ids, int no_of_nodes); /** @@ -97,54 +97,54 @@ private: * this case "22". Each function is responsible to check the parameters * argument. */ - void executeHelp(char* parameters); - void executeShow(char* parameters); - void executeConnect(char* parameters); - void executePurge(char* parameters); + int executeHelp(char* parameters); + int executeShow(char* parameters); + int executePurge(char* parameters); + int executeConnect(char* parameters, bool interactive); int executeShutdown(char* parameters); void executeRun(char* parameters); void executeInfo(char* parameters); void executeClusterLog(char* parameters); public: - void executeStop(int processId, const char* parameters, bool all); - void executeStop(Vector<BaseString> &command_list, unsigned command_pos, + int executeStop(int processId, const char* parameters, bool all); + int executeEnterSingleUser(char* parameters); + int executeExitSingleUser(char* parameters); + int executeStart(int processId, const char* parameters, bool all); + int executeRestart(int processId, const char* parameters, bool all); + int executeLogLevel(int processId, const char* parameters, bool all); + int executeError(int processId, const char* parameters, bool all); + int executeLog(int processId, const char* parameters, bool all); + int executeLogIn(int processId, const char* parameters, bool all); + int executeLogOut(int processId, const char* parameters, bool all); + int executeLogOff(int processId, const char* parameters, bool all); + int executeTestOn(int processId, const char* parameters, bool all); + int executeTestOff(int processId, const char* parameters, bool all); + int executeSet(int processId, const char* parameters, bool all); + int executeGetStat(int processId, const char* parameters, bool all); + int executeStatus(int processId, const char* parameters, bool all); + int executeEventReporting(int processId, const char* parameters, bool all); + int executeDumpState(int processId, const char* parameters, bool all); + int executeStartBackup(char * parameters); + int executeAbortBackup(char * parameters); + int executeStop(Vector<BaseString> &command_list, unsigned command_pos, int *node_ids, int no_of_nodes); - void executeEnterSingleUser(char* parameters); - void executeExitSingleUser(char* parameters); - void executeStart(int processId, const char* parameters, bool all); - void executeRestart(int processId, const char* parameters, bool all); - void executeRestart(Vector<BaseString> &command_list, unsigned command_pos, + int executeRestart(Vector<BaseString> &command_list, unsigned command_pos, int *node_ids, int no_of_nodes); - void executeLogLevel(int processId, const char* parameters, bool all); - void executeError(int processId, const char* parameters, bool all); - void executeLog(int processId, const char* parameters, bool all); - void executeLogIn(int processId, const char* parameters, bool all); - void executeLogOut(int processId, const char* parameters, bool all); - void executeLogOff(int processId, const char* parameters, bool all); - void executeTestOn(int processId, const char* parameters, bool all); - void executeTestOff(int processId, const char* parameters, bool all); - void executeSet(int processId, const char* parameters, bool all); - void executeGetStat(int processId, const char* parameters, bool all); - void executeStatus(int processId, const char* parameters, bool all); - void executeEventReporting(int processId, const char* parameters, bool all); - void executeDumpState(int processId, const char* parameters, bool all); - int executeStartBackup(char * parameters); - void executeAbortBackup(char * parameters); - - void executeRep(char* parameters); + + int executeRep(char* parameters); void executeCpc(char * parameters); public: - bool connect(); + bool connect(bool interactive); bool disconnect(); /** * A execute function definition */ public: - typedef void (CommandInterpreter::* ExecuteFunction)(int processId, + typedef int (CommandInterpreter::* ExecuteFunction)(int processId, const char * param, bool all); @@ -156,7 +156,7 @@ private: /** * */ - void executeForAll(const char * cmd, + int executeForAll(const char * cmd, ExecuteFunction fun, const char * param); @@ -173,8 +173,15 @@ private: bool rep_connected; #endif struct NdbThread* m_event_thread; + NdbMutex *m_print_mutex; +}; + +struct event_thread_param { + NdbMgmHandle *m; + NdbMutex **p; }; +NdbMutex* print_mutex; /* * Facade object for CommandInterpreter @@ -191,9 +198,9 @@ Ndb_mgmclient::~Ndb_mgmclient() { delete m_cmd; } -int Ndb_mgmclient::execute(const char *_line, int _try_reconnect, int *error) +int Ndb_mgmclient::execute(const char *_line, int _try_reconnect, bool interactive, int *error) { - return m_cmd->execute(_line,_try_reconnect,error); + return m_cmd->execute(_line,_try_reconnect,interactive, error); } int Ndb_mgmclient::disconnect() @@ -239,7 +246,7 @@ extern "C" { #include <util/InputStream.hpp> #include <util/OutputStream.hpp> -int Ndb_mgmclient::execute(int argc, char** argv, int _try_reconnect, int *error) +int Ndb_mgmclient::execute(int argc, char** argv, int _try_reconnect, bool interactive, int *error) { if (argc <= 0) return 0; @@ -248,7 +255,7 @@ int Ndb_mgmclient::execute(int argc, char** argv, int _try_reconnect, int *error { _line.appfmt(" %s", argv[i]); } - return m_cmd->execute(_line.c_str(),_try_reconnect, error); + return m_cmd->execute(_line.c_str(),_try_reconnect, interactive, error); } /***************************************************************************** @@ -259,7 +266,7 @@ static const char* helpText = " NDB Cluster -- Management Client -- Help\n" "---------------------------------------------------------------------------\n" "HELP Print help text\n" -"HELP SHOW Help for SHOW command\n" +"HELP COMMAND Print detailed help for COMMAND(e.g. SHOW)\n" #ifdef HAVE_GLOBAL_REPLICATION "HELP REPLICATION Help for global replication\n" #endif // HAVE_GLOBAL_REPLICATION @@ -279,10 +286,10 @@ static const char* helpText = "CLUSTERLOG OFF [<severity>] ... Disable Cluster logging\n" "CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off\n" "CLUSTERLOG INFO Print cluster log information\n" -"<id> START Start DB node (started with -n)\n" -"<id> RESTART [-n] [-i] Restart DB node\n" -"<id> STOP Stop DB node\n" -"ENTER SINGLE USER MODE <api-node> Enter single user mode\n" +"<id> START Start data node (started with -n)\n" +"<id> RESTART [-n] [-i] Restart data or management server node\n" +"<id> STOP Stop data or management server node\n" +"ENTER SINGLE USER MODE <id> Enter single user mode\n" "EXIT SINGLE USER MODE Exit single user mode\n" "<id> STATUS Print status\n" "<id> CLUSTERLOG {<category>=<level>}+ Set log level for cluster log\n" @@ -298,14 +305,296 @@ static const char* helpTextShow = "---------------------------------------------------------------------------\n" " NDB Cluster -- Management Client -- Help for SHOW command\n" "---------------------------------------------------------------------------\n" -"SHOW prints NDB Cluster information\n\n" -"SHOW Print information about cluster\n" +"SHOW Print information about cluster\n\n" +"SHOW Print information about cluster.The status reported is from\n" +" the perspective of the data nodes. API and Management Server nodes\n" +" are only reported as connected once the data nodes have started.\n" #if 0 "SHOW CONFIG Print configuration (in initial config file format)\n" "SHOW PARAMETERS Print information about configuration parameters\n\n" #endif ; +static const char* helpTextHelp = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for HELP command\n" +"---------------------------------------------------------------------------\n" +"HELP List available commands of NDB Cluster Management Client\n\n" +"HELP List available commands.\n" +; + +static const char* helpTextBackup = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for BACKUP command\n" +"---------------------------------------------------------------------------\n" +"BACKUP A backup is a snapshot of the database at a given time. \n" +" The backup consists of three main parts:\n\n" +" Metadata: the names and definitions of all database tables. \n" +" Table records: the data actually stored in the database tables \n" +" at the time that the backup was made.\n" +" Transaction log: a sequential record telling how \n" +" and when data was stored in the database.\n\n" +" Backups are stored on each data node in the cluster that \n" +" participates in the backup.\n\n" +" The cluster log records backup related events (such as \n" +" backup started, aborted, finished).\n" +; + +static const char* helpTextStartBackup = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for START BACKUP command\n" +"---------------------------------------------------------------------------\n" +"START BACKUP Start a cluster backup\n\n" +"START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]\n" +" Start a backup for the cluster.\n" +" Each backup gets an ID number that is reported to the\n" +" user. This ID number can help you find the backup on the\n" +" file system, or ABORT BACKUP if you wish to cancel a \n" +" running backup.\n\n" +" NOWAIT \n" +" Start a cluster backup and return immediately.\n" +" The management client will return control directly\n" +" to the user without waiting for the backup\n" +" to have started.\n" +" The status of the backup is recorded in the Cluster log.\n" +" WAIT STARTED\n" +" Start a cluster backup and return until the backup has\n" +" started. The management client will wait for the backup \n" +" to have started before returning control to the user.\n" +" WAIT COMPLETED\n" +" Start a cluster backup and return until the backup has\n" +" completed. The management client will wait for the backup\n" +" to complete before returning control to the user.\n" +; + +static const char* helpTextAbortBackup = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for ABORT BACKUP command\n" +"---------------------------------------------------------------------------\n" +"ABORT BACKUP Abort a cluster backup\n\n" +"ABORT BACKUP <backup id> \n" +" Abort a backup that is already in progress.\n" +" The backup id can be seen in the cluster log or in the\n" +" output of the START BACKUP command.\n" +; + +static const char* helpTextShutdown = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for SHUTDOWN command\n" +"---------------------------------------------------------------------------\n" +"SHUTDOWN Shutdown the cluster\n\n" +"SHUTDOWN Shutdown the data nodes and management nodes.\n" +" MySQL Servers and NDBAPI nodes are currently not \n" +" shut down by issuing this command.\n" +; + +static const char* helpTextClusterlogOn = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for CLUSTERLOG ON command\n" +"---------------------------------------------------------------------------\n" +"CLUSTERLOG ON Enable Cluster logging\n\n" +"CLUSTERLOG ON [<severity>] ... \n" +" Turn the cluster log on.\n" +" It tells management server which severity levels\n" +" messages will be logged.\n\n" +" <severity> can be any one of the following values:\n" +" ALERT, CRITICAL, ERROR, WARNING, INFO, DEBUG.\n" +; + +static const char* helpTextClusterlogOff = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for CLUSTERLOG OFF command\n" +"---------------------------------------------------------------------------\n" +"CLUSTERLOG OFF Disable Cluster logging\n\n" +"CLUSTERLOG OFF [<severity>] ... \n" +" Turn the cluster log off.\n" +" It tells management server which serverity\n" +" levels logging will be disabled.\n\n" +" <severity> can be any one of the following values:\n" +" ALERT, CRITICAL, ERROR, WARNING, INFO, DEBUG.\n" +; + +static const char* helpTextClusterlogToggle = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for CLUSTERLOG TOGGLE command\n" +"---------------------------------------------------------------------------\n" +"CLUSTERLOG TOGGLE Toggle severity filter on/off\n\n" +"CLUSTERLOG TOGGLE [<severity>] ... \n" +" Toggle serverity filter on/off.\n" +" If a serverity level is already enabled,then it will\n" +" be disabled after you use the command,vice versa.\n\n" +" <severity> can be any one of the following values:\n" +" ALERT, CRITICAL, ERROR, WARNING, INFO, DEBUG.\n" +; + +static const char* helpTextClusterlogInfo = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for CLUSTERLOG INFO command\n" +"---------------------------------------------------------------------------\n" +"CLUSTERLOG INFO Print cluster log information\n\n" +"CLUSTERLOG INFO Display which severity levels have been enabled,\n" +" see HELP CLUSTERLOG for list of the severity levels.\n" +; + +static const char* helpTextStart = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for START command\n" +"---------------------------------------------------------------------------\n" +"START Start data node (started with -n)\n\n" +"<id> START Start the data node identified by <id>.\n" +" Only starts data nodes that have not\n" +" yet joined the cluster. These are nodes\n" +" launched or restarted with the -n(--nostart)\n" +" option.\n\n" +" It does not launch the ndbd process on a remote\n" +" machine.\n" +; + +static const char* helpTextRestart = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for RESTART command\n" +"---------------------------------------------------------------------------\n" +"RESTART Restart data or management server node\n\n" +"<id> RESTART [-n] [-i] \n" +" Restart the data or management node <id>(or All data nodes).\n\n" +" -n (--nostart) restarts the node but does not\n" +" make it join the cluster. Use '<id> START' to\n" +" join the node to the cluster.\n\n" +" -i (--initial) perform initial start.\n" +" This cleans the file system (ndb_<id>_fs)\n" +" and the node will copy data from another node\n" +" in the same node group during start up.\n\n" +" Consult the documentation before using -i.\n\n" +" INCORRECT USE OF -i WILL CAUSE DATA LOSS!\n" +; + +static const char* helpTextStop = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for STOP command\n" +"---------------------------------------------------------------------------\n" +"STOP Stop data or management server node\n\n" +"<id> STOP Stop the data or management server node <id>.\n\n" +" ALL STOP will just stop all data nodes.\n\n" +" If you desire to also shut down management servers,\n" +" use SHUTDOWN instead.\n" +; + +static const char* helpTextEnterSingleUserMode = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for ENTER SINGLE USER MODE command\n" +"---------------------------------------------------------------------------\n" +"ENTER SINGLE USER MODE Enter single user mode\n\n" +"ENTER SINGLE USER MODE <id> \n" +" Enters single-user mode, whereby only the MySQL Server or NDBAPI\n" +" node identified by <id> is allowed to access the database. \n" +; + +static const char* helpTextExitSingleUserMode = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for EXIT SINGLE USER MODE command\n" +"---------------------------------------------------------------------------\n" +"EXIT SINGLE USER MODE Exit single user mode\n\n" +"EXIT SINGLE USER MODE \n" +" Exits single-user mode, allowing all SQL nodes \n" +" (that is, all running mysqld processes) to access the database. \n" +; + +static const char* helpTextStatus = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for STATUS command\n" +"---------------------------------------------------------------------------\n" +"STATUS Print status\n\n" +"<id> STATUS Displays status information for the data node <id>\n" +" or for All data nodes. \n\n" +" e.g.\n" +" ALL STATUS\n" +" 1 STATUS\n\n" +" When a node is starting, the start phase will be\n" +" listed.\n\n" +" Start Phase Meaning\n" +" 1 Clear the cluster file system(ndb_<id>_fs). \n" +" This stage occurs only when the --initial option \n" +" has been specified.\n" +" 2 This stage sets up Cluster connections, establishes \n" +" inter-node communications and starts Cluster heartbeats.\n" +" 3 The arbitrator node is elected.\n" +" 4 Initializes a number of internal cluster variables.\n" +" 5 For an initial start or initial node restart,\n" +" the redo log files are created.\n" +" 6 If this is an initial start, create internal system tables.\n" +" 7 Update internal variables. \n" +" 8 In a system restart, rebuild all indexes.\n" +" 9 Update internal variables. \n" +" 10 The node can be connected by APIs and can receive events.\n" +" 11 At this point,event delivery is handed over to\n" +" the node joining the cluster.\n" +"(see manual for more information)\n" +; + +static const char* helpTextClusterlog = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for CLUSTERLOG command\n" +"---------------------------------------------------------------------------\n" +"CLUSTERLOG Set log level for cluster log\n\n" +" <id> CLUSTERLOG {<category>=<level>}+ \n" +" Logs <category> events with priority less than \n" +" or equal to <level> in the cluster log.\n\n" +" <category> can be any one of the following values:\n" +" STARTUP, SHUTDOWN, STATISTICS, CHECKPOINT, NODERESTART,\n" +" CONNECTION, ERROR, INFO, CONGESTION, DEBUG, or BACKUP. \n\n" +" <level> is represented by one of the numbers \n" +" from 1 to 15 inclusive, where 1 indicates 'most important' \n" +" and 15 'least important'.\n\n" +" <severity> can be any one of the following values:\n" +" ALERT, CRITICAL, ERROR, WARNING, INFO, DEBUG.\n" +; + + +static const char* helpTextPurgeStaleSessions = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for PURGE STALE SESSIONS command\n" +"---------------------------------------------------------------------------\n" +"PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server\n\n" +"PURGE STALE SESSIONS \n" +" Running this statement forces all reserved \n" +" node IDs to be checked; any that are not \n" +" being used by nodes acutally connected to \n" +" the cluster are then freed.\n\n" +" This command is not normally needed, but may be\n" +" required in some situations where failed nodes \n" +" cannot rejoin the cluster due to failing to\n" +" allocate a node id.\n" +; + +static const char* helpTextConnect = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for CONNECT command\n" +"---------------------------------------------------------------------------\n" +"CONNECT Connect to management server (reconnect if already connected)\n\n" +"CONNECT [<connectstring>] \n" +" Connect to management server.\n" +" The optional parameter connectstring specifies the \n" +" connect string to user.\n\n" +" A connect string may be:\n" +" mgm-server\n" +" mgm-server:port\n" +" mgm1:port,mgm2:port\n" +" With multiple management servers comma separated.\n" +" The management client with try to connect to the \n" +" management servers in the order they are listed.\n\n" +" If no connect string is specified, the default \n" +" is used. \n" +; + +static const char* helpTextQuit = +"---------------------------------------------------------------------------\n" +" NDB Cluster -- Management Client -- Help for QUIT command\n" +"---------------------------------------------------------------------------\n" +"QUIT Quit management client\n\n" +"QUIT Terminates the management client. \n" +; + + #ifdef HAVE_GLOBAL_REPLICATION static const char* helpTextRep = "---------------------------------------------------------------------------\n" @@ -363,6 +652,44 @@ static const char* helpTextDebug = ; #endif +struct st_cmd_help { + const char *cmd; + const char * help; +}help_items[]={ + {"SHOW", helpTextShow}, + {"HELP", helpTextHelp}, + {"BACKUP", helpTextBackup}, + {"START BACKUP", helpTextStartBackup}, + {"START BACKUP NOWAIT", helpTextStartBackup}, + {"START BACKUP WAIT STARTED", helpTextStartBackup}, + {"START BACKUP WAIT", helpTextStartBackup}, + {"START BACKUP WAIT COMPLETED", helpTextStartBackup}, + {"ABORT BACKUP", helpTextAbortBackup}, + {"SHUTDOWN", helpTextShutdown}, + {"CLUSTERLOG ON", helpTextClusterlogOn}, + {"CLUSTERLOG OFF", helpTextClusterlogOff}, + {"CLUSTERLOG TOGGLE", helpTextClusterlogToggle}, + {"CLUSTERLOG INFO", helpTextClusterlogInfo}, + {"START", helpTextStart}, + {"RESTART", helpTextRestart}, + {"STOP", helpTextStop}, + {"ENTER SINGLE USER MODE", helpTextEnterSingleUserMode}, + {"EXIT SINGLE USER MODE", helpTextExitSingleUserMode}, + {"STATUS", helpTextStatus}, + {"CLUSTERLOG", helpTextClusterlog}, + {"PURGE STALE SESSIONS", helpTextPurgeStaleSessions}, + {"CONNECT", helpTextConnect}, + {"QUIT", helpTextQuit}, +#ifdef HAVE_GLOBAL_REPLICATION + {"REPLICATION", helpTextRep}, + {"REP", helpTextRep}, +#endif // HAVE_GLOBAL_REPLICATION +#ifdef VM_TRACE // DEBUG ONLY + {"DEBUG", helpTextDebug}, +#endif //VM_TRACE + {NULL, NULL} +}; + static bool convert(const char* s, int& val) { @@ -393,8 +720,9 @@ CommandInterpreter::CommandInterpreter(const char *_host,int verbose) { m_constr= _host; m_connected= false; - m_event_thread= 0; + m_event_thread= NULL; try_reconnect = 0; + m_print_mutex= NdbMutex_Create(); #ifdef HAVE_GLOBAL_REPLICATION rep_host = NULL; m_repserver = NULL; @@ -408,6 +736,7 @@ CommandInterpreter::CommandInterpreter(const char *_host,int verbose) CommandInterpreter::~CommandInterpreter() { disconnect(); + NdbMutex_Destroy(m_print_mutex); } static bool @@ -444,11 +773,13 @@ CommandInterpreter::printError() static int do_event_thread; static void* -event_thread_run(void* m) +event_thread_run(void* p) { DBUG_ENTER("event_thread_run"); - NdbMgmHandle handle= *(NdbMgmHandle*)m; + struct event_thread_param param= *(struct event_thread_param*)p; + NdbMgmHandle handle= *(param.m); + NdbMutex* printmutex= *(param.p); int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 1, NDB_MGM_EVENT_CATEGORY_STARTUP, @@ -466,7 +797,11 @@ event_thread_run(void* m) { const char ping_token[]= "<PING>"; if (memcmp(ping_token,tmp,sizeof(ping_token)-1)) - ndbout << tmp; + if(tmp && strlen(tmp)) + { + Guard g(printmutex); + ndbout << tmp; + } } } while(do_event_thread); NDB_CLOSE_SOCKET(fd); @@ -480,7 +815,7 @@ event_thread_run(void* m) } bool -CommandInterpreter::connect() +CommandInterpreter::connect(bool interactive) { DBUG_ENTER("CommandInterpreter::connect"); @@ -492,10 +827,12 @@ CommandInterpreter::connect() ndbout_c("Cannot create handle to management server."); exit(-1); } - m_mgmsrv2 = ndb_mgm_create_handle(); - if(m_mgmsrv2 == NULL) { - ndbout_c("Cannot create 2:nd handle to management server."); - exit(-1); + if (interactive) { + m_mgmsrv2 = ndb_mgm_create_handle(); + if(m_mgmsrv2 == NULL) { + ndbout_c("Cannot create 2:nd handle to management server."); + exit(-1); + } } if (ndb_mgm_set_connectstring(m_mgmsrv, m_constr)) @@ -509,59 +846,64 @@ CommandInterpreter::connect() const char *host= ndb_mgm_get_connected_host(m_mgmsrv); unsigned port= ndb_mgm_get_connected_port(m_mgmsrv); - BaseString constr; - constr.assfmt("%s:%d",host,port); - if(!ndb_mgm_set_connectstring(m_mgmsrv2, constr.c_str()) && - !ndb_mgm_connect(m_mgmsrv2, try_reconnect-1, 5, 1)) - { - DBUG_PRINT("info",("2:ndb connected to Management Server ok at: %s:%d", - host, port)); - assert(m_event_thread == 0); - assert(do_event_thread == 0); - do_event_thread= 0; - m_event_thread = NdbThread_Create(event_thread_run, - (void**)&m_mgmsrv2, - 32768, - "CommandInterpreted_event_thread", - NDB_THREAD_PRIO_LOW); - if (m_event_thread != 0) - { - DBUG_PRINT("info",("Thread created ok, waiting for started...")); - int iter= 1000; // try for 30 seconds - while(do_event_thread == 0 && - iter-- > 0) - NdbSleep_MilliSleep(30); - } - if (m_event_thread == 0 || - do_event_thread == 0 || - do_event_thread == -1) + if (interactive) { + BaseString constr; + constr.assfmt("%s:%d",host,port); + if(!ndb_mgm_set_connectstring(m_mgmsrv2, constr.c_str()) && + !ndb_mgm_connect(m_mgmsrv2, try_reconnect-1, 5, 1)) { - DBUG_PRINT("info",("Warning, event thread startup failed, " - "degraded printouts as result, errno=%d", - errno)); - printf("Warning, event thread startup failed, " - "degraded printouts as result, errno=%d\n", errno); + DBUG_PRINT("info",("2:ndb connected to Management Server ok at: %s:%d", + host, port)); + assert(m_event_thread == NULL); + assert(do_event_thread == 0); do_event_thread= 0; + struct event_thread_param p; + p.m= &m_mgmsrv2; + p.p= &m_print_mutex; + m_event_thread = NdbThread_Create(event_thread_run, + (void**)&p, + 32768, + "CommandInterpreted_event_thread", + NDB_THREAD_PRIO_LOW); if (m_event_thread) { - void *res; - NdbThread_WaitFor(m_event_thread, &res); - NdbThread_Destroy(&m_event_thread); + DBUG_PRINT("info",("Thread created ok, waiting for started...")); + int iter= 1000; // try for 30 seconds + while(do_event_thread == 0 && + iter-- > 0) + NdbSleep_MilliSleep(30); + } + if (m_event_thread == NULL || + do_event_thread == 0 || + do_event_thread == -1) + { + DBUG_PRINT("info",("Warning, event thread startup failed, " + "degraded printouts as result, errno=%d", + errno)); + printf("Warning, event thread startup failed, " + "degraded printouts as result, errno=%d\n", errno); + do_event_thread= 0; + if (m_event_thread) + { + void *res; + NdbThread_WaitFor(m_event_thread, &res); + NdbThread_Destroy(&m_event_thread); + } + ndb_mgm_disconnect(m_mgmsrv2); } - ndb_mgm_disconnect(m_mgmsrv2); } - } - else - { - DBUG_PRINT("warning", - ("Could not do 2:nd connect to mgmtserver for event listening")); - DBUG_PRINT("info", ("code: %d, msg: %s", - ndb_mgm_get_latest_error(m_mgmsrv2), - ndb_mgm_get_latest_error_msg(m_mgmsrv2))); - printf("Warning, event connect failed, degraded printouts as result\n"); - printf("code: %d, msg: %s\n", - ndb_mgm_get_latest_error(m_mgmsrv2), - ndb_mgm_get_latest_error_msg(m_mgmsrv2)); + else + { + DBUG_PRINT("warning", + ("Could not do 2:nd connect to mgmtserver for event listening")); + DBUG_PRINT("info", ("code: %d, msg: %s", + ndb_mgm_get_latest_error(m_mgmsrv2), + ndb_mgm_get_latest_error_msg(m_mgmsrv2))); + printf("Warning, event connect failed, degraded printouts as result\n"); + printf("code: %d, msg: %s\n", + ndb_mgm_get_latest_error(m_mgmsrv2), + ndb_mgm_get_latest_error_msg(m_mgmsrv2)); + } } m_connected= true; DBUG_PRINT("info",("Connected to Management Server at: %s:%d", host, port)); @@ -584,7 +926,7 @@ CommandInterpreter::disconnect() do_event_thread= 0; NdbThread_WaitFor(m_event_thread, &res); NdbThread_Destroy(&m_event_thread); - m_event_thread= 0; + m_event_thread= NULL; ndb_mgm_destroy_handle(&m_mgmsrv2); } if (m_connected) @@ -600,13 +942,14 @@ CommandInterpreter::disconnect() int CommandInterpreter::execute(const char *_line, int _try_reconnect, - int *error) + bool interactive, int *error) { if (_try_reconnect >= 0) try_reconnect=_try_reconnect; - int result= execute_impl(_line); + int result= execute_impl(_line, interactive); if (error) *error= m_error; + return result; } @@ -618,7 +961,7 @@ invalid_command(const char *cmd) } int -CommandInterpreter::execute_impl(const char *_line) +CommandInterpreter::execute_impl(const char *_line, bool interactive) { DBUG_ENTER("CommandInterpreter::execute_impl"); DBUG_PRINT("enter",("line=\"%s\"",_line)); @@ -626,6 +969,7 @@ CommandInterpreter::execute_impl(const char *_line) char * line; if(_line == NULL) { + m_error = -1; DBUG_RETURN(false); } line = my_strdup(_line,MYF(MY_WME)); @@ -663,16 +1007,17 @@ CommandInterpreter::execute_impl(const char *_line) if (strcasecmp(firstToken, "HELP") == 0 || strcasecmp(firstToken, "?") == 0) { - executeHelp(allAfterFirstToken); + m_error = executeHelp(allAfterFirstToken); DBUG_RETURN(true); } else if (strcasecmp(firstToken, "CONNECT") == 0) { - executeConnect(allAfterFirstToken); + m_error = executeConnect(allAfterFirstToken, interactive); DBUG_RETURN(true); } else if (strcasecmp(firstToken, "SLEEP") == 0) { if (allAfterFirstToken) - sleep(atoi(allAfterFirstToken)); + if (sleep(atoi(allAfterFirstToken)) != 0 ) + m_error = -1; DBUG_RETURN(true); } else if((strcasecmp(firstToken, "QUIT") == 0 || @@ -682,11 +1027,20 @@ CommandInterpreter::execute_impl(const char *_line) DBUG_RETURN(false); } - if (!connect()) + if (!connect(interactive)){ + m_error = -1; DBUG_RETURN(true); + } + + if (ndb_mgm_check_connection(m_mgmsrv)) + { + disconnect(); + connect(interactive); + } if (strcasecmp(firstToken, "SHOW") == 0) { - executeShow(allAfterFirstToken); + Guard g(m_print_mutex); + m_error = executeShow(allAfterFirstToken); DBUG_RETURN(true); } else if (strcasecmp(firstToken, "SHUTDOWN") == 0) { @@ -706,17 +1060,17 @@ CommandInterpreter::execute_impl(const char *_line) else if(strcasecmp(firstToken, "ABORT") == 0 && allAfterFirstToken != NULL && strncasecmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ - executeAbortBackup(allAfterFirstToken); + m_error = executeAbortBackup(allAfterFirstToken); DBUG_RETURN(true); } else if (strcasecmp(firstToken, "PURGE") == 0) { - executePurge(allAfterFirstToken); + m_error = executePurge(allAfterFirstToken); DBUG_RETURN(true); } #ifdef HAVE_GLOBAL_REPLICATION else if(strcasecmp(firstToken, "REPLICATION") == 0 || strcasecmp(firstToken, "REP") == 0) { - executeRep(allAfterFirstToken); + m_error = executeRep(allAfterFirstToken); DBUG_RETURN(true); } #endif // HAVE_GLOBAL_REPLICATION @@ -724,18 +1078,18 @@ CommandInterpreter::execute_impl(const char *_line) allAfterFirstToken != NULL && strncasecmp(allAfterFirstToken, "SINGLE USER MODE ", sizeof("SINGLE USER MODE") - 1) == 0){ - executeEnterSingleUser(allAfterFirstToken); + m_error = executeEnterSingleUser(allAfterFirstToken); DBUG_RETURN(true); } else if(strcasecmp(firstToken, "EXIT") == 0 && allAfterFirstToken != NULL && strncasecmp(allAfterFirstToken, "SINGLE USER MODE ", sizeof("SINGLE USER MODE") - 1) == 0){ - executeExitSingleUser(allAfterFirstToken); + m_error = executeExitSingleUser(allAfterFirstToken); DBUG_RETURN(true); } else if (strcasecmp(firstToken, "ALL") == 0) { - analyseAfterFirstToken(-1, allAfterFirstToken); + m_error = analyseAfterFirstToken(-1, allAfterFirstToken); } else { /** * First tokens should be digits, node ID's @@ -747,7 +1101,7 @@ CommandInterpreter::execute_impl(const char *_line) int node_id; if (convert(command_list[pos].c_str(), node_id)) { - if (node_id <= 0) { + if (node_id <= 0 || node_id > MAX_NODES) { ndbout << "Invalid node ID: " << command_list[pos].c_str() << "." << endl; DBUG_RETURN(true); @@ -762,20 +1116,22 @@ CommandInterpreter::execute_impl(const char *_line) { /* No digit found */ invalid_command(_line); + m_error = -1; DBUG_RETURN(true); } if (pos == command_list.size()) { /* No command found */ invalid_command(_line); + m_error = -1; DBUG_RETURN(true); } if (no_of_nodes == 1) { - analyseAfterFirstToken(node_ids[0], allAfterFirstToken); + m_error = analyseAfterFirstToken(node_ids[0], allAfterFirstToken); DBUG_RETURN(true); } - executeCommand(command_list, pos, node_ids, no_of_nodes); + m_error = executeCommand(command_list, pos, node_ids, no_of_nodes); DBUG_RETURN(true); } DBUG_RETURN(true); @@ -809,14 +1165,15 @@ static const CommandInterpreter::CommandFunctionPair commands[] = { //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::analyseAfterFirstToken(int processId, char* allAfterFirstToken) { + int retval = 0; if (emptyString(allAfterFirstToken)) { ndbout << "Expected a command after " << ((processId == -1) ? "ALL." : "node ID.") << endl; - return; + return -1; } char* secondToken = strtok(allAfterFirstToken, " "); @@ -835,36 +1192,39 @@ CommandInterpreter::analyseAfterFirstToken(int processId, if(fun == 0){ invalid_command(secondToken); - return; + return -1; } if(processId == -1){ - executeForAll(command, fun, allAfterSecondToken); + retval = executeForAll(command, fun, allAfterSecondToken); } else { - (this->*fun)(processId, allAfterSecondToken, false); + retval = (this->*fun)(processId, allAfterSecondToken, false); } ndbout << endl; + return retval; } -void +int CommandInterpreter::executeCommand(Vector<BaseString> &command_list, unsigned command_pos, int *node_ids, int no_of_nodes) { const char *cmd= command_list[command_pos].c_str(); + int retval = 0; + if (strcasecmp("STOP", cmd) == 0) { - executeStop(command_list, command_pos+1, node_ids, no_of_nodes); - return; + retval = executeStop(command_list, command_pos+1, node_ids, no_of_nodes); + return retval; } if (strcasecmp("RESTART", cmd) == 0) { - executeRestart(command_list, command_pos+1, node_ids, no_of_nodes); - return; + retval = executeRestart(command_list, command_pos+1, node_ids, no_of_nodes); + return retval; } ndbout_c("Invalid command: '%s' after multi node id list. " "Expected STOP or RESTART.", cmd); - return; + return -1; } /** @@ -905,31 +1265,35 @@ get_next_nodeid(struct ndb_mgm_cluster_state *cl, return 0; } -void +int CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, const char * allAfterSecondToken) { int nodeId = 0; + int retval = 0; + if(strcasecmp(cmd, "STOP") == 0) { ndbout_c("Executing STOP on all nodes."); - (this->*fun)(nodeId, allAfterSecondToken, true); + retval = (this->*fun)(nodeId, allAfterSecondToken, true); } else if(strcasecmp(cmd, "RESTART") == 0) { ndbout_c("Executing RESTART on all nodes."); ndbout_c("Starting shutdown. This may take a while. Please wait..."); - (this->*fun)(nodeId, allAfterSecondToken, true); + retval = (this->*fun)(nodeId, allAfterSecondToken, true); ndbout_c("Trying to start all nodes of system."); ndbout_c("Use ALL STATUS to see the system start-up phases."); } else { + Guard g(m_print_mutex); struct ndb_mgm_cluster_state *cl= ndb_mgm_get_status(m_mgmsrv); if(cl == 0){ ndbout_c("Unable get status from management server"); printError(); - return; + return -1; } NdbAutoPtr<char> ap1((char*)cl); while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB)) - (this->*fun)(nodeId, allAfterSecondToken, true); + retval = (this->*fun)(nodeId, allAfterSecondToken, true); } + return retval; } //***************************************************************************** @@ -999,7 +1363,7 @@ CommandInterpreter::parseBlockSpecification(const char* allAfterLog, /***************************************************************************** * HELP *****************************************************************************/ -void +int CommandInterpreter::executeHelp(char* parameters) { if (emptyString(parameters)) { @@ -1024,20 +1388,23 @@ CommandInterpreter::executeHelp(char* parameters) ndbout << "<level> = " << "0 - 15" << endl; ndbout << "<id> = " << "ALL | Any database node id" << endl; ndbout << endl; - } else if (strcasecmp(parameters, "SHOW") == 0) { - ndbout << helpTextShow; -#ifdef HAVE_GLOBAL_REPLICATION - } else if (strcasecmp(parameters, "REPLICATION") == 0 || - strcasecmp(parameters, "REP") == 0) { - ndbout << helpTextRep; -#endif // HAVE_GLOBAL_REPLICATION -#ifdef VM_TRACE // DEBUG ONLY - } else if (strcasecmp(parameters, "DEBUG") == 0) { - ndbout << helpTextDebug; -#endif + ndbout << "For detailed help on COMMAND, use HELP COMMAND." << endl; } else { - invalid_command(parameters); + int i = 0; + for (i = 0; help_items[i].cmd != NULL; i++) + { + if (strcasecmp(parameters, help_items[i].cmd) == 0) + { + ndbout << help_items[i].help; + break; + } + } + if (help_items[i].cmd == NULL){ + ndbout << "No help for " << parameters << " available" << endl; + return -1; + } } + return 0; } @@ -1160,7 +1527,7 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it, ndbout << endl; } -void +int CommandInterpreter::executePurge(char* parameters) { int command_ok= 0; @@ -1179,15 +1546,14 @@ CommandInterpreter::executePurge(char* parameters) if (!command_ok) { ndbout_c("Unexpected command, expected: PURGE STALE SESSIONS"); - return; + return -1; } - int i; char *str; if (ndb_mgm_purge_stale_sessions(m_mgmsrv, &str)) { ndbout_c("Command failed"); - return; + return -1; } if (str) { ndbout_c("Purged sessions with node id's: %s", str); @@ -1197,9 +1563,10 @@ CommandInterpreter::executePurge(char* parameters) { ndbout_c("No sessions purged"); } + return 0; } -void +int CommandInterpreter::executeShow(char* parameters) { int i; @@ -1208,7 +1575,7 @@ CommandInterpreter::executeShow(char* parameters) if(state == NULL) { ndbout_c("Could not get status"); printError(); - return; + return -1; } NdbAutoPtr<char> ap1((char*)state); @@ -1216,7 +1583,7 @@ CommandInterpreter::executeShow(char* parameters) if(conf == 0){ ndbout_c("Could not get configuration"); printError(); - return; + return -1; } ndb_mgm_configuration_iterator * it; @@ -1224,7 +1591,8 @@ CommandInterpreter::executeShow(char* parameters) if(it == 0){ ndbout_c("Unable to create config iterator"); - return; + ndb_mgm_destroy_configuration(conf); + return -1; } NdbAutoPtr<ndb_mgm_configuration_iterator> ptr(it); @@ -1258,7 +1626,7 @@ CommandInterpreter::executeShow(char* parameters) break; case NDB_MGM_NODE_TYPE_UNKNOWN: ndbout << "Error: Unknown Node Type" << endl; - return; + return -1; case NDB_MGM_NODE_TYPE_REP: abort(); } @@ -1270,7 +1638,8 @@ CommandInterpreter::executeShow(char* parameters) print_nodes(state, it, "ndb_mgmd", mgm_nodes, NDB_MGM_NODE_TYPE_MGM, 0); print_nodes(state, it, "mysqld", api_nodes, NDB_MGM_NODE_TYPE_API, 0); // ndbout << helpTextShow; - return; + ndb_mgm_destroy_configuration(conf); + return 0; } else if (strcasecmp(parameters, "PROPERTIES") == 0 || strcasecmp(parameters, "PROP") == 0) { ndbout << "SHOW PROPERTIES is not yet implemented." << endl; @@ -1287,17 +1656,28 @@ CommandInterpreter::executeShow(char* parameters) // << endl; /* XXX */ } else { ndbout << "Invalid argument." << endl; + return -1; } + return 0; } -void -CommandInterpreter::executeConnect(char* parameters) +int +CommandInterpreter::executeConnect(char* parameters, bool interactive) { + BaseString *basestring = NULL; + disconnect(); if (!emptyString(parameters)) { - m_constr= BaseString(parameters).trim().c_str(); + basestring= new BaseString(parameters); + m_constr= basestring->trim().c_str(); } - connect(); + if ( connect(interactive) == false ){ + return -1; + } + if (basestring != NULL) + delete basestring; + + return 0; } //***************************************************************************** @@ -1310,6 +1690,7 @@ CommandInterpreter::executeClusterLog(char* parameters) if (emptyString(parameters)) { ndbout << "Missing argument." << endl; + m_error = -1; DBUG_VOID_RETURN; } @@ -1325,6 +1706,7 @@ CommandInterpreter::executeClusterLog(char* parameters) if(enabled == NULL) { ndbout << "Couldn't get status" << endl; printError(); + m_error = -1; DBUG_VOID_RETURN; } @@ -1336,6 +1718,7 @@ CommandInterpreter::executeClusterLog(char* parameters) if(enabled[0] == 0) { ndbout << "Cluster logging is disabled." << endl; + m_error = 0; DBUG_VOID_RETURN; } #if 0 @@ -1354,6 +1737,7 @@ CommandInterpreter::executeClusterLog(char* parameters) ndbout << BaseString(str).ndb_toupper() << " "; } ndbout << endl; + m_error = 0; DBUG_VOID_RETURN; } @@ -1372,6 +1756,7 @@ CommandInterpreter::executeClusterLog(char* parameters) enable= 1; } else { ndbout << "Invalid argument." << endl; + m_error = -1; DBUG_VOID_RETURN; } @@ -1386,9 +1771,11 @@ CommandInterpreter::executeClusterLog(char* parameters) { ndbout << "Couldn't set filter" << endl; printError(); + m_error = -1; DBUG_VOID_RETURN; } ndbout << "Cluster logging is " << (res_enable ? "enabled.":"disabled") << endl; + m_error = 0; DBUG_VOID_RETURN; } @@ -1415,6 +1802,7 @@ CommandInterpreter::executeClusterLog(char* parameters) } if (severity == NDB_MGM_ILLEGAL_EVENT_SEVERITY) { ndbout << "Invalid severity level: " << item << endl; + m_error = -1; DBUG_VOID_RETURN; } @@ -1424,23 +1812,27 @@ CommandInterpreter::executeClusterLog(char* parameters) { ndbout << "Couldn't set filter" << endl; printError(); + m_error = -1; DBUG_VOID_RETURN; } ndbout << BaseString(item).ndb_toupper().c_str() << " " << (res_enable ? "enabled":"disabled") << endl; item = strtok_r(NULL, " ", &tmpPtr); } while(item != NULL); - + + m_error = 0; DBUG_VOID_RETURN; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeStop(int processId, const char *parameters, bool all) { + int retval = 0; + Vector<BaseString> command_list; if (parameters) { @@ -1450,18 +1842,22 @@ CommandInterpreter::executeStop(int processId, const char *parameters, command_list[i].c_str()[0] ? i++ : (command_list.erase(i),0); } if (all) - executeStop(command_list, 0, 0, 0); + retval = executeStop(command_list, 0, 0, 0); else - executeStop(command_list, 0, &processId, 1); + retval = executeStop(command_list, 0, &processId, 1); + + return retval; } -void +int CommandInterpreter::executeStop(Vector<BaseString> &command_list, unsigned command_pos, int *node_ids, int no_of_nodes) { int need_disconnect; int abort= 0; + int retval = 0; + for (; command_pos < command_list.size(); command_pos++) { const char *item= command_list[command_pos].c_str(); @@ -1472,7 +1868,7 @@ CommandInterpreter::executeStop(Vector<BaseString> &command_list, } ndbout_c("Invalid option: %s. Expecting -A after STOP", item); - return; + return -1; } int result= ndb_mgm_stop3(m_mgmsrv, no_of_nodes, node_ids, abort, @@ -1481,6 +1877,7 @@ CommandInterpreter::executeStop(Vector<BaseString> &command_list, { ndbout_c("Shutdown failed."); printError(); + retval = -1; } else { @@ -1501,9 +1898,10 @@ CommandInterpreter::executeStop(Vector<BaseString> &command_list, disconnect(); } + return retval; } -void +int CommandInterpreter::executeEnterSingleUser(char* parameters) { strtok(parameters, " "); @@ -1515,37 +1913,42 @@ CommandInterpreter::executeEnterSingleUser(char* parameters) if(id == 0 || sscanf(id, "%d", &nodeId) != 1){ ndbout_c("Invalid arguments: expected <NodeId>"); ndbout_c("Use SHOW to see what API nodes are configured"); - return; + return -1; } int result = ndb_mgm_enter_single_user(m_mgmsrv, nodeId, &reply); if (result != 0) { ndbout_c("Entering single user mode for node %d failed", nodeId); printError(); + return -1; } else { ndbout_c("Single user mode entered"); ndbout_c("Access is granted for API node %d only.", nodeId); } + return 0; } -void +int CommandInterpreter::executeExitSingleUser(char* parameters) { int result = ndb_mgm_exit_single_user(m_mgmsrv, 0); if (result != 0) { ndbout_c("Exiting single user mode failed."); printError(); + return -1; } else { ndbout_c("Exiting single user mode in progress."); ndbout_c("Use ALL STATUS or SHOW to see when single user mode has been exited."); + return 0; } } -void +int CommandInterpreter::executeStart(int processId, const char* parameters, bool all) { int result; + int retval = 0; if(all) { result = ndb_mgm_start(m_mgmsrv, 0, 0); } else { @@ -1555,6 +1958,7 @@ CommandInterpreter::executeStart(int processId, const char* parameters, if (result <= 0) { ndbout << "Start failed." << endl; printError(); + retval = -1; } else { if(all) @@ -1562,13 +1966,16 @@ CommandInterpreter::executeStart(int processId, const char* parameters, else ndbout_c("Database node %d is being started.", processId); } + return retval; } -void +int CommandInterpreter::executeRestart(int processId, const char* parameters, bool all) { Vector<BaseString> command_list; + int retval = 0; + if (parameters) { BaseString tmp(parameters); @@ -1577,17 +1984,20 @@ CommandInterpreter::executeRestart(int processId, const char* parameters, command_list[i].c_str()[0] ? i++ : (command_list.erase(i),0); } if (all) - executeRestart(command_list, 0, 0, 0); + retval = executeRestart(command_list, 0, 0, 0); else - executeRestart(command_list, 0, &processId, 1); + retval = executeRestart(command_list, 0, &processId, 1); + + return retval; } -void +int CommandInterpreter::executeRestart(Vector<BaseString> &command_list, unsigned command_pos, int *node_ids, int no_of_nodes) { int result; + int retval = 0; int nostart= 0; int initialstart= 0; int abort= 0; @@ -1613,15 +2023,19 @@ CommandInterpreter::executeRestart(Vector<BaseString> &command_list, } ndbout_c("Invalid option: %s. Expecting -A,-N or -I after RESTART", item); - return; + return -1; } + if (!nostart) + ndbout_c("Shutting down nodes with \"-n, no start\" option, to subsequently start the nodes."); + result= ndb_mgm_restart3(m_mgmsrv, no_of_nodes, node_ids, initialstart, nostart, abort, &need_disconnect); if (result <= 0) { ndbout_c("Restart failed."); printError(); + retval = -1; } else { @@ -1637,15 +2051,16 @@ CommandInterpreter::executeRestart(Vector<BaseString> &command_list, if(need_disconnect) disconnect(); } + return retval; } -void +int CommandInterpreter::executeDumpState(int processId, const char* parameters, bool all) { if(emptyString(parameters)){ ndbout << "Expected argument" << endl; - return; + return -1; } Uint32 no = 0; @@ -1662,7 +2077,7 @@ CommandInterpreter::executeDumpState(int processId, const char* parameters, ndbout << "Illegal value in argument to signal." << endl << "(Value must be between 0 and 0xffffffff.)" << endl; - return; + return -1; } no++; item = strtok_r(NULL, " ", &tmpPtr); @@ -1674,28 +2089,27 @@ CommandInterpreter::executeDumpState(int processId, const char* parameters, } struct ndb_mgm_reply reply; - ndb_mgm_dump_state(m_mgmsrv, processId, pars, no, &reply); + return ndb_mgm_dump_state(m_mgmsrv, processId, pars, no, &reply); } -void +int CommandInterpreter::executeStatus(int processId, const char* parameters, bool all) { if (! emptyString(parameters)) { ndbout_c("No parameters expected to this command."); - return; + return -1; } ndb_mgm_node_status status; Uint32 startPhase, version; - bool system; struct ndb_mgm_cluster_state *cl; cl = ndb_mgm_get_status(m_mgmsrv); if(cl == NULL) { ndbout_c("Cannot get status of node %d.", processId); printError(); - return; + return -1; } NdbAutoPtr<char> ap1((char*)cl); @@ -1704,7 +2118,20 @@ CommandInterpreter::executeStatus(int processId, i++; if(cl->node_states[i].node_id != processId) { ndbout << processId << ": Node not found" << endl; - return; + return -1; + } + if (cl->node_states[i].node_type != NDB_MGM_NODE_TYPE_NDB){ + if (cl->node_states[i].version != 0){ + version = cl->node_states[i].version; + ndbout << "Node "<< cl->node_states[i].node_id <<": connected" ; + ndbout_c(" (Version %d.%d.%d)", + getMajor(version) , + getMinor(version), + getBuild(version)); + + }else + ndbout << "Node "<< cl->node_states[i].node_id <<": not connected" << endl; + return 0; } status = cl->node_states[i].node_status; startPhase = cl->node_states[i].start_phase; @@ -1728,27 +2155,29 @@ CommandInterpreter::executeStatus(int processId, getBuild(version)); else ndbout << endl; + + return 0; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeLogLevel(int processId, const char* parameters, bool all) { (void) all; if (emptyString(parameters)) { ndbout << "Expected argument" << endl; - return; + return -1; } BaseString tmp(parameters); Vector<BaseString> spec; tmp.split(spec, "="); if(spec.size() != 2){ ndbout << "Invalid loglevel specification: " << parameters << endl; - return; + return -1; } spec[0].trim().ndb_toupper(); @@ -1758,14 +2187,14 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, if(category < NDB_MGM_MIN_EVENT_CATEGORY || category > NDB_MGM_MAX_EVENT_CATEGORY){ ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl; - return; + return -1; } } int level = atoi(spec[1].c_str()); if(level < 0 || level > 15){ ndbout << "Invalid level: " << spec[1].c_str() << endl; - return; + return -1; } ndbout << "Executing LOGLEVEL on node " << processId << flush; @@ -1781,20 +2210,22 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, if (result < 0) { ndbout_c(" failed."); printError(); + return -1; } else { ndbout_c(" OK!"); } - + return 0; } //***************************************************************************** //***************************************************************************** -void CommandInterpreter::executeError(int processId, +int CommandInterpreter::executeError(int processId, const char* parameters, bool /* all */) { + int retval = 0; if (emptyString(parameters)) { ndbout << "Missing error number." << endl; - return; + return -1; } // Copy parameters since strtok will modify it @@ -1805,29 +2236,30 @@ void CommandInterpreter::executeError(int processId, int errorNo; if (! convert(firstParameter, errorNo)) { ndbout << "Expected an integer." << endl; - return; + return -1; } char* allAfterFirstParameter = strtok(NULL, "\0"); if (! emptyString(allAfterFirstParameter)) { ndbout << "Nothing expected after error number." << endl; - return; + return -1; } - ndb_mgm_insert_error(m_mgmsrv, processId, errorNo, NULL); + retval = ndb_mgm_insert_error(m_mgmsrv, processId, errorNo, NULL); + return retval; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeLog(int processId, const char* parameters, bool all) { struct ndb_mgm_reply reply; Vector<const char *> blocks; if (! parseBlockSpecification(parameters, blocks)) { - return; + return -1; } int len=1; Uint32 i; @@ -1851,82 +2283,91 @@ CommandInterpreter::executeLog(int processId, if (result != 0) { ndbout_c("Execute LOG on node %d failed.", processId); printError(); + return -1; } + return 0; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeLogIn(int /* processId */, const char* parameters, bool /* all */) { ndbout << "Command LOGIN not implemented." << endl; + return 0; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeLogOut(int /*processId*/, const char* parameters, bool /*all*/) { ndbout << "Command LOGOUT not implemented." << endl; + return 0; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeLogOff(int /*processId*/, const char* parameters, bool /*all*/) { ndbout << "Command LOGOFF not implemented." << endl; + return 0; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeTestOn(int processId, const char* parameters, bool /*all*/) { if (! emptyString(parameters)) { ndbout << "No parameters expected to this command." << endl; - return; + return -1; } struct ndb_mgm_reply reply; int result = ndb_mgm_start_signallog(m_mgmsrv, processId, &reply); if (result != 0) { ndbout_c("Execute TESTON failed."); printError(); + return -1; } + return 0; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeTestOff(int processId, const char* parameters, bool /*all*/) { if (! emptyString(parameters)) { ndbout << "No parameters expected to this command." << endl; - return; + return -1; } struct ndb_mgm_reply reply; int result = ndb_mgm_stop_signallog(m_mgmsrv, processId, &reply); if (result != 0) { ndbout_c("Execute TESTOFF failed."); printError(); + return -1; } + return 0; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeSet(int /*processId*/, const char* parameters, bool /*all*/) { if (emptyString(parameters)) { ndbout << "Missing parameter name." << endl; - return; + return -1; } #if 0 // Copy parameters since strtok will modify it @@ -1990,17 +2431,18 @@ CommandInterpreter::executeSet(int /*processId*/, abort(); } } -#endif +#endif + return 0; } //***************************************************************************** //***************************************************************************** -void CommandInterpreter::executeGetStat(int /*processId*/, +int CommandInterpreter::executeGetStat(int /*processId*/, const char* parameters, bool /*all*/) { if (! emptyString(parameters)) { ndbout << "No parameters expected to this command." << endl; - return; + return -1; } #if 0 @@ -2016,25 +2458,27 @@ void CommandInterpreter::executeGetStat(int /*processId*/, ndbout << "Number of GETSTAT commands: " << statistics._test1 << endl; */ + return 0; } //***************************************************************************** //***************************************************************************** -void +int CommandInterpreter::executeEventReporting(int processId, const char* parameters, bool all) { + int retval = 0; if (emptyString(parameters)) { ndbout << "Expected argument" << endl; - return; + return -1; } BaseString tmp(parameters); Vector<BaseString> specs; tmp.split(specs, " "); - for (int i=0; i < specs.size(); i++) + for (int i=0; i < (int) specs.size(); i++) { Vector<BaseString> spec; specs[i].split(spec, "="); @@ -2075,10 +2519,12 @@ CommandInterpreter::executeEventReporting(int processId, if (result != 0) { ndbout_c(" failed."); printError(); + retval = -1; } else { ndbout_c(" OK!"); } } + return retval; } /***************************************************************************** @@ -2138,7 +2584,7 @@ CommandInterpreter::executeStartBackup(char* parameters) } if (result != 0) { - ndbout << "Start of backup failed" << endl; + ndbout << "Backup failed" << endl; printError(); #if 0 close(fd); @@ -2179,7 +2625,7 @@ CommandInterpreter::executeStartBackup(char* parameters) return 0; } -void +int CommandInterpreter::executeAbortBackup(char* parameters) { int bid = -1; @@ -2198,14 +2644,15 @@ CommandInterpreter::executeAbortBackup(char* parameters) if (result != 0) { ndbout << "Abort of backup " << bid << " failed" << endl; printError(); + return -1; } else { ndbout << "Abort of backup " << bid << " ordered" << endl; } } - return; + return 0; executeAbortBackupError1: ndbout << "Invalid arguments: expected <BackupId>" << endl; - return; + return -1; } #ifdef HAVE_GLOBAL_REPLICATION @@ -2236,12 +2683,12 @@ CommandInterpreter::executeAbortBackup(char* parameters) *****************************************************************************/ -void +int CommandInterpreter::executeRep(char* parameters) { if (emptyString(parameters)) { ndbout << helpTextRep; - return; + return 0; } char * line = my_strdup(parameters,MYF(MY_WME)); @@ -2261,7 +2708,7 @@ CommandInterpreter::executeRep(char* parameters) if(host == NULL) { ndbout_c("host:port must be specified."); - return; + return -1; } if(rep_connected) { @@ -2273,14 +2720,17 @@ CommandInterpreter::executeRep(char* parameters) if(m_repserver == NULL) m_repserver = ndb_rep_create_handle(); - if(ndb_rep_connect(m_repserver, host) < 0) - ndbout_c("Failed to connect to %s", host); + if(ndb_rep_connect(m_repserver, host) < 0){ + ndbout_c("Failed to connect to %s", host); + return -1; + } else rep_connected=true; - return; + return 0; if(!rep_connected) { ndbout_c("Not connected to REP server"); + return -1; } } @@ -2314,17 +2764,18 @@ CommandInterpreter::executeRep(char* parameters) req = GrepReq::START_DELETE; } else { ndbout_c("Illegal argument to command 'REPLICATION START'"); - return; + return -1; } int result = ndb_rep_command(m_repserver, req, &repId, &reply); if (result != 0) { ndbout << "Start of Global Replication failed" << endl; + return -1; } else { ndbout << "Start of Global Replication ordered" << endl; } - return; + return 0; } /******** @@ -2344,7 +2795,7 @@ CommandInterpreter::executeRep(char* parameters) char *strEpoch = strtok(NULL, "\0"); if(strEpoch == NULL) { ndbout_c("Epoch expected!"); - return; + return -1; } req = GrepReq::STOP; epoch=atoi(strEpoch); @@ -2368,16 +2819,17 @@ CommandInterpreter::executeRep(char* parameters) req = GrepReq::STOP_DELETE; } else { ndbout_c("Illegal argument to command 'REPLICATION STOP'"); - return; + return -1; } int result = ndb_rep_command(m_repserver, req, &repId, &reply, epoch); if (result != 0) { ndbout << "Stop command failed" << endl; + return -1; } else { ndbout << "Stop ordered" << endl; } - return; + return 0; } /********* @@ -2390,6 +2842,7 @@ CommandInterpreter::executeRep(char* parameters) if (result != 0) { ndbout << "Status request of Global Replication failed" << endl; + return -1; } else { ndbout << "Status request of Global Replication ordered" << endl; ndbout << "See printout at one of the DB nodes" << endl; @@ -2397,7 +2850,7 @@ CommandInterpreter::executeRep(char* parameters) ndbout << " SubscriptionId " << repstate.subid << " SubscriptionKey " << repstate.subkey << endl; } - return; + return 0; } /********* @@ -2416,6 +2869,7 @@ CommandInterpreter::executeRep(char* parameters) if (result != 0) { ndbout << "Query repserver failed" << endl; + return -1; } else { ndbout << "Query repserver sucessful" << endl; ndbout_c("repstate : QueryCounter %d, f=%d l=%d" @@ -2424,8 +2878,9 @@ CommandInterpreter::executeRep(char* parameters) repstate.first[0], repstate.last[0], repstate.no_of_nodegroups ); } - return; + return 0; } + return 0; } #endif // HAVE_GLOBAL_REPLICATION diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index c63e8d1bff8..8ce8bf4da45 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LTLIBRARIES = libndbmgmclient.la ndbtools_PROGRAMS = ndb_mgm diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index ba5d0308f1f..55617c74e3f 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -38,6 +37,7 @@ extern "C" int add_history(const char *command); /* From readline directory */ #include "ndb_mgmclient.hpp" const char *progname = "ndb_mgm"; +const char *load_default_groups[]= { "mysql_cluster","ndb_mgm",0 }; static Ndb_mgmclient* com; @@ -87,6 +87,8 @@ static void usage() { short_usage_sub(); ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -121,14 +123,11 @@ read_and_execute(int _try_reconnect) line_read= strdup(linebuffer); } #endif - return com->execute(line_read,_try_reconnect); + return com->execute(line_read, _try_reconnect, 1); } int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *_host = 0; - int _port = 0; - const char *load_default_groups[]= { "mysql_cluster","ndb_mgm",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; @@ -163,7 +162,7 @@ int main(int argc, char** argv){ } else { - com->execute(opt_execute_str,_try_reconnect, &ret); + com->execute(opt_execute_str,_try_reconnect, 0, &ret); } delete com; diff --git a/ndb/src/mgmclient/ndb_mgmclient.h b/ndb/src/mgmclient/ndb_mgmclient.h index b62a33999a3..edb57e25ccb 100644 --- a/ndb/src/mgmclient/ndb_mgmclient.h +++ b/ndb/src/mgmclient/ndb_mgmclient.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmclient/ndb_mgmclient.hpp b/ndb/src/mgmclient/ndb_mgmclient.hpp index bffdf69f920..e21f57ba323 100644 --- a/ndb/src/mgmclient/ndb_mgmclient.hpp +++ b/ndb/src/mgmclient/ndb_mgmclient.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -23,8 +22,8 @@ class Ndb_mgmclient public: Ndb_mgmclient(const char*,int verbose=0); ~Ndb_mgmclient(); - int execute(const char *_line, int _try_reconnect=-1, int *error= 0); - int execute(int argc, char** argv, int _try_reconnect=-1, int *error= 0); + int execute(const char *_line, int _try_reconnect=-1, bool interactive=1, int *error= 0); + int execute(int argc, char** argv, int _try_reconnect=-1, bool interactive=1, int *error= 0); int disconnect(); private: CommandInterpreter *m_cmd; diff --git a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp index 32f0adbcf26..b70d75e5fbe 100644 --- a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp +++ b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/Config.cpp b/ndb/src/mgmsrv/Config.cpp index 6ff5fb789f0..0bbf3580b5c 100644 --- a/ndb/src/mgmsrv/Config.cpp +++ b/ndb/src/mgmsrv/Config.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/Config.hpp b/ndb/src/mgmsrv/Config.hpp index 8e16ddf1810..1eaa1c34280 100644 --- a/ndb/src/mgmsrv/Config.hpp +++ b/ndb/src/mgmsrv/Config.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 7f220c0da65..0cf37b5f874 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -459,7 +458,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::CI_INT, "128", "8", - STR_VALUE(MAX_INT_RNIL) }, + STR_VALUE(MAX_TABLES) }, { CFG_DB_NO_ORDERED_INDEXES, @@ -2318,7 +2317,6 @@ ConfigInfo::ConfigInfo() break; case CI_BOOL: { - bool tmp_bool; require(InitConfigFileParser::convertStringToBool(param._default, default_bool)); require(p->put(param._fname, default_bool)); break; @@ -2326,7 +2324,6 @@ ConfigInfo::ConfigInfo() case CI_INT: case CI_INT64: { - Uint64 tmp_uint64; require(InitConfigFileParser::convertStringToUint64(param._default, default_uint64)); require(p->put(param._fname, default_uint64)); break; @@ -2604,6 +2601,13 @@ transformNode(InitConfigFileParser::Context & ctx, const char * data){ return false; } + if(id >= MAX_NODES) + { + ctx.reportError("too many nodes configured, only up to %d nodes supported.", + MAX_NODES); + return false; + } + // next node id _always_ next numbers after last used id ctx.m_userProperties.put("NextNodeId", id+1, true); @@ -2835,7 +2839,7 @@ applyDefaultValues(InitConfigFileParser::Context & ctx, Properties::Iterator it(defaults); for(const char * name = it.first(); name != NULL; name = it.next()){ - ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); + (void) ctx.m_info->getStatus(ctx.m_currentInfo, name); if(!ctx.m_currentSection->contains(name)){ switch (ctx.m_info->getType(ctx.m_currentInfo, name)){ case ConfigInfo::CI_INT: @@ -3442,7 +3446,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ if(!ctx.m_currentInfo->get(n, &info)) continue; - Uint32 id = 0; + id = 0; info->get("Id", &id); if(id == KEY_INTERNAL) @@ -3495,11 +3499,11 @@ sanity_checks(Vector<ConfigInfo::ConfigRuleSection>§ions, Uint32 mgm_nodes = 0; Uint32 api_nodes = 0; if (!ctx.m_userProperties.get("DB", &db_nodes)) { - ctx.reportError("At least one database node should be defined in config file"); + ctx.reportError("At least one database node (ndbd) should be defined in config file"); return false; } if (!ctx.m_userProperties.get("MGM", &mgm_nodes)) { - ctx.reportError("At least one management server node should be defined in config file"); + ctx.reportError("At least one management server node (ndb_mgmd) should be defined in config file"); return false; } if (!ctx.m_userProperties.get("API", &api_nodes)) { diff --git a/ndb/src/mgmsrv/ConfigInfo.hpp b/ndb/src/mgmsrv/ConfigInfo.hpp index 788619db7fe..6f9c8ad17b8 100644 --- a/ndb/src/mgmsrv/ConfigInfo.hpp +++ b/ndb/src/mgmsrv/ConfigInfo.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -27,8 +26,11 @@ * A MANDATORY parameters must be specified in the config file * An UNDEFINED parameter may or may not be specified in the config file */ -static const char* MANDATORY = (char*)~(UintPtr)0;// Default value for mandatory params. -static const char* UNDEFINED = 0; // Default value for undefined params. + +// Default value for mandatory params. +#define MANDATORY ((char*)~(UintPtr)0) +// Default value for undefined params. +#define UNDEFINED ((char*) 0) /** * @class ConfigInfo diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index e03c5408837..fc25197cf38 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -690,34 +689,35 @@ load_defaults(Vector<struct my_option>& options, const char* groups[]) BaseString extra_file; BaseString group_suffix; - const char *save_file = defaults_file; - char *save_extra_file = defaults_extra_file; - const char *save_group_suffix = defaults_group_suffix; + const char *save_file = my_defaults_file; + char *save_extra_file = my_defaults_extra_file; + const char *save_group_suffix = my_defaults_group_suffix; - if (defaults_file) + if (my_defaults_file) { - file.assfmt("--defaults-file=%s", defaults_file); + file.assfmt("--defaults-file=%s", my_defaults_file); argv[argc++] = file.c_str(); } - if (defaults_extra_file) + if (my_defaults_extra_file) { - extra_file.assfmt("--defaults-extra-file=%s", defaults_extra_file); + extra_file.assfmt("--defaults-extra-file=%s", my_defaults_extra_file); argv[argc++] = extra_file.c_str(); } - if (defaults_group_suffix) + if (my_defaults_group_suffix) { - group_suffix.assfmt("--defaults-group-suffix=%s", defaults_group_suffix); + group_suffix.assfmt("--defaults-group-suffix=%s", + my_defaults_group_suffix); argv[argc++] = group_suffix.c_str(); } char ** tmp = (char**)argv; int ret = load_defaults("my", groups, &argc, &tmp); - defaults_file = save_file; - defaults_extra_file = save_extra_file; - defaults_group_suffix = save_group_suffix; + my_defaults_file = save_file; + my_defaults_extra_file = save_extra_file; + my_defaults_group_suffix = save_group_suffix; if (ret == 0) { diff --git a/ndb/src/mgmsrv/InitConfigFileParser.hpp b/ndb/src/mgmsrv/InitConfigFileParser.hpp index 616fd5a62fb..64ccead1d33 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.hpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index 7fd3fa66b43..88622c08e53 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir= $(prefix) @@ -23,7 +38,7 @@ INCLUDES_LOC = -I$(top_srcdir)/ndb/src/ndbapi \ -I$(top_srcdir)/ndb/src/common/mgmcommon \ -I$(top_srcdir)/ndb/src/mgmclient -LDADD_LOC = $(top_srcdir)/ndb/src/mgmclient/CommandInterpreter.o \ +LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CommandInterpreter.o \ $(top_builddir)/ndb/src/libndbclient.la \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/mysys/libmysys.a \ diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index cad299e5386..409694fead1 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -77,7 +76,6 @@ }\ } -extern int global_flag_send_heartbeat_now; extern int g_no_nodeid_checks; extern my_bool opt_core; @@ -102,6 +100,8 @@ MgmtSrvr::logLevelThread_C(void* m) extern EventLogger g_eventLogger; +#ifdef NOT_USED + static NdbOut& operator<<(NdbOut& out, const LogLevel & ll) { @@ -111,6 +111,7 @@ operator<<(NdbOut& out, const LogLevel & ll) out << "]"; return out; } +#endif void MgmtSrvr::logLevelThreadRun() @@ -139,8 +140,11 @@ MgmtSrvr::logLevelThreadRun() m_started_nodes.erase(0, false); m_started_nodes.unlock(); - setEventReportingLevelImpl(node, req); - + if (setEventReportingLevelImpl(node, req)) + { + ndbout_c("setEventReportingLevelImpl(%d): failed", node); + } + SetLogLevelOrd ord; ord = m_nodeLogLevel[node]; setNodeLogLevelImpl(node, ord); @@ -157,10 +161,16 @@ MgmtSrvr::logLevelThreadRun() m_log_level_requests.erase(0, false); m_log_level_requests.unlock(); - if(req.blockRef == 0){ + if(req.blockRef == 0) + { req.blockRef = _ownReference; - setEventReportingLevelImpl(0, req); - } else { + if (setEventReportingLevelImpl(0, req)) + { + ndbout_c("setEventReportingLevelImpl: failed 2!"); + } + } + else + { SetLogLevelOrd ord; ord = req; setNodeLogLevelImpl(req.blockRef, ord); @@ -450,7 +460,10 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, // read config locally _config= readConfig(); if (_config == 0) { - ndbout << "Unable to read config file" << endl; + if (config_filename != NULL) + ndbout << "Invalid configuration file: " << config_filename << endl; + else + ndbout << "Invalid configuration file" << endl; exit(-1); } } @@ -614,6 +627,16 @@ MgmtSrvr::start(BaseString &error_string) ndbout_c("This is probably a bug."); } + /* + set api reg req frequency quite high: + + 100 ms interval to make sure we have fairly up-to-date + info from the nodes. This to make sure that this info + is not dependent on heart beat settings in the + configuration + */ + theFacade->theClusterMgr->set_max_api_reg_req_interval(100); + TransporterRegistry *reg = theFacade->get_registry(); for(unsigned int i=0;i<reg->m_transporter_interface.size();i++) { BaseString msg; @@ -694,7 +717,7 @@ int MgmtSrvr::okToSendTo(NodeId nodeId, bool unCond) return WRONG_PROCESS_TYPE; // Check if we have contact with it if(unCond){ - if(theFacade->theClusterMgr->getNodeInfo(nodeId).connected) + if(theFacade->theClusterMgr->getNodeInfo(nodeId).m_api_reg_conf) return 0; } else if (theFacade->get_node_alive(nodeId) == true) @@ -833,7 +856,7 @@ MgmtSrvr::sendVersionReq(int v_nodeId, Uint32 &version, const char **address) case GSN_API_VERSION_CONF: { const ApiVersionConf * const conf = CAST_CONSTPTR(ApiVersionConf, signal->getDataPtr()); - assert(conf->nodeId == v_nodeId); + assert((int) conf->nodeId == v_nodeId); version = conf->version; struct in_addr in; in.s_addr= conf->inet_addr; @@ -1012,6 +1035,11 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids, { nodeId= node_ids[i]; ndbout << "asked to stop " << nodeId << endl; + + if ((getNodeType(nodeId) != NDB_MGM_NODE_TYPE_MGM) + &&(getNodeType(nodeId) != NDB_MGM_NODE_TYPE_NDB)) + return WRONG_PROCESS_TYPE; + if (getNodeType(nodeId) != NDB_MGM_NODE_TYPE_MGM) nodes_to_stop.set(nodeId); else if (nodeId != getOwnNodeId()) @@ -1108,7 +1136,6 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids, break; } case GSN_STOP_CONF:{ - const StopConf * const ref = CAST_CONSTPTR(StopConf, signal->getDataPtr()); const NodeId nodeId = refToNode(signal->header.theSendersBlockRef); #ifdef VM_TRACE ndbout_c("Node %d single user mode", nodeId); @@ -1138,8 +1165,6 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids, break; } case GSN_NODE_FAILREP:{ - const NodeFailRep * const rep = - CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); break; } default: @@ -1327,7 +1352,7 @@ int MgmtSrvr::restartNodes(const Vector<NodeId> &node_ids, for (unsigned i = 0; i < node_ids.size(); i++) { - int result = start(node_ids[i]); + start(node_ids[i]); } return 0; } @@ -1370,9 +1395,6 @@ int MgmtSrvr::restartDB(bool nostart, bool initialStart, NodeId nodeId = 0; NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; - ndbout_c(" %d", nodes.get(1)); - ndbout_c(" %d", nodes.get(2)); - while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) { if (!nodes.get(nodeId)) continue; @@ -1455,6 +1477,12 @@ MgmtSrvr::exitSingleUser(int * stopCount, bool abort) #include <ClusterMgr.hpp> +void +MgmtSrvr::updateStatus() +{ + theFacade->theClusterMgr->forceHB(); +} + int MgmtSrvr::status(int nodeId, ndb_mgm_node_status * _status, @@ -1544,37 +1572,96 @@ MgmtSrvr::status(int nodeId, } int -MgmtSrvr::setEventReportingLevelImpl(int nodeId, +MgmtSrvr::setEventReportingLevelImpl(int nodeId_arg, const EventSubscribeReq& ll) { SignalSender ss(theFacade); - ss.lock(); - - SimpleSignal ssig; - EventSubscribeReq * dst = - CAST_PTR(EventSubscribeReq, ssig.getDataPtrSend()); - ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_EVENT_SUBSCRIBE_REQ, - EventSubscribeReq::SignalLength); - *dst = ll; - - NodeBitmask nodes; + NdbNodeBitmask nodes; + int retries = 30; nodes.clear(); - Uint32 max = (nodeId == 0) ? (nodeId = 1, MAX_NDB_NODES) : nodeId; - for(; nodeId <= max; nodeId++) + while (1) { - if (nodeTypes[nodeId] != NODE_TYPE_DB) - continue; - if (okToSendTo(nodeId, true)) - continue; - if (ss.sendSignal(nodeId, &ssig) == SEND_OK) + Uint32 nodeId, max; + ss.lock(); + SimpleSignal ssig; + EventSubscribeReq * dst = + CAST_PTR(EventSubscribeReq, ssig.getDataPtrSend()); + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_EVENT_SUBSCRIBE_REQ, + EventSubscribeReq::SignalLength); + *dst = ll; + + if (nodeId_arg == 0) { - nodes.set(nodeId); + // all nodes + nodeId = 1; + max = MAX_NDB_NODES; + } + else + { + // only one node + max = nodeId = nodeId_arg; } + // first make sure nodes are sendable + for(; nodeId <= max; nodeId++) + { + if (nodeTypes[nodeId] != NODE_TYPE_DB) + continue; + if (okToSendTo(nodeId, true)) + { + if (theFacade->theClusterMgr->getNodeInfo(nodeId).connected == false) + { + // node not connected we can safely skip this one + continue; + } + // api_reg_conf not recevied yet, need to retry + break; + } + } + if (nodeId <= max) + { + if (--retries) + { + ss.unlock(); + NdbSleep_MilliSleep(100); + continue; + } + return SEND_OR_RECEIVE_FAILED; + } + + if (nodeId_arg == 0) + { + // all nodes + nodeId = 1; + max = MAX_NDB_NODES; + } + else + { + // only one node + max = nodeId = nodeId_arg; + } + // now send to all sendable nodes nodes + // note, lock is held, so states have not changed + for(; (Uint32) nodeId <= max; nodeId++) + { + if (nodeTypes[nodeId] != NODE_TYPE_DB) + continue; + if (theFacade->theClusterMgr->getNodeInfo(nodeId).connected == false) + continue; // node is not connected, skip + if (ss.sendSignal(nodeId, &ssig) == SEND_OK) + nodes.set(nodeId); + } + break; } + if (nodes.isclear()) + { + return SEND_OR_RECEIVE_FAILED; + } + int error = 0; while (!nodes.isclear()) { + Uint32 nodeId; SimpleSignal *signal = ss.waitFor(); int gsn = signal->readSignalNumber(); nodeId = refToNode(signal->header.theSendersBlockRef); @@ -1588,16 +1675,24 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId, error = 1; break; } + // Since sending okToSend(true), + // there is no guarantee that NF_COMPLETEREP will come + // i.e listen also to NODE_FAILREP + case GSN_NODE_FAILREP: { + const NodeFailRep * const rep = + CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); + NdbNodeBitmask mask; + mask.assign(NdbNodeBitmask::Size, rep->theNodes); + nodes.bitANDC(mask); + break; + } + case GSN_NF_COMPLETEREP:{ const NFCompleteRep * const rep = CAST_CONSTPTR(NFCompleteRep, signal->getDataPtr()); nodes.clear(rep->failedNodeId); break; } - case GSN_NODE_FAILREP:{ - // ignore, NF_COMPLETEREP will arrive later - break; - } default: report_unknown_signal(signal); return SEND_OR_RECEIVE_FAILED; @@ -1897,7 +1992,10 @@ MgmtSrvr::handleStatus(NodeId nodeId, bool alive, bool nfComplete) theData[1] = nodeId; if (alive) { - m_started_nodes.push_back(nodeId); + if (nodeTypes[nodeId] == NODE_TYPE_DB) + { + m_started_nodes.push_back(nodeId); + } rep->setEventType(NDB_LE_Connected); } else { rep->setEventType(NDB_LE_Disconnected); @@ -1988,8 +2086,8 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, int log_event) { DBUG_ENTER("MgmtSrvr::alloc_node_id"); - DBUG_PRINT("enter", ("nodeid=%d, type=%d, client_addr=%d", - *nodeId, type, client_addr)); + DBUG_PRINT("enter", ("nodeid: %d type: %d client_addr: 0x%ld", + *nodeId, type, (long) client_addr)); if (g_no_nodeid_checks) { if (*nodeId == 0) { error_string.appfmt("no-nodeid-checks set in management server.\n" @@ -2153,7 +2251,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, if (found_matching_type && !found_free_node) { // we have a temporary error which might be due to that // we have got the latest connect status from db-nodes. Force update. - global_flag_send_heartbeat_now= 1; + updateStatus(); } BaseString type_string, type_c_string; @@ -2509,7 +2607,7 @@ MgmtSrvr::Allocated_resources::~Allocated_resources() if (!m_reserved_nodes.isclear()) { m_mgmsrv.m_reserved_nodes.bitANDC(m_reserved_nodes); // node has been reserved, force update signal to ndb nodes - global_flag_send_heartbeat_now= 1; + m_mgmsrv.updateStatus(); char tmp_str[128]; m_mgmsrv.m_reserved_nodes.getText(tmp_str); diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 187f225470a..6ccbbd20b09 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -50,6 +49,7 @@ class Ndb_mgmd_event_service : public EventLoggerBase friend class MgmtSrvr; public: struct Event_listener : public EventLoggerBase { + Event_listener() {} NDB_SOCKET_TYPE m_socket; Uint32 m_parsable; }; @@ -490,6 +490,8 @@ public: void get_connected_nodes(NodeBitmask &connected_nodes) const; SocketServer *get_socket_server() { return m_socket_server; } + void updateStatus(); + //************************************************************************** private: //************************************************************************** @@ -596,7 +598,6 @@ private: */ enum WaitSignalType { NO_WAIT, // We don't expect to receive any signal - WAIT_SET_VAR, // Accept SET_VAR_CONF and SET_VAR_REF WAIT_SUBSCRIBE_CONF // Accept event subscription confirmation }; diff --git a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp index e56643a3d7e..cc101eacc22 100644 --- a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp +++ b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp b/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp index c99936e1861..a8fd443497f 100644 --- a/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp +++ b/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 0524aba4c32..b7ff4df7012 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -33,6 +32,7 @@ #include "../mgmapi/ndb_logevent.hpp" #include <base64.h> +#include <ndberror.h> extern bool g_StopServer; extern bool g_RestartServer; @@ -146,6 +146,7 @@ ParserRow<MgmApiSession> commands[] = { MGM_CMD("get status", &MgmApiSession::getStatus, ""), MGM_CMD("get info clusterlog", &MgmApiSession::getInfoClusterLog, ""), + MGM_CMD("get cluster loglevel", &MgmApiSession::getClusterLogLevel, ""), MGM_CMD("restart node", &MgmApiSession::restart_v1, ""), MGM_ARG("node", String, Mandatory, "Nodes to restart"), @@ -331,19 +332,6 @@ MgmApiSession::runSession() switch(ctx.m_status) { case Parser_t::UnknownCommand: -#ifdef MGM_GET_CONFIG_BACKWARDS_COMPAT - /* Backwards compatibility for old NDBs that still use - * the old "GET CONFIG" command. - */ - size_t i; - for(i=0; i<strlen(ctx.m_currentToken); i++) - ctx.m_currentToken[i] = toupper(ctx.m_currentToken[i]); - - if(strncmp("GET CONFIG ", - ctx.m_currentToken, - strlen("GET CONFIG ")) == 0) - getConfig_old(ctx); -#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */ break; default: break; @@ -358,32 +346,6 @@ MgmApiSession::runSession() DBUG_VOID_RETURN; } -#ifdef MGM_GET_CONFIG_BACKWARDS_COMPAT -void -MgmApiSession::getConfig_old(Parser_t::Context &ctx) { - Properties args; - - Uint32 version, node; - - if(sscanf(ctx.m_currentToken, "GET CONFIG %d %d", - (int *)&version, (int *)&node) != 2) { - m_output->println("Expected 2 arguments for GET CONFIG"); - return; - } - - /* Put arguments in properties object so we can call the real function */ - args.put("version", version); - args.put("node", node); - getConfig_common(ctx, args, true); -} -#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */ - -void -MgmApiSession::getConfig(Parser_t::Context &ctx, - const class Properties &args) { - getConfig_common(ctx, args); -} - static Properties * backward(const char * base, const Properties* reply){ Properties * ret = new Properties(); @@ -559,9 +521,9 @@ MgmApiSession::get_nodeid(Parser_t::Context &, } void -MgmApiSession::getConfig_common(Parser_t::Context &, - const class Properties &args, - bool compat) { +MgmApiSession::getConfig(Parser_t::Context &, + const class Properties &args) +{ Uint32 version, node = 0; args.get("version", &version); @@ -575,47 +537,6 @@ MgmApiSession::getConfig_common(Parser_t::Context &, return; } - if(version > 0 && version < makeVersion(3, 5, 0) && compat){ - Properties *reply = backward("", conf->m_oldConfig); - reply->put("Version", version); - reply->put("LocalNodeId", node); - - backward("", reply); - //reply->print(); - - const Uint32 size = reply->getPackedSize(); - Uint32 *buffer = new Uint32[size/4+1]; - - reply->pack(buffer); - delete reply; - - const int uurows = (size + 44)/45; - char * uubuf = new char[uurows * 62+5]; - - const int uusz = uuencode_mem(uubuf, (char *)buffer, size); - delete[] buffer; - - m_output->println("GET CONFIG %d %d %d %d %d", - 0, version, node, size, uusz); - - m_output->println("begin 664 Ndb_cfg.bin"); - - /* XXX Need to write directly to the socket, because the uubuf is not - * NUL-terminated. This could/should probably be done in a nicer way. - */ - write_socket(m_socket, MAX_WRITE_TIMEOUT, uubuf, uusz); - delete[] uubuf; - - m_output->println("end"); - m_output->println(""); - return; - } - - if(compat){ - m_output->println("GET CONFIG %d %d %d %d %d",1, version, 0, 0, 0); - return; - } - if(node != 0){ bool compatible; switch (m_mgmsrv.getNodeType(node)) { @@ -644,14 +565,13 @@ MgmApiSession::getConfig_common(Parser_t::Context &, NdbMutex_Lock(m_mgmsrv.m_configMutex); const ConfigValues * cfg = &conf->m_configValues->m_config; - const Uint32 size = cfg->getPackedSize(); UtilBuffer src; cfg->pack(src); NdbMutex_Unlock(m_mgmsrv.m_configMutex); char *tmp_str = (char *) malloc(base64_needed_encoded_length(src.length())); - int res = base64_encode(src.get_data(), src.length(), tmp_str); + (void) base64_encode(src.get_data(), src.length(), tmp_str); m_output->println("get config reply"); m_output->println("result: Ok"); @@ -803,13 +723,37 @@ MgmApiSession::endSession(Parser<MgmApiSession>::Context &, } void +MgmApiSession::getClusterLogLevel(Parser<MgmApiSession>::Context & , Properties const &) { + const char* names[] = { "startup", + "shutdown", + "statistics", + "checkpoint", + "noderestart", + "connection", + "info", + "warning", + "error", + "congestion", + "debug", + "backup" }; + + int loglevel_count = (CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1) ; + LogLevel::EventCategory category; + + m_output->println("get cluster loglevel"); + for(int i = 0; i < loglevel_count; i++) { + category = (LogLevel::EventCategory) i; + m_output->println("%s: %d", names[i], m_mgmsrv.m_event_listner[0].m_logLevel.getLogLevel(category)); + } + m_output->println(""); +} + +void MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &, Properties const &args) { const char *reply= "set cluster loglevel reply"; Uint32 node, level, cat; BaseString errorString; - SetLogLevelOrd logLevel; - int result; DBUG_ENTER("MgmApiSession::setClusterLogLevel"); args.get("node", &node); args.get("category", &cat); @@ -817,8 +761,7 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &, DBUG_PRINT("enter",("node=%d, category=%d, level=%d", node, cat, level)); - /* XXX should use constants for this value */ - if(level > 15) { + if(level > NDB_MGM_MAX_LOGLEVEL) { m_output->println(reply); m_output->println("result: Invalid loglevel %d", level); m_output->println(""); @@ -856,14 +799,12 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &, Uint32 node = 0, level = 0, cat; BaseString errorString; SetLogLevelOrd logLevel; - int result; logLevel.clear(); args.get("node", &node); args.get("category", &cat); args.get("level", &level); - /* XXX should use constants for this value */ - if(level > 15) { + if(level > NDB_MGM_MAX_LOGLEVEL) { m_output->println("set loglevel reply"); m_output->println("result: Invalid loglevel", errorString.c_str()); m_output->println(""); @@ -982,6 +923,7 @@ printNodeStatus(OutputStream *output, MgmtSrvr &mgmsrv, enum ndb_mgm_node_type type) { NodeId nodeId = 0; + mgmsrv.updateStatus(); while(mgmsrv.getNextNodeId(&nodeId, type)) { enum ndb_mgm_node_status status; Uint32 startPhase = 0, @@ -1284,6 +1226,8 @@ MgmApiSession::setLogFilter(Parser_t::Context &ctx, m_output->println(""); } +#ifdef NOT_USED + static NdbOut& operator<<(NdbOut& out, const LogLevel & ll) { @@ -1293,6 +1237,7 @@ operator<<(NdbOut& out, const LogLevel & ll) out << "]"; return out; } +#endif void Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId){ @@ -1308,7 +1253,7 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId) if (EventLoggerBase::event_lookup(eventType,cat,threshold,severity,textF)) DBUG_VOID_RETURN; - char m_text[256]; + char m_text[512]; EventLogger::getText(m_text, sizeof(m_text), textF, theData, nodeId); @@ -1324,6 +1269,15 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId) if (ndb_logevent_body[i].index_fn) val= (*(ndb_logevent_body[i].index_fn))(val); str.appfmt("%s=%d\n",ndb_logevent_body[i].token, val); + if(strcmp(ndb_logevent_body[i].token,"error") == 0) + { + int m_text_len= strlen(m_text); + if(sizeof(m_text)-m_text_len-3 > 0) + { + BaseString::snprintf(m_text+m_text_len, 4 , " - "); + ndb_error_string(val, m_text+(m_text_len+3), sizeof(m_text)-m_text_len-3); + } + } } Vector<NDB_SOCKET_TYPE> copy; @@ -1553,7 +1507,7 @@ MgmApiSession::listen_event(Parser<MgmApiSession>::Context & ctx, } int level = atoi(spec[1].c_str()); - if(level < 0 || level > 15){ + if(level < 0 || level > NDB_MGM_MAX_LOGLEVEL){ msg.appfmt("Invalid level: >%s<", spec[1].c_str()); result = -1; goto done; @@ -1670,7 +1624,7 @@ MgmApiSession::report_event(Parser_t::Context &ctx, BaseString tmp(data_string); Vector<BaseString> item; tmp.split(item, " "); - for (int i = 0; i < length ; i++) + for (int i = 0; (Uint32) i < length ; i++) { sscanf(item[i].c_str(), "%u", data+i); } diff --git a/ndb/src/mgmsrv/Services.hpp b/ndb/src/mgmsrv/Services.hpp index 6e0bb701d7b..48ba55a8b12 100644 --- a/ndb/src/mgmsrv/Services.hpp +++ b/ndb/src/mgmsrv/Services.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -25,9 +24,6 @@ #include "MgmtSrvr.hpp" -/** Undefine this to remove backwards compatibility for "GET CONFIG". */ -#define MGM_GET_CONFIG_BACKWARDS_COMPAT - class MgmApiSession : public SocketServer::Session { static void stop_session_if_timed_out(SocketServer::Session *_s, void *data); @@ -43,9 +39,6 @@ private: char m_err_str[1024]; int m_stopSelf; // -1 is restart, 0 do nothing, 1 stop - void getConfig_common(Parser_t::Context &ctx, - const class Properties &args, - bool compat = false); const char *get_error_text(int err_no) { return m_mgmsrv.getErrorText(err_no, m_err_str, sizeof(m_err_str)); } @@ -56,9 +49,6 @@ public: void getStatPort(Parser_t::Context &ctx, const class Properties &args); void getConfig(Parser_t::Context &ctx, const class Properties &args); -#ifdef MGM_GET_CONFIG_BACKWARDS_COMPAT - void getConfig_old(Parser_t::Context &ctx); -#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */ void get_nodeid(Parser_t::Context &ctx, const class Properties &args); void getVersion(Parser_t::Context &ctx, const class Properties &args); @@ -87,6 +77,8 @@ public: void bye(Parser_t::Context &ctx, const class Properties &args); void endSession(Parser_t::Context &ctx, const class Properties &args); void setLogLevel(Parser_t::Context &ctx, const class Properties &args); + void getClusterLogLevel(Parser_t::Context &ctx, + const class Properties &args); void setClusterLogLevel(Parser_t::Context &ctx, const class Properties &args); void setLogFilter(Parser_t::Context &ctx, const class Properties &args); diff --git a/ndb/src/mgmsrv/SignalQueue.cpp b/ndb/src/mgmsrv/SignalQueue.cpp index 08ad5f363a6..d1c29dc617d 100644 --- a/ndb/src/mgmsrv/SignalQueue.cpp +++ b/ndb/src/mgmsrv/SignalQueue.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/SignalQueue.hpp b/ndb/src/mgmsrv/SignalQueue.hpp index bacbad53415..cb0ed2e4ea1 100644 --- a/ndb/src/mgmsrv/SignalQueue.hpp +++ b/ndb/src/mgmsrv/SignalQueue.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/convertStrToInt.cpp b/ndb/src/mgmsrv/convertStrToInt.cpp index e5216047d10..4622a76e3db 100644 --- a/ndb/src/mgmsrv/convertStrToInt.cpp +++ b/ndb/src/mgmsrv/convertStrToInt.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/convertStrToInt.hpp b/ndb/src/mgmsrv/convertStrToInt.hpp index 0b2a96ed0bf..163f8198932 100644 --- a/ndb/src/mgmsrv/convertStrToInt.hpp +++ b/ndb/src/mgmsrv/convertStrToInt.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 5960a3517b5..80a832196bb 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -47,6 +46,7 @@ #define DEBUG(x) ndbout << x << endl; const char progname[] = "mgmtsrvr"; +const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 }; // copied from mysql.cc to get readline extern "C" { @@ -183,6 +183,8 @@ static void usage() { short_usage_sub(); ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -192,11 +194,9 @@ static void usage() */ int main(int argc, char** argv) { - int mgm_connect_result; NDB_INIT(argv[0]); - const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; diff --git a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp index 28823aaa35e..5e8a03aacd1 100644 --- a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp +++ b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/API.hpp b/ndb/src/ndbapi/API.hpp index 05e2d863cb6..ca8473d99d8 100644 --- a/ndb/src/ndbapi/API.hpp +++ b/ndb/src/ndbapi/API.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index fbff57d3168..d3946dddfb7 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -37,7 +36,7 @@ #include <mgmapi_configuration.hpp> #include <mgmapi_config_parameters.h> -int global_flag_send_heartbeat_now= 0; +//#define DEBUG_REG // Just a C wrapper for threadMain extern "C" @@ -67,6 +66,9 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade): DBUG_ENTER("ClusterMgr::ClusterMgr"); ndbSetOwnVersion(); clusterMgrThreadMutex = NdbMutex_Create(); + waitForHBCond= NdbCondition_Create(); + waitingForHB= false; + m_max_api_reg_req_interval= 0xFFFFFFFF; // MAX_INT noOfAliveNodes= 0; noOfConnectedNodes= 0; theClusterMgrThread= 0; @@ -77,7 +79,8 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade): ClusterMgr::~ClusterMgr() { DBUG_ENTER("ClusterMgr::~ClusterMgr"); - doStop(); + doStop(); + NdbCondition_Destroy(waitForHBCond); NdbMutex_Destroy(clusterMgrThreadMutex); DBUG_VOID_RETURN; } @@ -164,6 +167,70 @@ ClusterMgr::doStop( ){ } void +ClusterMgr::forceHB() +{ + theFacade.lock_mutex(); + + if(waitingForHB) + { + NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000); + theFacade.unlock_mutex(); + return; + } + + waitingForHB= true; + + NodeBitmask ndb_nodes; + ndb_nodes.clear(); + waitForHBFromNodes.clear(); + for(Uint32 i = 0; i < MAX_NODES; i++) + { + if(!theNodes[i].defined) + continue; + if(theNodes[i].m_info.m_type == NodeInfo::DB) + { + ndb_nodes.set(i); + const ClusterMgr::Node &node= getNodeInfo(i); + waitForHBFromNodes.bitOR(node.m_state.m_connected_nodes); + } + } + waitForHBFromNodes.bitAND(ndb_nodes); + +#ifdef DEBUG_REG + char buf[128]; + ndbout << "Waiting for HB from " << waitForHBFromNodes.getText(buf) << endl; +#endif + NdbApiSignal signal(numberToRef(API_CLUSTERMGR, theFacade.ownId())); + + signal.theVerId_signalNumber = GSN_API_REGREQ; + signal.theReceiversBlockNumber = QMGR; + signal.theTrace = 0; + signal.theLength = ApiRegReq::SignalLength; + + ApiRegReq * req = CAST_PTR(ApiRegReq, signal.getDataPtrSend()); + req->ref = numberToRef(API_CLUSTERMGR, theFacade.ownId()); + req->version = NDB_VERSION; + + int nodeId= 0; + for(int i=0; + (int) NodeBitmask::NotFound != (nodeId= waitForHBFromNodes.find(i)); + i= nodeId+1) + { +#ifdef DEBUG_REG + ndbout << "FORCE HB to " << nodeId << endl; +#endif + theFacade.sendSignalUnCond(&signal, nodeId); + } + + NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000); + waitingForHB= false; +#ifdef DEBUG_REG + ndbout << "Still waiting for HB from " << waitForHBFromNodes.getText(buf) << endl; +#endif + theFacade.unlock_mutex(); +} + +void ClusterMgr::threadMain( ){ NdbApiSignal signal(numberToRef(API_CLUSTERMGR, theFacade.ownId())); @@ -184,11 +251,8 @@ ClusterMgr::threadMain( ){ /** * Start of Secure area for use of Transporter */ - int send_heartbeat_now= global_flag_send_heartbeat_now; - global_flag_send_heartbeat_now= 0; - theFacade.lock_mutex(); - for (int i = 1; i < MAX_NODES; i++){ + for (int i = 1; i < MAX_NDB_NODES; i++){ /** * Send register request (heartbeat) to all available nodes * at specified timing intervals @@ -209,8 +273,8 @@ ClusterMgr::threadMain( ){ } theNode.hbCounter += timeSlept; - if (theNode.hbCounter >= theNode.hbFrequency || - send_heartbeat_now) { + if (theNode.hbCounter >= m_max_api_reg_req_interval || + theNode.hbCounter >= theNode.hbFrequency) { /** * It is now time to send a new Heartbeat */ @@ -219,14 +283,7 @@ ClusterMgr::threadMain( ){ theNode.hbCounter = 0; } - /** - * If the node is of type REP, - * then the receiver of the signal should be API_CLUSTERMGR - */ - if (theNode.m_info.m_type == NodeInfo::REP) { - signal.theReceiversBlockNumber = API_CLUSTERMGR; - } -#if 0 +#ifdef DEBUG_REG ndbout_c("ClusterMgr: Sending API_REGREQ to node %d", (int)nodeId); #endif theFacade.sendSignalUnCond(&signal, nodeId); @@ -265,7 +322,7 @@ ClusterMgr::showState(NodeId nodeId){ ClusterMgr::Node::Node() : m_state(NodeState::SL_NOTHING) { compatible = nfCompleteRep = true; - connected = defined = m_alive = false; + connected = defined = m_alive = m_api_reg_conf = false; m_state.m_connected_nodes.clear(); } @@ -278,7 +335,7 @@ ClusterMgr::execAPI_REGREQ(const Uint32 * theData){ const ApiRegReq * const apiRegReq = (ApiRegReq *)&theData[0]; const NodeId nodeId = refToNode(apiRegReq->ref); -#if 0 +#ifdef DEBUG_REG ndbout_c("ClusterMgr: Recd API_REGREQ from node %d", nodeId); #endif @@ -319,7 +376,7 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){ const ApiRegConf * const apiRegConf = (ApiRegConf *)&theData[0]; const NodeId nodeId = refToNode(apiRegConf->qmgrRef); -#if 0 +#ifdef DEBUG_REG ndbout_c("ClusterMgr: Recd API_REGCONF from node %d", nodeId); #endif @@ -339,9 +396,11 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){ node.m_info.m_version); } + node.m_api_reg_conf = true; + node.m_state = apiRegConf->nodeState; if (node.compatible && (node.m_state.startLevel == NodeState::SL_STARTED || - node.m_state.startLevel == NodeState::SL_SINGLEUSER)){ + node.m_state.getSingleUserMode())){ set_node_alive(node, true); } else { set_node_alive(node, false); @@ -351,6 +410,17 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){ if (node.m_info.m_type != NodeInfo::REP) { node.hbFrequency = (apiRegConf->apiHeartbeatFrequency * 10) - 50; } + + if(waitingForHB) + { + waitForHBFromNodes.clear(nodeId); + + if(waitForHBFromNodes.isclear()) + { + waitingForHB= false; + NdbCondition_Broadcast(waitForHBCond); + } + } } void @@ -379,6 +449,10 @@ ClusterMgr::execAPI_REGREF(const Uint32 * theData){ default: break; } + + waitForHBFromNodes.clear(nodeId); + if(waitForHBFromNodes.isclear()) + NdbCondition_Signal(waitForHBCond); } void @@ -430,6 +504,7 @@ ClusterMgr::reportConnected(NodeId nodeId){ theNode.m_info.m_version = 0; theNode.compatible = true; theNode.nfCompleteRep = true; + theNode.m_state.startLevel = NodeState::SL_NOTHING; theFacade.ReportNodeAlive(nodeId); } @@ -441,14 +516,14 @@ ClusterMgr::reportDisconnected(NodeId nodeId){ noOfConnectedNodes--; theNodes[nodeId].connected = false; - + theNodes[nodeId].m_api_reg_conf = false; theNodes[nodeId].m_state.m_connected_nodes.clear(); - reportNodeFailed(nodeId); + reportNodeFailed(nodeId, true); } void -ClusterMgr::reportNodeFailed(NodeId nodeId){ +ClusterMgr::reportNodeFailed(NodeId nodeId, bool disconnect){ Node & theNode = theNodes[nodeId]; @@ -459,10 +534,11 @@ ClusterMgr::reportNodeFailed(NodeId nodeId){ { theFacade.doDisconnect(nodeId); } + const bool report = (theNode.m_state.startLevel != NodeState::SL_NOTHING); theNode.m_state.startLevel = NodeState::SL_NOTHING; - if(report) + if(disconnect || report) { theFacade.ReportNodeDead(nodeId); } diff --git a/ndb/src/ndbapi/ClusterMgr.hpp b/ndb/src/ndbapi/ClusterMgr.hpp index 1a1e622a889..467b18f2330 100644 --- a/ndb/src/ndbapi/ClusterMgr.hpp +++ b/ndb/src/ndbapi/ClusterMgr.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -49,7 +48,10 @@ public: void doStop(); void startThread(); - + + void forceHB(); + void set_max_api_reg_req_interval(unsigned int millisec) { m_max_api_reg_req_interval = millisec; } + private: void threadMain(); @@ -64,6 +66,7 @@ public: bool compatible; // Version is compatible bool nfCompleteRep; // NF Complete Rep has arrived bool m_alive; // Node is alive + bool m_api_reg_conf;// API_REGCONF has arrived NodeInfo m_info; NodeState m_state; @@ -81,19 +84,24 @@ public: Uint32 m_connect_count; private: + Uint32 m_max_api_reg_req_interval; Uint32 noOfAliveNodes; Uint32 noOfConnectedNodes; Node theNodes[MAX_NODES]; NdbThread* theClusterMgrThread; - + + NodeBitmask waitForHBFromNodes; // used in forcing HBs + NdbCondition* waitForHBCond; + bool waitingForHB; + /** * Used for controlling start/stop of the thread */ NdbMutex* clusterMgrThreadMutex; void showState(NodeId nodeId); - void reportNodeFailed(NodeId nodeId); - + void reportNodeFailed(NodeId nodeId, bool disconnect = false); + /** * Signals received */ @@ -174,6 +182,7 @@ private: ArbitSignalData data; NDB_TICKS timestamp; + ArbitSignal() {} inline void init(GlobalSignalNumber aGsn, const Uint32* aData) { gsn = aGsn; if (aData != NULL) diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index bb59c16fb7c..6a815067233 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -116,7 +115,8 @@ void GlobalDictCache::printCache() NdbElement_t<Vector<TableVersion> > * curr = m_tableHash.getNext(0); while(curr != 0){ DBUG_PRINT("curr", ("len: %d, hash: %d, lk: %d, str: %s", - curr->len, curr->hash, curr->localkey1, curr->str)); + curr->len, curr->hash, curr->localkey1, + (char*) curr->str)); if (curr->theData){ Vector<TableVersion> * vers = curr->theData; const unsigned sz = vers->size(); @@ -141,7 +141,7 @@ void GlobalDictCache::printCache() } NdbTableImpl * -GlobalDictCache::get(const char * name) +GlobalDictCache::get(const char * name, int *error) { DBUG_ENTER("GlobalDictCache::get"); DBUG_PRINT("enter", ("name: %s", name)); @@ -151,6 +151,11 @@ GlobalDictCache::get(const char * name) versions = m_tableHash.getData(name, len); if(versions == 0){ versions = new Vector<TableVersion>(2); + if (versions == NULL) + { + *error = -1; + DBUG_RETURN(0); + } m_tableHash.insertKey(name, len, 0, versions); } @@ -180,7 +185,11 @@ GlobalDictCache::get(const char * name) tmp.m_impl = 0; tmp.m_status = RETREIVING; tmp.m_refCount = 1; // The one retreiving it - versions->push_back(tmp); + if (versions->push_back(tmp)) + { + *error = -1; + DBUG_RETURN(0); + } DBUG_RETURN(0); } diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp index 19198e88824..db90a07d487 100644 --- a/ndb/src/ndbapi/DictCache.hpp +++ b/ndb/src/ndbapi/DictCache.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -68,7 +67,7 @@ public: GlobalDictCache(); ~GlobalDictCache(); - NdbTableImpl * get(const char * name); + NdbTableImpl * get(const char * name, int *error); NdbTableImpl* put(const char * name, NdbTableImpl *); void drop(NdbTableImpl *); diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am index 522e78dd6e0..1a5d10eae5b 100644 --- a/ndb/src/ndbapi/Makefile.am +++ b/ndb/src/ndbapi/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + #SUBDIRS = signal-sender noinst_LTLIBRARIES = libndbapi.la @@ -33,7 +48,8 @@ libndbapi_la_SOURCES = \ DictCache.cpp \ ndb_cluster_connection.cpp \ NdbBlob.cpp \ - SignalSender.cpp + SignalSender.cpp \ + ObjectMap.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 9d1c78a5972..449f287dc1d 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -57,6 +56,8 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) // We have connections now to the desired node. Return //**************************************************************************** DBUG_RETURN(getConnectedNdbTransaction(tConNode)); + } else if (TretCode < 0) { + DBUG_RETURN(NULL); } else if (TretCode != 0) { tAnyAlive = 1; }//if @@ -80,6 +81,8 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) // We have connections now to the desired node. Return //**************************************************************************** DBUG_RETURN(getConnectedNdbTransaction(tNode)); + } else if (TretCode < 0) { + DBUG_RETURN(NULL); } else if (TretCode != 0) { tAnyAlive= 1; }//if @@ -108,6 +111,8 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) // We have connections now to the desired node. Return //**************************************************************************** DBUG_RETURN(getConnectedNdbTransaction(tNode)); + } else if (TretCode < 0) { + DBUG_RETURN(NULL); } else if (TretCode != 0) { tAnyAlive= 1; }//if @@ -177,6 +182,7 @@ Ndb::NDB_connect(Uint32 tNode) nodeSequence = tp->getNodeSequence(tNode); bool node_is_alive = tp->get_node_alive(tNode); if (node_is_alive) { + DBUG_PRINT("info",("Sending signal to node %u", tNode)); tReturnCode = tp->sendSignal(tSignal, tNode); releaseSignal(tSignal); if (tReturnCode != -1) { @@ -208,6 +214,11 @@ Ndb::NDB_connect(Uint32 tNode) DBUG_PRINT("info", ("unsuccessful connect tReturnCode %d, tNdbCon->Status() %d", tReturnCode, tNdbCon->Status())); + if (theError.code == 299) + { + // single user mode so no need to retry with other node + DBUG_RETURN(-1); + } DBUG_RETURN(3); }//if }//Ndb::NDB_connect() @@ -269,8 +280,6 @@ Ndb::waitUntilReady(int timeout) DBUG_ENTER("Ndb::waitUntilReady"); int secondsCounter = 0; int milliCounter = 0; - int noChecksSinceFirstAliveFound = 0; - int id; if (theInitState != Initialised) { // Ndb::init is not called @@ -355,8 +364,9 @@ Ndb::startTransaction(const NdbDictionary::Table *table, { NdbTransaction *trans= startTransactionLocal(0, nodeId); - DBUG_PRINT("exit",("start trans: 0x%x transid: 0x%llx", - trans, trans ? trans->getTransactionId() : 0)); + DBUG_PRINT("exit",("start trans: 0x%lx transid: 0x%lx", + (long) trans, + (long) (trans ? trans->getTransactionId() : 0))); DBUG_RETURN(trans); } } else { @@ -377,7 +387,7 @@ Ndb::hupp(NdbTransaction* pBuddyTrans) { DBUG_ENTER("Ndb::hupp"); - DBUG_PRINT("enter", ("trans: 0x%x",pBuddyTrans)); + DBUG_PRINT("enter", ("trans: 0x%lx", (long) pBuddyTrans)); Uint32 aPriority = 0; if (pBuddyTrans == NULL){ @@ -402,8 +412,9 @@ Ndb::hupp(NdbTransaction* pBuddyTrans) } pCon->setTransactionId(pBuddyTrans->getTransactionId()); pCon->setBuddyConPtr((Uint32)pBuddyTrans->getTC_ConnectPtr()); - DBUG_PRINT("exit", ("hupp trans: 0x%x transid: 0x%llx", - pCon, pCon ? pCon->getTransactionId() : 0)); + DBUG_PRINT("exit", ("hupp trans: 0x%lx transid: 0x%lx", + (long) pCon, + (long) (pCon ? pCon->getTransactionId() : 0))); DBUG_RETURN(pCon); } else { DBUG_RETURN(NULL); @@ -439,7 +450,11 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId) theRemainingStartTransactions--; NdbTransaction* tConNext = theTransactionList; - tConnection->init(); + if (tConnection->init()) + { + theError.code = tConnection->theError.code; + DBUG_RETURN(NULL); + } theTransactionList = tConnection; // into a transaction list. tConnection->next(tConNext); // Add the active connection object tConnection->setTransactionId(tFirstTransId); @@ -490,8 +505,9 @@ Ndb::closeTransaction(NdbTransaction* aConnection) tCon = theTransactionList; theRemainingStartTransactions++; - DBUG_PRINT("info",("close trans: 0x%x transid: 0x%llx", - aConnection, aConnection->getTransactionId())); + DBUG_PRINT("info",("close trans: 0x%lx transid: 0x%lx", + (long) aConnection, + (long) aConnection->getTransactionId())); DBUG_PRINT("info",("magic number: 0x%x TCConPtr: 0x%x theMyRef: 0x%x 0x%x", aConnection->theMagicNumber, aConnection->theTCConPtr, aConnection->theMyRef, getReference())); @@ -774,7 +790,7 @@ Ndb::getAutoIncrementValue(const char* aTableName, } if (getTupleIdFromNdb(info, tupleId, cacheSize) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong) tupleId)); DBUG_RETURN(0); } @@ -795,7 +811,7 @@ Ndb::getAutoIncrementValue(const NdbDictionary::Table * aTable, } if (getTupleIdFromNdb(info, tupleId, cacheSize) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong)tupleId)); DBUG_RETURN(0); } @@ -808,7 +824,7 @@ Ndb::getTupleIdFromNdb(Ndb_local_table_info* info, { assert(info->m_first_tuple_id < info->m_last_tuple_id); tupleId = ++info->m_first_tuple_id; - DBUG_PRINT("info", ("next cached value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("next cached value %lu", (ulong)tupleId)); } else { @@ -842,7 +858,7 @@ Ndb::readAutoIncrementValue(const char* aTableName, } if (readTupleIdFromNdb(info, tupleId) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong)tupleId)); DBUG_RETURN(0); } @@ -863,7 +879,7 @@ Ndb::readAutoIncrementValue(const NdbDictionary::Table * aTable, } if (readTupleIdFromNdb(info, tupleId) == -1) DBUG_RETURN(-1); - DBUG_PRINT("info", ("value %llu", (ulonglong)tupleId)); + DBUG_PRINT("info", ("value %lu", (ulong)tupleId)); DBUG_RETURN(0); } @@ -945,8 +961,8 @@ Ndb::setTupleIdInNdb(Ndb_local_table_info* info, { info->m_first_tuple_id = tupleId - 1; DBUG_PRINT("info", - ("Setting next auto increment cached value to %llu", - (ulonglong)tupleId)); + ("Setting next auto increment cached value to %lu", + (ulong)tupleId)); DBUG_RETURN(0); } } @@ -973,13 +989,16 @@ Ndb::opTupleIdOnNdb(Ndb_local_table_info* info, Uint64 & opValue, Uint32 op) { DBUG_ENTER("Ndb::opTupleIdOnNdb"); Uint32 aTableId = info->m_table_impl->m_tableId; - DBUG_PRINT("enter", ("table=%u value=%llu op=%u", aTableId, opValue, op)); + DBUG_PRINT("enter", ("table: %u value: %lu op: %u", + aTableId, (ulong) opValue, op)); NdbTransaction* tConnection; NdbOperation* tOperation= 0; // Compiler warning if not initialized Uint64 tValue; NdbRecAttr* tRecAttrResult; + NdbError savedError; + CHECK_STATUS_MACRO_ZERO; BaseString currentDb(getDatabaseName()); @@ -1047,8 +1066,8 @@ Ndb::opTupleIdOnNdb(Ndb_local_table_info* info, Uint64 & opValue, Uint32 op) else { DBUG_PRINT("info", - ("Setting next auto increment value (db) to %llu", - (ulonglong)opValue)); + ("Setting next auto increment value (db) to %lu", + (ulong)opValue)); info->m_first_tuple_id = info->m_last_tuple_id = opValue - 1; } break; @@ -1074,7 +1093,12 @@ Ndb::opTupleIdOnNdb(Ndb_local_table_info* info, Uint64 & opValue, Uint32 op) error_handler: theError.code = tConnection->theError.code; + + savedError = theError; + this->closeTransaction(tConnection); + theError = savedError; + error_return: // Restore current name space setDatabaseName(currentDb.c_str()); @@ -1110,28 +1134,37 @@ const char * Ndb::getCatalogName() const } -void Ndb::setCatalogName(const char * a_catalog_name) +int Ndb::setCatalogName(const char * a_catalog_name) { if (a_catalog_name) { - theImpl->m_dbname.assign(a_catalog_name); - theImpl->update_prefix(); + if (!theImpl->m_dbname.assign(a_catalog_name) || + theImpl->update_prefix()) + { + theError.code = 4000; + return -1; + } } + return 0; } - const char * Ndb::getSchemaName() const { return theImpl->m_schemaname.c_str(); } -void Ndb::setSchemaName(const char * a_schema_name) +int Ndb::setSchemaName(const char * a_schema_name) { if (a_schema_name) { - theImpl->m_schemaname.assign(a_schema_name); - theImpl->update_prefix(); + if (!theImpl->m_schemaname.assign(a_schema_name) || + theImpl->update_prefix()) + { + theError.code = 4000; + return -1; + } } + return 0; } /* @@ -1142,9 +1175,9 @@ const char * Ndb::getDatabaseName() const return getCatalogName(); } -void Ndb::setDatabaseName(const char * a_catalog_name) +int Ndb::setDatabaseName(const char * a_catalog_name) { - setCatalogName(a_catalog_name); + return setCatalogName(a_catalog_name); } const char * Ndb::getDatabaseSchemaName() const @@ -1152,9 +1185,9 @@ const char * Ndb::getDatabaseSchemaName() const return getSchemaName(); } -void Ndb::setDatabaseSchemaName(const char * a_schema_name) +int Ndb::setDatabaseSchemaName(const char * a_schema_name) { - setSchemaName(a_schema_name); + return setSchemaName(a_schema_name); } bool Ndb::usingFullyQualifiedNames() @@ -1244,7 +1277,7 @@ Ndb::internalize_index_name(const NdbTableImpl * table, if (!table) { DBUG_PRINT("error", ("!table")); - return ret; + DBUG_RETURN(ret); } if (fullyQualifiedNames) @@ -1268,6 +1301,11 @@ const BaseString Ndb::getDatabaseFromInternalName(const char * internalName) { char * databaseName = new char[strlen(internalName) + 1]; + if (databaseName == NULL) + { + errno = ENOMEM; + return BaseString(NULL); + } strcpy(databaseName, internalName); register char *ptr = databaseName; @@ -1284,6 +1322,11 @@ const BaseString Ndb::getSchemaFromInternalName(const char * internalName) { char * schemaName = new char[strlen(internalName)]; + if (schemaName == NULL) + { + errno = ENOMEM; + return BaseString(NULL); + } register const char *ptr1 = internalName; /* Scan name for the second table_name_separator */ diff --git a/ndb/src/ndbapi/NdbApiSignal.cpp b/ndb/src/ndbapi/NdbApiSignal.cpp index 94695185224..b19b112ee2c 100644 --- a/ndb/src/ndbapi/NdbApiSignal.cpp +++ b/ndb/src/ndbapi/NdbApiSignal.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbApiSignal.hpp b/ndb/src/ndbapi/NdbApiSignal.hpp index 9d04a8594a8..bd07f2665bf 100644 --- a/ndb/src/ndbapi/NdbApiSignal.hpp +++ b/ndb/src/ndbapi/NdbApiSignal.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index fdee8961337..7ab9c2132d8 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -389,8 +388,6 @@ NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part) DBUG_ENTER("NdbBlob::setPartKeyValue"); DBUG_PRINT("info", ("dist=%u part=%u key=", getDistKey(part), part)); DBUG_DUMP("info", theKeyBuf.data, 4 * theTable->m_keyLenInWords); - Uint32* data = (Uint32*)theKeyBuf.data; - unsigned size = theTable->m_keyLenInWords; // TODO use attr ids after compatibility with 4.1.7 not needed if (anOp->equal("PK", theKeyBuf.data) == -1 || anOp->equal("DIST", getDistKey(part)) == -1 || @@ -410,6 +407,12 @@ NdbBlob::getHeadInlineValue(NdbOperation* anOp) setErrorCode(anOp); DBUG_RETURN(-1); } + /* + * If we get no data from this op then the operation is aborted + * one way or other. Following hack in 5.0 makes sure we don't read + * garbage. The proper fix exists only in version >= 5.1. + */ + theHead->length = 0; DBUG_RETURN(0); } @@ -803,7 +806,9 @@ NdbBlob::writeDataPrivate(const char* buf, Uint32 bytes) DBUG_RETURN(-1); Uint32 n = thePartSize - off; if (n > len) { - memset(thePartBuf.data + off + len, theFillChar, n - len); + /* If we are adding data at the end, fill rest of part. */ + if (pos + len >= theLength) + memset(thePartBuf.data + off + len, theFillChar, n - len); n = len; } memcpy(thePartBuf.data + off, buf, n); @@ -1158,7 +1163,7 @@ NdbBlob::atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl if (isReadOp()) { // upgrade lock mode if (theNdbOp->theLockMode == NdbOperation::LM_CommittedRead) - theNdbOp->theLockMode = NdbOperation::LM_Read; + theNdbOp->setReadLockMode(NdbOperation::LM_Read); // add read of head+inline in this op if (getHeadInlineValue(theNdbOp) == -1) DBUG_RETURN(-1); @@ -1179,7 +1184,7 @@ NdbBlob::atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl if (isScanOp()) { // upgrade lock mode if (theNdbOp->theLockMode == NdbOperation::LM_CommittedRead) - theNdbOp->theLockMode = NdbOperation::LM_Read; + theNdbOp->setReadLockMode(NdbOperation::LM_Read); // add read of head+inline in this op if (getHeadInlineValue(theNdbOp) == -1) DBUG_RETURN(-1); diff --git a/ndb/src/ndbapi/NdbBlobImpl.hpp b/ndb/src/ndbapi/NdbBlobImpl.hpp index b56aabfd84e..9a7aa7ff40b 100644 --- a/ndb/src/ndbapi/NdbBlobImpl.hpp +++ b/ndb/src/ndbapi/NdbBlobImpl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 6c721b76ba0..86a6624959e 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -53,9 +52,9 @@ NdbDictionary::Column::operator=(const NdbDictionary::Column& column) return *this; } -void +int NdbDictionary::Column::setName(const char * name){ - m_impl.m_name.assign(name); + return !m_impl.m_name.assign(name); } const char* @@ -209,10 +208,10 @@ NdbDictionary::Column::setAutoIncrementInitialValue(Uint64 val){ m_impl.m_autoIncrementInitialValue = val; } -void +int NdbDictionary::Column::setDefaultValue(const char* defaultValue) { - m_impl.m_defaultValue.assign(defaultValue); + return !m_impl.m_defaultValue.assign(defaultValue); } const char* @@ -274,9 +273,9 @@ NdbDictionary::Table::operator=(const NdbDictionary::Table& table) return *this; } -void +int NdbDictionary::Table::setName(const char * name){ - m_impl.setName(name); + return m_impl.setName(name); } const char * @@ -289,18 +288,30 @@ NdbDictionary::Table::getTableId() const { return m_impl.m_tableId; } -void +int NdbDictionary::Table::addColumn(const Column & c){ NdbColumnImpl* col = new NdbColumnImpl; + if (col == NULL) + { + errno = ENOMEM; + return -1; + } (* col) = NdbColumnImpl::getImpl(c); - m_impl.m_columns.push_back(col); + if (m_impl.m_columns.push_back(col)) + { + return -1; + } if(c.getPrimaryKey()){ m_impl.m_noOfKeys++; } if (col->getBlobType()) { m_impl.m_noOfBlobs++; } - m_impl.buildColumnHash(); + if (m_impl.buildColumnHash()) + { + return -1; + } + return 0; } const NdbDictionary::Column* @@ -431,9 +442,21 @@ NdbDictionary::Table::getFrmLength() const { return m_impl.m_frm.length(); } +enum NdbDictionary::Table::SingleUserMode +NdbDictionary::Table::getSingleUserMode() const +{ + return (enum SingleUserMode)m_impl.m_single_user_mode; +} + void +NdbDictionary::Table::setSingleUserMode(enum NdbDictionary::Table::SingleUserMode mode) +{ + m_impl.m_single_user_mode = (Uint8)mode; +} + +int NdbDictionary::Table::setFrm(const void* data, Uint32 len){ - m_impl.m_frm.assign(data, len); + return m_impl.m_frm.assign(data, len); } NdbDictionary::Object::Status @@ -480,6 +503,7 @@ NdbDictionary::Table::createTableInDb(Ndb* pNdb, bool equalOk) const { /***************************************************************** * Index facade */ + NdbDictionary::Index::Index(const char * name) : m_impl(* new NdbIndexImpl(* this)) { @@ -498,9 +522,9 @@ NdbDictionary::Index::~Index(){ } } -void +int NdbDictionary::Index::setName(const char * name){ - m_impl.setName(name); + return m_impl.setName(name); } const char * @@ -508,9 +532,9 @@ NdbDictionary::Index::getName() const { return m_impl.getName(); } -void +int NdbDictionary::Index::setTable(const char * table){ - m_impl.setTable(table); + return m_impl.setTable(table); } const char * @@ -545,39 +569,56 @@ NdbDictionary::Index::getIndexColumn(int no) const { return NULL; } -void +int NdbDictionary::Index::addColumn(const Column & c){ NdbColumnImpl* col = new NdbColumnImpl; + if (col == NULL) + { + errno = ENOMEM; + return -1; + } (* col) = NdbColumnImpl::getImpl(c); - m_impl.m_columns.push_back(col); + if (m_impl.m_columns.push_back(col)) + { + return -1; + } + return 0; } -void +int NdbDictionary::Index::addColumnName(const char * name){ const Column c(name); - addColumn(c); + return addColumn(c); } -void +int NdbDictionary::Index::addIndexColumn(const char * name){ const Column c(name); - addColumn(c); + return addColumn(c); } -void +int NdbDictionary::Index::addColumnNames(unsigned noOfNames, const char ** names){ for(unsigned i = 0; i < noOfNames; i++) { const Column c(names[i]); - addColumn(c); + if (addColumn(c)) + { + return -1; + } } + return 0; } -void +int NdbDictionary::Index::addIndexColumns(int noOfNames, const char ** names){ for(int i = 0; i < noOfNames; i++) { const Column c(names[i]); - addColumn(c); + if (addColumn(c)) + { + return -1; + } } + return 0; } void diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index b91df24d8d7..3fed04de26d 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -319,6 +318,7 @@ NdbTableImpl::init(){ m_replicaCount= 0; m_min_rows = 0; m_max_rows = 0; + m_single_user_mode = 0; } bool @@ -379,32 +379,53 @@ NdbTableImpl::equal(const NdbTableImpl& obj) const DBUG_RETURN(false); } + if(m_single_user_mode != obj.m_single_user_mode) + { + DBUG_PRINT("info",("m_single_user_mode %d != %d", + (int32)m_single_user_mode, + (int32)obj.m_single_user_mode)); + DBUG_RETURN(false); + } + DBUG_RETURN(true); } -void +int NdbTableImpl::assign(const NdbTableImpl& org) { m_tableId = org.m_tableId; - m_internalName.assign(org.m_internalName); - m_externalName.assign(org.m_externalName); - m_newExternalName.assign(org.m_newExternalName); - m_frm.assign(org.m_frm.get_data(), org.m_frm.length()); + if (!m_internalName.assign(org.m_internalName) || + !m_externalName.assign(org.m_externalName) || + !m_newExternalName.assign(org.m_newExternalName) || + m_frm.assign(org.m_frm.get_data(), org.m_frm.length())) + { + return -1; + } m_fragmentType = org.m_fragmentType; m_fragmentCount = org.m_fragmentCount; for(unsigned i = 0; i<org.m_columns.size(); i++){ NdbColumnImpl * col = new NdbColumnImpl(); + if (col == NULL) + { + errno = ENOMEM; + return -1; + } const NdbColumnImpl * iorg = org.m_columns[i]; (* col) = (* iorg); - m_columns.push_back(col); + if (m_columns.push_back(col)) + { + delete col; + return -1; + } } m_logging = org.m_logging; m_kvalue = org.m_kvalue; m_minLoadFactor = org.m_minLoadFactor; m_maxLoadFactor = org.m_maxLoadFactor; - + m_single_user_mode = org.m_single_user_mode; + if (m_index != 0) delete m_index; m_index = org.m_index; @@ -419,11 +440,13 @@ NdbTableImpl::assign(const NdbTableImpl& org) m_max_rows = org.m_max_rows; m_min_rows = org.m_min_rows; + + return 0; } -void NdbTableImpl::setName(const char * name) +int NdbTableImpl::setName(const char * name) { - m_newExternalName.assign(name); + return !m_newExternalName.assign(name); } const char * @@ -436,7 +459,7 @@ NdbTableImpl::getName() const } -void +int NdbTableImpl::buildColumnHash(){ const Uint32 size = m_columns.size(); @@ -449,19 +472,29 @@ NdbTableImpl::buildColumnHash(){ } Vector<Uint32> hashValues; - Vector<Vector<Uint32> > chains; chains.fill(size, hashValues); + Vector<Vector<Uint32> > chains; + if (chains.fill(size, hashValues)) + { + return -1; + } for(i = 0; i< (int) size; i++){ Uint32 hv = Hash(m_columns[i]->getName()) & 0xFFFE; Uint32 bucket = hv & m_columnHashMask; bucket = (bucket < size ? bucket : bucket - size); assert(bucket < size); - hashValues.push_back(hv); - chains[bucket].push_back(i); + if (hashValues.push_back(hv) || + chains[bucket].push_back(i)) + { + return -1; + } } m_columnHash.clear(); Uint32 tmp = 1; - m_columnHash.fill((unsigned)size-1, tmp); // Default no chaining + if (m_columnHash.fill((unsigned)size-1, tmp)) // Default no chaining + { + return -1; + } Uint32 pos = 0; // In overflow vector for(i = 0; i< (int) size; i++){ @@ -481,12 +514,18 @@ NdbTableImpl::buildColumnHash(){ for(size_t j = 0; j<sz; j++, pos++){ Uint32 col = chains[i][j]; Uint32 hv = hashValues[col]; - m_columnHash.push_back((col << 16) | hv); + if (m_columnHash.push_back((col << 16) | hv)) + { + return -1; + } } } } - m_columnHash.push_back(0); // Overflow when looping in end of array + if (m_columnHash.push_back(0)) // Overflow when looping in end of array + { + return -1; + } #if 0 for(size_t i = 0; i<m_columnHash.size(); i++){ @@ -501,6 +540,7 @@ NdbTableImpl::buildColumnHash(){ i, col > 0 ? m_columns[col]->getName() : "" , m_columnHash[i]); } #endif + return 0; } Uint32 @@ -554,9 +594,9 @@ NdbIndexImpl::~NdbIndexImpl(){ delete m_columns[i]; } -void NdbIndexImpl::setName(const char * name) +int NdbIndexImpl::setName(const char * name) { - m_externalName.assign(name); + return !m_externalName.assign(name); } const char * @@ -565,10 +605,10 @@ NdbIndexImpl::getName() const return m_externalName.c_str(); } -void +int NdbIndexImpl::setTable(const char * table) { - m_tableName.assign(table); + return !m_tableName.assign(table); } const char * @@ -648,14 +688,18 @@ Ndb_local_table_info * NdbDictionaryImpl::fetchGlobalTableImpl(const BaseString& internalTableName) { NdbTableImpl *impl; + int error= 0; m_globalHash->lock(); - impl = m_globalHash->get(internalTableName.c_str()); + impl = m_globalHash->get(internalTableName.c_str(), &error); m_globalHash->unlock(); if (impl == 0){ - impl = m_receiver.getTable(internalTableName, - m_ndb.usingFullyQualifiedNames()); + if (error == 0) + impl = m_receiver.getTable(internalTableName, + m_ndb.usingFullyQualifiedNames()); + else + m_error.code = 4000; m_globalHash->lock(); m_globalHash->put(internalTableName.c_str(), impl); m_globalHash->unlock(); @@ -881,6 +925,7 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal, r = m_transporter->sendSignal(signal, aNodeId); } if(r != 0){ + m_error.code= 4007; m_transporter->unlock_mutex(); continue; } @@ -904,7 +949,10 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal, * Handle error codes */ if(m_waiter.m_state == WAIT_NODE_FAILURE) + { + m_error.code = 4013; continue; + } if(m_waiter.m_state == WST_WAIT_TIMEOUT) { @@ -985,12 +1033,20 @@ NdbDictInterface::getTable(const BaseString& name, bool fullyQualifiedNames) // Copy name to m_buffer to get a word sized buffer m_buffer.clear(); - m_buffer.grow(namelen_words*4+4); - m_buffer.append(name.c_str(), namelen); + if (m_buffer.grow(namelen_words*4+4) || + m_buffer.append(name.c_str(), namelen)) + { + m_error.code= 4000; + return NULL; + } #ifndef IGNORE_VALGRIND_WARNINGS Uint32 pad = 0; - m_buffer.append(&pad, 4); + if (m_buffer.append(&pad, 4)) + { + m_error.code= 4000; + return NULL; + } #endif LinearSectionPtr ptr[1]; @@ -1021,7 +1077,14 @@ NdbDictInterface::getTable(class NdbApiSignal * signal, (Uint32*)m_buffer.get_data(), m_buffer.length() / 4, fullyQualifiedNames); if (rt != 0) - rt->buildColumnHash(); + { + if (rt->buildColumnHash()) + { + m_error.code = 4000; + delete rt; + return NULL; + } + } return rt; } @@ -1030,18 +1093,25 @@ NdbDictInterface::execGET_TABINFO_CONF(NdbApiSignal * signal, LinearSectionPtr ptr[3]) { const GetTabInfoConf* conf = CAST_CONSTPTR(GetTabInfoConf, signal->getDataPtr()); + const Uint32 i = GetTabInfoConf::DICT_TAB_INFO; if(signal->isFirstFragment()){ m_fragmentId = signal->getFragmentId(); - m_buffer.grow(4 * conf->totalLen); + if (m_buffer.grow(4 * conf->totalLen)) + { + m_error.code= 4000; + goto end; + } } else { if(m_fragmentId != signal->getFragmentId()){ abort(); } } - const Uint32 i = GetTabInfoConf::DICT_TAB_INFO; - m_buffer.append(ptr[i].p, 4 * ptr[i].sz); - + if (m_buffer.append(ptr[i].p, 4 * ptr[i].sz)) + { + m_error.code= 4000; + } +end: if(!signal->isLastFragment()){ return; } @@ -1172,10 +1242,12 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, impl->m_tableId = tableDesc.TableId; impl->m_version = tableDesc.TableVersion; impl->m_status = NdbDictionary::Object::Retrieved; - impl->m_internalName.assign(internalName); - impl->m_externalName.assign(externalName); - - impl->m_frm.assign(tableDesc.FrmData, tableDesc.FrmLen); + if (!impl->m_internalName.assign(internalName) || + !impl->m_externalName.assign(externalName) || + impl->m_frm.assign(tableDesc.FrmData, tableDesc.FrmLen)) + { + DBUG_RETURN(4000); + } impl->m_fragmentType = (NdbDictionary::Object::FragmentType) getApiConstant(tableDesc.FragmentType, @@ -1192,6 +1264,7 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, impl->m_kvalue = tableDesc.TableKValue; impl->m_minLoadFactor = tableDesc.MinLoadFactor; impl->m_maxLoadFactor = tableDesc.MaxLoadFactor; + impl->m_single_user_mode = tableDesc.SingleUserMode; impl->m_indexType = (NdbDictionary::Index::Type) getApiConstant(tableDesc.TableType, @@ -1202,7 +1275,10 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, } else { const char * externalPrimary = Ndb::externalizeTableName(tableDesc.PrimaryTable, fullyQualifiedNames); - impl->m_primaryTable.assign(externalPrimary); + if (!impl->m_primaryTable.assign(externalPrimary)) + { + DBUG_RETURN(4000); + } } Uint32 keyInfoPos = 0; @@ -1229,6 +1305,7 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, // check type and compute attribute size and array size if (! attrDesc.translateExtType()) { + delete col; delete impl; DBUG_RETURN(703); } @@ -1240,12 +1317,14 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, unsigned cs_number = (attrDesc.AttributeExtPrecision >> 16); // charset is defined exactly for char types if (col->getCharType() != (cs_number != 0)) { + delete col; delete impl; DBUG_RETURN(703); } if (col->getCharType()) { col->m_cs = get_charset(cs_number, MYF(0)); if (col->m_cs == NULL) { + delete col; delete impl; DBUG_RETURN(743); } @@ -1263,7 +1342,12 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, col->m_nullable = attrDesc.AttributeNullableFlag; col->m_autoIncrement = (attrDesc.AttributeAutoIncrement ? true : false); col->m_autoIncrementInitialValue = ~0; - col->m_defaultValue.assign(attrDesc.AttributeDefaultValue); + if (!col->m_defaultValue.assign(attrDesc.AttributeDefaultValue)) + { + delete col; + delete impl; + DBUG_RETURN(4000); + } if(attrDesc.AttributeKeyFlag){ col->m_keyInfoPos = keyInfoPos + 1; @@ -1303,7 +1387,11 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, for(i = 0; i<(fragCount*replicaCount); i++) { - impl->m_fragments.push_back(tableDesc.FragmentData[i+2]); + if (impl->m_fragments.push_back(tableDesc.FragmentData[i+2])) + { + delete impl; + DBUG_RETURN(4000); + } } Uint32 topBit = (1 << 31); @@ -1467,7 +1555,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, } if (!impl.m_newExternalName.empty()) { - impl.m_externalName.assign(impl.m_newExternalName); + if (!impl.m_externalName.assign(impl.m_newExternalName)) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } AlterTableReq::setNameFlag(impl.m_changeMask, true); } @@ -1476,7 +1568,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, const BaseString internalName( ndb.internalize_table_name(impl.m_externalName.c_str())); - impl.m_internalName.assign(internalName); + if (!impl.m_internalName.assign(internalName)) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } UtilBufferWriter w(m_buffer); DictTabInfo::Table tmpTab; tmpTab.init(); BaseString::snprintf(tmpTab.TableName, @@ -1520,11 +1616,8 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, tmpTab.MaxRowsLow = (Uint32)(impl.m_max_rows & 0xFFFFFFFF); tmpTab.MinRowsHigh = (Uint32)(impl.m_min_rows >> 32); tmpTab.MinRowsLow = (Uint32)(impl.m_min_rows & 0xFFFFFFFF); - - Uint64 maxRows = - (((Uint64)tmpTab.MaxRowsHigh) << 32) + tmpTab.MaxRowsLow; - Uint64 minRows = - (((Uint64)tmpTab.MinRowsHigh) << 32) + tmpTab.MinRowsLow; + + tmpTab.SingleUserMode = impl.m_single_user_mode; tmpTab.FragmentType = getKernelConstant(impl.m_fragmentType, fragmentTypeMapping, @@ -1956,13 +2049,19 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName, NdbIndexImpl* idx; if(NdbDictInterface::create_index_obj_from_table(&idx, tab, prim) == 0){ idx->m_table = tab; - idx->m_externalName.assign(externalName); - idx->m_internalName.assign(internalName); + if (!idx->m_externalName.assign(externalName) || + !idx->m_internalName.assign(internalName)) + { + delete idx; + m_error.code = 4000; + return 0; + } // TODO Assign idx to tab->m_index // Don't do it right now since assign can't asign a table with index // tab->m_index = idx; return idx; } + m_error.code = 4000; return 0; } @@ -1971,11 +2070,21 @@ NdbDictInterface::create_index_obj_from_table(NdbIndexImpl** dst, NdbTableImpl* tab, const NdbTableImpl* prim){ NdbIndexImpl *idx = new NdbIndexImpl(); + if (idx == NULL) + { + errno = ENOMEM; + return -1; + } idx->m_version = tab->m_version; idx->m_status = tab->m_status; idx->m_indexId = tab->m_tableId; - idx->m_externalName.assign(tab->getName()); - idx->m_tableName.assign(prim->m_externalName); + if (!idx->m_externalName.assign(tab->getName()) || + !idx->m_tableName.assign(prim->m_externalName)) + { + delete idx; + errno = ENOMEM; + return -1; + } NdbDictionary::Index::Type type = idx->m_type = tab->m_indexType; idx->m_logging = tab->m_logging; // skip last attribute (NDB$PK or NDB$TNODE) @@ -1988,9 +2097,20 @@ NdbDictInterface::create_index_obj_from_table(NdbIndexImpl** dst, NdbColumnImpl* org = tab->m_columns[i]; NdbColumnImpl* col = new NdbColumnImpl; + if (col == NULL) + { + errno = ENOMEM; + delete idx; + return -1; + } // Copy column definition *col = * org; - idx->m_columns.push_back(col); + if (idx->m_columns.push_back(col)) + { + delete col; + delete idx; + return -1; + } /** * reverse map @@ -2056,7 +2176,11 @@ NdbDictInterface::createIndex(Ndb & ndb, } const BaseString internalName( ndb.internalize_index_name(&table, impl.getName())); - impl.m_internalName.assign(internalName); + if (!impl.m_internalName.assign(internalName)) + { + m_error.code = 4000; + return -1; + } w.add(DictTabInfo::TableName, internalName.c_str()); w.add(DictTabInfo::TableLoggedFlag, impl.m_logging); @@ -2342,34 +2466,72 @@ NdbDictInterface::listObjects(NdbDictionary::Dictionary::List& list, BaseString databaseName; BaseString schemaName; BaseString objectName; + if (!databaseName || !schemaName || !objectName) + { + m_error.code= 4000; + return -1; + } if ((element.type == NdbDictionary::Object::UniqueHashIndex) || (element.type == NdbDictionary::Object::OrderedIndex)) { char * indexName = new char[n << 2]; + if (indexName == NULL) + { + m_error.code= 4000; + return -1; + } memcpy(indexName, &data[pos], n << 2); - databaseName = Ndb::getDatabaseFromInternalName(indexName); - schemaName = Ndb::getSchemaFromInternalName(indexName); + if (!(databaseName = Ndb::getDatabaseFromInternalName(indexName)) || + !(schemaName = Ndb::getSchemaFromInternalName(indexName))) + { + delete [] indexName; + m_error.code= 4000; + return -1; + } objectName = BaseString(Ndb::externalizeIndexName(indexName, fullyQualifiedNames)); delete [] indexName; } else if ((element.type == NdbDictionary::Object::SystemTable) || (element.type == NdbDictionary::Object::UserTable)) { char * tableName = new char[n << 2]; + if (tableName == NULL) + { + m_error.code= 4000; + return -1; + } memcpy(tableName, &data[pos], n << 2); - databaseName = Ndb::getDatabaseFromInternalName(tableName); - schemaName = Ndb::getSchemaFromInternalName(tableName); + if (!(databaseName = Ndb::getDatabaseFromInternalName(tableName)) || + !(schemaName = Ndb::getSchemaFromInternalName(tableName))) + { + delete [] tableName; + m_error.code= 4000; + return -1; + } objectName = BaseString(Ndb::externalizeTableName(tableName, fullyQualifiedNames)); delete [] tableName; } else { char * otherName = new char[n << 2]; + if (otherName == NULL) + { + m_error.code= 4000; + return -1; + } memcpy(otherName, &data[pos], n << 2); - objectName = BaseString(otherName); + if (!(objectName = BaseString(otherName))) + { + m_error.code= 4000; + return -1; + } delete [] otherName; } - element.database = new char[databaseName.length() + 1]; + if (!(element.database = new char[databaseName.length() + 1]) || + !(element.schema = new char[schemaName.length() + 1]) || + !(element.name = new char[objectName.length() + 1])) + { + m_error.code= 4000; + return -1; + } strcpy(element.database, databaseName.c_str()); - element.schema = new char[schemaName.length() + 1]; strcpy(element.schema, schemaName.c_str()); - element.name = new char[objectName.length() + 1]; strcpy(element.name, objectName.c_str()); pos += n; count++; @@ -2416,7 +2578,10 @@ NdbDictInterface::execLIST_TABLES_CONF(NdbApiSignal* signal, { const unsigned off = ListTablesConf::HeaderLength; const unsigned len = (signal->getLength() - off); - m_buffer.append(signal->getDataPtr() + off, len << 2); + if (m_buffer.append(signal->getDataPtr() + off, len << 2)) + { + m_error.code= 4000; + } if (signal->getLength() < ListTablesConf::SignalLength) { // last signal has less than full length m_waiter.signal(NO_WAIT); diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 6a86ee44bfb..819de921235 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -104,7 +103,7 @@ public: ~NdbTableImpl(); void init(); - void setName(const char * name); + int setName(const char * name); const char * getName() const; Uint32 m_changeMask; @@ -121,7 +120,7 @@ public: Uint32 m_columnHashMask; Vector<Uint32> m_columnHash; Vector<NdbColumnImpl *> m_columns; - void buildColumnHash(); + int buildColumnHash(); /** * Fragment info @@ -139,6 +138,7 @@ public: int m_maxLoadFactor; Uint16 m_keyLenInWords; Uint16 m_fragmentCount; + Uint8 m_single_user_mode; NdbDictionaryImpl * m_dictionary; NdbIndexImpl * m_index; @@ -166,7 +166,7 @@ public: * Equality/assign */ bool equal(const NdbTableImpl&) const; - void assign(const NdbTableImpl&); + int assign(const NdbTableImpl&); static NdbTableImpl & getImpl(NdbDictionary::Table & t); static NdbTableImpl & getImpl(const NdbDictionary::Table & t); @@ -185,9 +185,9 @@ public: ~NdbIndexImpl(); void init(); - void setName(const char * name); + int setName(const char * name); const char * getName() const; - void setTable(const char * table); + int setTable(const char * table); const char * getTable() const; const NdbTableImpl * getIndexTable() const; diff --git a/ndb/src/ndbapi/NdbErrorOut.cpp b/ndb/src/ndbapi/NdbErrorOut.cpp index 07e0b2fe6e8..703abbb8c9e 100644 --- a/ndb/src/ndbapi/NdbErrorOut.cpp +++ b/ndb/src/ndbapi/NdbErrorOut.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbEventOperation.cpp b/ndb/src/ndbapi/NdbEventOperation.cpp index e99cad918c5..2104e5da560 100644 --- a/ndb/src/ndbapi/NdbEventOperation.cpp +++ b/ndb/src/ndbapi/NdbEventOperation.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp index 9c147be9f16..f83581b8527 100644 --- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.hpp b/ndb/src/ndbapi/NdbEventOperationImpl.hpp index 96958979c76..0e5315ffb71 100644 --- a/ndb/src/ndbapi/NdbEventOperationImpl.hpp +++ b/ndb/src/ndbapi/NdbEventOperationImpl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index c668533457d..dc0a057619f 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -38,7 +37,7 @@ struct Ndb_free_list_t Ndb_free_list_t(); ~Ndb_free_list_t(); - void fill(Ndb*, Uint32 cnt); + int fill(Ndb*, Uint32 cnt); T* seize(Ndb*); void release(T*); void clear(); @@ -80,10 +79,23 @@ public: BaseString m_prefix; // Buffer for preformatted internal name <db>/<schema>/ - void update_prefix() + int update_prefix() { - m_prefix.assfmt("%s%c%s%c", m_dbname.c_str(), table_name_separator, - m_schemaname.c_str(), table_name_separator); + if (!m_prefix.assfmt("%s%c%s%c", m_dbname.c_str(), table_name_separator, + m_schemaname.c_str(), table_name_separator)) + { + return -1; + } + return 0; + } + +/* + We need this friend accessor function to work around a HP compiler problem, + where template class friends are not working. +*/ + static inline void setNdbError(Ndb &ndb,int code){ + ndb.theError.code = code; + return; } /** @@ -195,7 +207,7 @@ Ndb_free_list_t<T>::~Ndb_free_list_t() template<class T> inline -void +int Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt) { if (m_free_list == 0) @@ -203,18 +215,28 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt) m_free_cnt++; m_alloc_cnt++; m_free_list = new T(ndb); + if (m_free_list == 0) + { + NdbImpl::setNdbError(*ndb, 4000); + assert(false); + return -1; + } } while(m_alloc_cnt < cnt) { T* obj= new T(ndb); if(obj == 0) - return; - + { + NdbImpl::setNdbError(*ndb, 4000); + assert(false); + return -1; + } obj->next(m_free_list); m_free_cnt++; m_alloc_cnt++; m_free_list = obj; } + return 0; } template<class T> @@ -235,7 +257,11 @@ Ndb_free_list_t<T>::seize(Ndb* ndb) { m_alloc_cnt++; } - + else + { + NdbImpl::setNdbError(*ndb, 4000); + assert(false); + } return tmp; } diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp index 853bab09c41..c2231149fbd 100644 --- a/ndb/src/ndbapi/NdbIndexOperation.cpp +++ b/ndb/src/ndbapi/NdbIndexOperation.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -245,8 +244,6 @@ NdbIndexOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransactionId) // Simple state is set if start and commit is set and it is // a read request. Otherwise it is set to zero. //------------------------------------------------------------- - Uint8 tReadInd = (theOperationType == ReadRequest); - Uint8 tSimpleState = tReadInd & tSimpleAlt; //theNdbCon->theSimpleState = tSimpleState; tcKeyReq->transId1 = tTransId1; diff --git a/ndb/src/ndbapi/NdbLinHash.hpp b/ndb/src/ndbapi/NdbLinHash.hpp index 0655e81ce9d..f0399d30233 100644 --- a/ndb/src/ndbapi/NdbLinHash.hpp +++ b/ndb/src/ndbapi/NdbLinHash.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp index ca08c39e070..51b6a3f6dab 100644 --- a/ndb/src/ndbapi/NdbOperation.cpp +++ b/ndb/src/ndbapi/NdbOperation.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -177,7 +176,11 @@ NdbOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection){ tcKeyReq->scanInfo = 0; theKEYINFOptr = &tcKeyReq->keyInfo[0]; theATTRINFOptr = &tcKeyReq->attrInfo[0]; - theReceiver.init(NdbReceiver::NDB_OPERATION, this); + if (theReceiver.init(NdbReceiver::NDB_OPERATION, this)) + { + // theReceiver sets the error code of its owner + return -1; + } return 0; } @@ -319,13 +322,31 @@ NdbOperation::setValue( Uint32 anAttrId, NdbBlob* NdbOperation::getBlobHandle(const char* anAttrName) { - return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrName)); + const NdbColumnImpl* col = m_currentTable->getColumn(anAttrName); + if (col == NULL) + { + setErrorCode(4004); + return NULL; + } + else + { + return getBlobHandle(theNdbCon, col); + } } NdbBlob* NdbOperation::getBlobHandle(Uint32 anAttrId) { - return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrId)); + const NdbColumnImpl* col = m_currentTable->getColumn(anAttrId); + if (col == NULL) + { + setErrorCode(4004); + return NULL; + } + else + { + return getBlobHandle(theNdbCon, col); + } } int diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp index 835e33dfb40..95e90609f9b 100644 --- a/ndb/src/ndbapi/NdbOperationDefine.cpp +++ b/ndb/src/ndbapi/NdbOperationDefine.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -323,6 +322,36 @@ NdbOperation::interpretedDeleteTuple() }//if }//NdbOperation::interpretedDeleteTuple() +void +NdbOperation::setReadLockMode(LockMode lockMode) +{ + /* We only support changing lock mode for read operations at this time. */ + assert(theOperationType == ReadRequest || theOperationType == ReadExclusive); + switch (lockMode) + { + case LM_CommittedRead: + theOperationType= ReadRequest; + theSimpleIndicator= 1; + theDirtyIndicator= 1; + break; + case LM_Read: + theNdbCon->theSimpleState= 0; + theOperationType= ReadRequest; + theSimpleIndicator= 0; + theDirtyIndicator= 0; + break; + case LM_Exclusive: + theNdbCon->theSimpleState= 0; + theOperationType= ReadExclusive; + theSimpleIndicator= 0; + theDirtyIndicator= 0; + break; + default: + /* Not supported / invalid. */ + assert(false); + } + theLockMode= lockMode; +} /****************************************************************************** @@ -407,10 +436,10 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, const char* aValuePassed, Uint32 len) { DBUG_ENTER("NdbOperation::setValue"); - DBUG_PRINT("enter", ("col=%s op=%d val=0x%x len=%u", + DBUG_PRINT("enter", ("col: %s op: %d val: 0x%lx len: %u", tAttrInfo->m_name.c_str(), theOperationType, - aValuePassed, len)); + (long) aValuePassed, len)); if (aValuePassed != NULL) DBUG_DUMP("value", (char*)aValuePassed, len); @@ -534,8 +563,7 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, }//if const Uint32 totalSizeInWords = (sizeInBytes + 3)/4; // Including bits in last word const Uint32 sizeInWords = sizeInBytes / 4; // Excluding bits in last word - AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, - totalSizeInWords); + (void) AttributeHeader::init(&ahValue, tAttrId, totalSizeInWords); insertATTRINFO( ahValue ); /*********************************************************************** diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index 58a816e3c1a..feff9ed5f36 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -177,8 +176,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) // Simple state is set if start and commit is set and it is // a read request. Otherwise it is set to zero. //------------------------------------------------------------- - Uint8 tReadInd = (theOperationType == ReadRequest); - Uint8 tSimpleState = tReadInd & tSimpleIndicator; tcKeyReq->transId1 = tTransId1; tcKeyReq->transId2 = tTransId2; @@ -205,7 +202,7 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) tcKeyReq->setKeyLength(tReqInfo, tTupKeyLen); // A simple read is always ignore error - abortOption = tSimpleIndicator ? AO_IgnoreError : abortOption; + abortOption = tSimpleIndicator ? (Uint8) AO_IgnoreError : abortOption; tcKeyReq->setAbortOption(tReqInfo, abortOption); Uint8 tDistrKeyIndicator = theDistrKeyIndicator_; diff --git a/ndb/src/ndbapi/NdbOperationInt.cpp b/ndb/src/ndbapi/NdbOperationInt.cpp index 41e0cb1d140..24e77363fb5 100644 --- a/ndb/src/ndbapi/NdbOperationInt.cpp +++ b/ndb/src/ndbapi/NdbOperationInt.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -1015,8 +1014,8 @@ NdbOperation::branch_col(Uint32 type, bool nopad, Uint32 Label){ DBUG_ENTER("NdbOperation::branch_col"); - DBUG_PRINT("enter", ("type=%u col=%u val=0x%x len=%u label=%u", - type, ColId, val, len, Label)); + DBUG_PRINT("enter", ("type: %u col:%u val: 0x%lx len: %u label: %u", + type, ColId, (long) val, len, Label)); if (val != NULL) DBUG_DUMP("value", (char*)val, len); diff --git a/ndb/src/ndbapi/NdbOperationScan.cpp b/ndb/src/ndbapi/NdbOperationScan.cpp index 283eb591bdb..aad24159455 100644 --- a/ndb/src/ndbapi/NdbOperationScan.cpp +++ b/ndb/src/ndbapi/NdbOperationScan.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp index 4be7ccb313c..a3e3f7a7a91 100644 --- a/ndb/src/ndbapi/NdbOperationSearch.cpp +++ b/ndb/src/ndbapi/NdbOperationSearch.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -58,16 +57,15 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo, Uint32 aVariableKeyLen) { DBUG_ENTER("NdbOperation::equal_impl"); - DBUG_PRINT("enter", ("col=%s op=%d val=0x%x len=%u", + DBUG_PRINT("enter", ("col: %s op: %d val: 0x%lx len: %u", tAttrInfo->m_name.c_str(), theOperationType, - aValuePassed, aVariableKeyLen)); + (long) aValuePassed, aVariableKeyLen)); if (aValuePassed != NULL) DBUG_DUMP("value", (char*)aValuePassed, aVariableKeyLen); register Uint32 tAttrId; - Uint32 tData; Uint32 tKeyInfoPosition; const char* aValue = aValuePassed; Uint64 tempData[512]; @@ -347,7 +345,6 @@ NdbOperation::insertKEYINFO(const char* aValue, Uint32 tEndPos; Uint32 tPos; Uint32 signalCounter; - Uint32 tData; /***************************************************************************** * Calculate the end position of the attribute in the key information. * @@ -514,7 +511,6 @@ NdbOperation::handle_distribution_key(const Uint64* value, Uint32 len) * Copy distribution key to linear memory */ NdbColumnImpl* const * cols = m_accessTable->m_columns.getBase(); - Uint32 len = 0; Uint64 tmp[1000]; Uint32 chunk = 8; diff --git a/ndb/src/ndbapi/NdbPool.cpp b/ndb/src/ndbapi/NdbPool.cpp index a8263f564f1..9a83cade52b 100644 --- a/ndb/src/ndbapi/NdbPool.cpp +++ b/ndb/src/ndbapi/NdbPool.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbPoolImpl.cpp b/ndb/src/ndbapi/NdbPoolImpl.cpp index 32e0a6f1410..e5d1b000601 100644 --- a/ndb/src/ndbapi/NdbPoolImpl.cpp +++ b/ndb/src/ndbapi/NdbPoolImpl.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbPoolImpl.hpp b/ndb/src/ndbapi/NdbPoolImpl.hpp index cd36f30e90b..f4dbaf009cb 100644 --- a/ndb/src/ndbapi/NdbPoolImpl.hpp +++ b/ndb/src/ndbapi/NdbPoolImpl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 771da56523c..8de163d1c22 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -56,7 +55,7 @@ NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue) if (theStorageX) delete[] theStorageX; - + // check alignment to signal data // a future version could check alignment per data type as well @@ -84,6 +83,7 @@ NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue) theRef = tRef; return 0; } + errno = ENOMEM; return -1; } @@ -103,7 +103,11 @@ NdbRecAttr::copyout() NdbRecAttr * NdbRecAttr::clone() const { NdbRecAttr * ret = new NdbRecAttr(0); - + if (ret == NULL) + { + errno = ENOMEM; + return NULL; + } ret->theAttrId = theAttrId; ret->theNULLind = theNULLind; ret->theAttrSize = theAttrSize; @@ -117,6 +121,12 @@ NdbRecAttr::clone() const { ret->theValue = 0; } else { ret->theStorageX = new Uint64[((n + 7) >> 3)]; + if (ret->theStorageX == NULL) + { + delete ret; + errno = ENOMEM; + return NULL; + } ret->theRef = (char*)ret->theStorageX; ret->theValue = 0; } @@ -141,8 +151,24 @@ NdbRecAttr::receive_data(const Uint32 * data, Uint32 sz){ return false; } +NdbRecordPrintFormat::NdbRecordPrintFormat() +{ + fields_terminated_by= ";"; + start_array_enclosure= "["; + end_array_enclosure= "]"; + fields_enclosed_by= ""; + fields_optionally_enclosed_by= "\""; + lines_terminated_by= "\n"; + hex_prefix= "H'"; + null_string= "[NULL]"; + hex_format= 0; +} +NdbRecordPrintFormat::~NdbRecordPrintFormat() {} +static const NdbRecordPrintFormat default_print_format; + static void -ndbrecattr_print_string(NdbOut& out, const char *type, +ndbrecattr_print_string(NdbOut& out, const NdbRecordPrintFormat &f, + const char *type, bool is_binary, const char *aref, unsigned sz) { const unsigned char* ref = (const unsigned char*)aref; @@ -151,6 +177,25 @@ ndbrecattr_print_string(NdbOut& out, const char *type, for (i=sz-1; i >= 0; i--) if (ref[i] == 0) sz--; else break; + if (!is_binary) + { + // trailing spaces are not printed + for (i=sz-1; i >= 0; i--) + if (ref[i] == 32) sz--; + else break; + } + if (is_binary && f.hex_format) + { + if (sz == 0) + { + out.print("0x0"); + return; + } + out.print("0x"); + for (len = 0; len < (int)sz; len++) + out.print("%02X", (int)ref[len]); + return; + } if (sz == 0) return; // empty for (len=0; len < (int)sz && ref[i] != 0; len++) @@ -171,228 +216,278 @@ ndbrecattr_print_string(NdbOut& out, const char *type, for (i= len+1; ref[i] != 0; i++) out.print("%u]",len-i); assert((int)sz > i); - ndbrecattr_print_string(out,type,aref+i,sz-i); + ndbrecattr_print_string(out,f,type,is_binary,aref+i,sz-i); } } -NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) +NdbOut& +ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, + const NdbRecordPrintFormat &f) { if (r.isNULL()) { - out << "[NULL]"; + out << f.null_string; return out; } - + const NdbDictionary::Column* c = r.getColumn(); uint length = c->getLength(); - if (length > 1) - out << "["; - - for (Uint32 j = 0; j < length; j++) { - if (j > 0) - out << " "; - - switch(r.getType()) + const char *fields_optionally_enclosed_by; + if (f.fields_enclosed_by[0] == '\0') + fields_optionally_enclosed_by= + f.fields_optionally_enclosed_by; + else + fields_optionally_enclosed_by= ""; + out << f.fields_enclosed_by; + Uint32 j; + switch(r.getType()){ + case NdbDictionary::Column::Bigunsigned: + out << r.u_64_value(); + break; + case NdbDictionary::Column::Bit: + out << f.hex_prefix << "0x"; { - case NdbDictionary::Column::Bigunsigned: - out << r.u_64_value(); - break; - case NdbDictionary::Column::Bit: - out << hex << "H'" << r.u_32_value() << dec; - break; - case NdbDictionary::Column::Unsigned: - out << r.u_32_value(); - break; - case NdbDictionary::Column::Smallunsigned: - out << r.u_short_value(); - break; - case NdbDictionary::Column::Tinyunsigned: - out << (unsigned) r.u_char_value(); - break; - case NdbDictionary::Column::Bigint: - out << r.int64_value(); - break; - case NdbDictionary::Column::Int: - out << r.int32_value(); - break; - case NdbDictionary::Column::Smallint: - out << r.short_value(); - break; - case NdbDictionary::Column::Tinyint: - out << (int) r.char_value(); - break; - case NdbDictionary::Column::Binary: - ndbrecattr_print_string(out,"Binary",r.aRef(),r.arraySize()); - j = r.arraySize(); - break; - case NdbDictionary::Column::Char: - ndbrecattr_print_string(out,"Char",r.aRef(),r.arraySize()); - j = length; - break; - case NdbDictionary::Column::Varchar: - { - unsigned len = *(const unsigned char*)r.aRef(); - ndbrecattr_print_string(out,"Varchar", r.aRef()+1,len); - j = length; - } - break; - case NdbDictionary::Column::Varbinary: - { - unsigned len = *(const unsigned char*)r.aRef(); - ndbrecattr_print_string(out,"Varbinary", r.aRef()+1,len); - j = length; - } - break; - case NdbDictionary::Column::Float: - out << r.float_value(); - break; - case NdbDictionary::Column::Double: - out << r.double_value(); - break; - case NdbDictionary::Column::Olddecimal: - { - short len = 1 + c->getPrecision() + (c->getScale() > 0); - out.print("%.*s", len, r.aRef()); - } - break; - case NdbDictionary::Column::Olddecimalunsigned: - { - short len = 0 + c->getPrecision() + (c->getScale() > 0); - out.print("%.*s", len, r.aRef()); - } - break; - case NdbDictionary::Column::Decimal: - case NdbDictionary::Column::Decimalunsigned: - goto unknown; // TODO - break; + const Uint32 *buf = (Uint32 *)r.aRef(); + int k = (length+31)/32; + while (k > 0 && (buf[--k] == 0)); + out.print("%X", buf[k]); + while (k > 0) + out.print("%.8X", buf[--k]); + } + break; + case NdbDictionary::Column::Unsigned: + if (length > 1) + out << f.start_array_enclosure; + out << *(Uint32*)r.aRef(); + for (j = 1; j < length; j++) + out << " " << *((Uint32*)r.aRef() + j); + if (length > 1) + out << f.end_array_enclosure; + break; + case NdbDictionary::Column::Mediumunsigned: + out << r.u_medium_value(); + break; + case NdbDictionary::Column::Smallunsigned: + out << r.u_short_value(); + break; + case NdbDictionary::Column::Tinyunsigned: + out << (unsigned) r.u_8_value(); + break; + case NdbDictionary::Column::Bigint: + out << r.int64_value(); + break; + case NdbDictionary::Column::Int: + out << r.int32_value(); + break; + case NdbDictionary::Column::Mediumint: + out << r.medium_value(); + break; + case NdbDictionary::Column::Smallint: + out << r.short_value(); + break; + case NdbDictionary::Column::Tinyint: + out << (int) r.int8_value(); + break; + case NdbDictionary::Column::Binary: + if (!f.hex_format) + out << fields_optionally_enclosed_by; + j = r.arraySize(); + ndbrecattr_print_string(out,f,"Binary", true, r.aRef(), j); + if (!f.hex_format) + out << fields_optionally_enclosed_by; + break; + case NdbDictionary::Column::Char: + out << fields_optionally_enclosed_by; + j = length; + ndbrecattr_print_string(out,f,"Char", false, r.aRef(), r.arraySize()); + out << fields_optionally_enclosed_by; + break; + case NdbDictionary::Column::Varchar: + { + out << fields_optionally_enclosed_by; + unsigned len = *(const unsigned char*)r.aRef(); + ndbrecattr_print_string(out,f,"Varchar", false, r.aRef()+1,len); + j = length; + out << fields_optionally_enclosed_by; + } + break; + case NdbDictionary::Column::Varbinary: + { + if (!f.hex_format) + out << fields_optionally_enclosed_by; + unsigned len = *(const unsigned char*)r.aRef(); + ndbrecattr_print_string(out,f,"Varbinary", true, r.aRef()+1,len); + j = length; + if (!f.hex_format) + out << fields_optionally_enclosed_by; + } + break; + case NdbDictionary::Column::Float: + out << r.float_value(); + break; + case NdbDictionary::Column::Double: + out << r.double_value(); + break; + case NdbDictionary::Column::Olddecimal: + { + short len = 1 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; + case NdbDictionary::Column::Olddecimalunsigned: + { + short len = 0 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; + case NdbDictionary::Column::Decimal: + case NdbDictionary::Column::Decimalunsigned: + goto unknown; // TODO + break; // for dates cut-and-paste from field.cc - case NdbDictionary::Column::Datetime: - { - ulonglong tmp=r.u_64_value(); - long part1,part2,part3; - part1=(long) (tmp/LL(1000000)); - part2=(long) (tmp - (ulonglong) part1*LL(1000000)); - char buf[40]; - char* pos=(char*) buf+19; - *pos--=0; - *pos--= (char) ('0'+(char) (part2%10)); part2/=10; - *pos--= (char) ('0'+(char) (part2%10)); part3= (int) (part2 / 10); - *pos--= ':'; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= ':'; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) part3); - *pos--= '/'; - *pos--= (char) ('0'+(char) (part1%10)); part1/=10; - *pos--= (char) ('0'+(char) (part1%10)); part1/=10; - *pos--= '-'; - *pos--= (char) ('0'+(char) (part1%10)); part1/=10; - *pos--= (char) ('0'+(char) (part1%10)); part3= (int) (part1/10); - *pos--= '-'; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos=(char) ('0'+(char) part3); - out << buf; - } - break; - case NdbDictionary::Column::Date: - { - uint32 tmp=(uint32) uint3korr(r.aRef()); - int part; - char buf[40]; - char *pos=(char*) buf+10; - *pos--=0; - part=(int) (tmp & 31); - *pos--= (char) ('0'+part%10); - *pos--= (char) ('0'+part/10); - *pos--= '-'; - part=(int) (tmp >> 5 & 15); - *pos--= (char) ('0'+part%10); - *pos--= (char) ('0'+part/10); - *pos--= '-'; - part=(int) (tmp >> 9); - *pos--= (char) ('0'+part%10); part/=10; - *pos--= (char) ('0'+part%10); part/=10; - *pos--= (char) ('0'+part%10); part/=10; - *pos= (char) ('0'+part); - out << buf; - } - break; - case NdbDictionary::Column::Time: - { - long tmp=(long) sint3korr(r.aRef()); - int hour=(uint) (tmp/10000); - int minute=(uint) (tmp/100 % 100); - int second=(uint) (tmp % 100); - char buf[40]; - sprintf(buf, "%02d:%02d:%02d", hour, minute, second); - out << buf; - } - break; - case NdbDictionary::Column::Year: - { - uint year = 1900 + r.u_char_value(); - char buf[40]; - sprintf(buf, "%04d", year); - out << buf; - } - break; - case NdbDictionary::Column::Timestamp: - { - time_t time = r.u_32_value(); - out << (uint)time; - } - break; - case NdbDictionary::Column::Blob: - { - const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef(); - out << h->length << ":"; - const unsigned char* p = (const unsigned char*)(h + 1); - unsigned n = r.arraySize() - sizeof(*h); - for (unsigned k = 0; k < n && k < h->length; k++) + case NdbDictionary::Column::Datetime: + { + ulonglong tmp=r.u_64_value(); + long part1,part2,part3; + part1=(long) (tmp/LL(1000000)); + part2=(long) (tmp - (ulonglong) part1*LL(1000000)); + char buf[40]; + char* pos=(char*) buf+19; + *pos--=0; + *pos--= (char) ('0'+(char) (part2%10)); part2/=10; + *pos--= (char) ('0'+(char) (part2%10)); part3= (int) (part2 / 10); + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) part3); + *pos--= '/'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= '-'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part3= (int) (part1/10); + *pos--= '-'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos=(char) ('0'+(char) part3); + out << buf; + } + break; + case NdbDictionary::Column::Date: + { + uint32 tmp=(uint32) uint3korr(r.aRef()); + int part; + char buf[40]; + char *pos=(char*) buf+10; + *pos--=0; + part=(int) (tmp & 31); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 5 & 15); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 9); + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos= (char) ('0'+part); + out << buf; + } + break; + case NdbDictionary::Column::Time: + { + long tmp=(long) sint3korr(r.aRef()); + int hour=(uint) (tmp/10000); + int minute=(uint) (tmp/100 % 100); + int second=(uint) (tmp % 100); + char buf[40]; + sprintf(buf, "%02d:%02d:%02d", hour, minute, second); + out << buf; + } + break; + case NdbDictionary::Column::Year: + { + uint year = 1900 + r.u_8_value(); + char buf[40]; + sprintf(buf, "%04d", year); + out << buf; + } + break; + case NdbDictionary::Column::Timestamp: + { + time_t time = r.u_32_value(); + out << (uint)time; + } + break; + case NdbDictionary::Column::Blob: + case NdbDictionary::Column::Text: + { + // user defined aRef() may not be aligned to Uint64 + NdbBlob::Head head; + memcpy(&head, r.aRef(), sizeof(head)); + out << head.length << ":"; + const unsigned char* p = (const unsigned char*)r.aRef() + sizeof(head); + if (r.arraySize() < sizeof(head)) + out << "***error***"; // really cannot happen + else { + unsigned n = r.arraySize() - sizeof(head); + for (unsigned k = 0; k < n && k < head.length; k++) { + if (r.getType() == NdbDictionary::Column::Blob) out.print("%02X", (int)p[k]); - j = length; - } - break; - case NdbDictionary::Column::Text: - { - const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef(); - out << h->length << ":"; - const unsigned char* p = (const unsigned char*)(h + 1); - unsigned n = r.arraySize() - sizeof(*h); - for (unsigned k = 0; k < n && k < h->length; k++) + else out.print("%c", (int)p[k]); - j = length; } - break; - case NdbDictionary::Column::Longvarchar: - { - unsigned len = uint2korr(r.aRef()); - ndbrecattr_print_string(out,"Longvarchar", r.aRef()+2,len); - j = length; - } - break; - unknown: - default: /* no print functions for the rest, just print type */ - out << (int) r.getType(); - j = length; - if (j > 1) - out << " " << j << " times"; - break; } - } + j = length; + } + break; + case NdbDictionary::Column::Longvarchar: + { + out << fields_optionally_enclosed_by; + unsigned len = uint2korr(r.aRef()); + ndbrecattr_print_string(out,f,"Longvarchar", false, r.aRef()+2,len); + j = length; + out << fields_optionally_enclosed_by; + } + break; + case NdbDictionary::Column::Longvarbinary: + { + if (!f.hex_format) + out << fields_optionally_enclosed_by; + unsigned len = uint2korr(r.aRef()); + ndbrecattr_print_string(out,f,"Longvarbinary", true, r.aRef()+2,len); + j = length; + if (!f.hex_format) + out << fields_optionally_enclosed_by; + } + break; - if (length > 1) - { - out << "]"; + case NdbDictionary::Column::Undefined: + unknown: + //default: /* no print functions for the rest, just print type */ + out << (int) r.getType(); + j = length; + if (j > 1) + out << " " << j << " times"; + break; + } + out << f.fields_enclosed_by; } return out; } +NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) +{ + return ndbrecattr_print_formatted(out, r, default_print_format); +} + Int64 NdbRecAttr::int64_value() const { @@ -424,3 +519,15 @@ NdbRecAttr::double_value() const memcpy(&val,theRef,sizeof(val)); return val; } + +Int32 +NdbRecAttr::medium_value() const +{ + return sint3korr((unsigned char *)theRef); +} + +Uint32 +NdbRecAttr::u_medium_value() const +{ + return uint3korr((unsigned char*)theRef); +} diff --git a/ndb/src/ndbapi/NdbReceiver.cpp b/ndb/src/ndbapi/NdbReceiver.cpp index 62119880076..46ca59f2f42 100644 --- a/ndb/src/ndbapi/NdbReceiver.cpp +++ b/ndb/src/ndbapi/NdbReceiver.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -33,7 +32,7 @@ NdbReceiver::NdbReceiver(Ndb *aNdb) : { theCurrentRecAttr = theFirstRecAttr = 0; m_defined_rows = 0; - m_rows = new NdbRecAttr*[0]; + m_rows = NULL; } NdbReceiver::~NdbReceiver() @@ -46,19 +45,26 @@ NdbReceiver::~NdbReceiver() DBUG_VOID_RETURN; } -void +int NdbReceiver::init(ReceiverType type, void* owner) { theMagicNumber = 0x11223344; m_type = type; m_owner = owner; + theFirstRecAttr = NULL; + theCurrentRecAttr = NULL; if (m_id == NdbObjectIdMap::InvalidId) { if (m_ndb) + { m_id = m_ndb->theImpl->theNdbObjectIdMap.map(this); + if (m_id == NdbObjectIdMap::InvalidId) + { + setErrorCode(4000); + return -1; + } + } } - - theFirstRecAttr = NULL; - theCurrentRecAttr = NULL; + return 0; } void @@ -147,7 +153,7 @@ NdbReceiver::calculate_batch_size(Uint32 key_size, return; } -void +int NdbReceiver::do_get_value(NdbReceiver * org, Uint32 rows, Uint32 key_size, @@ -155,7 +161,11 @@ NdbReceiver::do_get_value(NdbReceiver * org, if(rows > m_defined_rows){ delete[] m_rows; m_defined_rows = rows; - m_rows = new NdbRecAttr*[rows + 1]; + if ((m_rows = new NdbRecAttr*[rows + 1]) == NULL) + { + setErrorCode(4000); + return -1; + } } m_rows[rows] = 0; @@ -175,7 +185,7 @@ NdbReceiver::do_get_value(NdbReceiver * org, // Put key-recAttr fir on each row if(key_size && !getValue(&key, (char*)0)){ abort(); - return ; // -1 + return -1; } if(range_no && @@ -194,7 +204,7 @@ NdbReceiver::do_get_value(NdbReceiver * org, if(tRecAttr){ abort(); - return ;// -1; + return -1; } // Store first recAttr for each row in m_rows[i] @@ -206,7 +216,7 @@ NdbReceiver::do_get_value(NdbReceiver * org, } prepareSend(); - return; + return 0; } NdbRecAttr* diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index b39fd10fe95..fb47772fdea 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -32,6 +31,7 @@ class NdbScanFilterImpl { public: + NdbScanFilterImpl() {} struct State { NdbScanFilter::Group m_group; Uint32 m_popCount; @@ -42,7 +42,9 @@ public: int m_label; State m_current; + Uint32 m_negative; //used for translating NAND/NOR to AND/OR, equal 0 or 1 Vector<State> m_stack; + Vector<Uint32> m_stack2; //to store info of m_negative NdbOperation * m_operation; Uint32 m_latestAttrib; @@ -66,6 +68,7 @@ NdbScanFilter::NdbScanFilter(class NdbOperation * op) m_impl.m_label = 0; m_impl.m_latestAttrib = ~0; m_impl.m_operation = op; + m_impl.m_negative = 0; } NdbScanFilter::~NdbScanFilter(){ @@ -75,18 +78,43 @@ NdbScanFilter::~NdbScanFilter(){ int NdbScanFilter::begin(Group group){ + if (m_impl.m_stack2.push_back(m_impl.m_negative)) + { + m_impl.m_operation->setErrorCodeAbort(4000); + return -1; + } switch(group){ case NdbScanFilter::AND: INT_DEBUG(("Begin(AND)")); + if(m_impl.m_negative == 1){ + group = NdbScanFilter::OR; + } break; case NdbScanFilter::OR: INT_DEBUG(("Begin(OR)")); + if(m_impl.m_negative == 1){ + group = NdbScanFilter::AND; + } break; case NdbScanFilter::NAND: INT_DEBUG(("Begin(NAND)")); + if(m_impl.m_negative == 0){ + group = NdbScanFilter::OR; + m_impl.m_negative = 1; + }else{ + group = NdbScanFilter::AND; + m_impl.m_negative = 0; + } break; case NdbScanFilter::NOR: INT_DEBUG(("Begin(NOR)")); + if(m_impl.m_negative == 0){ + group = NdbScanFilter::AND; + m_impl.m_negative = 1; + }else{ + group = NdbScanFilter::OR; + m_impl.m_negative = 0; + } break; } @@ -103,7 +131,11 @@ NdbScanFilter::begin(Group group){ } NdbScanFilterImpl::State tmp = m_impl.m_current; - m_impl.m_stack.push_back(m_impl.m_current); + if (m_impl.m_stack.push_back(m_impl.m_current)) + { + m_impl.m_operation->setErrorCodeAbort(4000); + return -1; + } m_impl.m_current.m_group = group; m_impl.m_current.m_ownLabel = m_impl.m_label++; m_impl.m_current.m_popCount = 0; @@ -130,6 +162,13 @@ NdbScanFilter::begin(Group group){ int NdbScanFilter::end(){ + if(m_impl.m_stack2.size() == 0){ + m_impl.m_operation->setErrorCodeAbort(4259); + return -1; + } + m_impl.m_negative = m_impl.m_stack2.back(); + m_impl.m_stack2.erase(m_impl.m_stack2.size() - 1); + switch(m_impl.m_current.m_group){ case NdbScanFilter::AND: INT_DEBUG(("End(AND pc=%d)", m_impl.m_current.m_popCount)); @@ -151,6 +190,10 @@ NdbScanFilter::end(){ } NdbScanFilterImpl::State tmp = m_impl.m_current; + if(m_impl.m_stack.size() == 0){ + m_impl.m_operation->setErrorCodeAbort(4259); + return -1; + } m_impl.m_current = m_impl.m_stack.back(); m_impl.m_stack.erase(m_impl.m_stack.size() - 1); @@ -293,12 +336,18 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){ int NdbScanFilter::isnull(int AttrId){ - return m_impl.cond_col(Interpreter::IS_NULL, AttrId); + if(m_impl.m_negative == 1) + return m_impl.cond_col(Interpreter::IS_NOT_NULL, AttrId); + else + return m_impl.cond_col(Interpreter::IS_NULL, AttrId); } int NdbScanFilter::isnotnull(int AttrId){ - return m_impl.cond_col(Interpreter::IS_NOT_NULL, AttrId); + if(m_impl.m_negative == 1) + return m_impl.cond_col(Interpreter::IS_NULL, AttrId); + else + return m_impl.cond_col(Interpreter::IS_NOT_NULL, AttrId); } struct tab3 { @@ -395,8 +444,17 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op, m_operation->setErrorCodeAbort(4260); return -1; } + + StrBranch2 branch; + if(m_negative == 1){ //change NdbOperation to its negative + if(m_current.m_group == NdbScanFilter::AND) + branch = table3[op].m_branches[(Uint32)(m_current.m_group) + 1]; + if(m_current.m_group == NdbScanFilter::OR) + branch = table3[op].m_branches[(Uint32)(m_current.m_group) - 1]; + }else{ + branch = table3[op].m_branches[(Uint32)(m_current.m_group)]; + } - StrBranch2 branch = table3[op].m_branches[m_current.m_group]; const NdbDictionary::Column * col = m_operation->m_currentTable->getColumn(AttrId); diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 628d7551a52..aec98a7f5d5 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -137,31 +136,6 @@ NdbScanOperation::readTuples(NdbScanOperation::LockMode lm, } theNdbCon->theScanningOp = this; - theLockMode = lm; - - bool lockExcl, lockHoldMode, readCommitted; - switch(lm){ - case NdbScanOperation::LM_Read: - lockExcl = false; - lockHoldMode = true; - readCommitted = false; - break; - case NdbScanOperation::LM_Exclusive: - lockExcl = true; - lockHoldMode = true; - readCommitted = false; - break; - case NdbScanOperation::LM_CommittedRead: - lockExcl = false; - lockHoldMode = false; - readCommitted = true; - break; - default: - setErrorCode(4003); - return -1; - } - - m_keyInfo = ((scan_flags & SF_KeyInfo) || lockExcl) ? 1 : 0; bool rangeScan = false; if (m_accessTable->m_indexType == NdbDictionary::Index::OrderedIndex) @@ -211,13 +185,13 @@ NdbScanOperation::readTuples(NdbScanOperation::LockMode lm, Uint32 reqInfo = 0; ScanTabReq::setParallelism(reqInfo, parallel); ScanTabReq::setScanBatch(reqInfo, 0); - ScanTabReq::setLockMode(reqInfo, lockExcl); - ScanTabReq::setHoldLockFlag(reqInfo, lockHoldMode); - ScanTabReq::setReadCommittedFlag(reqInfo, readCommitted); ScanTabReq::setRangeScanFlag(reqInfo, rangeScan); ScanTabReq::setTupScanFlag(reqInfo, tupScan); req->requestInfo = reqInfo; + m_keyInfo = (scan_flags & SF_KeyInfo) ? 1 : 0; + setReadLockMode(lm); + Uint64 transId = theNdbCon->getTransactionId(); req->transId1 = (Uint32) transId; req->transId2 = (Uint32) (transId >> 32); @@ -237,6 +211,41 @@ NdbScanOperation::readTuples(NdbScanOperation::LockMode lm, return 0; } +void +NdbScanOperation::setReadLockMode(LockMode lockMode) +{ + bool lockExcl, lockHoldMode, readCommitted; + switch (lockMode) + { + case LM_CommittedRead: + lockExcl= false; + lockHoldMode= false; + readCommitted= true; + break; + case LM_Read: + lockExcl= false; + lockHoldMode= true; + readCommitted= false; + break; + case LM_Exclusive: + lockExcl= true; + lockHoldMode= true; + readCommitted= false; + m_keyInfo= 1; + break; + default: + /* Not supported / invalid. */ + assert(false); + } + theLockMode= lockMode; + ScanTabReq *req= CAST_PTR(ScanTabReq, theSCAN_TABREQ->getDataPtrSend()); + Uint32 reqInfo= req->requestInfo; + ScanTabReq::setLockMode(reqInfo, lockExcl); + ScanTabReq::setHoldLockFlag(reqInfo, lockHoldMode); + ScanTabReq::setReadCommittedFlag(reqInfo, readCommitted); + req->requestInfo= reqInfo; +} + int NdbScanOperation::fix_receivers(Uint32 parallel){ assert(parallel > 0); @@ -507,6 +516,8 @@ int NdbScanOperation::nextResultImpl(bool fetchAllowed, bool forceSend) int return_code = theNdb->receiveResponse(3*timeout); if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) { continue; + } else if(return_code == -1){ + retVal = -1; } else { idx = last; retVal = -2; //return_code; @@ -651,9 +662,9 @@ NdbScanOperation::doSend(int ProcessorId) void NdbScanOperation::close(bool forceSend, bool releaseOp) { DBUG_ENTER("NdbScanOperation::close"); - DBUG_PRINT("enter", ("this=%x tcon=%x con=%x force=%d release=%d", - (UintPtr)this, - (UintPtr)m_transConnection, (UintPtr)theNdbCon, + DBUG_PRINT("enter", ("this: 0x%lx tcon: 0x%lx con: 0x%lx force: %d release: %d", + (long)this, + (long)m_transConnection, (long)theNdbCon, forceSend, releaseOp)); if(m_transConnection){ @@ -796,9 +807,12 @@ int NdbScanOperation::prepareSendScan(Uint32 aTC_ConnectPtr, req->requestInfo = reqInfo; for(Uint32 i = 0; i<theParallelism; i++){ - m_receivers[i]->do_get_value(&theReceiver, batch_size, - key_size, - m_read_range_no); + if (m_receivers[i]->do_get_value(&theReceiver, batch_size, + key_size, + m_read_range_no)) + { + return -1; + } } return 0; } @@ -828,7 +842,6 @@ NdbScanOperation::doSendScan(int aProcessorId) tSignal = theSCAN_TABREQ; Uint32 tupKeyLen = theTupKeyLen; - Uint32 len = theTotalNrOfKeyWordInSignal; Uint32 aTC_ConnectPtr = theNdbCon->theTCConPtr; Uint64 transId = theNdbCon->theTransactionId; @@ -1187,7 +1200,7 @@ NdbIndexScanOperation::setBound(const NdbColumnImpl* tAttrInfo, * so it's safe to use [tIndexAttrId] * (instead of looping as is NdbOperation::equal_impl) */ - if(type == BoundEQ && tDistrKey) + if(type == BoundEQ && tDistrKey && !m_multi_range) { theNoOfTupKeyLeft--; return handle_distribution_key((Uint64*)aValue, sizeInWords); @@ -1248,7 +1261,8 @@ NdbIndexScanOperation::readTuples(LockMode lm, const bool order_by = scan_flags & SF_OrderBy; const bool order_desc = scan_flags & SF_Descending; const bool read_range_no = scan_flags & SF_ReadRangeNo; - + m_multi_range = scan_flags & SF_MultiRange; + int res = NdbScanOperation::readTuples(lm, scan_flags, parallel, batch); if(!res && read_range_no) { @@ -1298,8 +1312,6 @@ NdbIndexScanOperation::fix_get_values(){ Uint32 cnt = m_accessTable->getNoOfColumns() - 1; assert(cnt < NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY); - const NdbIndexImpl * idx = m_accessTable->m_index; - const NdbTableImpl * tab = m_currentTable; for(Uint32 i = 0; i<cnt; i++){ Uint32 val = theTupleKeyDefined[i][0]; switch(val){ @@ -1398,7 +1410,11 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed, continue; } if(DEBUG_NEXT_RESULT) ndbout_c("return -1"); - setErrorCode(4028); + if(return_code == -1){ + setErrorCode(4008); + } else { + setErrorCode(4028); + } return -1; } @@ -1711,6 +1727,12 @@ NdbIndexScanOperation::reset_bounds(bool forceSend){ int NdbIndexScanOperation::end_of_bound(Uint32 no) { + DBUG_ENTER("end_of_bound"); + DBUG_PRINT("info", ("Range number %u", no)); + /* Check that SF_MultiRange has been specified if more + than one range is specified */ + if (no > 0 && !m_multi_range) + DBUG_RETURN(-1); if(no < (1 << 13)) // Only 12-bits no of ranges { Uint32 bound_head = * m_first_bound_word; @@ -1719,9 +1741,9 @@ NdbIndexScanOperation::end_of_bound(Uint32 no) m_first_bound_word = theKEYINFOptr + theTotalNrOfKeyWordInSignal;; m_this_bound_start = theTupKeyLen; - return 0; + DBUG_RETURN(0); } - return -1; + DBUG_RETURN(-1); } int diff --git a/ndb/src/ndbapi/NdbTransaction.cpp b/ndb/src/ndbapi/NdbTransaction.cpp index 1be11254fc3..f5076ff2020 100644 --- a/ndb/src/ndbapi/NdbTransaction.cpp +++ b/ndb/src/ndbapi/NdbTransaction.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -82,6 +81,7 @@ NdbTransaction::NdbTransaction( Ndb* aNdb ) : { theListState = NotInList; theError.code = 0; + //theId = NdbObjectIdMap::InvalidId; theId = theNdb->theImpl->theNdbObjectIdMap.map(this); #define CHECK_SZ(mask, sz) assert((sizeof(mask)/sizeof(mask[0])) == sz) @@ -107,7 +107,7 @@ void init(); Remark: Initialise connection object for new transaction. *****************************************************************************/ -void +int NdbTransaction::init() { theListState = NotInList; @@ -148,6 +148,17 @@ NdbTransaction::init() // theBlobFlag = false; thePendingBlobOps = 0; + if (theId == NdbObjectIdMap::InvalidId) + { + theId = theNdb->theImpl->theNdbObjectIdMap.map(this); + if (theId == NdbObjectIdMap::InvalidId) + { + theError.code = 4000; + return -1; + } + } + return 0; + }//NdbTransaction::init() /***************************************************************************** @@ -531,8 +542,8 @@ NdbTransaction::executeAsynchPrepare( ExecType aTypeOfExec, AbortOption abortOption) { DBUG_ENTER("NdbTransaction::executeAsynchPrepare"); - DBUG_PRINT("enter", ("aTypeOfExec: %d, aCallback: %x, anyObject: %x", - aTypeOfExec, aCallback, anyObject)); + DBUG_PRINT("enter", ("aTypeOfExec: %d, aCallback: 0x%lx, anyObject: Ox%lx", + aTypeOfExec, (long) aCallback, (long) anyObject)); /** * Reset error.code on execute @@ -695,6 +706,17 @@ NdbTransaction::executeAsynchPrepare( ExecType aTypeOfExec, DBUG_VOID_RETURN; }//NdbTransaction::executeAsynchPrepare() +void +NdbTransaction::executeAsynch(ExecType aTypeOfExec, + NdbAsynchCallback aCallback, + void* anyObject, + AbortOption abortOption, + int forceSend) +{ + executeAsynchPrepare(aTypeOfExec, aCallback, anyObject, abortOption); + theNdb->sendPreparedTransactions(forceSend); +} + void NdbTransaction::close() { theNdb->closeTransaction(this); @@ -1011,7 +1033,8 @@ void NdbTransaction::releaseExecutedScanOperation(NdbIndexScanOperation* cursorOp) { DBUG_ENTER("NdbTransaction::releaseExecutedScanOperation"); - DBUG_PRINT("enter", ("this=0x%x op=0x%x", (UintPtr)this, (UintPtr)cursorOp)); + DBUG_PRINT("enter", ("this: 0x%lx op=0x%lx", + (long)this, (long)cursorOp)); releaseScanOperation(&m_firstExecutedScanOp, 0, cursorOp); @@ -1234,9 +1257,9 @@ NdbTransaction::getNdbIndexScanOperation(const NdbIndexImpl* index, if(tOp) { tOp->m_currentTable = table; + // Mark that this really an NdbIndexScanOperation + tOp->m_type = NdbOperation::OrderedIndexScan; } - // Mark that this really an NdbIndexScanOperation - tOp->m_type = NdbOperation::OrderedIndexScan; return tOp; } else { setOperationErrorCodeAbort(4271); diff --git a/ndb/src/ndbapi/NdbTransactionScan.cpp b/ndb/src/ndbapi/NdbTransactionScan.cpp index 4c507f6ab8c..a2bbf45fbb5 100644 --- a/ndb/src/ndbapi/NdbTransactionScan.cpp +++ b/ndb/src/ndbapi/NdbTransactionScan.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbUtil.cpp b/ndb/src/ndbapi/NdbUtil.cpp index 6019ea675a1..c0087e51777 100644 --- a/ndb/src/ndbapi/NdbUtil.cpp +++ b/ndb/src/ndbapi/NdbUtil.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp index 268f6c69e6f..f76b21cfceb 100644 --- a/ndb/src/ndbapi/NdbUtil.hpp +++ b/ndb/src/ndbapi/NdbUtil.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/NdbWaiter.hpp b/ndb/src/ndbapi/NdbWaiter.hpp index 8b7b2a75879..c6154044ead 100644 --- a/ndb/src/ndbapi/NdbWaiter.hpp +++ b/ndb/src/ndbapi/NdbWaiter.hpp @@ -1,8 +1,7 @@ /* Copyright (C) 2003 MySQL 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/Ndberr.cpp b/ndb/src/ndbapi/Ndberr.cpp index ad0b4eafcb4..4a237a561b7 100644 --- a/ndb/src/ndbapi/Ndberr.cpp +++ b/ndb/src/ndbapi/Ndberr.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index 0c52e6bd120..d404436be59 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -193,11 +192,11 @@ void Ndb::connected(Uint32 ref) ((Uint64)tmpTheNode << 40); theFirstTransId += theFacade->m_max_trans_id; // assert(0); - DBUG_PRINT("info",("connected with ref=%x, id=%d, no_db_nodes=%d, first_trans_id=%lx", + DBUG_PRINT("info",("connected with ref=%x, id=%d, no_db_nodes=%d, first_trans_id: 0x%lx", theMyRef, tmpTheNode, theImpl->theNoOfDBnodes, - theFirstTransId)); + (long) theFirstTransId)); theCommitAckSignal = new NdbApiSignal(theMyRef); theDictionary->m_receiver.m_reference= theMyRef; @@ -817,8 +816,9 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) InvalidSignal: #ifdef VM_TRACE ndbout_c("Ndbif: Error Ndb::handleReceivedSignal " - "(GSN=%d, theImpl->theWaiter.m_state=%d)" + "(tFirstDataPtr=%p, GSN=%d, theImpl->theWaiter.m_state=%d)" " sender = (Block: %d Node: %d)", + tFirstDataPtr, tSignalNumber, tWaitState, refToBlock(aSignal->theSendersBlockRef), diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 40cac675b21..35ad7882e78 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -39,7 +38,7 @@ Ndb::Ndb( Ndb_cluster_connection *ndb_cluster_connection, : theImpl(NULL) { DBUG_ENTER("Ndb::Ndb()"); - DBUG_PRINT("enter",("Ndb::Ndb this=0x%x", this)); + DBUG_PRINT("enter",("Ndb::Ndb this: 0x%lx", (long) this)); setup(ndb_cluster_connection, aDataBase, aSchema); DBUG_VOID_RETURN; } @@ -115,7 +114,7 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, Ndb::~Ndb() { DBUG_ENTER("Ndb::~Ndb()"); - DBUG_PRINT("enter",("Ndb::~Ndb this=0x%x",this)); + DBUG_PRINT("enter",("Ndb::~Ndb this: 0x%lx",(long) this)); doDisconnect(); if (TransporterFacade::instance() != NULL && theNdbBlockNumber > 0){ diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index f82348fc91d..443f9bb42fc 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -75,7 +74,10 @@ Ndb::checkFailedNode() int Ndb::createConIdleList(int aNrOfCon) { - theImpl->theConIdleList.fill(this, aNrOfCon); + if (theImpl->theConIdleList.fill(this, aNrOfCon)) + { + return -1; + } return aNrOfCon; } @@ -91,7 +93,10 @@ Ndb::createConIdleList(int aNrOfCon) int Ndb::createOpIdleList(int aNrOfOp) { - theImpl->theOpIdleList.fill(this, aNrOfOp); + if (theImpl->theOpIdleList.fill(this, aNrOfOp)) + { + return -1; + } return aNrOfOp; } @@ -361,7 +366,7 @@ void Ndb::releaseScanOperation(NdbIndexScanOperation* aScanOperation) { DBUG_ENTER("Ndb::releaseScanOperation"); - DBUG_PRINT("enter", ("op=%x", (UintPtr)aScanOperation)); + DBUG_PRINT("enter", ("op: 0x%lx", (long)aScanOperation)); #ifdef ndb_release_check_dup { NdbIndexScanOperation* tOp = theScanOpIdleList; while (tOp != NULL) { diff --git a/ndb/src/ndbapi/ObjectMap.cpp b/ndb/src/ndbapi/ObjectMap.cpp new file mode 100644 index 00000000000..c87911a10d4 --- /dev/null +++ b/ndb/src/ndbapi/ObjectMap.cpp @@ -0,0 +1,62 @@ +/* Copyright (C) 2003 MySQL 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 */ + +#include "ObjectMap.hpp" + +NdbObjectIdMap::NdbObjectIdMap(NdbMutex* mutex, Uint32 sz, Uint32 eSz) +{ + m_size = 0; + m_firstFree = InvalidId; + m_map = 0; + m_mutex = mutex; + m_expandSize = eSz; + expand(sz); +#ifdef DEBUG_OBJECTMAP + ndbout_c("NdbObjectIdMap:::NdbObjectIdMap(%u)", sz); +#endif +} + +NdbObjectIdMap::~NdbObjectIdMap() +{ + free(m_map); +} + +int NdbObjectIdMap::expand(Uint32 incSize) +{ + NdbMutex_Lock(m_mutex); + Uint32 newSize = m_size + incSize; + MapEntry * tmp = (MapEntry*)realloc(m_map, newSize * sizeof(MapEntry)); + + if (likely(tmp != 0)) + { + m_map = tmp; + + for(Uint32 i = m_size; i < newSize; i++){ + m_map[i].m_next = i + 1; + } + m_firstFree = m_size; + m_map[newSize-1].m_next = InvalidId; + m_size = newSize; + } + else + { + NdbMutex_Unlock(m_mutex); + g_eventLogger.error("NdbObjectIdMap::expand: realloc(%u*%u) failed", + newSize, sizeof(MapEntry)); + return -1; + } + NdbMutex_Unlock(m_mutex); + return 0; +} diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp index c730d1ce6b1..6a8dbcbeef5 100644 --- a/ndb/src/ndbapi/ObjectMap.hpp +++ b/ndb/src/ndbapi/ObjectMap.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -21,6 +20,9 @@ //#include <NdbMutex.h> #include <NdbOut.hpp> +#include <EventLogger.hpp> +extern EventLogger g_eventLogger; + //#define DEBUG_OBJECTMAP /** @@ -47,36 +49,17 @@ private: } * m_map; NdbMutex * m_mutex; - void expand(Uint32 newSize); + int expand(Uint32 newSize); }; inline -NdbObjectIdMap::NdbObjectIdMap(NdbMutex* mutex, Uint32 sz, Uint32 eSz) { - m_size = 0; - m_firstFree = InvalidId; - m_map = 0; - m_mutex = mutex; - m_expandSize = eSz; - expand(sz); -#ifdef DEBUG_OBJECTMAP - ndbout_c("NdbObjectIdMap:::NdbObjectIdMap(%u)", sz); -#endif -} - -inline -NdbObjectIdMap::~NdbObjectIdMap(){ - free(m_map); -} - -inline Uint32 NdbObjectIdMap::map(void * object){ // lock(); - if(m_firstFree == InvalidId){ - expand(m_expandSize); - } + if(m_firstFree == InvalidId && expand(m_expandSize)) + return InvalidId; Uint32 ff = m_firstFree; m_firstFree = m_map[ff].m_next; @@ -104,7 +87,8 @@ NdbObjectIdMap::unmap(Uint32 id, void *object){ m_map[i].m_next = m_firstFree; m_firstFree = i; } else { - ndbout_c("Error: NdbObjectIdMap::::unmap(%u, 0x%x) obj=0x%x", id, object, obj); + g_eventLogger.error("NdbObjectIdMap::unmap(%u, 0x%x) obj=0x%x", + id, object, obj); return 0; } @@ -130,29 +114,4 @@ NdbObjectIdMap::getObject(Uint32 id){ } return 0; } - -inline void -NdbObjectIdMap::expand(Uint32 incSize){ - NdbMutex_Lock(m_mutex); - Uint32 newSize = m_size + incSize; - MapEntry * tmp = (MapEntry*)realloc(m_map, newSize * sizeof(MapEntry)); - - if (likely(tmp != 0)) - { - m_map = tmp; - - for(Uint32 i = m_size; i<newSize; i++){ - m_map[i].m_next = i + 1; - } - m_firstFree = m_size; - m_map[newSize-1].m_next = InvalidId; - m_size = newSize; - } - else - { - ndbout_c("NdbObjectIdMap::expand unable to expand!!"); - } - NdbMutex_Unlock(m_mutex); -} - #endif diff --git a/ndb/src/ndbapi/SignalSender.cpp b/ndb/src/ndbapi/SignalSender.cpp index 0ecc98f5f29..393524bb96e 100644 --- a/ndb/src/ndbapi/SignalSender.cpp +++ b/ndb/src/ndbapi/SignalSender.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -133,6 +132,8 @@ SignalSender::getNoOfConnectedNodes() const { SendStatus SignalSender::sendSignal(Uint16 nodeId, const SimpleSignal * s){ + assert(getNodeInfo(nodeId).m_api_reg_conf == true || + s->readSignalNumber() == GSN_API_REGREQ); return theFacade->theTransporterRegistry->prepareSend(&s->header, 1, // JBB &s->theData[0], @@ -146,6 +147,10 @@ SignalSender::waitFor(Uint32 timeOutMillis, T & t) { SimpleSignal * s = t.check(m_jobBuffer); if(s != 0){ + if (m_usedBuffer.push_back(s)) + { + return 0; + } return s; } @@ -160,7 +165,10 @@ SignalSender::waitFor(Uint32 timeOutMillis, T & t) SimpleSignal * s = t.check(m_jobBuffer); if(s != 0){ - m_usedBuffer.push_back(s); + if (m_usedBuffer.push_back(s)) + { + return 0; + } return s; } @@ -173,6 +181,7 @@ SignalSender::waitFor(Uint32 timeOutMillis, T & t) class WaitForAny { public: + WaitForAny() {} SimpleSignal * check(Vector<SimpleSignal*> & m_jobBuffer){ if(m_jobBuffer.size() > 0){ SimpleSignal * s = m_jobBuffer[0]; @@ -192,6 +201,7 @@ SignalSender::waitFor(Uint32 timeOutMillis){ class WaitForNode { public: + WaitForNode() {} Uint32 m_nodeId; SimpleSignal * check(Vector<SimpleSignal*> & m_jobBuffer){ Uint32 len = m_jobBuffer.size(); diff --git a/ndb/src/ndbapi/SignalSender.hpp b/ndb/src/ndbapi/SignalSender.hpp index 4b991460034..4cad759a334 100644 --- a/ndb/src/ndbapi/SignalSender.hpp +++ b/ndb/src/ndbapi/SignalSender.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -33,7 +32,7 @@ public: Uint32 theData[25]; LinearSectionPtr ptr[3]; - int readSignalNumber() {return header.theVerId_signalNumber; } + int readSignalNumber() const {return header.theVerId_signalNumber; } Uint32 *getDataPtrSend() { return theData; } const Uint32 *getDataPtr() const { return theData; } diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 7554111f4bd..79240180098 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp index 48e1c8ed25f..5a826bc2309 100644 --- a/ndb/src/ndbapi/TransporterFacade.hpp +++ b/ndb/src/ndbapi/TransporterFacade.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -316,7 +315,8 @@ inline bool TransporterFacade::get_node_stopping(NodeId n) const { const ClusterMgr::Node & node = theClusterMgr->getNodeInfo(n); - return ((node.m_state.startLevel == NodeState::SL_STOPPING_1) || + return (!node.m_state.getSingleUserMode() && + (node.m_state.startLevel == NodeState::SL_STOPPING_1) || (node.m_state.startLevel == NodeState::SL_STOPPING_2)); } @@ -327,16 +327,9 @@ TransporterFacade::getIsNodeSendable(NodeId n) const { const Uint32 startLevel = node.m_state.startLevel; if (node.m_info.m_type == NodeInfo::DB) { - if(node.m_state.singleUserMode && - ownId() == node.m_state.singleUserApi) { - return (node.compatible && - (node.m_state.startLevel == NodeState::SL_STOPPING_1 || - node.m_state.startLevel == NodeState::SL_STARTED || - node.m_state.startLevel == NodeState::SL_SINGLEUSER)); - } - else - return node.compatible && (startLevel == NodeState::SL_STARTED || - startLevel == NodeState::SL_STOPPING_1); + return node.compatible && (startLevel == NodeState::SL_STARTED || + startLevel == NodeState::SL_STOPPING_1 || + node.m_state.getSingleUserMode()); } else if (node.m_info.m_type == NodeInfo::REP) { /** * @todo Check that REP node actually has received API_REG_REQ diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 1e53558f179..9eed5db8bad 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -262,7 +261,7 @@ Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char * m_name(0) { DBUG_ENTER("Ndb_cluster_connection"); - DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this)); + DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%lx", (long) this)); g_eventLogger.createConsoleHandler(); g_eventLogger.setCategory("NdbApi"); @@ -354,7 +353,7 @@ Ndb_cluster_connection_impl::set_name(const char *name) } } -void +int Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config) @@ -403,7 +402,10 @@ Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid, break; } } - m_impl.m_all_nodes.push_back(Node(group,remoteNodeId)); + if (m_impl.m_all_nodes.push_back(Node(group,remoteNodeId))) + { + DBUG_RETURN(-1); + } DBUG_PRINT("info",("saved %d %d", group,remoteNodeId)); for (int i= m_impl.m_all_nodes.size()-2; i >= 0 && m_impl.m_all_nodes[i].group > m_impl.m_all_nodes[i+1].group; @@ -450,7 +452,7 @@ Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid, do_test(); #endif - DBUG_VOID_RETURN; + DBUG_RETURN(0); } void @@ -516,7 +518,6 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, struct ndb_mgm_reply mgm_reply; DBUG_ENTER("Ndb_cluster_connection::connect"); - const char* error = 0; do { if (m_impl.m_config_retriever == 0) DBUG_RETURN(-1); @@ -534,7 +535,11 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, break; m_impl.m_transporter_facade->start_instance(nodeId, props); - m_impl.init_nodes_vector(nodeId, *props); + if (m_impl.init_nodes_vector(nodeId, *props)) + { + ndbout_c("Ndb_cluster_connection::connect: malloc failure"); + DBUG_RETURN(-1); + } for(unsigned i=0; i<m_impl.m_transporter_facade->get_registry()->m_transporter_interface.size(); diff --git a/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp index a50d3004364..d3ff7610e18 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp +++ b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -69,7 +68,7 @@ private: }; Vector<Node> m_all_nodes; - void init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config); + int init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config); void connect_thread(); void set_name(const char *name); diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 95e2be3297f..328b0688857 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -138,10 +137,12 @@ ErrorBundle ErrorCodes[] = { /** * Unknown result */ + { 4007, UR, "Send to ndbd node failed" }, { 4008, UR, "Receive from NDB failed" }, { 4009, UR, "Cluster Failure" }, { 4012, UR, "Request ndbd time-out, maybe due to high load or communication problems"}, + { 4013, UR, "Request timed out in waiting for node failure"}, { 4024, UR, "Time-out, most likely caused by simple read or cluster failure" }, @@ -209,7 +210,6 @@ ErrorBundle ErrorCodes[] = { /** * Internal errors */ - { 892, IE, "Inconsistent hash index. The index needs to be dropped and recreated" }, { 896, IE, "Tuple corrupted - wrong checksum or column data in invalid format" }, { 901, IE, "Inconsistent ordered index. The index needs to be dropped and recreated" }, { 202, IE, "202" }, @@ -266,6 +266,7 @@ ErrorBundle ErrorCodes[] = { /** * Application error */ + { 299, AE, "Operation not allowed or aborted due to single user mode" }, { 763, AE, "Alter table requires cluster nodes to have exact same version" }, { 823, AE, "Too much attrinfo from application in tuple manager" }, { 831, AE, "Too many nullable/bitfields in table definition" }, @@ -379,7 +380,7 @@ ErrorBundle ErrorCodes[] = { { 1305, IE, "Backup definition not implemented" }, { 1306, AE, "Backup not supported in diskless mode (change Diskless)" }, - { 1321, IE, "Backup aborted by application" }, + { 1321, UD, "Backup aborted by user request" }, { 1322, IE, "Backup already completed" }, { 1323, IE, "1323" }, { 1324, IE, "Backup log buffer full" }, @@ -402,7 +403,7 @@ ErrorBundle ErrorCodes[] = { * Still uncategorized */ { 720, AE, "Attribute name reused in table definition" }, - { 4004, AE, "Attribute name not found in the Table" }, + { 4004, AE, "Attribute name or id not found in the table" }, { 4100, AE, "Status Error in NDB" }, { 4101, AE, "No connections to NDB available and connect failed" }, @@ -681,11 +682,14 @@ const char *ndberror_classification_message(ndberror_classification classificati return empty_string; } -int ndb_error_string(int err_no, char *str, unsigned int size) +int ndb_error_string(int err_no, char *str, int size) { ndberror_struct error; - unsigned int len; + int len; + assert(size > 1); + if(size <= 1) + return 0; error.code = err_no; ndberror_update(&error); diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.cpp b/ndb/src/ndbapi/signal-sender/SignalSender.cpp index 680d0c23b4a..faca172a93e 100644 --- a/ndb/src/ndbapi/signal-sender/SignalSender.cpp +++ b/ndb/src/ndbapi/signal-sender/SignalSender.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.hpp b/ndb/src/ndbapi/signal-sender/SignalSender.hpp index e4e6c1931d2..e1ed4ba68ed 100644 --- a/ndb/src/ndbapi/signal-sender/SignalSender.hpp +++ b/ndb/src/ndbapi/signal-sender/SignalSender.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/Makefile.am b/ndb/test/Makefile.am index b8753668c60..c746f526769 100644 --- a/ndb/test/Makefile.am +++ b/ndb/test/Makefile.am @@ -1,3 +1,18 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SUBDIRS = src tools ndbapi run-test EXTRA_DIST = include @@ -6,3 +21,6 @@ dist-hook: -rm -rf `find $(distdir) -type d -name SCCS` windoze-dsp: + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/test/include/CpcClient.hpp b/ndb/test/include/CpcClient.hpp index 8d8e079d219..62f016f8e1d 100644 --- a/ndb/test/include/CpcClient.hpp +++ b/ndb/test/include/CpcClient.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/HugoAsynchTransactions.hpp b/ndb/test/include/HugoAsynchTransactions.hpp index d7e6e8fc187..bc79b8d5134 100644 --- a/ndb/test/include/HugoAsynchTransactions.hpp +++ b/ndb/test/include/HugoAsynchTransactions.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/HugoCalculator.hpp b/ndb/test/include/HugoCalculator.hpp index 03de46cd7ea..6dfcb253d24 100644 --- a/ndb/test/include/HugoCalculator.hpp +++ b/ndb/test/include/HugoCalculator.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/HugoOperations.hpp b/ndb/test/include/HugoOperations.hpp index 82fd5529fa2..04fbf4a6cf1 100644 --- a/ndb/test/include/HugoOperations.hpp +++ b/ndb/test/include/HugoOperations.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/HugoTransactions.hpp b/ndb/test/include/HugoTransactions.hpp index 7a15a2f977d..5ed02375e64 100644 --- a/ndb/test/include/HugoTransactions.hpp +++ b/ndb/test/include/HugoTransactions.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT.hpp b/ndb/test/include/NDBT.hpp index 657a9cb03b6..144ea00871b 100644 --- a/ndb/test/include/NDBT.hpp +++ b/ndb/test/include/NDBT.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT_DataSet.hpp b/ndb/test/include/NDBT_DataSet.hpp index 1a0122f617c..b5f91cb50c3 100644 --- a/ndb/test/include/NDBT_DataSet.hpp +++ b/ndb/test/include/NDBT_DataSet.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT_DataSetTransaction.hpp b/ndb/test/include/NDBT_DataSetTransaction.hpp index 9f250c566dd..bf57ae85ccc 100644 --- a/ndb/test/include/NDBT_DataSetTransaction.hpp +++ b/ndb/test/include/NDBT_DataSetTransaction.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT_Error.hpp b/ndb/test/include/NDBT_Error.hpp index 6775a107196..352f5926eeb 100644 --- a/ndb/test/include/NDBT_Error.hpp +++ b/ndb/test/include/NDBT_Error.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT_Output.hpp b/ndb/test/include/NDBT_Output.hpp index aaa619ac479..397a3912c23 100644 --- a/ndb/test/include/NDBT_Output.hpp +++ b/ndb/test/include/NDBT_Output.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT_ResultRow.hpp b/ndb/test/include/NDBT_ResultRow.hpp index cbb5d7f6c6a..58a36e83d33 100644 --- a/ndb/test/include/NDBT_ResultRow.hpp +++ b/ndb/test/include/NDBT_ResultRow.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT_ReturnCodes.h b/ndb/test/include/NDBT_ReturnCodes.h index 0bc71ad8ceb..8660c0828f4 100644 --- a/ndb/test/include/NDBT_ReturnCodes.h +++ b/ndb/test/include/NDBT_ReturnCodes.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT_Stats.hpp b/ndb/test/include/NDBT_Stats.hpp index 28212bdba17..55785f633ec 100644 --- a/ndb/test/include/NDBT_Stats.hpp +++ b/ndb/test/include/NDBT_Stats.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT_Table.hpp b/ndb/test/include/NDBT_Table.hpp index d2f99b85187..75c516b226c 100644 --- a/ndb/test/include/NDBT_Table.hpp +++ b/ndb/test/include/NDBT_Table.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NDBT_Tables.hpp b/ndb/test/include/NDBT_Tables.hpp index fb0df8aa35b..53689578aa0 100644 --- a/ndb/test/include/NDBT_Tables.hpp +++ b/ndb/test/include/NDBT_Tables.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -42,6 +41,8 @@ public: static const NdbDictionary::Table* getTable(int _num); static int getNumTables(); + static const char** getIndexes(const char* table); + private: static const NdbDictionary::Table* tableWithPkSize(const char* _nam, Uint32 pkSize); }; diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index 027ac356e0c..e476a1a0759 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -326,6 +325,12 @@ public: // supply argc and argv as parameters int execute(int, const char**); + // NDBT's test tables are fixed and it always create + // and drop fixed table when execute, add this method + // in order to run CTX only and adapt to some new + // customized testsuite + int executeOneCtx(Ndb_cluster_connection&, + const NdbDictionary::Table* ptab, const char* testname = NULL); // These function can be used from main in the test program // to control the behaviour of the testsuite diff --git a/ndb/test/include/NdbBackup.hpp b/ndb/test/include/NdbBackup.hpp index e2e672b8a72..9903fe0c6a6 100644 --- a/ndb/test/include/NdbBackup.hpp +++ b/ndb/test/include/NdbBackup.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NdbConfig.hpp b/ndb/test/include/NdbConfig.hpp index 19439fafbb2..efd7e260ac0 100644 --- a/ndb/test/include/NdbConfig.hpp +++ b/ndb/test/include/NdbConfig.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NdbGrep.hpp b/ndb/test/include/NdbGrep.hpp index 31c49d1e4da..3115ef27693 100644 --- a/ndb/test/include/NdbGrep.hpp +++ b/ndb/test/include/NdbGrep.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NdbRestarter.hpp b/ndb/test/include/NdbRestarter.hpp index a2e6a4b3248..3307cf3e424 100644 --- a/ndb/test/include/NdbRestarter.hpp +++ b/ndb/test/include/NdbRestarter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NdbRestarts.hpp b/ndb/test/include/NdbRestarts.hpp index aabcd7b9975..fdba34bcc0b 100644 --- a/ndb/test/include/NdbRestarts.hpp +++ b/ndb/test/include/NdbRestarts.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NdbSchemaCon.hpp b/ndb/test/include/NdbSchemaCon.hpp index 313daf0094b..10df5f6be0b 100644 --- a/ndb/test/include/NdbSchemaCon.hpp +++ b/ndb/test/include/NdbSchemaCon.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp index 1edbc155643..768cfe8e78d 100644 --- a/ndb/test/include/NdbSchemaOp.hpp +++ b/ndb/test/include/NdbSchemaOp.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NdbTest.hpp b/ndb/test/include/NdbTest.hpp index a2e612b7ffa..105147af7de 100644 --- a/ndb/test/include/NdbTest.hpp +++ b/ndb/test/include/NdbTest.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/NdbTimer.hpp b/ndb/test/include/NdbTimer.hpp index b0d500b5c2c..94a39522434 100644 --- a/ndb/test/include/NdbTimer.hpp +++ b/ndb/test/include/NdbTimer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/TestNdbEventOperation.hpp b/ndb/test/include/TestNdbEventOperation.hpp index 307b0e0089b..a25e89f704d 100644 --- a/ndb/test/include/TestNdbEventOperation.hpp +++ b/ndb/test/include/TestNdbEventOperation.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/UtilTransactions.hpp b/ndb/test/include/UtilTransactions.hpp index 333f5d98328..75bbcd9c776 100644 --- a/ndb/test/include/UtilTransactions.hpp +++ b/ndb/test/include/UtilTransactions.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/include/getarg.h b/ndb/test/include/getarg.h index 03ed25f6828..64a0b9f0e14 100644 --- a/ndb/test/include/getarg.h +++ b/ndb/test/include/getarg.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/InsertRecs.cpp b/ndb/test/ndbapi/InsertRecs.cpp index f42786d666d..41f17da3aae 100644 --- a/ndb/test/ndbapi/InsertRecs.cpp +++ b/ndb/test/ndbapi/InsertRecs.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index b639c71d07a..9019d71ada2 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA SUBDIRS = bank @@ -25,6 +39,7 @@ testOperations \ testRestartGci \ testScan \ testInterpreter \ +testScanFilter \ testScanInterpreter \ testScanPerf \ testSystemRestart \ @@ -69,6 +84,7 @@ testOperations_SOURCES = testOperations.cpp testRestartGci_SOURCES = testRestartGci.cpp testScan_SOURCES = testScan.cpp ScanFunctions.hpp testInterpreter_SOURCES = testInterpreter.cpp +testScanFilter_SOURCES = testScanFilter.cpp testScanInterpreter_SOURCES = testScanInterpreter.cpp ScanFilter.hpp ScanInterpretTest.hpp testScanPerf_SOURCES = testScanPerf.cpp testSystemRestart_SOURCES = testSystemRestart.cpp diff --git a/ndb/test/ndbapi/ScanFilter.hpp b/ndb/test/ndbapi/ScanFilter.hpp index 09786756798..aa866648bf6 100644 --- a/ndb/test/ndbapi/ScanFilter.hpp +++ b/ndb/test/ndbapi/ScanFilter.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ScanFunctions.hpp b/ndb/test/ndbapi/ScanFunctions.hpp index 37389d9b7de..7cb984f4157 100644 --- a/ndb/test/ndbapi/ScanFunctions.hpp +++ b/ndb/test/ndbapi/ScanFunctions.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ScanInterpretTest.hpp b/ndb/test/ndbapi/ScanInterpretTest.hpp index d4e9bbecc81..d0c2acc621f 100644 --- a/ndb/test/ndbapi/ScanInterpretTest.hpp +++ b/ndb/test/ndbapi/ScanInterpretTest.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/TraceNdbApi.cpp b/ndb/test/ndbapi/TraceNdbApi.cpp index bd43b15f2e6..42a424c96f1 100644 --- a/ndb/test/ndbapi/TraceNdbApi.cpp +++ b/ndb/test/ndbapi/TraceNdbApi.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/VerifyNdbApi.cpp b/ndb/test/ndbapi/VerifyNdbApi.cpp index 79645827e2c..89aaf2ff734 100644 --- a/ndb/test/ndbapi/VerifyNdbApi.cpp +++ b/ndb/test/ndbapi/VerifyNdbApi.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/acid.cpp b/ndb/test/ndbapi/acid.cpp index 3eb1625be26..b0343c1d7ee 100644 --- a/ndb/test/ndbapi/acid.cpp +++ b/ndb/test/ndbapi/acid.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/acid2.cpp b/ndb/test/ndbapi/acid2.cpp index 7bd7ec00ac5..c798e1f98c8 100644 --- a/ndb/test/ndbapi/acid2.cpp +++ b/ndb/test/ndbapi/acid2.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/adoInsertRecs.cpp b/ndb/test/ndbapi/adoInsertRecs.cpp index 0bc67ef641b..6e33d93fa41 100644 --- a/ndb/test/ndbapi/adoInsertRecs.cpp +++ b/ndb/test/ndbapi/adoInsertRecs.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/asyncGenerator.cpp b/ndb/test/ndbapi/asyncGenerator.cpp index d91e38dff1a..16dd8ae74ce 100644 --- a/ndb/test/ndbapi/asyncGenerator.cpp +++ b/ndb/test/ndbapi/asyncGenerator.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/Bank.cpp b/ndb/test/ndbapi/bank/Bank.cpp index 37224fdd055..07edc7da33a 100644 --- a/ndb/test/ndbapi/bank/Bank.cpp +++ b/ndb/test/ndbapi/bank/Bank.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/Bank.hpp b/ndb/test/ndbapi/bank/Bank.hpp index b80f02dae97..47c98374485 100644 --- a/ndb/test/ndbapi/bank/Bank.hpp +++ b/ndb/test/ndbapi/bank/Bank.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/BankLoad.cpp b/ndb/test/ndbapi/bank/BankLoad.cpp index 34947019a51..76a9df5a495 100644 --- a/ndb/test/ndbapi/bank/BankLoad.cpp +++ b/ndb/test/ndbapi/bank/BankLoad.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/Makefile.am b/ndb/test/ndbapi/bank/Makefile.am index d4f82a7f9c4..b754ab19386 100644 --- a/ndb/test/ndbapi/bank/Makefile.am +++ b/ndb/test/ndbapi/bank/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ndbtest_PROGRAMS = testBank bankSumAccounts bankValidateAllGLs bankMakeGL bankTransactionMaker bankCreator bankTimer diff --git a/ndb/test/ndbapi/bank/bankCreator.cpp b/ndb/test/ndbapi/bank/bankCreator.cpp index 257255babc8..0cd42a23c2b 100644 --- a/ndb/test/ndbapi/bank/bankCreator.cpp +++ b/ndb/test/ndbapi/bank/bankCreator.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/bankMakeGL.cpp b/ndb/test/ndbapi/bank/bankMakeGL.cpp index cf373481e3e..cc3843d39ca 100644 --- a/ndb/test/ndbapi/bank/bankMakeGL.cpp +++ b/ndb/test/ndbapi/bank/bankMakeGL.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/bankSumAccounts.cpp b/ndb/test/ndbapi/bank/bankSumAccounts.cpp index 034f70f8f95..e40b4b290b8 100644 --- a/ndb/test/ndbapi/bank/bankSumAccounts.cpp +++ b/ndb/test/ndbapi/bank/bankSumAccounts.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/bankTimer.cpp b/ndb/test/ndbapi/bank/bankTimer.cpp index 298f85e1e43..121759bb1da 100644 --- a/ndb/test/ndbapi/bank/bankTimer.cpp +++ b/ndb/test/ndbapi/bank/bankTimer.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/bankTransactionMaker.cpp b/ndb/test/ndbapi/bank/bankTransactionMaker.cpp index f8e646b6553..cc90f7abc12 100644 --- a/ndb/test/ndbapi/bank/bankTransactionMaker.cpp +++ b/ndb/test/ndbapi/bank/bankTransactionMaker.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp b/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp index 0c268121d8a..098d958097c 100644 --- a/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp +++ b/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bank/testBank.cpp b/ndb/test/ndbapi/bank/testBank.cpp index 6be66d528b1..b7ddba8bdba 100644 --- a/ndb/test/ndbapi/bank/testBank.cpp +++ b/ndb/test/ndbapi/bank/testBank.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/asyncGenerator.cpp b/ndb/test/ndbapi/bench/asyncGenerator.cpp index d91e38dff1a..16dd8ae74ce 100644 --- a/ndb/test/ndbapi/bench/asyncGenerator.cpp +++ b/ndb/test/ndbapi/bench/asyncGenerator.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/dbGenerator.h b/ndb/test/ndbapi/bench/dbGenerator.h index 2256498e151..3e1a3e6704a 100644 --- a/ndb/test/ndbapi/bench/dbGenerator.h +++ b/ndb/test/ndbapi/bench/dbGenerator.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/dbPopulate.cpp b/ndb/test/ndbapi/bench/dbPopulate.cpp index 42fbb52f3b2..89c312ab636 100644 --- a/ndb/test/ndbapi/bench/dbPopulate.cpp +++ b/ndb/test/ndbapi/bench/dbPopulate.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/dbPopulate.h b/ndb/test/ndbapi/bench/dbPopulate.h index 1916720e141..a7220b671b1 100644 --- a/ndb/test/ndbapi/bench/dbPopulate.h +++ b/ndb/test/ndbapi/bench/dbPopulate.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/macros.h b/ndb/test/ndbapi/bench/macros.h index 22b7f564490..d50183d1749 100644 --- a/ndb/test/ndbapi/bench/macros.h +++ b/ndb/test/ndbapi/bench/macros.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp b/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp index 828b924582f..5e488436d9a 100644 --- a/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp +++ b/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/mainPopulate.cpp b/ndb/test/ndbapi/bench/mainPopulate.cpp index 5ab1a5b015d..8189821723c 100644 --- a/ndb/test/ndbapi/bench/mainPopulate.cpp +++ b/ndb/test/ndbapi/bench/mainPopulate.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_async1.cpp b/ndb/test/ndbapi/bench/ndb_async1.cpp index 2a84f6b2aca..e532744ac93 100644 --- a/ndb/test/ndbapi/bench/ndb_async1.cpp +++ b/ndb/test/ndbapi/bench/ndb_async1.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_async2.cpp b/ndb/test/ndbapi/bench/ndb_async2.cpp index 31cf1d8310a..14422f6617b 100644 --- a/ndb/test/ndbapi/bench/ndb_async2.cpp +++ b/ndb/test/ndbapi/bench/ndb_async2.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_error.hpp b/ndb/test/ndbapi/bench/ndb_error.hpp index d90f5506813..1874213c6da 100644 --- a/ndb/test/ndbapi/bench/ndb_error.hpp +++ b/ndb/test/ndbapi/bench/ndb_error.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_schema.hpp b/ndb/test/ndbapi/bench/ndb_schema.hpp index af08bc2eecd..ff7be1f8956 100644 --- a/ndb/test/ndbapi/bench/ndb_schema.hpp +++ b/ndb/test/ndbapi/bench/ndb_schema.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction.cpp index 182f1f99586..37de6dadc90 100644 --- a/ndb/test/ndbapi/bench/ndb_user_transaction.cpp +++ b/ndb/test/ndbapi/bench/ndb_user_transaction.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp index df3c7a7989e..bb27bfe3600 100644 --- a/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp +++ b/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp index d2c92ecd424..d193b21fa11 100644 --- a/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp +++ b/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp index e652c7bfed8..5df4717eb6d 100644 --- a/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp +++ b/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp index 86580008d10..d76f6afd3f9 100644 --- a/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp +++ b/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp index 262f38e9ffb..4f705ee5047 100644 --- a/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp +++ b/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/testData.h b/ndb/test/ndbapi/bench/testData.h index 3db85e7342e..0327656de73 100644 --- a/ndb/test/ndbapi/bench/testData.h +++ b/ndb/test/ndbapi/bench/testData.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/testDefinitions.h b/ndb/test/ndbapi/bench/testDefinitions.h index 2f4aeb30975..e2705b55a34 100644 --- a/ndb/test/ndbapi/bench/testDefinitions.h +++ b/ndb/test/ndbapi/bench/testDefinitions.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/userInterface.cpp b/ndb/test/ndbapi/bench/userInterface.cpp index 35e88183230..651963cb95a 100644 --- a/ndb/test/ndbapi/bench/userInterface.cpp +++ b/ndb/test/ndbapi/bench/userInterface.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bench/userInterface.h b/ndb/test/ndbapi/bench/userInterface.h index bad61fcf171..5492b012553 100644 --- a/ndb/test/ndbapi/bench/userInterface.h +++ b/ndb/test/ndbapi/bench/userInterface.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/benchronja.cpp b/ndb/test/ndbapi/benchronja.cpp index a7523e8e416..4973e6e2487 100644 --- a/ndb/test/ndbapi/benchronja.cpp +++ b/ndb/test/ndbapi/benchronja.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/bulk_copy.cpp b/ndb/test/ndbapi/bulk_copy.cpp index b53654ce0fb..3828a833fc6 100644 --- a/ndb/test/ndbapi/bulk_copy.cpp +++ b/ndb/test/ndbapi/bulk_copy.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/cdrserver.cpp b/ndb/test/ndbapi/cdrserver.cpp index 976319034bf..1a39edcfaec 100644 --- a/ndb/test/ndbapi/cdrserver.cpp +++ b/ndb/test/ndbapi/cdrserver.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/celloDb.cpp b/ndb/test/ndbapi/celloDb.cpp index 2d6401c355a..243930056f7 100644 --- a/ndb/test/ndbapi/celloDb.cpp +++ b/ndb/test/ndbapi/celloDb.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/create_all_tabs.cpp b/ndb/test/ndbapi/create_all_tabs.cpp index f06078d67a2..1820af6fec2 100644 --- a/ndb/test/ndbapi/create_all_tabs.cpp +++ b/ndb/test/ndbapi/create_all_tabs.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/create_tab.cpp b/ndb/test/ndbapi/create_tab.cpp index b35c8655236..d93308bbec7 100644 --- a/ndb/test/ndbapi/create_tab.cpp +++ b/ndb/test/ndbapi/create_tab.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/drop_all_tabs.cpp b/ndb/test/ndbapi/drop_all_tabs.cpp index f12d750916e..cebd257cc29 100644 --- a/ndb/test/ndbapi/drop_all_tabs.cpp +++ b/ndb/test/ndbapi/drop_all_tabs.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch.cpp index 8a7dbec1561..20a157fc2f3 100644 --- a/ndb/test/ndbapi/flexAsynch.cpp +++ b/ndb/test/ndbapi/flexAsynch.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/flexBench.cpp b/ndb/test/ndbapi/flexBench.cpp index abddecfdc40..5c60022797b 100644 --- a/ndb/test/ndbapi/flexBench.cpp +++ b/ndb/test/ndbapi/flexBench.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/flexHammer.cpp b/ndb/test/ndbapi/flexHammer.cpp index f254b1e5ccf..9abac905f5a 100644 --- a/ndb/test/ndbapi/flexHammer.cpp +++ b/ndb/test/ndbapi/flexHammer.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/flexScan.cpp b/ndb/test/ndbapi/flexScan.cpp index 4d2c85d6955..cbea90f44f4 100644 --- a/ndb/test/ndbapi/flexScan.cpp +++ b/ndb/test/ndbapi/flexScan.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -27,7 +26,7 @@ verify delete Arguments: - -f Location of Ndb.cfg file, default Ndb.cfg + -f Location of my.cnf file, default my.cnf -t Number of threads to start, default 1 -o Number of operations per loop, default 500 -l Number of loops to run, default 1, 0=infinite -a Number of attributes, default 25 @@ -829,7 +828,7 @@ static int createTables(Ndb* pMyNdb) static void printUsage() { ndbout << "Usage of flexScan:" << endl; - ndbout << "-f <path> Location of Ndb.cfg file, default: Ndb.cfg" << endl; + ndbout << "-f <path> Location of my.cnf file, default: my.cnf" << endl; ndbout << "-t <int> Number of threads to start, default 1" << endl; ndbout << "-o <int> Number of operations per loop, default 500" << endl; ndbout << "-l <int> Number of loops to run, default 1, 0=infinite" << endl; diff --git a/ndb/test/ndbapi/flexTT.cpp b/ndb/test/ndbapi/flexTT.cpp index 7cd5ac8e3b4..71d5b6c096e 100644 --- a/ndb/test/ndbapi/flexTT.cpp +++ b/ndb/test/ndbapi/flexTT.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/flexTimedAsynch.cpp b/ndb/test/ndbapi/flexTimedAsynch.cpp index 2b8c0bdd5f8..cc44ab8b237 100644 --- a/ndb/test/ndbapi/flexTimedAsynch.cpp +++ b/ndb/test/ndbapi/flexTimedAsynch.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/flex_bench_mysql.cpp b/ndb/test/ndbapi/flex_bench_mysql.cpp index 3efb7ee2094..5d4e7ece7c7 100644 --- a/ndb/test/ndbapi/flex_bench_mysql.cpp +++ b/ndb/test/ndbapi/flex_bench_mysql.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/index.cpp b/ndb/test/ndbapi/index.cpp index c22da594164..1326f9fee75 100644 --- a/ndb/test/ndbapi/index.cpp +++ b/ndb/test/ndbapi/index.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/index2.cpp b/ndb/test/ndbapi/index2.cpp index f739468d7df..8c7ea26fead 100644 --- a/ndb/test/ndbapi/index2.cpp +++ b/ndb/test/ndbapi/index2.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/initronja.cpp b/ndb/test/ndbapi/initronja.cpp index 3ce274e4319..63bbc374c62 100644 --- a/ndb/test/ndbapi/initronja.cpp +++ b/ndb/test/ndbapi/initronja.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/interpreterInTup.cpp b/ndb/test/ndbapi/interpreterInTup.cpp index a07d5898213..4d4ef75f81d 100644 --- a/ndb/test/ndbapi/interpreterInTup.cpp +++ b/ndb/test/ndbapi/interpreterInTup.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/mainAsyncGenerator.cpp b/ndb/test/ndbapi/mainAsyncGenerator.cpp index 73a8b98ab57..b9c623c4793 100644 --- a/ndb/test/ndbapi/mainAsyncGenerator.cpp +++ b/ndb/test/ndbapi/mainAsyncGenerator.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/msa.cpp b/ndb/test/ndbapi/msa.cpp index e39f7a8c64a..2db694f4dbb 100644 --- a/ndb/test/ndbapi/msa.cpp +++ b/ndb/test/ndbapi/msa.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ndb_async1.cpp b/ndb/test/ndbapi/ndb_async1.cpp index 2a84f6b2aca..e532744ac93 100644 --- a/ndb/test/ndbapi/ndb_async1.cpp +++ b/ndb/test/ndbapi/ndb_async1.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ndb_async2.cpp b/ndb/test/ndbapi/ndb_async2.cpp index 0c1d138defb..9aa5ef0ae87 100644 --- a/ndb/test/ndbapi/ndb_async2.cpp +++ b/ndb/test/ndbapi/ndb_async2.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ndb_user_populate.cpp b/ndb/test/ndbapi/ndb_user_populate.cpp index ce3a76cdd59..9aea13932ec 100644 --- a/ndb/test/ndbapi/ndb_user_populate.cpp +++ b/ndb/test/ndbapi/ndb_user_populate.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ndb_user_transaction.cpp b/ndb/test/ndbapi/ndb_user_transaction.cpp index 182f1f99586..37de6dadc90 100644 --- a/ndb/test/ndbapi/ndb_user_transaction.cpp +++ b/ndb/test/ndbapi/ndb_user_transaction.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ndb_user_transaction2.cpp b/ndb/test/ndbapi/ndb_user_transaction2.cpp index df3c7a7989e..bb27bfe3600 100644 --- a/ndb/test/ndbapi/ndb_user_transaction2.cpp +++ b/ndb/test/ndbapi/ndb_user_transaction2.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ndb_user_transaction3.cpp b/ndb/test/ndbapi/ndb_user_transaction3.cpp index d2c92ecd424..d193b21fa11 100644 --- a/ndb/test/ndbapi/ndb_user_transaction3.cpp +++ b/ndb/test/ndbapi/ndb_user_transaction3.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ndb_user_transaction4.cpp b/ndb/test/ndbapi/ndb_user_transaction4.cpp index e652c7bfed8..5df4717eb6d 100644 --- a/ndb/test/ndbapi/ndb_user_transaction4.cpp +++ b/ndb/test/ndbapi/ndb_user_transaction4.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ndb_user_transaction5.cpp b/ndb/test/ndbapi/ndb_user_transaction5.cpp index 86580008d10..d76f6afd3f9 100644 --- a/ndb/test/ndbapi/ndb_user_transaction5.cpp +++ b/ndb/test/ndbapi/ndb_user_transaction5.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/ndb_user_transaction6.cpp b/ndb/test/ndbapi/ndb_user_transaction6.cpp index 262f38e9ffb..4f705ee5047 100644 --- a/ndb/test/ndbapi/ndb_user_transaction6.cpp +++ b/ndb/test/ndbapi/ndb_user_transaction6.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/acid2/TraceNdbApi.hpp b/ndb/test/ndbapi/old_dirs/acid2/TraceNdbApi.hpp index 2bd4eab6b70..16acd639f18 100644 --- a/ndb/test/ndbapi/old_dirs/acid2/TraceNdbApi.hpp +++ b/ndb/test/ndbapi/old_dirs/acid2/TraceNdbApi.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/acid2/VerifyNdbApi.hpp b/ndb/test/ndbapi/old_dirs/acid2/VerifyNdbApi.hpp index 4a5b8cc8111..f9d5dff698d 100644 --- a/ndb/test/ndbapi/old_dirs/acid2/VerifyNdbApi.hpp +++ b/ndb/test/ndbapi/old_dirs/acid2/VerifyNdbApi.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/dbGenerator.h b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/dbGenerator.h index 2256498e151..3e1a3e6704a 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/dbGenerator.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/dbGenerator.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/testData.h b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/testData.h index 3db85e7342e..0327656de73 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/testData.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/testData.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/userInterface.h b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/userInterface.h index 94bd1e80ab3..61769904964 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/userInterface.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/userInterface.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/macros.h b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/macros.h index 22b7f564490..d50183d1749 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/macros.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/macros.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/ndb_error.hpp b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/ndb_error.hpp index 9e6c5e55e73..cb5cd062ae4 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/ndb_error.hpp +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/ndb_error.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/include/ndb_schema.hpp b/ndb/test/ndbapi/old_dirs/lmc-bench/include/ndb_schema.hpp index af08bc2eecd..ff7be1f8956 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/include/ndb_schema.hpp +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/include/ndb_schema.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/include/testDefinitions.h b/ndb/test/ndbapi/old_dirs/lmc-bench/include/testDefinitions.h index 2f4aeb30975..e2705b55a34 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/include/testDefinitions.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/include/testDefinitions.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.c index 7484c7647f5..a0df1e7c1d2 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.c +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.h index 824688b6cf9..206b13c3f00 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/mainGenerator.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/mainGenerator.c index 4a31db0b4e9..cb47207a0f2 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/mainGenerator.c +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/mainGenerator.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/testData.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/testData.h index 863c230502b..494b111ea7f 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/testData.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/testData.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/userInterface.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/userInterface.h index b70ded87756..ed1146f3a0c 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/userInterface.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/userInterface.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.c index 42fbb52f3b2..89c312ab636 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.c +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.h index 1916720e141..a7220b671b1 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/mainPopulate.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/mainPopulate.c index 838ac8a7196..e882edcc186 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/mainPopulate.c +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/mainPopulate.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/localDbPrepare.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/localDbPrepare.c index dd100507016..f3ad4c9f12f 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/localDbPrepare.c +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/localDbPrepare.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/macros.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/macros.h index 363f247b93f..c4a9c38f2a3 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/macros.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/macros.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/ndb_error.hpp b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/ndb_error.hpp index b3aaeac822e..a86966d128e 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/ndb_error.hpp +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/ndb_error.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userHandle.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userHandle.h index 1de468d4dad..61baca41501 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userHandle.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userHandle.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userInterface.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userInterface.c index bacf1861dde..03a9465b32c 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userInterface.c +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userInterface.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userTransaction.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userTransaction.c index a2f4787bb0c..bdc60912482 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userTransaction.c +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userTransaction.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userHandle.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userHandle.h index 6da76fc2bff..9b6ac1ef161 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userHandle.h +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userHandle.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userInterface.cpp b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userInterface.cpp index fe3c17acbf5..f20316ec52a 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userInterface.cpp +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userInterface.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userTransaction.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userTransaction.c index a2f4787bb0c..bdc60912482 100644 --- a/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userTransaction.c +++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userTransaction.c @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/vw_test/bcd.h b/ndb/test/ndbapi/old_dirs/vw_test/bcd.h index d0aaffbd8b7..9e42355d30f 100644 --- a/ndb/test/ndbapi/old_dirs/vw_test/bcd.h +++ b/ndb/test/ndbapi/old_dirs/vw_test/bcd.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/vw_test/utv.h b/ndb/test/ndbapi/old_dirs/vw_test/utv.h index 6f378e5595b..7dfbf29b467 100644 --- a/ndb/test/ndbapi/old_dirs/vw_test/utv.h +++ b/ndb/test/ndbapi/old_dirs/vw_test/utv.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/old_dirs/vw_test/vcdrfunc.h b/ndb/test/ndbapi/old_dirs/vw_test/vcdrfunc.h index 3c5444d733b..156cd4d3c3d 100644 --- a/ndb/test/ndbapi/old_dirs/vw_test/vcdrfunc.h +++ b/ndb/test/ndbapi/old_dirs/vw_test/vcdrfunc.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/restarter.cpp b/ndb/test/ndbapi/restarter.cpp index d6831494b48..089f6834375 100644 --- a/ndb/test/ndbapi/restarter.cpp +++ b/ndb/test/ndbapi/restarter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/restarter2.cpp b/ndb/test/ndbapi/restarter2.cpp index 846748a7bba..f14f703f29f 100644 --- a/ndb/test/ndbapi/restarter2.cpp +++ b/ndb/test/ndbapi/restarter2.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/restarts.cpp b/ndb/test/ndbapi/restarts.cpp index 184e754de4a..9269953fe4a 100644 --- a/ndb/test/ndbapi/restarts.cpp +++ b/ndb/test/ndbapi/restarts.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/size.cpp b/ndb/test/ndbapi/size.cpp index ff178b11d68..b9cf44e1a35 100644 --- a/ndb/test/ndbapi/size.cpp +++ b/ndb/test/ndbapi/size.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testBackup.cpp b/ndb/test/ndbapi/testBackup.cpp index da3c52cf4d2..79fec217c08 100644 --- a/ndb/test/ndbapi/testBackup.cpp +++ b/ndb/test/ndbapi/testBackup.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testBasic.cpp b/ndb/test/ndbapi/testBasic.cpp index 10235eef6d7..a9487262ea3 100644 --- a/ndb/test/ndbapi/testBasic.cpp +++ b/ndb/test/ndbapi/testBasic.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testBasicAsynch.cpp b/ndb/test/ndbapi/testBasicAsynch.cpp index 6daa22fdc6a..c7e5c187218 100644 --- a/ndb/test/ndbapi/testBasicAsynch.cpp +++ b/ndb/test/ndbapi/testBasicAsynch.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index fae3a662ff9..6b08b7d686e 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -124,23 +123,25 @@ printusage() << "metadata" << endl << " -pk2len N length of PK2 [" << d.m_pk2len << "/" << g_max_pk2len <<"]" << endl << " -oneblob only 1 blob attribute [default 2]" << endl - << "testcases for test/skip" << endl + << "test cases for test/skip" << endl << " k primary key ops" << endl << " i hash index ops" << endl << " s table scans" << endl << " r ordered index scans" << endl << " p performance test" << endl - << "additional flags for test/skip" << endl + << "operations for test/skip" << endl << " u update existing blob value" << endl << " n normal insert and update" << endl << " w insert and update using writeTuple" << endl + << "blob operation styles for test/skip" << endl << " 0 getValue / setValue" << endl << " 1 setActiveHook" << endl << " 2 readData / writeData" << endl - << "bug tests (no blob test)" << endl + << "example: -test kn0 (need all 3 parts)" << endl + << "bug tests" << endl << " -bug 4088 ndb api hang with mixed ops on index table" << endl - << " -bug nnnn delete + write gives 626" << endl - << " -bug nnnn acc crash on delete and long key" << endl + << " -bug 27018 middle partial part write clobbers rest of part" << endl + << " -bug 27370 Potential inconsistent blob reads for ReadCommitted reads" << endl ; } @@ -1028,6 +1029,32 @@ deletePk() return 0; } +static int +deleteNoPk() +{ + DBG("--- deleteNoPk ---"); + Tup no_tup; // bug#24028 + no_tup.m_pk1 = 0xb1ffb1ff; + sprintf(no_tup.m_pk2, "%-*.*s", g_opt.m_pk2len, g_opt.m_pk2len, "b1ffb1ff"); + CHK((g_con = g_ndb->startTransaction()) != 0); + Tup& tup = no_tup; + DBG("deletePk pk1=" << hex << tup.m_pk1); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->deleteTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(g_con->execute(Commit) == -1); // fail + // BUG: error should be on op but is on con now + DBG("con: " << g_con->getNdbError()); + DBG("opr: " << g_opr->getNdbError()); + CHK(g_con->getNdbError().code == 626 || g_opr->getNdbError().code == 626); + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + return 0; +} + // hash index ops static int @@ -1383,6 +1410,7 @@ testmain() CHK(readPk(style) == 0); } CHK(deletePk() == 0); + CHK(deleteNoPk() == 0); CHK(verifyBlob() == 0); } if (testcase('w')) { @@ -1397,6 +1425,7 @@ testmain() CHK(readPk(style) == 0); } CHK(deletePk() == 0); + CHK(deleteNoPk() == 0); CHK(verifyBlob() == 0); } } @@ -1808,14 +1837,249 @@ bugtest_4088() } static int -bugtest_2222() +bugtest_27018() { + DBG("bug test 27018 - middle partial part write clobbers rest of part"); + + // insert rows + calcTups(false); + CHK(insertPk(false) == 0); + // new trans + for (unsigned k= 0; k < g_opt.m_rows; k++) + { + Tup& tup= g_tups[k]; + + CHK((g_con= g_ndb->startTransaction()) != 0); + CHK((g_opr= g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->updateTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(getBlobHandles(g_opr) == 0); + CHK(g_con->execute(NoCommit) == 0); + + /* Update one byte in random position. */ + Uint32 offset= urandom(tup.m_blob1.m_len); + tup.m_blob1.m_buf[0]= 0xff ^ tup.m_blob1.m_val[offset]; + CHK(g_bh1->setPos(offset) == 0); + CHK(g_bh1->writeData(&(tup.m_blob1.m_buf[0]), 1) == 0); + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + + CHK((g_con= g_ndb->startTransaction()) != 0); + CHK((g_opr= g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->readTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(getBlobHandles(g_opr) == 0); + + CHK(g_bh1->getValue(tup.m_blob1.m_buf, tup.m_blob1.m_len) == 0); + CHK(g_con->execute(Commit) == 0); + Uint64 len= ~0; + CHK(g_bh1->getLength(len) == 0 && len == tup.m_blob1.m_len); + tup.m_blob1.m_buf[offset]^= 0xff; + CHK(memcmp(tup.m_blob1.m_buf, tup.m_blob1.m_val, tup.m_blob1.m_len) == 0); + g_ndb->closeTransaction(g_con); + } + return 0; } + +struct bug27370_data { + Ndb *m_ndb; + char m_current_write_value; + char *m_writebuf; + Uint32 m_blob1_size; + Uint32 m_pk1; + char m_pk2[g_max_pk2len + 1]; + bool m_thread_stop; +}; + +void *bugtest_27370_thread(void *arg) +{ + bug27370_data *data= (bug27370_data *)arg; + + while (!data->m_thread_stop) + { + memset(data->m_writebuf, data->m_current_write_value, data->m_blob1_size); + data->m_current_write_value++; + + NdbConnection *con; + if ((con= data->m_ndb->startTransaction()) == 0) + return (void *)"Failed to create transaction"; + NdbOperation *opr; + if ((opr= con->getNdbOperation(g_opt.m_tname)) == 0) + return (void *)"Failed to create operation"; + if (opr->writeTuple() != 0) + return (void *)"writeTuple() failed"; + if (opr->equal("PK1", data->m_pk1) != 0) + return (void *)"equal(PK1) failed"; + if (g_opt.m_pk2len != 0) + if (opr->equal("PK2", data->m_pk2) != 0) + return (void *)"equal(PK2) failed"; + NdbBlob *bh; + if ((bh= opr->getBlobHandle("BL1")) == 0) + return (void *)"getBlobHandle() failed"; + if (bh->setValue(data->m_writebuf, data->m_blob1_size) != 0) + return (void *)"setValue() failed"; + if (con->execute(Commit, AbortOnError, 1) != 0) + return (void *)"execute() failed"; + data->m_ndb->closeTransaction(con); + } + + return NULL; // Success +} + static int -bugtest_3333() +bugtest_27370() { + DBG("bug test 27370 - Potential inconsistent blob reads for ReadCommitted reads"); + + bug27370_data data; + + data.m_ndb= new Ndb(g_ncc, "TEST_DB"); + CHK(data.m_ndb->init(20) == 0); + CHK(data.m_ndb->waitUntilReady() == 0); + + data.m_current_write_value= 0; + data.m_blob1_size= g_opt.m_blob1.m_inline + 10 * g_opt.m_blob1.m_partsize; + CHK((data.m_writebuf= new char [data.m_blob1_size]) != 0); + data.m_pk1= 27370; + memset(data.m_pk2, 'x', g_max_pk2len); + data.m_pk2[g_max_pk2len]= '\0'; + data.m_thread_stop= false; + + memset(data.m_writebuf, data.m_current_write_value, data.m_blob1_size); + data.m_current_write_value++; + + CHK((g_con= g_ndb->startTransaction()) != 0); + CHK((g_opr= g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->writeTuple() == 0); + CHK(g_opr->equal("PK1", data.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", data.m_pk2) == 0); + CHK((g_bh1= g_opr->getBlobHandle("BL1")) != 0); + CHK(g_bh1->setValue(data.m_writebuf, data.m_blob1_size) == 0); + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_con= NULL; + + pthread_t thread_handle; + CHK(pthread_create(&thread_handle, NULL, bugtest_27370_thread, &data) == 0); + + DBG("bug test 27370 - PK blob reads"); + Uint32 seen_updates= 0; + while (seen_updates < 50) + { + CHK((g_con= g_ndb->startTransaction()) != 0); + CHK((g_opr= g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->readTuple(NdbOperation::LM_CommittedRead) == 0); + CHK(g_opr->equal("PK1", data.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", data.m_pk2) == 0); + CHK((g_bh1= g_opr->getBlobHandle("BL1")) != 0); + CHK(g_con->execute(NoCommit, AbortOnError, 1) == 0); + + const Uint32 loop_max= 10; + char read_char; + char original_read_char= 0; + Uint32 readloop; + for (readloop= 0;; readloop++) + { + if (readloop > 0) + { + if (readloop > 1) + { + /* Compare against first read. */ + CHK(read_char == original_read_char); + } + else + { + /* + We count the number of times we see the other thread had the + chance to update, so that we can be sure it had the opportunity + to run a reasonable number of times before we stop. + */ + if (original_read_char != read_char) + seen_updates++; + original_read_char= read_char; + } + } + if (readloop > loop_max) + break; + Uint32 readSize= 1; + CHK(g_bh1->setPos(urandom(data.m_blob1_size)) == 0); + CHK(g_bh1->readData(&read_char, readSize) == 0); + CHK(readSize == 1); + ExecType commitType= readloop == loop_max ? Commit : NoCommit; + CHK(g_con->execute(commitType, AbortOnError, 1) == 0); + } + g_ndb->closeTransaction(g_con); + g_con= NULL; + } + + DBG("bug test 27370 - table scan blob reads"); + seen_updates= 0; + while (seen_updates < 50) + { + CHK((g_con= g_ndb->startTransaction()) != 0); + CHK((g_ops= g_con->getNdbScanOperation(g_opt.m_tname)) != 0); + CHK(g_ops->readTuples(NdbOperation::LM_CommittedRead) == 0); + CHK((g_bh1= g_ops->getBlobHandle("BL1")) != 0); + CHK(g_con->execute(NoCommit, AbortOnError, 1) == 0); + CHK(g_ops->nextResult(true) == 0); + + const Uint32 loop_max= 10; + char read_char; + char original_read_char= 0; + Uint32 readloop; + for (readloop= 0;; readloop++) + { + if (readloop > 0) + { + if (readloop > 1) + { + /* Compare against first read. */ + CHK(read_char == original_read_char); + } + else + { + /* + We count the number of times we see the other thread had the + chance to update, so that we can be sure it had the opportunity + to run a reasonable number of times before we stop. + */ + if (original_read_char != read_char) + seen_updates++; + original_read_char= read_char; + } + } + if (readloop > loop_max) + break; + Uint32 readSize= 1; + CHK(g_bh1->setPos(urandom(data.m_blob1_size)) == 0); + CHK(g_bh1->readData(&read_char, readSize) == 0); + CHK(readSize == 1); + CHK(g_con->execute(NoCommit, AbortOnError, 1) == 0); + } + + CHK(g_ops->nextResult(true) == 1); + g_ndb->closeTransaction(g_con); + g_con= NULL; + } + + data.m_thread_stop= true; + void *thread_return; + CHK(pthread_join(thread_handle, &thread_return) == 0); + DBG("bug 27370 - thread return status: " << + (thread_return ? (char *)thread_return : "<null>")); + CHK(thread_return == 0); + + g_con= NULL; + g_opr= NULL; + g_bh1= NULL; return 0; } @@ -1823,7 +2087,9 @@ static struct { int m_bug; int (*m_test)(); } g_bugtest[] = { - { 4088, bugtest_4088 } + { 4088, bugtest_4088 }, + { 27018, bugtest_27018 }, + { 27370, bugtest_27370 } }; NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) diff --git a/ndb/test/ndbapi/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers.cpp index 83a063d60d3..92e97f4e6e1 100644 --- a/ndb/test/ndbapi/testDataBuffers.cpp +++ b/ndb/test/ndbapi/testDataBuffers.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testDeadlock.cpp b/ndb/test/ndbapi/testDeadlock.cpp index 0070a7ecc83..045abf66d98 100644 --- a/ndb/test/ndbapi/testDeadlock.cpp +++ b/ndb/test/ndbapi/testDeadlock.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp index b992d492ad6..d6cc5dd7c62 100644 --- a/ndb/test/ndbapi/testDict.cpp +++ b/ndb/test/ndbapi/testDict.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -1022,8 +1021,8 @@ int verifyTablesAreEqual(const NdbDictionary::Table* pTab, const NdbDictionary:: if (!pTab->equal(*pTab2)){ g_err << "equal failed" << endl; - g_info << *pTab; - g_info << *pTab2; + g_info << *(NDBT_Table*)pTab; // gcc-4.1.2 + g_info << *(NDBT_Table*)pTab2; return NDBT_FAILED; } return NDBT_OK; @@ -1033,7 +1032,7 @@ int runGetPrimaryKey(NDBT_Context* ctx, NDBT_Step* step){ Ndb* pNdb = GETNDB(step); const NdbDictionary::Table* pTab = ctx->getTab(); ndbout << "|- " << pTab->getName() << endl; - g_info << *pTab; + g_info << *(NDBT_Table*)pTab; // Try to create table in db if (pTab->createTableInDb(pNdb) != 0){ return NDBT_FAILED; @@ -1890,6 +1889,52 @@ runDictOps(NDBT_Context* ctx, NDBT_Step* step) // replace by the Retrieved table pTab = pTab2; + // create indexes + const char** indlist = NDBT_Tables::getIndexes(tabName); + uint indnum = 0; + while (indlist != 0 && *indlist != 0) { + uint count = 0; + try_create_index: + count++; + if (count == 1) + g_info << "2: create index " << indnum << " " << *indlist << endl; + NdbDictionary::Index ind; + char indName[200]; + sprintf(indName, "%s_X%u", tabName, indnum); + ind.setName(indName); + ind.setTable(tabName); + if (strcmp(*indlist, "UNIQUE") == 0) { + ind.setType(NdbDictionary::Index::UniqueHashIndex); + ind.setLogging(pTab->getLogging()); + } else if (strcmp(*indlist, "ORDERED") == 0) { + ind.setType(NdbDictionary::Index::OrderedIndex); + ind.setLogging(false); + } else { + assert(false); + } + const char** indtemp = indlist; + while (*++indtemp != 0) { + ind.addColumn(*indtemp); + } + if (pDic->createIndex(ind) != 0) { + const NdbError err = pDic->getNdbError(); + if (count == 1) + g_err << "2: " << indName << ": create failed: " << err << endl; + if (err.code != 711) { + result = NDBT_FAILED; + break; + } + NdbSleep_MilliSleep(myRandom48(maxsleep)); + goto try_create_index; + } + indlist = ++indtemp; + indnum++; + } + if (result == NDBT_FAILED) + break; + + uint indcount = indnum; + int records = myRandom48(ctx->getNumRecords()); g_info << "2: load " << records << " records" << endl; HugoTransactions hugoTrans(*pTab); @@ -1901,6 +1946,32 @@ runDictOps(NDBT_Context* ctx, NDBT_Step* step) } NdbSleep_MilliSleep(myRandom48(maxsleep)); + // drop indexes + indnum = 0; + while (indnum < indcount) { + uint count = 0; + try_drop_index: + count++; + if (count == 1) + g_info << "2: drop index " << indnum << endl; + char indName[200]; + sprintf(indName, "%s_X%u", tabName, indnum); + if (pDic->dropIndex(indName, tabName) != 0) { + const NdbError err = pDic->getNdbError(); + if (count == 1) + g_err << "2: " << indName << ": drop failed: " << err << endl; + if (err.code != 711) { + result = NDBT_FAILED; + break; + } + NdbSleep_MilliSleep(myRandom48(maxsleep)); + goto try_drop_index; + } + indnum++; + } + if (result == NDBT_FAILED) + break; + g_info << "2: drop" << endl; { uint count = 0; diff --git a/ndb/test/ndbapi/testGrepVerify.cpp b/ndb/test/ndbapi/testGrepVerify.cpp index 52dcda9a162..461ee249985 100644 --- a/ndb/test/ndbapi/testGrepVerify.cpp +++ b/ndb/test/ndbapi/testGrepVerify.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testIndex.cpp b/ndb/test/ndbapi/testIndex.cpp index bec649cf84d..78672cd519f 100644 --- a/ndb/test/ndbapi/testIndex.cpp +++ b/ndb/test/ndbapi/testIndex.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testInterpreter.cpp b/ndb/test/ndbapi/testInterpreter.cpp index 5d930d3d555..0dc032ba7aa 100644 --- a/ndb/test/ndbapi/testInterpreter.cpp +++ b/ndb/test/ndbapi/testInterpreter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testMgm.cpp b/ndb/test/ndbapi/testMgm.cpp index ef653d3f972..b7037e682f9 100644 --- a/ndb/test/ndbapi/testMgm.cpp +++ b/ndb/test/ndbapi/testMgm.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -21,6 +20,8 @@ #include <NdbRestarter.hpp> #include <Vector.hpp> #include <random.h> +#include <mgmapi.h> +#include <mgmapi_debug.h> int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ @@ -167,6 +168,26 @@ int runTestSingleUserMode(NDBT_Context* ctx, NDBT_Step* step){ return result; } +int runTestApiSession(NDBT_Context* ctx, NDBT_Step* step) +{ + char *mgm= ctx->getRemoteMgm(); + + NdbMgmHandle h; + h= ndb_mgm_create_handle(); + ndb_mgm_set_connectstring(h, mgm); + ndb_mgm_connect(h,0,0,0); + int s= ndb_mgm_get_fd(h); + write(s,"get",3); + ndb_mgm_disconnect(h); + ndb_mgm_destroy_handle(&h); + /** NOTE: WE CANNOT REALLY TEST ANYTHING in 5.0 + * + * a more conservative patch for 5.0, full get and list + * sessions in 5.1. + * + * This is kept so that we can at least manually test easily + */ +} NDBT_TESTSUITE(testMgm); @@ -175,6 +196,11 @@ TESTCASE("SingleUserMode", INITIALIZER(runTestSingleUserMode); FINALIZER(runClearTable); } +TESTCASE("ApiSessionFailure", + "Test failures in MGMAPI session"){ + INITIALIZER(runTestApiSession); + +} NDBT_TESTSUITE_END(testMgm); int main(int argc, const char** argv){ diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp index 5bdcaf9fd5a..ec510c8b270 100644 --- a/ndb/test/ndbapi/testNdbApi.cpp +++ b/ndb/test/ndbapi/testNdbApi.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -1235,6 +1234,76 @@ int runScan_4006(NDBT_Context* ctx, NDBT_Step* step){ return result; } +static void +testExecuteAsynchCallback(int res, NdbTransaction *con, void *data_ptr) +{ + int *res_ptr= (int *)data_ptr; + + *res_ptr= res; +} + +int runTestExecuteAsynch(NDBT_Context* ctx, NDBT_Step* step){ + /* Test that NdbTransaction::executeAsynch() works (BUG#27495). */ + int result = NDBT_OK; + const NdbDictionary::Table* pTab = ctx->getTab(); + + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); + if (pNdb == NULL){ + ndbout << "pNdb == NULL" << endl; + return NDBT_FAILED; + } + if (pNdb->init(2048)){ + ERR(pNdb->getNdbError()); + delete pNdb; + return NDBT_FAILED; + } + + NdbConnection* pCon = pNdb->startTransaction(); + if (pCon == NULL){ + ERR(pNdb->getNdbError()); + delete pNdb; + return NDBT_FAILED; + } + + NdbScanOperation* pOp = pCon->getNdbScanOperation(pTab->getName()); + if (pOp == NULL){ + ERR(pOp->getNdbError()); + pNdb->closeTransaction(pCon); + delete pNdb; + return NDBT_FAILED; + } + + if (pOp->readTuples() != 0){ + ERR(pOp->getNdbError()); + pNdb->closeTransaction(pCon); + delete pNdb; + return NDBT_FAILED; + } + + if (pOp->getValue(NdbDictionary::Column::FRAGMENT) == 0){ + ERR(pOp->getNdbError()); + pNdb->closeTransaction(pCon); + delete pNdb; + return NDBT_FAILED; + } + int res= 42; + pCon->executeAsynch(NoCommit, testExecuteAsynchCallback, &res); + while(pNdb->pollNdb(100000) == 0) + ; + if (res != 0){ + ERR(pCon->getNdbError()); + ndbout << "Error returned from execute: " << res << endl; + result= NDBT_FAILED; + } + + pNdb->closeTransaction(pCon); + + delete pNdb; + + return result; +} + + template class Vector<NdbScanOperation*>; int @@ -1353,6 +1422,10 @@ TESTCASE("Scan_4006", INITIALIZER(runScan_4006); FINALIZER(runClearTable); } +TESTCASE("ExecuteAsynch", + "Check that executeAsync() works (BUG#27495)\n"){ + INITIALIZER(runTestExecuteAsynch); +} TESTCASE("Bug28443", ""){ INITIALIZER(runBug28443); diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp index c0bc8b7747c..fd5d6f15e71 100644 --- a/ndb/test/ndbapi/testNodeRestart.cpp +++ b/ndb/test/ndbapi/testNodeRestart.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp index 942ee2ec966..8f77f0bb062 100644 --- a/ndb/test/ndbapi/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -47,7 +46,6 @@ struct Opt { int m_die; bool m_dups; NdbDictionary::Object::FragmentType m_fragtype; - unsigned m_subsubloop; const char* m_index; unsigned m_loop; bool m_msglock; @@ -56,6 +54,7 @@ struct Opt { unsigned m_pctnull; unsigned m_rows; unsigned m_samples; + unsigned m_scanbatch; unsigned m_scanpar; unsigned m_scanstop; int m_seed; @@ -74,7 +73,6 @@ struct Opt { m_die(0), m_dups(false), m_fragtype(NdbDictionary::Object::FragUndefined), - m_subsubloop(4), m_index(0), m_loop(1), m_msglock(true), @@ -83,6 +81,7 @@ struct Opt { m_pctnull(10), m_rows(1000), m_samples(0), + m_scanbatch(0), m_scanpar(0), m_scanstop(0), m_seed(-1), @@ -120,9 +119,10 @@ printhelp() << " -pctnull N pct NULL values in nullable column [" << d.m_pctnull << "]" << endl << " -rows N rows per thread [" << d.m_rows << "]" << endl << " -samples N samples for some timings (0=all) [" << d.m_samples << "]" << endl - << " -scanpar N scan parallelism [" << d.m_scanpar << "]" << endl + << " -scanbatch N scan batch 0=default [" << d.m_scanbatch << "]" << endl + << " -scanpar N scan parallel 0=default [" << d.m_scanpar << "]" << endl << " -seed N srandom seed 0=loop number -1=random [" << d.m_seed << "]" << endl - << " -subloop N subtest loop count [" << d.m_subloop << "]" << endl + << " -subloop N subtest (and subsubtest) loop count [" << d.m_subloop << "]" << endl << " -table xyz only given table numbers (digits 0-9)" << endl << " -threads N number of threads [" << d.m_threads << "]" << endl << " -vN verbosity [" << d.m_v << "]" << endl @@ -294,6 +294,7 @@ struct Par : public Opt { Set& set() const { assert(m_set != 0); return *m_set; } Tmr* m_tmr; Tmr& tmr() const { assert(m_tmr != 0); return *m_tmr; } + char m_currcase[2]; unsigned m_lno; unsigned m_slno; unsigned m_totrows; @@ -302,6 +303,7 @@ struct Par : public Opt { unsigned m_pctrange; unsigned m_pctbrange; int m_bdir; + bool m_noindexkeyupdate; // choice of key bool m_randomkey; // do verify after read @@ -330,6 +332,7 @@ struct Par : public Opt { m_pctrange(40), m_pctbrange(80), m_bdir(0), + m_noindexkeyupdate(false), m_randomkey(false), m_verify(false), m_deadlock(false), @@ -337,7 +340,9 @@ struct Par : public Opt { m_lockmode(NdbOperation::LM_Read), m_tupscan(false), m_ordered(false), - m_descending(false) { + m_descending(false) + { + m_currcase[0] = 0; } }; @@ -892,6 +897,8 @@ struct Tab { const Col** m_col; unsigned m_itabs; const ITab** m_itab; + unsigned m_orderedindexes; + unsigned m_hashindexes; // pk must contain an Unsigned column unsigned m_keycol; void coladd(unsigned k, Col* colptr); @@ -906,6 +913,8 @@ Tab::Tab(const char* name, unsigned cols, unsigned itabs, unsigned keycol) : m_col(new const Col* [cols + 1]), m_itabs(itabs), m_itab(new const ITab* [itabs + 1]), + m_orderedindexes(0), + m_hashindexes(0), m_keycol(keycol) { for (unsigned k = 0; k <= cols; k++) @@ -935,8 +944,12 @@ Tab::coladd(unsigned k, Col* colptr) void Tab::itabadd(unsigned j, ITab* itabptr) { - assert(j < m_itabs && m_itab[j] == 0); + assert(j < m_itabs && m_itab[j] == 0 && itabptr != 0); m_itab[j] = itabptr; + if (itabptr->m_type == ITab::OrderedIndex) + m_orderedindexes++; + else + m_hashindexes++; } static NdbOut& @@ -1434,7 +1447,7 @@ Con::readTuples(Par par) int scan_flags = 0; if (par.m_tupscan) scan_flags |= NdbScanOperation::SF_TupScan; - CHKCON(m_scanop->readTuples(par.m_lockmode, scan_flags, par.m_scanpar) == 0, *this); + CHKCON(m_scanop->readTuples(par.m_lockmode, scan_flags, par.m_scanpar, par.m_scanbatch) == 0, *this); return 0; } @@ -1442,7 +1455,12 @@ int Con::readIndexTuples(Par par) { assert(m_tx != 0 && m_indexscanop != 0); - CHKCON(m_indexscanop->readTuples(par.m_lockmode, 0, par.m_scanpar, par.m_ordered, par.m_descending) == 0, *this); + int scan_flags = 0; + if (par.m_ordered) + scan_flags |= NdbScanOperation::SF_OrderBy; + if (par.m_descending) + scan_flags |= NdbScanOperation::SF_Descending; + CHKCON(m_indexscanop->readTuples(par.m_lockmode, scan_flags, par.m_scanpar, par.m_scanbatch) == 0, *this); return 0; } @@ -2193,7 +2211,7 @@ struct Row { void copy(const Row& row2); void calc(Par par, unsigned i, unsigned mask = 0); const Row& dbrow() const; - int verify(Par par, const Row& row2) const; + int verify(Par par, const Row& row2, bool pkonly) const; int insrow(Par par); int updrow(Par par); int updrow(Par par, const ITab& itab); @@ -2275,15 +2293,18 @@ Row::dbrow() const } int -Row::verify(Par par, const Row& row2) const +Row::verify(Par par, const Row& row2, bool pkonly) const { const Tab& tab = m_tab; const Row& row1 = *this; assert(&row1.m_tab == &row2.m_tab && row1.m_exist && row2.m_exist); for (unsigned k = 0; k < tab.m_cols; k++) { - const Val& val1 = *row1.m_val[k]; - const Val& val2 = *row2.m_val[k]; - CHK(val1.verify(par, val2) == 0); + const Col& col = row1.m_val[k]->m_col; + if (! pkonly || col.m_pk) { + const Val& val1 = *row1.m_val[k]; + const Val& val2 = *row2.m_val[k]; + CHK(val1.verify(par, val2) == 0); + } } return 0; } @@ -2585,8 +2606,11 @@ struct Set { int getval(Par par); int getkey(Par par, unsigned* i); int putval(unsigned i, bool force, unsigned n = ~0); + // sort rows in-place according to ordered index + void sort(Par par, const ITab& itab); + void sort(Par par, const ITab& itab, unsigned lo, unsigned hi); // verify - int verify(Par par, const Set& set2) const; + int verify(Par par, const Set& set2, bool pkonly) const; int verifyorder(Par par, const ITab& itab, bool descending) const; // protect structure NdbMutex* m_mutex; @@ -2890,6 +2914,7 @@ Set::getkey(Par par, unsigned* i) assert(m_rec[k] != 0); const char* aRef = m_rec[k]->aRef(); Uint32 key = *(const Uint32*)aRef; + LL5("getkey: " << key); CHK(key < m_rows); *i = key; return 0; @@ -2922,8 +2947,43 @@ Set::putval(unsigned i, bool force, unsigned n) return 0; } +void +Set::sort(Par par, const ITab& itab) +{ + if (m_rows != 0) + sort(par, itab, 0, m_rows - 1); +} + +void +Set::sort(Par par, const ITab& itab, unsigned lo, unsigned hi) +{ + assert(lo < m_rows && hi < m_rows && lo <= hi); + Row* const p = m_row[lo]; + unsigned i = lo; + unsigned j = hi; + while (i < j) { + while (i < j && m_row[j]->cmp(par, *p, itab) >= 0) + j--; + if (i < j) { + m_row[i] = m_row[j]; + i++; + } + while (i < j && m_row[i]->cmp(par, *p, itab) <= 0) + i++; + if (i < j) { + m_row[j] = m_row[i]; + j--; + } + } + m_row[i] = p; + if (lo < i) + sort(par, itab, lo, i - 1); + if (hi > i) + sort(par, itab, i + 1, hi); +} + int -Set::verify(Par par, const Set& set2) const +Set::verify(Par par, const Set& set2, bool pkonly) const { assert(&m_tab == &set2.m_tab && m_rows == set2.m_rows); LL4("verify set1 count=" << count() << " vs set2 count=" << set2.count()); @@ -2932,7 +2992,7 @@ Set::verify(Par par, const Set& set2) const if (exist(i) != set2.exist(i)) { ok = false; } else if (exist(i)) { - if (dbrow(i).verify(par, set2.dbrow(i)) != 0) + if (dbrow(i).verify(par, set2.dbrow(i), pkonly) != 0) ok = false; } if (! ok) { @@ -3490,7 +3550,7 @@ pkread(Par par) con.closeTransaction(); } if (par.m_verify) - CHK(set1.verify(par, set2) == 0); + CHK(set1.verify(par, set2, false) == 0); return 0; } @@ -3657,7 +3717,7 @@ hashindexread(Par par, const ITab& itab) con.closeTransaction(); } if (par.m_verify) - CHK(set1.verify(par, set2) == 0); + CHK(set1.verify(par, set2, false) == 0); return 0; } @@ -3698,7 +3758,7 @@ scanreadtable(Par par) } con.closeTransaction(); if (par.m_verify) - CHK(set1.verify(par, set2) == 0); + CHK(set1.verify(par, set2, false) == 0); LL3("scanread " << tab.m_name << " done rows=" << n); return 0; } @@ -3730,6 +3790,23 @@ scanreadtablefast(Par par, unsigned countcheck) return 0; } +// try to get interesting bounds +static void +calcscanbounds(Par par, const ITab& itab, BSet& bset, const Set& set, Set& set1) +{ + while (true) { + bset.calc(par); + bset.filter(par, set, set1); + unsigned n = set1.count(); + // prefer proper subset + if (0 < n && n < set.m_rows) + break; + if (urandom(5) == 0) + break; + set1.reset(); + } +} + static int scanreadindex(Par par, const ITab& itab, BSet& bset, bool calc) { @@ -3738,21 +3815,11 @@ scanreadindex(Par par, const ITab& itab, BSet& bset, bool calc) const Set& set = par.set(); Set set1(tab, set.m_rows); if (calc) { - while (true) { - bset.calc(par); - bset.filter(par, set, set1); - unsigned n = set1.count(); - // prefer proper subset - if (0 < n && n < set.m_rows) - break; - if (urandom(3) == 0) - break; - set1.reset(); - } + calcscanbounds(par, itab, bset, set, set1); } else { bset.filter(par, set, set1); } - LL3("scanread " << itab.m_name << " " << bset << " lockmode=" << par.m_lockmode << " expect=" << set1.count() << " verify=" << par.m_verify << " ordered=" << par.m_ordered << " descending=" << par.m_descending); + LL3("scanread " << itab.m_name << " " << bset << " lockmode=" << par.m_lockmode << " expect=" << set1.count() << " ordered=" << par.m_ordered << " descending=" << par.m_descending << " verify=" << par.m_verify); Set set2(tab, set.m_rows); CHK(con.startTransaction() == 0); CHK(con.getNdbIndexScanOperation(itab, tab) == 0); @@ -3780,7 +3847,7 @@ scanreadindex(Par par, const ITab& itab, BSet& bset, bool calc) } con.closeTransaction(); if (par.m_verify) { - CHK(set1.verify(par, set2) == 0); + CHK(set1.verify(par, set2, false) == 0); if (par.m_ordered) CHK(set2.verifyorder(par, itab, par.m_descending) == 0); } @@ -3825,17 +3892,7 @@ scanreadfilter(Par par, const ITab& itab, BSet& bset, bool calc) const Set& set = par.set(); Set set1(tab, set.m_rows); if (calc) { - while (true) { - bset.calc(par); - bset.filter(par, set, set1); - unsigned n = set1.count(); - // prefer proper subset - if (0 < n && n < set.m_rows) - break; - if (urandom(3) == 0) - break; - set1.reset(); - } + calcscanbounds(par, itab, bset, set, set1); } else { bset.filter(par, set, set1); } @@ -3867,7 +3924,7 @@ scanreadfilter(Par par, const ITab& itab, BSet& bset, bool calc) } con.closeTransaction(); if (par.m_verify) { - CHK(set1.verify(par, set2) == 0); + CHK(set1.verify(par, set2, false) == 0); } LL3("scanfilter " << itab.m_name << " done rows=" << n); return 0; @@ -3877,7 +3934,7 @@ static int scanreadindex(Par par, const ITab& itab) { const Tab& tab = par.tab(); - for (unsigned i = 0; i < par.m_subsubloop; i++) { + for (unsigned i = 0; i < par.m_subloop; i++) { if (itab.m_type == ITab::OrderedIndex) { BSet bset(tab, itab, par.m_rows); CHK(scanreadfilter(par, itab, bset, true) == 0); @@ -4068,12 +4125,19 @@ out: } static int -scanupdateindex(Par par, const ITab& itab, const BSet& bset) +scanupdateindex(Par par, const ITab& itab, BSet& bset, bool calc) { Con& con = par.con(); const Tab& tab = par.tab(); Set& set = par.set(); - LL3("scan update " << itab.m_name); + // expected + Set set1(tab, set.m_rows); + if (calc) { + calcscanbounds(par, itab, bset, set, set1); + } else { + bset.filter(par, set, set1); + } + LL3("scan update " << itab.m_name << " " << bset << " expect=" << set1.count() << " ordered=" << par.m_ordered << " descending=" << par.m_descending << " verify=" << par.m_verify); Set set2(tab, set.m_rows); par.m_lockmode = NdbOperation::LM_Exclusive; CHK(con.startTransaction() == 0); @@ -4117,7 +4181,7 @@ scanupdateindex(Par par, const ITab& itab, const BSet& bset) Par par2 = par; par2.m_con = &con2; set.dbsave(i); - set.calc(par, i); + set.calc(par, i, ! par.m_noindexkeyupdate ? 0 : itab.m_colmask); CHKTRY(set.setrow(par2, i) == 0, set.unlock()); LL4("scan update " << itab.m_name << ": " << row); lst.push(i); @@ -4131,6 +4195,7 @@ scanupdateindex(Par par, const ITab& itab, const BSet& bset) goto out; } con2.closeTransaction(); + LL4("scanupdateindex: committed batch [at 1]"); set.lock(); set.notpending(lst); set.dbdiscard(lst); @@ -4148,6 +4213,7 @@ scanupdateindex(Par par, const ITab& itab, const BSet& bset) goto out; } con2.closeTransaction(); + LL4("scanupdateindex: committed batch [at 2]"); set.lock(); set.notpending(lst); set.dbdiscard(lst); @@ -4160,6 +4226,11 @@ scanupdateindex(Par par, const ITab& itab, const BSet& bset) } out: con2.closeTransaction(); + if (par.m_verify) { + CHK(set1.verify(par, set2, true) == 0); + if (par.m_ordered) + CHK(set2.verifyorder(par, itab, par.m_descending) == 0); + } LL3("scan update " << itab.m_name << " rows updated=" << count); con.closeTransaction(); return 0; @@ -4169,11 +4240,10 @@ static int scanupdateindex(Par par, const ITab& itab) { const Tab& tab = par.tab(); - for (unsigned i = 0; i < par.m_subsubloop; i++) { + for (unsigned i = 0; i < par.m_subloop; i++) { if (itab.m_type == ITab::OrderedIndex) { BSet bset(tab, itab, par.m_rows); - bset.calc(par); - CHK(scanupdateindex(par, itab, bset) == 0); + CHK(scanupdateindex(par, itab, bset, true) == 0); } else { CHK(hashindexupdate(par, itab) == 0); } @@ -4205,22 +4275,6 @@ scanupdateall(Par par) // medium level routines static int -readverify(Par par) -{ - if (par.m_noverify) - return 0; - par.m_verify = true; - if (par.m_abortpct != 0) { - LL2("skip verify in this version"); // implement in 5.0 version - par.m_verify = false; - } - par.m_lockmode = NdbOperation::LM_CommittedRead; - CHK(pkread(par) == 0); - CHK(scanreadall(par) == 0); - return 0; -} - -static int readverifyfull(Par par) { if (par.m_noverify) @@ -4237,8 +4291,7 @@ readverifyfull(Par par) CHK(scanreadtable(par) == 0); // once more via tup scan par.m_tupscan = true; - if (NDB_VERSION < MAKE_VERSION(5, 1, 0)) //TODO - CHK(scanreadtable(par) == 0); + CHK(scanreadtable(par) == 0); } // each thread scans different indexes for (unsigned i = 0; i < tab.m_itabs; i++) { @@ -4278,7 +4331,7 @@ pkops(Par par) { const Tab& tab = par.tab(); par.m_randomkey = true; - for (unsigned i = 0; i < par.m_subsubloop; i++) { + for (unsigned i = 0; i < par.m_subloop; i++) { unsigned j = 0; while (j < tab.m_itabs) { if (tab.m_itab[j] != 0) { @@ -4378,6 +4431,33 @@ mixedoperations(Par par) } static int +parallelorderedupdate(Par par) +{ + const Tab& tab = par.tab(); + unsigned k = 0; + for (unsigned i = 0; i < tab.m_itabs; i++) { + if (tab.m_itab[i] == 0) + continue; + const ITab& itab = *tab.m_itab[i]; + if (itab.m_type != ITab::OrderedIndex) + continue; + // cannot sync threads yet except via subloop + if (k++ == par.m_slno % tab.m_orderedindexes) { + LL3("parallelorderedupdate: " << itab.m_name); + par.m_noindexkeyupdate = true; + par.m_ordered = true; + par.m_descending = (par.m_slno != 0); + par.m_verify = true; + BSet bset(tab, itab, par.m_rows); // empty bounds + // prefer empty bounds + unsigned sel = urandom(10); + CHK(scanupdateindex(par, itab, bset, sel < 2) == 0); + } + } + return 0; +} + +static int pkupdateindexbuild(Par par) { if (par.m_no == 0) { @@ -4579,7 +4659,7 @@ getthrno() static int runstep(Par par, const char* fname, TFunc func, unsigned mode) { - LL2(fname); + LL2("step: " << fname); const int threads = (mode & ST ? 1 : par.m_threads); int n; for (n = 0; n < threads; n++) { @@ -4605,7 +4685,12 @@ runstep(Par par, const char* fname, TFunc func, unsigned mode) return 0; } -#define RUNSTEP(par, func, mode) CHK(runstep(par, #func, func, mode) == 0) +#define RUNSTEP(par, func, mode) \ + CHK(runstep(par, #func, func, mode) == 0) + +#define SUBLOOP(par) \ + "subloop: " << par.m_lno << "/" << par.m_currcase << "/" << \ + par.m_tab->m_name << "/" << par.m_slno static int tbuild(Par par) @@ -4614,20 +4699,30 @@ tbuild(Par par) RUNSTEP(par, createtable, ST); RUNSTEP(par, invalidatetable, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { - if (par.m_slno % 2 == 0) { + LL1(SUBLOOP(par)); + if (par.m_slno % 3 == 0) { RUNSTEP(par, createindex, ST); RUNSTEP(par, invalidateindex, MT); RUNSTEP(par, pkinsert, MT); + RUNSTEP(par, pkupdate, MT); + } else if (par.m_slno % 3 == 1) { + RUNSTEP(par, pkinsert, MT); + RUNSTEP(par, createindex, ST); + RUNSTEP(par, invalidateindex, MT); + RUNSTEP(par, pkupdate, MT); } else { RUNSTEP(par, pkinsert, MT); + RUNSTEP(par, pkupdate, MT); RUNSTEP(par, createindex, ST); RUNSTEP(par, invalidateindex, MT); } - RUNSTEP(par, pkupdate, MT); RUNSTEP(par, readverifyfull, MT); - RUNSTEP(par, pkdelete, MT); - RUNSTEP(par, readverifyfull, MT); - RUNSTEP(par, dropindex, ST); + // leave last one + if (par.m_slno + 1 < par.m_subloop) { + RUNSTEP(par, pkdelete, MT); + RUNSTEP(par, readverifyfull, MT); + RUNSTEP(par, dropindex, ST); + } } return 0; } @@ -4643,7 +4738,7 @@ tindexscan(Par par) RUNSTEP(par, pkinsert, MT); RUNSTEP(par, readverifyfull, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { - LL4("subloop " << par.m_slno); + LL1(SUBLOOP(par)); RUNSTEP(par, readverifyindex, MT); } return 0; @@ -4659,6 +4754,7 @@ tpkops(Par par) RUNSTEP(par, createindex, ST); RUNSTEP(par, invalidateindex, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); RUNSTEP(par, pkops, MT); LL2("rows=" << par.set().count()); RUNSTEP(par, readverifyfull, MT); @@ -4675,13 +4771,14 @@ tpkopsread(Par par) RUNSTEP(par, pkinsert, MT); RUNSTEP(par, createindex, ST); RUNSTEP(par, invalidateindex, MT); - RUNSTEP(par, readverify, ST); + RUNSTEP(par, readverifyfull, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); RUNSTEP(par, pkupdatescanread, MT); - RUNSTEP(par, readverify, ST); + RUNSTEP(par, readverifyfull, MT); } RUNSTEP(par, pkdelete, MT); - RUNSTEP(par, readverify, ST); + RUNSTEP(par, readverifyfull, MT); return 0; } @@ -4694,10 +4791,11 @@ tmixedops(Par par) RUNSTEP(par, pkinsert, MT); RUNSTEP(par, createindex, ST); RUNSTEP(par, invalidateindex, MT); - RUNSTEP(par, readverify, ST); + RUNSTEP(par, readverifyfull, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); RUNSTEP(par, mixedoperations, MT); - RUNSTEP(par, readverify, ST); + RUNSTEP(par, readverifyfull, MT); } return 0; } @@ -4710,9 +4808,10 @@ tbusybuild(Par par) RUNSTEP(par, invalidatetable, MT); RUNSTEP(par, pkinsert, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); RUNSTEP(par, pkupdateindexbuild, MT); RUNSTEP(par, invalidateindex, MT); - RUNSTEP(par, readverify, ST); + RUNSTEP(par, readverifyfull, MT); RUNSTEP(par, dropindex, ST); } return 0; @@ -4728,10 +4827,29 @@ trollback(Par par) RUNSTEP(par, pkinsert, MT); RUNSTEP(par, createindex, ST); RUNSTEP(par, invalidateindex, MT); - RUNSTEP(par, readverify, ST); + RUNSTEP(par, readverifyfull, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); RUNSTEP(par, mixedoperations, MT); - RUNSTEP(par, readverify, ST); + RUNSTEP(par, readverifyfull, MT); + } + return 0; +} + +static int +tparupdate(Par par) +{ + RUNSTEP(par, droptable, ST); + RUNSTEP(par, createtable, ST); + RUNSTEP(par, invalidatetable, MT); + RUNSTEP(par, pkinsert, MT); + RUNSTEP(par, createindex, ST); + RUNSTEP(par, invalidateindex, MT); + RUNSTEP(par, readverifyfull, MT); + for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); + RUNSTEP(par, parallelorderedupdate, MT); + RUNSTEP(par, readverifyfull, MT); } return 0; } @@ -4744,6 +4862,7 @@ ttimebuild(Par par) RUNSTEP(par, createtable, ST); RUNSTEP(par, invalidatetable, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); RUNSTEP(par, pkinsert, MT); t1.on(); RUNSTEP(par, createindex, ST); @@ -4763,6 +4882,7 @@ ttimemaint(Par par) RUNSTEP(par, createtable, ST); RUNSTEP(par, invalidatetable, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); RUNSTEP(par, pkinsert, MT); t1.on(); RUNSTEP(par, pkupdate, MT); @@ -4792,6 +4912,7 @@ ttimescan(Par par) RUNSTEP(par, createtable, ST); RUNSTEP(par, invalidatetable, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); RUNSTEP(par, pkinsert, MT); RUNSTEP(par, createindex, ST); par.m_tmr = &t1; @@ -4818,6 +4939,7 @@ ttimepkread(Par par) RUNSTEP(par, createtable, ST); RUNSTEP(par, invalidatetable, MT); for (par.m_slno = 0; par.m_slno < par.m_subloop; par.m_slno++) { + LL1(SUBLOOP(par)); RUNSTEP(par, pkinsert, MT); RUNSTEP(par, createindex, ST); par.m_tmr = &t1; @@ -4859,6 +4981,7 @@ tcaselist[] = { TCase("e", tmixedops, "pk operations and scan operations"), TCase("f", tbusybuild, "pk operations and index build"), TCase("g", trollback, "operations with random rollbacks"), + TCase("h", tparupdate, "parallel ordered update (bug20446)"), TCase("t", ttimebuild, "time index build"), TCase("u", ttimemaint, "time index maintenance"), TCase("v", ttimescan, "time full scan table vs index on pk"), @@ -4916,17 +5039,16 @@ printtables() static int runtest(Par par) { - LL1("start"); if (par.m_seed == -1) { // good enough for daily run - unsigned short seed = (getpid() ^ time(0)); - LL1("random seed: " << seed); + unsigned short seed = (unsigned short)getpid(); + LL0("random seed: " << seed); srandom((unsigned)seed); } else if (par.m_seed != 0) { - LL1("random seed: " << par.m_seed); + LL0("random seed: " << par.m_seed); srandom(par.m_seed); } else { - LL1("random seed: loop number"); + LL0("random seed: loop number"); } // cs assert(par.m_csname != 0); @@ -4951,22 +5073,25 @@ runtest(Par par) assert(thr.m_thread != 0); } for (par.m_lno = 0; par.m_loop == 0 || par.m_lno < par.m_loop; par.m_lno++) { - LL1("loop " << par.m_lno); - if (par.m_seed == 0) + LL1("loop: " << par.m_lno); + if (par.m_seed == 0) { + LL1("random seed: " << par.m_lno); srandom(par.m_lno); + } for (unsigned i = 0; i < tcasecount; i++) { const TCase& tcase = tcaselist[i]; if (par.m_case != 0 && strchr(par.m_case, tcase.m_name[0]) == 0) continue; + sprintf(par.m_currcase, "%c", tcase.m_name[0]); makebuiltintables(par); - LL1("case " << tcase.m_name << " - " << tcase.m_desc); + LL1("case: " << par.m_lno << "/" << tcase.m_name << " - " << tcase.m_desc); for (unsigned j = 0; j < tabcount; j++) { if (tablist[j] == 0) continue; const Tab& tab = *tablist[j]; par.m_tab = &tab; par.m_set = new Set(tab, par.m_totrows); - LL1("table " << tab.m_name); + LL1("table: " << par.m_lno << "/" << tcase.m_name << "/" << tab.m_name); CHK(tcase.m_func(par) == 0); delete par.m_set; par.m_set = 0; @@ -4985,15 +5110,21 @@ runtest(Par par) delete [] g_thrlist; g_thrlist = 0; con.disconnect(); - LL1("done"); return 0; } -NDB_COMMAND(testOIBasic, "testOIBasic", "testOIBasic", "testOIBasic", 65535) +static const char* g_progname = "testOIBasic"; + +int +main(int argc, char** argv) { ndb_init(); - if (ndbout_mutex == NULL) - ndbout_mutex = NdbMutex_Create(); + unsigned i; + ndbout << g_progname; + for (i = 1; i < argc; i++) + ndbout << " " << argv[i]; + ndbout << endl; + ndbout_mutex = NdbMutex_Create(); while (++argv, --argc > 0) { const char* arg = argv[0]; if (*arg != '-') { @@ -5103,6 +5234,12 @@ NDB_COMMAND(testOIBasic, "testOIBasic", "testOIBasic", "testOIBasic", 65535) continue; } } + if (strcmp(arg, "-scanbatch") == 0) { + if (++argv, --argc > 0) { + g_opt.m_scanbatch = atoi(argv[0]); + continue; + } + } if (strcmp(arg, "-scanpar") == 0) { if (++argv, --argc > 0) { g_opt.m_scanpar = atoi(argv[0]); diff --git a/ndb/test/ndbapi/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp index 505b1620900..1f610cade4a 100644 --- a/ndb/test/ndbapi/testOperations.cpp +++ b/ndb/test/ndbapi/testOperations.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testOrderedIndex.cpp b/ndb/test/ndbapi/testOrderedIndex.cpp index b3a75410646..60eaca3248b 100644 --- a/ndb/test/ndbapi/testOrderedIndex.cpp +++ b/ndb/test/ndbapi/testOrderedIndex.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testPartitioning.cpp b/ndb/test/ndbapi/testPartitioning.cpp index 9d67c27354b..da6889e13c1 100644 --- a/ndb/test/ndbapi/testPartitioning.cpp +++ b/ndb/test/ndbapi/testPartitioning.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testReadPerf.cpp b/ndb/test/ndbapi/testReadPerf.cpp index ba5f3c4232d..17ef60c1849 100644 --- a/ndb/test/ndbapi/testReadPerf.cpp +++ b/ndb/test/ndbapi/testReadPerf.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testRestartGci.cpp b/ndb/test/ndbapi/testRestartGci.cpp index 4e541d1f38f..7fac47fe3fb 100644 --- a/ndb/test/ndbapi/testRestartGci.cpp +++ b/ndb/test/ndbapi/testRestartGci.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testSRBank.cpp b/ndb/test/ndbapi/testSRBank.cpp index 6d57724f4c6..dfe8ebcbd01 100644 --- a/ndb/test/ndbapi/testSRBank.cpp +++ b/ndb/test/ndbapi/testSRBank.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testScan.cpp b/ndb/test/ndbapi/testScan.cpp index 882ed649b9a..f7bb14c33d6 100644 --- a/ndb/test/ndbapi/testScan.cpp +++ b/ndb/test/ndbapi/testScan.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testScanFilter.cpp b/ndb/test/ndbapi/testScanFilter.cpp new file mode 100644 index 00000000000..5098d83745b --- /dev/null +++ b/ndb/test/ndbapi/testScanFilter.cpp @@ -0,0 +1,850 @@ +/* Copyright (C) 2007 MySQL 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 */ + +#include <NDBT.hpp> +#include <NDBT_Test.hpp> + +#define ERR_EXIT(obj, msg) \ +do \ +{ \ +fprintf(stderr, "%s: %s (%d) in %s:%d\n", \ +msg, obj->getNdbError().message, obj->getNdbError().code, __FILE__, __LINE__); \ +exit(-1); \ +} \ +while (0); + +#define PRINT_ERROR(code,msg) \ +do \ +{ \ +fprintf(stderr, "Error in %s, line: %d, code: %d, msg: %s.\n", __FILE__, __LINE__, code, msg); \ +} \ +while (0); + +#define MYSQLERROR(mysql) { \ + PRINT_ERROR(mysql_errno(&mysql),mysql_error(&mysql)); \ + exit(-1); } +#define APIERROR(error) { \ + PRINT_ERROR(error.code,error.message); \ + exit(-1); } + +#define TEST_NAME "TestScanFilter" +#define TABLE_NAME "TABLE_SCAN" + +const char *COL_NAME[] = {"id", "i", "j", "k", "l", "m", "n"}; +const char COL_LEN = 7; +/* +* Not to change TUPLE_NUM, because the column in TABLE_NAME is fixed, +* there are six columns, 'i', 'j', 'k', 'l', 'm', 'n', and each on is equal to 1 or 1, +* Since each tuple should be unique in this case, then TUPLE_NUM = 2 power 6 = 64 +*/ +const int TUPLE_NUM = (int)pow(2, COL_LEN-1); + +/* +* the recursive level of random scan filter, can +* modify this parameter more or less, range from +* 1 to 100, larger num consumes more scan time +*/ +const int RECURSIVE_LEVEL = 10; + +const int MAX_STR_LEN = (RECURSIVE_LEVEL * (COL_LEN+1) * 4); + +/* +* Each time stands for one test, it will produce a random +* filter string, and scan through ndb api and through +* calculation with tuples' data, then compare the result, +* if they are equal, this test passed, or failed. +* Only all TEST_NUM times tests passed, we can believe +* the suite of test cases are okay. +* Change TEST_NUM to larger will need more time to test +*/ +const int TEST_NUM = 5000; + + +/* Table definition*/ +static +const +NDBT_Attribute MYTAB1Attribs[] = { + NDBT_Attribute("id", NdbDictionary::Column::Unsigned, 1, true), + NDBT_Attribute("i", NdbDictionary::Column::Unsigned), + NDBT_Attribute("j", NdbDictionary::Column::Unsigned), + NDBT_Attribute("k", NdbDictionary::Column::Unsigned), + NDBT_Attribute("l", NdbDictionary::Column::Unsigned), + NDBT_Attribute("m", NdbDictionary::Column::Unsigned), + NDBT_Attribute("n", NdbDictionary::Column::Unsigned), +}; +static +const +NDBT_Table MYTAB1(TABLE_NAME, sizeof(MYTAB1Attribs)/sizeof(NDBT_Attribute), MYTAB1Attribs); + + +int createTable(Ndb* pNdb, const NdbDictionary::Table* tab, bool _temp, + bool existsOk, NDBT_CreateTableHook f) +{ + int r = 0; + do{ + NdbDictionary::Table tmpTab(* tab); + tmpTab.setStoredTable(_temp ? 0 : 1); + if(f != 0 && f(pNdb, tmpTab, 0)) + { + ndbout << "Failed to create table" << endl; + return NDBT_FAILED; + } + r = pNdb->getDictionary()->createTable(tmpTab); + if(r == -1){ + if(!existsOk){ + ndbout << "Error: " << pNdb->getDictionary()->getNdbError() << endl; + break; + } + if(pNdb->getDictionary()->getNdbError().code != 721){ + ndbout << "Error: " << pNdb->getDictionary()->getNdbError() << endl; + break; + } + r = 0; + } + }while(false); + + return r; +} + +/* +* Function to produce the tuples' data +*/ +int runPopulate(NDBT_Context* ctx, NDBT_Step* step) +{ + Ndb *myNdb = GETNDB(step); + const NdbDictionary::Dictionary* myDict= myNdb->getDictionary(); + const NdbDictionary::Table *myTable= myDict->getTable(TABLE_NAME); + if(myTable == NULL) + APIERROR(myDict->getNdbError()); + + NdbTransaction* myTrans = myNdb->startTransaction(); + if (myTrans == NULL) + APIERROR(myNdb->getNdbError()); + + for(int num = 0; num < TUPLE_NUM; num++) + { + NdbOperation* myNdbOperation = myTrans->getNdbOperation(myTable); + if(myNdbOperation == NULL) + { + APIERROR(myTrans->getNdbError()); + } + +/* the tuples' data in TABLE_NAME ++----+---+---+---+---+---+---+ +| id | i | j | k | l | m | n | ++----+---+---+---+---+---+---+ +| 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 1 | 0 | 0 | 0 | 0 | 0 | 1 | +| 2 | 0 | 0 | 0 | 0 | 1 | 0 | +| 3 | 0 | 0 | 0 | 0 | 1 | 1 | +| 4 | 0 | 0 | 0 | 1 | 0 | 0 | +| 5 | 0 | 0 | 0 | 1 | 0 | 1 | +| 6 | 0 | 0 | 0 | 1 | 1 | 0 | +| 7 | 0 | 0 | 0 | 1 | 1 | 1 | +| 8 | 0 | 0 | 1 | 0 | 0 | 0 | +| 9 | 0 | 0 | 1 | 0 | 0 | 1 | +| 10 | 0 | 0 | 1 | 0 | 1 | 0 | +| 11 | 0 | 0 | 1 | 0 | 1 | 1 | +| 12 | 0 | 0 | 1 | 1 | 0 | 0 | +| 13 | 0 | 0 | 1 | 1 | 0 | 1 | +| 14 | 0 | 0 | 1 | 1 | 1 | 0 | +| 15 | 0 | 0 | 1 | 1 | 1 | 1 | +| 16 | 0 | 1 | 0 | 0 | 0 | 0 | +| 17 | 0 | 1 | 0 | 0 | 0 | 1 | +| 18 | 0 | 1 | 0 | 0 | 1 | 0 | +| 19 | 0 | 1 | 0 | 0 | 1 | 1 | +| 20 | 0 | 1 | 0 | 1 | 0 | 0 | +| 21 | 0 | 1 | 0 | 1 | 0 | 1 | +| 22 | 0 | 1 | 0 | 1 | 1 | 0 | +| 23 | 0 | 1 | 0 | 1 | 1 | 1 | +| 24 | 0 | 1 | 1 | 0 | 0 | 0 | +| 25 | 0 | 1 | 1 | 0 | 0 | 1 | +| 26 | 0 | 1 | 1 | 0 | 1 | 0 | +| 27 | 0 | 1 | 1 | 0 | 1 | 1 | +| 28 | 0 | 1 | 1 | 1 | 0 | 0 | +| 29 | 0 | 1 | 1 | 1 | 0 | 1 | +| 30 | 0 | 1 | 1 | 1 | 1 | 0 | +| 31 | 0 | 1 | 1 | 1 | 1 | 1 | +| 32 | 1 | 0 | 0 | 0 | 0 | 0 | +| 33 | 1 | 0 | 0 | 0 | 0 | 1 | +| 34 | 1 | 0 | 0 | 0 | 1 | 0 | +| 35 | 1 | 0 | 0 | 0 | 1 | 1 | +| 36 | 1 | 0 | 0 | 1 | 0 | 0 | +| 37 | 1 | 0 | 0 | 1 | 0 | 1 | +| 38 | 1 | 0 | 0 | 1 | 1 | 0 | +| 39 | 1 | 0 | 0 | 1 | 1 | 1 | +| 40 | 1 | 0 | 1 | 0 | 0 | 0 | +| 41 | 1 | 0 | 1 | 0 | 0 | 1 | +| 42 | 1 | 0 | 1 | 0 | 1 | 0 | +| 43 | 1 | 0 | 1 | 0 | 1 | 1 | +| 44 | 1 | 0 | 1 | 1 | 0 | 0 | +| 45 | 1 | 0 | 1 | 1 | 0 | 1 | +| 46 | 1 | 0 | 1 | 1 | 1 | 0 | +| 47 | 1 | 0 | 1 | 1 | 1 | 1 | +| 48 | 1 | 1 | 0 | 0 | 0 | 0 | +| 49 | 1 | 1 | 0 | 0 | 0 | 1 | +| 50 | 1 | 1 | 0 | 0 | 1 | 0 | +| 51 | 1 | 1 | 0 | 0 | 1 | 1 | +| 52 | 1 | 1 | 0 | 1 | 0 | 0 | +| 53 | 1 | 1 | 0 | 1 | 0 | 1 | +| 54 | 1 | 1 | 0 | 1 | 1 | 0 | +| 55 | 1 | 1 | 0 | 1 | 1 | 1 | +| 56 | 1 | 1 | 1 | 0 | 0 | 0 | +| 57 | 1 | 1 | 1 | 0 | 0 | 1 | +| 58 | 1 | 1 | 1 | 0 | 1 | 0 | +| 59 | 1 | 1 | 1 | 0 | 1 | 1 | +| 60 | 1 | 1 | 1 | 1 | 0 | 0 | +| 61 | 1 | 1 | 1 | 1 | 0 | 1 | +| 62 | 1 | 1 | 1 | 1 | 1 | 0 | +| 63 | 1 | 1 | 1 | 1 | 1 | 1 | ++----+---+---+---+---+---+---+ +*/ + myNdbOperation->insertTuple(); + myNdbOperation->equal(COL_NAME[0], num); + for(int col = 1; col < COL_LEN; col++) + { + myNdbOperation->setValue(COL_NAME[col], (num>>(COL_LEN-1-col))&1); + } + } + + int check = myTrans->execute(NdbTransaction::Commit); + + myTrans->close(); + + if (check == -1) + return NDBT_FAILED; + else + return NDBT_OK; + +} + + + +/* +* a=AND, o=OR, A=NAND, O=NOR +*/ +char op_string[] = "aoAO"; +/* +* the six columns' name of test table +*/ +char col_string[] = "ijklmn"; +const int op_len = strlen(op_string); +const int col_len = strlen(col_string); + +/* +* get a random op from "aoAO" +*/ +int get_rand_op_ch(char *ch) +{ + static unsigned int num = 0; + if(++num == 0) + num = 1; + srand(num*time(NULL)); + *ch = op_string[rand() % op_len]; + return 1; +} + +/* +* get a random order form of "ijklmn" trough exchanging letter +*/ +void change_col_order() +{ + int pos1,pos2; + char temp; + for (int i = 0; i < 10; i++) //exchange for 10 times + { + srand(time(NULL)/(i+1)); + pos1 = rand() % col_len; + srand((i+1)*time(NULL)); + pos2 = rand() % col_len; + if (pos1 == pos2) + continue; + temp = col_string[pos1]; + col_string[pos1] = col_string[pos2]; + col_string[pos2] = temp; + } +} + +/* +* get a random sub string of "ijklmn" +*/ +int get_rand_col_str(char *str) +{ + int len; + static unsigned int num = 0; + if(++num == 0) + num = 1; + srand(num*time(NULL)); + len = rand() % col_len + 1; + change_col_order(); + snprintf(str, len+1, "%s", col_string); //len+1, including '\0' + return len; +} + +/* +* get a random string including operation and column +* eg, Alnikx +*/ +int get_rand_op_str(char *str) +{ + char temp[256]; + int len1, len2, len; + len1 = get_rand_op_ch(temp); + len2 = get_rand_col_str(temp+len1); + len = len1 + len2; + temp[len] = 'x'; + snprintf(str, len+1+1, "%s", temp); //len+1, including '\0' + return len+1; +} + +/* +* replace a letter of source string with a new string +* e.g., source string: 'Aijkx', replace i with new string 'olmx' +* then source string is changed to 'Aolmxjkx' +* source: its format should be produced from get_rand_op_str() +* pos: range from 1 to strlen(source)-2 +*/ +int replace_a_to_str(char *source, int pos, char *newstr) +{ + char temp[MAX_STR_LEN]; + snprintf(temp, pos+1, "%s", source); + snprintf(temp+pos, strlen(newstr)+1, "%s", newstr); + snprintf(temp+pos+strlen(newstr), strlen(source)-pos, "%s", source+pos+1); + snprintf(source, strlen(temp)+1, "%s", temp); + return strlen(source); +} + +/* +* check whether the inputed char is an operation +*/ +bool check_op(char ch) +{ + if( ch == 'a' || ch == 'A' || ch == 'o' || ch == 'O') + return true; + else + return false; +} + +/* +* check whether the inputed char is end flag +*/ +bool check_end(char ch) +{ + return (ch == 'x'); +} + +/* +* check whether the inputed char is end flag +*/ +bool check_col(char ch) +{ + if( ch == 'i' || ch == 'j' || ch == 'k' + || ch == 'l' || ch == 'm' || ch == 'n' ) + return true; + else + return false; +} + +/* +* To ensure we can get a random string with RECURSIVE_LEVEL, +* we need a position where can replace a letter with a new string. +*/ +int get_rand_replace_pos(char *str, int len) +{ + int pos_op = 0; + int pos_x = 0; + int pos_col = 0; + int span = 0; + static int num = 0; + char temp; + + for(int i = 0; i < len; i++) + { + temp = str[i]; + if(! check_end(temp)) + { + if(check_op(temp)) + pos_op = i; + } + else + { + pos_x = i; + break; + } + } + + if(++num == 0) + num = 1; + + span = pos_x - pos_op - 1; + if(span <= 1) + { + pos_col = pos_op + 1; + } + else + { + srand(num*time(NULL)); + pos_col = pos_op + rand() % span + 1; + } + return pos_col; +} + +/* +* Check whether the given random string is valid +* and applicable for this test case +*/ +bool check_random_str(char *str) +{ + char *p; + int op_num = 0; + int end_num = 0; + + for(p = str; *p; p++) + { + bool tmp1 = false, tmp2 = false; + if(tmp1 = check_op(*p)) + op_num++; + if(tmp2 = check_end(*p)) + end_num++; + if(!(tmp1 || tmp2 || check_col(*p))) //there are illegal letters + return false; + } + + if(op_num != end_num) //begins are not equal to ends + return false; + + return true; +} + +/* +* Get a random string with RECURSIVE_LEVEL +*/ +void get_rand_op_str_compound(char *str) +{ + char small_str[256]; + int pos; + int tmp; + int level; + static int num = 0; + + if(++num == 0) + num = 1; + + srand(num*time(NULL)); + level = 1 + rand() % RECURSIVE_LEVEL; + + get_rand_op_str(str); + + for(int i = 0; i < level; i++) + { + get_rand_op_str(small_str); + tmp = strlen(small_str); + get_rand_op_str(small_str + tmp); //get two operations + pos = get_rand_replace_pos(str, strlen(str)); + replace_a_to_str(str, pos, small_str); + } + + //check the random string + if(!check_random_str(str)) + { + fprintf(stderr, "Error random string! \n"); + exit(-1); + } +} + +/* +* get column id of i,j,k,l,m,n +*/ +int get_column_id(char ch) +{ + return (ch - 'i' + 1); //from 1 to 6 +} + +/* +* check whether column value of the NO. tuple is equal to 1 +* col_id: column id, range from 1 to 6 +* tuple_no: record NO., range from 0 to 63 +*/ +bool check_col_equal_one(int tuple_no, int col_id) +{ + int i = (int)pow(2, 6 - col_id); + int j = tuple_no / i; + if(j % 2) + return true; + else + return false; +} + +/* +* get a result after all elements in the array with AND +* value: pointer to a bool array +* len: length of the bool array +*/ +bool AND_op(bool *value, int len) +{ + for(int i = 0; i < len; i++) + { + if(! value[i]) + return false; + } + return true; +} + +/* +* get a result after all elements in the array with OR +* value: pointer to a bool array +* len: length of the bool array +*/ +bool OR_op(bool *value, int len) +{ + for(int i = 0; i < len; i++) + { + if(value[i]) + return true; + } + return false; +} + +/* +* get a result after all elements in the array with NAND +* value: pointer to a bool array +* len: length of the bool array +*/ +bool NAND_op(bool *value, int len) +{ + return (! AND_op(value, len)); +} + +/* +* get a result after all elements in the array with NOR +* value: pointer to a bool array +* len: length of the bool array +*/ +bool NOR_op(bool *value, int len) +{ + return (! OR_op(value, len)); +} + +/* +* AND/NAND/OR/NOR operation for a bool array +*/ +bool calculate_one_op(char op_type, bool *value, int len) +{ + switch(op_type) + { + case 'a': + return AND_op(value, len); + break; + case 'o': + return OR_op(value, len); + break; + case 'A': + return NAND_op(value, len); + break; + case 'O': + return NOR_op(value, len); + break; + } + return false; //make gcc happy +} + +typedef struct _stack_element +{ + char type; + int num; +}stack_element; + +/* +* stack_op, store info for AND,OR,NAND,NOR +* stack_col, store value of column(i,j,k,l,m,n) and temporary result for an operation +*/ +stack_element stack_op[RECURSIVE_LEVEL * COL_LEN]; +bool stack_col[RECURSIVE_LEVEL * COL_LEN * 2]; + +/* +* check whether the given tuple is chosen by judgement condition +* tuple_no, the NO of tuple in TABLE_NAME, range from 0 to TUPLE_NUM +* str: a random string of scan opearation and condition +* len: length of str +*/ +bool check_one_tuple(int tuple_no, char *str, int len) +{ + int pop_op = 0; + int pop_col = 0; + for(int i = 0; i < len; i++) + { + char letter = *(str + i); + if(check_op(letter)) //push + { + stack_op[pop_op].type = letter; + stack_op[pop_op].num = 0; + pop_op++; + } + if(check_col(letter)) //push + { + stack_col[pop_col] = check_col_equal_one(tuple_no, get_column_id(letter)); + pop_col++; + stack_op[pop_op-1].num += 1; + } + if(check_end(letter)) + { + if(pop_op <= 1) + { + return calculate_one_op(stack_op[pop_op-1].type, + stack_col, + stack_op[pop_op-1].num); + } + else + { + bool tmp1 = calculate_one_op(stack_op[pop_op-1].type, + stack_col + pop_col - stack_op[pop_op-1].num, + stack_op[pop_op-1].num); + pop_col -= stack_op[pop_op-1].num; //pop + pop_op--; + stack_col[pop_col] = tmp1; //push + pop_col++; + stack_op[pop_op-1].num += 1; + } + } + } + return false; //make gcc happy +} + +/* +* get lists of tuples which match the scan condiction through calculating +* str: a random string of scan opearation and condition +*/ +void check_all_tuples(char *str, bool *res) +{ + for (int i = 0; i < TUPLE_NUM; i++) + { + if(check_one_tuple(i, str, strlen(str))) + res[i] = true; + } +} + +/* +* convert a letter to group number what ndbapi need +*/ +NdbScanFilter::Group get_api_group(char op_name) +{ + switch (op_name) { + case 'a': return NdbScanFilter::AND; + case 'o': return NdbScanFilter::OR; + case 'A': return NdbScanFilter::NAND; + case 'O': return NdbScanFilter::NOR; + default: + fprintf(stderr, "Invalid group name %c !\n", op_name); + exit(3); + } +} + +/* +* with ndbapi, call begin, eq/ne/lt/gt/le/ge..., end +*/ +NdbScanFilter * call_ndbapi(char *str, NdbTransaction *transaction, + NdbScanOperation *scan, NdbDictionary::Column const *col[]) +{ + NdbScanFilter *scanfilter = new NdbScanFilter(scan); + char *p; + + for (p = str; *p; p++) + { + if(check_op(*p)) + { + if(scanfilter->begin(get_api_group(*p))) + ERR_EXIT(transaction, "filter begin() failed"); + } + if(check_col(*p)) + { + if(scanfilter->eq(col[*p-'i'+1]->getColumnNo(), (Uint32)1)) + ERR_EXIT(transaction, "filter eq() failed"); + } + if(check_end(*p)) + { + if(scanfilter->end()) + ERR_EXIT(transaction, "filter end() failed"); + } + } + + return scanfilter; +} + +/* +* get the tuples through ndbapi, and save the tuples NO. +* str: a random string of scan opearation and condition +*/ +void ndbapi_tuples(Ndb *ndb, char *str, bool *res) +{ + const NdbDictionary::Dictionary *dict = ndb->getDictionary(); + if (!dict) + ERR_EXIT(ndb, "Can't get dict"); + + const NdbDictionary::Table *table = dict->getTable(TABLE_NAME); + if (!table) + ERR_EXIT(dict, "Can't get table"TABLE_NAME); + + const NdbDictionary::Column *col[COL_LEN]; + for(int i = 0; i < COL_LEN; i++) + { + char tmp[128]; + col[i] = table->getColumn(COL_NAME[i]); + if(!col[i]) + { + snprintf(tmp, 128, "Can't get column %s", COL_NAME[i]); + ERR_EXIT(dict, tmp); + } + } + + NdbTransaction *transaction; + NdbScanOperation *scan; + NdbScanFilter *filter; + + transaction = ndb->startTransaction(); + if (!transaction) + ERR_EXIT(ndb, "Can't start transaction"); + + scan = transaction->getNdbScanOperation(table); + if (!scan) + ERR_EXIT(transaction, "Can't get scan op"); + + if (scan->readTuples(NdbOperation::LM_Exclusive)) + ERR_EXIT(scan, "Can't set up read"); + + NdbRecAttr *rec[COL_LEN]; + for(int i = 0; i < COL_LEN; i++) + { + char tmp[128]; + rec[i] = scan->getValue(COL_NAME[i]); + if(!rec[i]) + { + snprintf(tmp, 128, "Can't get rec of %s", COL_NAME[i]); + ERR_EXIT(scan, tmp); + } + } + + filter = call_ndbapi(str, transaction, scan, col); + + if (transaction->execute(NdbTransaction::NoCommit)) + ERR_EXIT(transaction, "Can't execute"); + + int i,j,k,l,m,n; + while (scan->nextResult(true) == 0) + { + do + { + i = rec[1]->u_32_value(); + j = rec[2]->u_32_value(); + k = rec[3]->u_32_value(); + l = rec[4]->u_32_value(); + m = rec[5]->u_32_value(); + n = rec[6]->u_32_value(); + res[32*i+16*j+8*k+4*l+2*m+n] = true; + } while (scan->nextResult(false) == 0); + } + + delete filter; + transaction->close(); +} + +/* +* compare the result between calculation and NDBAPI +* str: a random string of scan opearation and condition +* return: true stands for ndbapi ok, false stands for ndbapi failed +*/ +bool compare_cal_ndb(char *str, Ndb *ndb) +{ + bool res_cal[TUPLE_NUM], res_ndb[TUPLE_NUM]; + + for(int i = 0; i < TUPLE_NUM; i++) + { + res_cal[i] = false; + res_ndb[i] = false; + } + + check_all_tuples(str, res_cal); + ndbapi_tuples(ndb, str, res_ndb); + + for(int i = 0; i < TUPLE_NUM; i++) + { + if(res_cal[i] != res_ndb[i]) + return false; + } + return true; +} + + +int runCreateTables(NDBT_Context* ctx, NDBT_Step* step) +{ + Ndb *pNdb = GETNDB(step); + pNdb->getDictionary()->dropTable(MYTAB1.getName()); + int ret = createTable(pNdb, &MYTAB1, false, true, 0); + if(ret) + return ret; + return NDBT_OK; +} + + +int runDropTables(NDBT_Context* ctx, NDBT_Step* step) +{ + int ret = GETNDB(step)->getDictionary()->dropTable(MYTAB1.getName()); + if(ret == -1) + return NDBT_FAILED; + + return NDBT_OK; +} + +int runScanRandomFilterTest(NDBT_Context* ctx, NDBT_Step* step) +{ + char random_str[MAX_STR_LEN]; + Ndb *myNdb = GETNDB(step); + bool res = true; + + for(int i = 0; i < TEST_NUM; i++) + { + get_rand_op_str_compound(random_str); + if( !compare_cal_ndb(random_str, myNdb)) + return NDBT_FAILED; + } + + return NDBT_OK; +} + +NDBT_TESTSUITE(testScanFilter); +TESTCASE(TEST_NAME, + "Scan table TABLE_NAME for the records which accord with \ + conditions of logical scan operations: AND/OR/NAND/NOR") +{ + INITIALIZER(runCreateTables); + INITIALIZER(runPopulate); + INITIALIZER(runScanRandomFilterTest); + FINALIZER(runDropTables); +} + +NDBT_TESTSUITE_END(testScanFilter); + + +int main(int argc, const char** argv) +{ + ndb_init(); + + Ndb_cluster_connection con; + if(con.connect(12, 5, 1)) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + return testScanFilter.executeOneCtx(con, &MYTAB1, TEST_NAME); +} diff --git a/ndb/test/ndbapi/testScanInterpreter.cpp b/ndb/test/ndbapi/testScanInterpreter.cpp index 5a7ca30cd2a..ae7859d7328 100644 --- a/ndb/test/ndbapi/testScanInterpreter.cpp +++ b/ndb/test/ndbapi/testScanInterpreter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testScanPerf.cpp b/ndb/test/ndbapi/testScanPerf.cpp index a730136c3af..837b96a5c96 100644 --- a/ndb/test/ndbapi/testScanPerf.cpp +++ b/ndb/test/ndbapi/testScanPerf.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testSystemRestart.cpp b/ndb/test/ndbapi/testSystemRestart.cpp index 8a0100ff3e4..026492d6afa 100644 --- a/ndb/test/ndbapi/testSystemRestart.cpp +++ b/ndb/test/ndbapi/testSystemRestart.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testTimeout.cpp b/ndb/test/ndbapi/testTimeout.cpp index e719cdf03e9..e5831ffee79 100644 --- a/ndb/test/ndbapi/testTimeout.cpp +++ b/ndb/test/ndbapi/testTimeout.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/testTransactions.cpp b/ndb/test/ndbapi/testTransactions.cpp index 46be808d8a5..6b6d2137d68 100644 --- a/ndb/test/ndbapi/testTransactions.cpp +++ b/ndb/test/ndbapi/testTransactions.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/test_event.cpp b/ndb/test/ndbapi/test_event.cpp index 2df50f21e43..b5096ce8c12 100644 --- a/ndb/test/ndbapi/test_event.cpp +++ b/ndb/test/ndbapi/test_event.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/test_event_merge.cpp b/ndb/test/ndbapi/test_event_merge.cpp index f57667caf62..3477923d81c 100644 --- a/ndb/test/ndbapi/test_event_merge.cpp +++ b/ndb/test/ndbapi/test_event_merge.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/test_event_multi_table.cpp b/ndb/test/ndbapi/test_event_multi_table.cpp index f16504029fa..aab8a563ff6 100644 --- a/ndb/test/ndbapi/test_event_multi_table.cpp +++ b/ndb/test/ndbapi/test_event_multi_table.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/ndbapi/userInterface.cpp b/ndb/test/ndbapi/userInterface.cpp index 2f77c0f4857..de5509cdfb7 100644 --- a/ndb/test/ndbapi/userInterface.cpp +++ b/ndb/test/ndbapi/userInterface.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/newtonapi/basic_test/basic/basic.cpp b/ndb/test/newtonapi/basic_test/basic/basic.cpp index bc33400078d..23c9d38cbdc 100644 --- a/ndb/test/newtonapi/basic_test/basic/basic.cpp +++ b/ndb/test/newtonapi/basic_test/basic/basic.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp index 4120cfba864..7b447b29e05 100644 --- a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp +++ b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/newtonapi/basic_test/common.cpp b/ndb/test/newtonapi/basic_test/common.cpp index d4c4e6a74a7..d393394dcc9 100644 --- a/ndb/test/newtonapi/basic_test/common.cpp +++ b/ndb/test/newtonapi/basic_test/common.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/newtonapi/basic_test/common.hpp b/ndb/test/newtonapi/basic_test/common.hpp index 0df8f7e078d..d76d1cf1733 100644 --- a/ndb/test/newtonapi/basic_test/common.hpp +++ b/ndb/test/newtonapi/basic_test/common.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp index 2c9cee5be87..754dad25dba 100644 --- a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp +++ b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/newtonapi/basic_test/too_basic.cpp b/ndb/test/newtonapi/basic_test/too_basic.cpp index 883aacf8841..f751967c181 100644 --- a/ndb/test/newtonapi/basic_test/too_basic.cpp +++ b/ndb/test/newtonapi/basic_test/too_basic.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/newtonapi/perf_test/perf.cpp b/ndb/test/newtonapi/perf_test/perf.cpp index 7b818e93a2a..23484dbdac2 100644 --- a/ndb/test/newtonapi/perf_test/perf.cpp +++ b/ndb/test/newtonapi/perf_test/perf.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/SQL99_test/SQL99_test.cpp b/ndb/test/odbc/SQL99_test/SQL99_test.cpp index eda9ff33834..039a77f4d53 100644 --- a/ndb/test/odbc/SQL99_test/SQL99_test.cpp +++ b/ndb/test/odbc/SQL99_test/SQL99_test.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/SQL99_test/SQL99_test.h b/ndb/test/odbc/SQL99_test/SQL99_test.h index 1c49f4a9a51..0af4e79be47 100644 --- a/ndb/test/odbc/SQL99_test/SQL99_test.h +++ b/ndb/test/odbc/SQL99_test/SQL99_test.h @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/NDBT_ALLOCHANDLE.cpp b/ndb/test/odbc/client/NDBT_ALLOCHANDLE.cpp index 336f4a46554..4f5f8455349 100644 --- a/ndb/test/odbc/client/NDBT_ALLOCHANDLE.cpp +++ b/ndb/test/odbc/client/NDBT_ALLOCHANDLE.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/NDBT_ALLOCHANDLE_HDBC.cpp b/ndb/test/odbc/client/NDBT_ALLOCHANDLE_HDBC.cpp index 8477a71edbf..7154409efa5 100644 --- a/ndb/test/odbc/client/NDBT_ALLOCHANDLE_HDBC.cpp +++ b/ndb/test/odbc/client/NDBT_ALLOCHANDLE_HDBC.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/NDBT_SQLConnect.cpp b/ndb/test/odbc/client/NDBT_SQLConnect.cpp index da97ffebea4..11522d7cf5a 100644 --- a/ndb/test/odbc/client/NDBT_SQLConnect.cpp +++ b/ndb/test/odbc/client/NDBT_SQLConnect.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/NDBT_SQLPrepare.cpp b/ndb/test/odbc/client/NDBT_SQLPrepare.cpp index 4aaff6a7df9..ce4300caf75 100644 --- a/ndb/test/odbc/client/NDBT_SQLPrepare.cpp +++ b/ndb/test/odbc/client/NDBT_SQLPrepare.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLAllocEnvTest.cpp b/ndb/test/odbc/client/SQLAllocEnvTest.cpp index ce50c4b7ccd..e44672b2dbc 100644 --- a/ndb/test/odbc/client/SQLAllocEnvTest.cpp +++ b/ndb/test/odbc/client/SQLAllocEnvTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLAllocHandleTest.cpp b/ndb/test/odbc/client/SQLAllocHandleTest.cpp index 0c51e2e46b7..b66f7ebc2f6 100644 --- a/ndb/test/odbc/client/SQLAllocHandleTest.cpp +++ b/ndb/test/odbc/client/SQLAllocHandleTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLAllocHandleTest_bf.cpp b/ndb/test/odbc/client/SQLAllocHandleTest_bf.cpp index 7786675243a..fc9a9d504ba 100644 --- a/ndb/test/odbc/client/SQLAllocHandleTest_bf.cpp +++ b/ndb/test/odbc/client/SQLAllocHandleTest_bf.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLBindColTest.cpp b/ndb/test/odbc/client/SQLBindColTest.cpp index e2cd4ce73d1..aa6effe1831 100644 --- a/ndb/test/odbc/client/SQLBindColTest.cpp +++ b/ndb/test/odbc/client/SQLBindColTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLBindParameterTest.cpp b/ndb/test/odbc/client/SQLBindParameterTest.cpp index 2ffd2892064..913c1d82230 100644 --- a/ndb/test/odbc/client/SQLBindParameterTest.cpp +++ b/ndb/test/odbc/client/SQLBindParameterTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLCancelTest.cpp b/ndb/test/odbc/client/SQLCancelTest.cpp index 904ffab6979..355dc4f3189 100644 --- a/ndb/test/odbc/client/SQLCancelTest.cpp +++ b/ndb/test/odbc/client/SQLCancelTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLCloseCursorTest.cpp b/ndb/test/odbc/client/SQLCloseCursorTest.cpp index 35f125df59d..e6a630319d5 100644 --- a/ndb/test/odbc/client/SQLCloseCursorTest.cpp +++ b/ndb/test/odbc/client/SQLCloseCursorTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLColAttributeTest.cpp b/ndb/test/odbc/client/SQLColAttributeTest.cpp index 4c067c21d7d..ade640173fe 100644 --- a/ndb/test/odbc/client/SQLColAttributeTest.cpp +++ b/ndb/test/odbc/client/SQLColAttributeTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLColAttributeTest1.cpp b/ndb/test/odbc/client/SQLColAttributeTest1.cpp index 322a21eefc1..45b1dd15967 100644 --- a/ndb/test/odbc/client/SQLColAttributeTest1.cpp +++ b/ndb/test/odbc/client/SQLColAttributeTest1.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLColAttributeTest2.cpp b/ndb/test/odbc/client/SQLColAttributeTest2.cpp index 18cffae76c1..fb1f2a9aa4a 100644 --- a/ndb/test/odbc/client/SQLColAttributeTest2.cpp +++ b/ndb/test/odbc/client/SQLColAttributeTest2.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLColAttributeTest3.cpp b/ndb/test/odbc/client/SQLColAttributeTest3.cpp index f8817565711..ef4943a8cdb 100644 --- a/ndb/test/odbc/client/SQLColAttributeTest3.cpp +++ b/ndb/test/odbc/client/SQLColAttributeTest3.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLConnectTest.cpp b/ndb/test/odbc/client/SQLConnectTest.cpp index 552fc8640fe..1adbd865f0c 100644 --- a/ndb/test/odbc/client/SQLConnectTest.cpp +++ b/ndb/test/odbc/client/SQLConnectTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLCopyDescTest.cpp b/ndb/test/odbc/client/SQLCopyDescTest.cpp index 4a3742f97ae..d944da5acbb 100644 --- a/ndb/test/odbc/client/SQLCopyDescTest.cpp +++ b/ndb/test/odbc/client/SQLCopyDescTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLDescribeColTest.cpp b/ndb/test/odbc/client/SQLDescribeColTest.cpp index 9f55c6a1cfe..abb31b53c5b 100644 --- a/ndb/test/odbc/client/SQLDescribeColTest.cpp +++ b/ndb/test/odbc/client/SQLDescribeColTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLDisconnectTest.cpp b/ndb/test/odbc/client/SQLDisconnectTest.cpp index 823b446ab84..700fadfed33 100644 --- a/ndb/test/odbc/client/SQLDisconnectTest.cpp +++ b/ndb/test/odbc/client/SQLDisconnectTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLDriverConnectTest.cpp b/ndb/test/odbc/client/SQLDriverConnectTest.cpp index fc3b1d10f91..376b0970f2e 100644 --- a/ndb/test/odbc/client/SQLDriverConnectTest.cpp +++ b/ndb/test/odbc/client/SQLDriverConnectTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLEndTranTest.cpp b/ndb/test/odbc/client/SQLEndTranTest.cpp index 06c497954fd..953336ec909 100644 --- a/ndb/test/odbc/client/SQLEndTranTest.cpp +++ b/ndb/test/odbc/client/SQLEndTranTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLErrorTest.cpp b/ndb/test/odbc/client/SQLErrorTest.cpp index 5220e7b5eed..f4effa464c8 100644 --- a/ndb/test/odbc/client/SQLErrorTest.cpp +++ b/ndb/test/odbc/client/SQLErrorTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLExecDirectTest.cpp b/ndb/test/odbc/client/SQLExecDirectTest.cpp index b9b4e770412..d0b7955f928 100644 --- a/ndb/test/odbc/client/SQLExecDirectTest.cpp +++ b/ndb/test/odbc/client/SQLExecDirectTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLExecuteTest.cpp b/ndb/test/odbc/client/SQLExecuteTest.cpp index 5f6bdb5d4bf..bcff66ff287 100644 --- a/ndb/test/odbc/client/SQLExecuteTest.cpp +++ b/ndb/test/odbc/client/SQLExecuteTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLFetchScrollTest.cpp b/ndb/test/odbc/client/SQLFetchScrollTest.cpp index 4a11ccd143e..1a92ac058a8 100644 --- a/ndb/test/odbc/client/SQLFetchScrollTest.cpp +++ b/ndb/test/odbc/client/SQLFetchScrollTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLFetchTest.cpp b/ndb/test/odbc/client/SQLFetchTest.cpp index bd62fcb2f04..0dcb3571bf7 100644 --- a/ndb/test/odbc/client/SQLFetchTest.cpp +++ b/ndb/test/odbc/client/SQLFetchTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLFreeHandleTest.cpp b/ndb/test/odbc/client/SQLFreeHandleTest.cpp index 3a7241dbe68..d8ab766a362 100644 --- a/ndb/test/odbc/client/SQLFreeHandleTest.cpp +++ b/ndb/test/odbc/client/SQLFreeHandleTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLFreeStmtTest.cpp b/ndb/test/odbc/client/SQLFreeStmtTest.cpp index e636b3063de..ce804283358 100644 --- a/ndb/test/odbc/client/SQLFreeStmtTest.cpp +++ b/ndb/test/odbc/client/SQLFreeStmtTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetConnectAttrTest.cpp b/ndb/test/odbc/client/SQLGetConnectAttrTest.cpp index 8d5a5c0dbbb..7eb6432904e 100644 --- a/ndb/test/odbc/client/SQLGetConnectAttrTest.cpp +++ b/ndb/test/odbc/client/SQLGetConnectAttrTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetCursorNameTest.cpp b/ndb/test/odbc/client/SQLGetCursorNameTest.cpp index 1e3ed9f557e..da66d976f34 100644 --- a/ndb/test/odbc/client/SQLGetCursorNameTest.cpp +++ b/ndb/test/odbc/client/SQLGetCursorNameTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetDataTest.cpp b/ndb/test/odbc/client/SQLGetDataTest.cpp index 9d958c6c953..12b7969c092 100644 --- a/ndb/test/odbc/client/SQLGetDataTest.cpp +++ b/ndb/test/odbc/client/SQLGetDataTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetDescFieldTest.cpp b/ndb/test/odbc/client/SQLGetDescFieldTest.cpp index b789ed75378..0bae4ae58b2 100644 --- a/ndb/test/odbc/client/SQLGetDescFieldTest.cpp +++ b/ndb/test/odbc/client/SQLGetDescFieldTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetDescRecTest.cpp b/ndb/test/odbc/client/SQLGetDescRecTest.cpp index 5944f393a71..46ecbfeaa83 100644 --- a/ndb/test/odbc/client/SQLGetDescRecTest.cpp +++ b/ndb/test/odbc/client/SQLGetDescRecTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetDiagFieldTest.cpp b/ndb/test/odbc/client/SQLGetDiagFieldTest.cpp index ef9bc3eb3fc..c8d381abd56 100644 --- a/ndb/test/odbc/client/SQLGetDiagFieldTest.cpp +++ b/ndb/test/odbc/client/SQLGetDiagFieldTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetDiagRecSimpleTest.cpp b/ndb/test/odbc/client/SQLGetDiagRecSimpleTest.cpp index 8fa4a2b3dbb..22a4e07f470 100644 --- a/ndb/test/odbc/client/SQLGetDiagRecSimpleTest.cpp +++ b/ndb/test/odbc/client/SQLGetDiagRecSimpleTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetDiagRecTest.cpp b/ndb/test/odbc/client/SQLGetDiagRecTest.cpp index 27c78edaa4d..2a8aed12a57 100644 --- a/ndb/test/odbc/client/SQLGetDiagRecTest.cpp +++ b/ndb/test/odbc/client/SQLGetDiagRecTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetEnvAttrTest.cpp b/ndb/test/odbc/client/SQLGetEnvAttrTest.cpp index efc8117d6d2..0c6b2ab51b8 100644 --- a/ndb/test/odbc/client/SQLGetEnvAttrTest.cpp +++ b/ndb/test/odbc/client/SQLGetEnvAttrTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetFunctionsTest.cpp b/ndb/test/odbc/client/SQLGetFunctionsTest.cpp index c6feb8ec033..917f63d7e18 100644 --- a/ndb/test/odbc/client/SQLGetFunctionsTest.cpp +++ b/ndb/test/odbc/client/SQLGetFunctionsTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetInfoTest.cpp b/ndb/test/odbc/client/SQLGetInfoTest.cpp index 95f7562dafe..0322cc47250 100644 --- a/ndb/test/odbc/client/SQLGetInfoTest.cpp +++ b/ndb/test/odbc/client/SQLGetInfoTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetStmtAttrTest.cpp b/ndb/test/odbc/client/SQLGetStmtAttrTest.cpp index 2052af60ee0..4a268ce99c1 100644 --- a/ndb/test/odbc/client/SQLGetStmtAttrTest.cpp +++ b/ndb/test/odbc/client/SQLGetStmtAttrTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLGetTypeInfoTest.cpp b/ndb/test/odbc/client/SQLGetTypeInfoTest.cpp index 5925d1cc1ae..fb114d06c26 100644 --- a/ndb/test/odbc/client/SQLGetTypeInfoTest.cpp +++ b/ndb/test/odbc/client/SQLGetTypeInfoTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLMoreResultsTest.cpp b/ndb/test/odbc/client/SQLMoreResultsTest.cpp index cba8b0dc53e..8b7ed0e4581 100644 --- a/ndb/test/odbc/client/SQLMoreResultsTest.cpp +++ b/ndb/test/odbc/client/SQLMoreResultsTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLNumResultColsTest.cpp b/ndb/test/odbc/client/SQLNumResultColsTest.cpp index 8f0c1dba94c..ca70d42018e 100644 --- a/ndb/test/odbc/client/SQLNumResultColsTest.cpp +++ b/ndb/test/odbc/client/SQLNumResultColsTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLParamDataTest.cpp b/ndb/test/odbc/client/SQLParamDataTest.cpp index 92d491dfaf5..e502a9e15fa 100644 --- a/ndb/test/odbc/client/SQLParamDataTest.cpp +++ b/ndb/test/odbc/client/SQLParamDataTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLPrepareTest.cpp b/ndb/test/odbc/client/SQLPrepareTest.cpp index 2ebbc224b85..aa20b1992a2 100644 --- a/ndb/test/odbc/client/SQLPrepareTest.cpp +++ b/ndb/test/odbc/client/SQLPrepareTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLPutDataTest.cpp b/ndb/test/odbc/client/SQLPutDataTest.cpp index 38a8458fec4..ea1a34651c3 100644 --- a/ndb/test/odbc/client/SQLPutDataTest.cpp +++ b/ndb/test/odbc/client/SQLPutDataTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLRowCountTest.cpp b/ndb/test/odbc/client/SQLRowCountTest.cpp index f298017c519..1cc2929c2dc 100644 --- a/ndb/test/odbc/client/SQLRowCountTest.cpp +++ b/ndb/test/odbc/client/SQLRowCountTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLSetConnectAttrTest.cpp b/ndb/test/odbc/client/SQLSetConnectAttrTest.cpp index c41ef885521..4e5f08a4a4c 100644 --- a/ndb/test/odbc/client/SQLSetConnectAttrTest.cpp +++ b/ndb/test/odbc/client/SQLSetConnectAttrTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLSetCursorNameTest.cpp b/ndb/test/odbc/client/SQLSetCursorNameTest.cpp index b35cf9fefc2..8676ab6eddf 100644 --- a/ndb/test/odbc/client/SQLSetCursorNameTest.cpp +++ b/ndb/test/odbc/client/SQLSetCursorNameTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLSetDescFieldTest.cpp b/ndb/test/odbc/client/SQLSetDescFieldTest.cpp index 798622e0f75..9ea93013312 100644 --- a/ndb/test/odbc/client/SQLSetDescFieldTest.cpp +++ b/ndb/test/odbc/client/SQLSetDescFieldTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLSetDescRecTest.cpp b/ndb/test/odbc/client/SQLSetDescRecTest.cpp index d97af576cb0..52a6b81ee84 100644 --- a/ndb/test/odbc/client/SQLSetDescRecTest.cpp +++ b/ndb/test/odbc/client/SQLSetDescRecTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLSetEnvAttrTest.cpp b/ndb/test/odbc/client/SQLSetEnvAttrTest.cpp index 16ae5671ca3..e843c5509b8 100644 --- a/ndb/test/odbc/client/SQLSetEnvAttrTest.cpp +++ b/ndb/test/odbc/client/SQLSetEnvAttrTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLSetStmtAttrTest.cpp b/ndb/test/odbc/client/SQLSetStmtAttrTest.cpp index 646f82cd306..dc37fc64e1c 100644 --- a/ndb/test/odbc/client/SQLSetStmtAttrTest.cpp +++ b/ndb/test/odbc/client/SQLSetStmtAttrTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLTablesTest.cpp b/ndb/test/odbc/client/SQLTablesTest.cpp index 735efd81e9c..ff55f217d0a 100644 --- a/ndb/test/odbc/client/SQLTablesTest.cpp +++ b/ndb/test/odbc/client/SQLTablesTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/SQLTransactTest.cpp b/ndb/test/odbc/client/SQLTransactTest.cpp index e9abe42129d..d7444794d5a 100644 --- a/ndb/test/odbc/client/SQLTransactTest.cpp +++ b/ndb/test/odbc/client/SQLTransactTest.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/common.hpp b/ndb/test/odbc/client/common.hpp index 236decf1b95..1eb61f44bd9 100644 --- a/ndb/test/odbc/client/common.hpp +++ b/ndb/test/odbc/client/common.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/client/main.cpp b/ndb/test/odbc/client/main.cpp index b202b6de111..187ac96c6a7 100644 --- a/ndb/test/odbc/client/main.cpp +++ b/ndb/test/odbc/client/main.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/driver/testOdbcDriver.cpp b/ndb/test/odbc/driver/testOdbcDriver.cpp index d3b3802ebe1..bdda4d447f8 100644 --- a/ndb/test/odbc/driver/testOdbcDriver.cpp +++ b/ndb/test/odbc/driver/testOdbcDriver.cpp @@ -2,24 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. - - 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 */ - -/* Copyright (C) 2003 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/odbc/test_compiler/test_compiler.cpp b/ndb/test/odbc/test_compiler/test_compiler.cpp index 042e9e6d4bf..d64d8f2a63d 100644 --- a/ndb/test/odbc/test_compiler/test_compiler.cpp +++ b/ndb/test/odbc/test_compiler/test_compiler.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index 2c45db50556..2008510349f 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA testdir=$(prefix)/mysql-test/ndb diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index f94b59efedf..c40c96209f4 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -550,7 +550,7 @@ args: -n TemporaryTables T1 T6 T7 T8 max-time: 1500 cmd: testDict -args: -n Restart_NR2 T1 +args: -n Restart_NR2 T1 I3 # # TEST NDBAPI @@ -625,6 +625,10 @@ max-time: 500 cmd: testNdbApi args: -n Scan_4006 T1 +max-time: 500 +cmd: testNdbApi +args: -n ExecuteAsynch T1 + max-time: 1000 cmd: testNdbApi args: -n BugBug28443 @@ -649,9 +653,25 @@ max-time: 600 cmd: testBlobs args: +max-time: 600 +cmd: testBlobs +args: -bug 27018 + +max-time: 600 +cmd: testBlobs +args: -bug 27370 + max-time: 5000 cmd: testOIBasic -args: +args: -case abcdefz + +max-time: 2000 +cmd: testOIBasic +args: -case gz + +max-time: 2000 +cmd: testOIBasic +args: -case hz max-time: 2500 cmd: testBitfield diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index 0b0b7472a19..aef041d24d6 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/run-test/run-test.hpp b/ndb/test/run-test/run-test.hpp index 7011aec33d3..2b259e83a60 100644 --- a/ndb/test/run-test/run-test.hpp +++ b/ndb/test/run-test/run-test.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/CpcClient.cpp b/ndb/test/src/CpcClient.cpp index 4d06b4a7ff5..51f2fb4cf4d 100644 --- a/ndb/test/src/CpcClient.cpp +++ b/ndb/test/src/CpcClient.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/HugoAsynchTransactions.cpp b/ndb/test/src/HugoAsynchTransactions.cpp index 5d2eb451c0b..6926c8a973e 100644 --- a/ndb/test/src/HugoAsynchTransactions.cpp +++ b/ndb/test/src/HugoAsynchTransactions.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/HugoCalculator.cpp b/ndb/test/src/HugoCalculator.cpp index d4d7ca2f95f..8c543f2f764 100644 --- a/ndb/test/src/HugoCalculator.cpp +++ b/ndb/test/src/HugoCalculator.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/HugoOperations.cpp b/ndb/test/src/HugoOperations.cpp index f2e54971766..b409c0acc5d 100644 --- a/ndb/test/src/HugoOperations.cpp +++ b/ndb/test/src/HugoOperations.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp index 7616c93c9e3..dba4e7b5d74 100644 --- a/ndb/test/src/HugoTransactions.cpp +++ b/ndb/test/src/HugoTransactions.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index 289633b060a..d3645ae0a1d 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA noinst_LIBRARIES = libNDBT.a diff --git a/ndb/test/src/NDBT_Error.cpp b/ndb/test/src/NDBT_Error.cpp index ffacb3eb928..c291a81a0df 100644 --- a/ndb/test/src/NDBT_Error.cpp +++ b/ndb/test/src/NDBT_Error.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NDBT_Output.cpp b/ndb/test/src/NDBT_Output.cpp index 633d71991d0..e08a3d996eb 100644 --- a/ndb/test/src/NDBT_Output.cpp +++ b/ndb/test/src/NDBT_Output.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp index ab8d7b07ea1..a226b072521 100644 --- a/ndb/test/src/NDBT_ResultRow.cpp +++ b/ndb/test/src/NDBT_ResultRow.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NDBT_ReturnCodes.cpp b/ndb/test/src/NDBT_ReturnCodes.cpp index 5bffc00177f..5cd5eed3af7 100644 --- a/ndb/test/src/NDBT_ReturnCodes.cpp +++ b/ndb/test/src/NDBT_ReturnCodes.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NDBT_Table.cpp b/ndb/test/src/NDBT_Table.cpp index 8d398b75d81..34db6ed9822 100644 --- a/ndb/test/src/NDBT_Table.cpp +++ b/ndb/test/src/NDBT_Table.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -32,7 +31,7 @@ operator <<(class NdbOut& ndbout, const NDBT_Table & tab) ndbout << "Number of attributes: " << tab.getNoOfColumns() << endl; ndbout << "Number of primary keys: " << tab.getNoOfPrimaryKeys() << endl; ndbout << "Length of frm data: " << tab.getFrmLength() << endl; - + ndbout << "SingleUserMode: " << (Uint32) tab.getSingleUserMode() << endl; //<< ((tab.getTupleKey() == TupleId) ? " tupleid" : "") <<endl; ndbout << "TableStatus: "; diff --git a/ndb/test/src/NDBT_Tables.cpp b/ndb/test/src/NDBT_Tables.cpp index 5a5fecd85c1..63ae7ad24bf 100644 --- a/ndb/test/src/NDBT_Tables.cpp +++ b/ndb/test/src/NDBT_Tables.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -799,6 +798,17 @@ NDBT_Tables::getNumTables(){ return numTestTables; } +const char** +NDBT_Tables::getIndexes(const char* table) +{ + Uint32 i = 0; + for (i = 0; indexes[i].m_table != 0; i++) { + if (strcmp(indexes[i].m_table, table) == 0) + return indexes[i].m_indexes; + } + return 0; +} + int NDBT_Tables::createAllTables(Ndb* pNdb, bool _temp, bool existsOk){ diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 8fecf56531f..391af3e5d95 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -818,6 +817,63 @@ NDBT_TestSuite::executeOne(Ndb_cluster_connection& con, } } +int +NDBT_TestSuite::executeOneCtx(Ndb_cluster_connection& con, + const NdbDictionary::Table *ptab, const char* _testname){ + + testSuiteTimer.doStart(); + + do{ + if(tests.size() == 0) + break; + + Ndb ndb(&con, "TEST_DB"); + ndb.init(1024); + + int result = ndb.waitUntilReady(300); // 5 minutes + if (result != 0){ + g_err << name <<": Ndb was not ready" << endl; + break; + } + + ndbout << name << " started [" << getDate() << "]" << endl; + ndbout << "|- " << ptab->getName() << endl; + + for (unsigned t = 0; t < tests.size(); t++){ + + if (_testname != NULL && + strcasecmp(tests[t]->getName(), _testname) != 0) + continue; + + tests[t]->initBeforeTest(); + + ctx = new NDBT_Context(con); + ctx->setTab(ptab); + ctx->setNumRecords(records); + ctx->setNumLoops(loops); + if(remote_mgm != NULL) + ctx->setRemoteMgm(remote_mgm); + ctx->setSuite(this); + + result = tests[t]->execute(ctx); + if (result != NDBT_OK) + numTestsFail++; + else + numTestsOk++; + numTestsExecuted++; + + delete ctx; + } + + if (numTestsFail > 0) + break; + }while(0); + + testSuiteTimer.doStop(); + int res = report(_testname); + return NDBT_ProgramExit(res); +} + void NDBT_TestSuite::execute(Ndb_cluster_connection& con, Ndb* ndb, const NdbDictionary::Table* pTab, const char* _testname){ diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index a9c71120d80..8fa3f907bd8 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NdbConfig.cpp b/ndb/test/src/NdbConfig.cpp index 2fb466d1b8f..ecb2030e63c 100644 --- a/ndb/test/src/NdbConfig.cpp +++ b/ndb/test/src/NdbConfig.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NdbGrep.cpp b/ndb/test/src/NdbGrep.cpp index 6c0c9cabfcb..99bcede63c8 100644 --- a/ndb/test/src/NdbGrep.cpp +++ b/ndb/test/src/NdbGrep.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 4c7f52a8622..b636ab4d608 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NdbRestarts.cpp b/ndb/test/src/NdbRestarts.cpp index 8465caaab48..013c7a97d1f 100644 --- a/ndb/test/src/NdbRestarts.cpp +++ b/ndb/test/src/NdbRestarts.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NdbSchemaCon.cpp b/ndb/test/src/NdbSchemaCon.cpp index 0de49ff983f..1e1b4028fc1 100644 --- a/ndb/test/src/NdbSchemaCon.cpp +++ b/ndb/test/src/NdbSchemaCon.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/NdbSchemaOp.cpp b/ndb/test/src/NdbSchemaOp.cpp index 4281ceb02c8..9e19426c615 100644 --- a/ndb/test/src/NdbSchemaOp.cpp +++ b/ndb/test/src/NdbSchemaOp.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/src/UtilTransactions.cpp b/ndb/test/src/UtilTransactions.cpp index c3941bda5dd..011cea24af9 100644 --- a/ndb/test/src/UtilTransactions.cpp +++ b/ndb/test/src/UtilTransactions.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/Makefile.am b/ndb/test/tools/Makefile.am index 873136e254d..849d8226466 100644 --- a/ndb/test/tools/Makefile.am +++ b/ndb/test/tools/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004-2005 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ndbtest_PROGRAMS = hugoLoad hugoFill hugoLockRecords hugoPkDelete hugoPkRead hugoPkReadRecord hugoPkUpdate hugoScanRead hugoScanUpdate restart verify_index copy_tab create_index ndb_cpcc diff --git a/ndb/test/tools/copy_tab.cpp b/ndb/test/tools/copy_tab.cpp index 97370b170ef..3a511995f48 100644 --- a/ndb/test/tools/copy_tab.cpp +++ b/ndb/test/tools/copy_tab.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/cpcc.cpp b/ndb/test/tools/cpcc.cpp index dd59e577f2c..f26f0ec4cd9 100644 --- a/ndb/test/tools/cpcc.cpp +++ b/ndb/test/tools/cpcc.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/create_index.cpp b/ndb/test/tools/create_index.cpp index 9f9c26aa0da..450d88124e7 100644 --- a/ndb/test/tools/create_index.cpp +++ b/ndb/test/tools/create_index.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoCalculator.cpp b/ndb/test/tools/hugoCalculator.cpp index 82c4bbff1a4..eedd8cd6e46 100644 --- a/ndb/test/tools/hugoCalculator.cpp +++ b/ndb/test/tools/hugoCalculator.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoFill.cpp b/ndb/test/tools/hugoFill.cpp index 6408b2987f9..713c2ca5152 100644 --- a/ndb/test/tools/hugoFill.cpp +++ b/ndb/test/tools/hugoFill.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoLoad.cpp b/ndb/test/tools/hugoLoad.cpp index 1a229169650..97448aa79b3 100644 --- a/ndb/test/tools/hugoLoad.cpp +++ b/ndb/test/tools/hugoLoad.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoLockRecords.cpp b/ndb/test/tools/hugoLockRecords.cpp index c0d0b9f9c5a..ddc77061446 100644 --- a/ndb/test/tools/hugoLockRecords.cpp +++ b/ndb/test/tools/hugoLockRecords.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoPkDelete.cpp b/ndb/test/tools/hugoPkDelete.cpp index 84e7ded0add..e9fc27d1e68 100644 --- a/ndb/test/tools/hugoPkDelete.cpp +++ b/ndb/test/tools/hugoPkDelete.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoPkRead.cpp b/ndb/test/tools/hugoPkRead.cpp index e3702dc5ca1..dd14203c16e 100644 --- a/ndb/test/tools/hugoPkRead.cpp +++ b/ndb/test/tools/hugoPkRead.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoPkReadRecord.cpp b/ndb/test/tools/hugoPkReadRecord.cpp index c60a994c7d4..28726e83206 100644 --- a/ndb/test/tools/hugoPkReadRecord.cpp +++ b/ndb/test/tools/hugoPkReadRecord.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoPkUpdate.cpp b/ndb/test/tools/hugoPkUpdate.cpp index 7d46ae95c29..f7445ed5102 100644 --- a/ndb/test/tools/hugoPkUpdate.cpp +++ b/ndb/test/tools/hugoPkUpdate.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoScanRead.cpp b/ndb/test/tools/hugoScanRead.cpp index a345bb88d0e..aa3ecf46e5a 100644 --- a/ndb/test/tools/hugoScanRead.cpp +++ b/ndb/test/tools/hugoScanRead.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/hugoScanUpdate.cpp b/ndb/test/tools/hugoScanUpdate.cpp index 6960fa44b96..3775b36f404 100644 --- a/ndb/test/tools/hugoScanUpdate.cpp +++ b/ndb/test/tools/hugoScanUpdate.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/old_dirs/waiter/waiter.cpp b/ndb/test/tools/old_dirs/waiter/waiter.cpp index d57daff3aea..0c2da8aceea 100644 --- a/ndb/test/tools/old_dirs/waiter/waiter.cpp +++ b/ndb/test/tools/old_dirs/waiter/waiter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/restart.cpp b/ndb/test/tools/restart.cpp index 9ad20801fd7..6fb16ef1d34 100644 --- a/ndb/test/tools/restart.cpp +++ b/ndb/test/tools/restart.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/transproxy.cpp b/ndb/test/tools/transproxy.cpp index 28a621fa584..b6aa3d2f313 100644 --- a/ndb/test/tools/transproxy.cpp +++ b/ndb/test/tools/transproxy.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/test/tools/verify_index.cpp b/ndb/test/tools/verify_index.cpp index acc97af883b..567f029aa06 100644 --- a/ndb/test/tools/verify_index.cpp +++ b/ndb/test/tools/verify_index.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index c8aff4da633..feae510349c 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -1,3 +1,17 @@ +# Copyright (C) 2004-2006 MySQL 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dist_bin_SCRIPTS = ndb_size.pl ndb_error_reporter dist_pkgdata_DATA = ndb_size.tmpl diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index 6aea9f87aaa..9b6a8cf94c6 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -27,6 +26,8 @@ static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, NDB_STD_OPTS_VARS; +const char *load_default_groups[]= { "mysql_cluster",0 }; + static const char* _dbname = "TEST_DB"; static my_bool _transactional = false; static struct my_option my_long_options[] = @@ -42,17 +43,20 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program will delete all records in the specified table using scan delete.\n"; +#endif ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; #ifndef DBUG_OFF @@ -63,6 +67,7 @@ int main(int argc, char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_delete_all"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp index 74cd740f2ae..83258515796 100644 --- a/ndb/tools/desc.cpp +++ b/ndb/tools/desc.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -24,6 +23,9 @@ NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; static int _unqualified = 0; static int _partinfo = 0; + +const char *load_default_groups[]= { "mysql_cluster",0 }; + static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_desc"), @@ -40,11 +42,15 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program list all properties of table(s) in NDB Cluster.\n"\ " ex: desc T1 T2 T4\n"; +#endif ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -53,7 +59,6 @@ static void print_part_info(Ndb* pNdb, NDBT_Table* pTab); int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; #ifndef DBUG_OFF @@ -64,6 +69,7 @@ int main(int argc, char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_desc"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp index 24116f22784..256c40e1924 100644 --- a/ndb/tools/drop_index.cpp +++ b/ndb/tools/drop_index.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -24,6 +23,9 @@ NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; + +const char *load_default_groups[]= { "mysql_cluster",0 }; + static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_desc"), @@ -34,22 +36,22 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "[<table> <index>]+\n"\ "This program will drop index(es) in Ndb\n"; +#endif ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; -#ifndef DBUG_OFF - "d:t:O,/tmp/ndb_drop_index.trace"; -#endif if ((ho_error=handle_options(&argc, &argv, my_long_options, ndb_std_get_one_option))) return NDBT_ProgramExit(NDBT_WRONGARGS); @@ -59,6 +61,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_drop_index"); if(con.connect(12, 5, 1) != 0) { return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index 991e1505486..a7accb904a4 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -24,6 +23,9 @@ NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; + +const char *load_default_groups[]= { "mysql_cluster",0 }; + static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_desc"), @@ -34,22 +36,22 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program will drop one table in Ndb\n"; - ndb_std_print_version(); +#endif + ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; -#ifndef DBUG_OFF - "d:t:O,/tmp/ndb_drop_table.trace"; -#endif if ((ho_error=handle_options(&argc, &argv, my_long_options, ndb_std_get_one_option))) return NDBT_ProgramExit(NDBT_WRONGARGS); @@ -59,6 +61,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_drop_table"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index fa078f7d351..009789824e8 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -32,6 +31,8 @@ static Ndb* ndb = 0; static const NdbDictionary::Dictionary * dic = 0; static int _unqualified = 0; +const char *load_default_groups[]= { "mysql_cluster",0 }; + static void fatal(char const* fmt, ...) { @@ -188,6 +189,7 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program list all system objects in NDB Cluster.\n"\ @@ -195,7 +197,10 @@ static void usage() " ex: ndb_show_tables -t 2 would show all UserTables\n"\ "To show all indexes for a table write table name as final argument\n"\ " ex: ndb_show_tables T1\n"; +#endif ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -203,7 +208,6 @@ static void usage() int main(int argc, char** argv){ NDB_INIT(argv[0]); const char* _tabname; - const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; #ifndef DBUG_OFF @@ -215,6 +219,7 @@ int main(int argc, char** argv){ _tabname = argv[0]; ndb_cluster_connection = new Ndb_cluster_connection(opt_connect_str); + ndb_cluster_connection->set_name("ndb_show_tables"); if (ndb_cluster_connection->connect(12,5,1)) fatal("Unable to connect to management server."); if (ndb_cluster_connection->wait_until_ready(30,0) < 0) diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index 27ab6a182bb..31fc59a8b83 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -19,6 +18,8 @@ */ #include <ndb_global.h> +#include <ndb_opts.h> + #include <my_sys.h> #include <my_getopt.h> #include <mysql_version.h> @@ -29,12 +30,12 @@ #include <mgmapi.h> #include <mgmapi_configuration.hpp> #include <ConfigInfo.hpp> +#include <NdbAutoPtr.hpp> static int g_verbose = 0; static int try_reconnect = 3; static int g_nodes, g_connections, g_section; -static const char * g_connectstring = 0; static const char * g_query = 0; static int g_nodeid = 0; @@ -45,34 +46,17 @@ static const char * g_row_delimiter=" "; static const char * g_config_file = 0; static int g_mycnf = 0; -int g_print_full_config, opt_ndb_shm; -my_bool opt_core; +const char *load_default_groups[]= { "mysql_cluster",0 }; -typedef ndb_mgm_configuration_iterator Iter; +NDB_STD_OPTS_VARS; -static void ndb_std_print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n", - MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} +int g_print_full_config; + +typedef ndb_mgm_configuration_iterator Iter; static struct my_option my_long_options[] = { - { "usage", '?', "Display this help and exit.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "help", '?', "Display this help and exit.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "version", 'V', "Output version information and exit.", 0, 0, 0, - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "ndb-connectstring", 256, - "Set connect string for connecting to ndb_mgmd. " - "Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", - (gptr*) &g_connectstring, (gptr*) &g_connectstring, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - { "ndb-shm", 256, "Print nodes", - (gptr*) &opt_ndb_shm, (gptr*) &opt_ndb_shm, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + NDB_STD_OPTS("ndb_config"), { "nodes", 256, "Print nodes", (gptr*) &g_nodes, (gptr*) &g_nodes, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -113,25 +97,13 @@ static void usage() { char desc[] = "This program will retreive config options for a ndb cluster\n"; + puts(desc); ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } -static my_bool -ndb_std_get_one_option(int optid, - const struct my_option *opt __attribute__((unused)), - char *argument) -{ - switch (optid) { - case 'V': - ndb_std_print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; -} /** * Match/Apply framework @@ -140,12 +112,15 @@ struct Match { int m_key; BaseString m_value; + Match() {} virtual int eval(const Iter&); + virtual ~Match() {} }; struct HostMatch : public Match { - virtual int eval(NdbMgmHandle, const Iter&); + HostMatch() {} + virtual int eval(const Iter&); }; struct Apply @@ -154,15 +129,18 @@ struct Apply Apply(int val) { m_key = val;} int m_key; virtual int apply(const Iter&); + virtual ~Apply() {} }; struct NodeTypeApply : public Apply { + NodeTypeApply() {} virtual int apply(const Iter&); }; struct ConnectionTypeApply : public Apply { + ConnectionTypeApply() {} virtual int apply(const Iter&); }; @@ -176,7 +154,6 @@ static ndb_mgm_configuration* load_configuration(); int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; if ((ho_error=handle_options(&argc, &argv, my_long_options, @@ -322,10 +299,10 @@ parse_where(Vector<Match*>& where, int &argc, char**& argv) Match m; if(g_host) { - HostMatch *m = new HostMatch; - m->m_key = CFG_NODE_HOST; - m->m_value.assfmt("%s", g_host); - where.push_back(m); + HostMatch *tmp = new HostMatch; + tmp->m_key = CFG_NODE_HOST; + tmp->m_value.assfmt("%s", g_host); + where.push_back(tmp); } if(g_type) @@ -402,34 +379,42 @@ Match::eval(const Iter& iter) } int -HostMatch::eval(NdbMgmHandle h, const Iter& iter) +HostMatch::eval(const Iter& iter) { const char* valc; if(iter.get(m_key, &valc) == 0) { - struct hostent *h1, *h2; + struct hostent *h1, *h2, copy1; + char *addr1; h1 = gethostbyname(m_value.c_str()); if (h1 == NULL) { return 0; } + // gethostbyname returns a pointer to a static structure + // so we need to copy the results before doing the next call + memcpy(©1, h1, sizeof(struct hostent)); + addr1 = (char *)malloc(copy1.h_length); + NdbAutoPtr<char> tmp_aptr(addr1); + memcpy(addr1, h1->h_addr, copy1.h_length); + h2 = gethostbyname(valc); if (h2 == NULL) { return 0; } - if (h1->h_addrtype != h2->h_addrtype) { + if (copy1.h_addrtype != h2->h_addrtype) { return 0; } - if (h1->h_length != h2->h_length) + if (copy1.h_length != h2->h_length) { return 0; } - return 0 == memcmp(h1->h_addr, h2->h_addr, h1->h_length); + return 0 == memcmp(addr1, h2->h_addr, copy1.h_length); } return 0; @@ -504,7 +489,7 @@ fetch_configuration() ndb_mgm_set_error_stream(mgm, stderr); - if (ndb_mgm_set_connectstring(mgm, g_connectstring)) + if (ndb_mgm_set_connectstring(mgm, opt_connect_str)) { fprintf(stderr, "* %5d: %s\n", ndb_mgm_get_latest_error(mgm), diff --git a/ndb/tools/ndb_size.pl b/ndb/tools/ndb_size.pl index c285a7590fd..3d1ea3f4231 100644 --- a/ndb/tools/ndb_size.pl +++ b/ndb/tools/ndb_size.pl @@ -57,7 +57,7 @@ if(@ARGV < 3 || $ARGV[0] eq '--usage' || $ARGV[0] eq '--help') $template->param(dsn => $dsn); } -my @releases = ({rel=>'4.1'},{rel=>'5.0'},{rel=>'5.1'}); +my @releases = ({rel=>'4.1'},{rel=>'5.0'},{rel=>'5.1'}); #,{rel=>'5.1-dd'}); $template->param(releases => \@releases); my $tables = $dbh->selectall_arrayref("show tables"); @@ -81,25 +81,29 @@ sub align { return @aligned; } -foreach(@{$tables}) -{ - my $table= @{$_}[0]; +sub do_table { + my $table= shift; + my $info= shift; + my %indexes= %{$_[0]}; + my @count= @{$_[1]}; + my @columns; - my $info= $dbh->selectall_hashref('describe `'.$table.'`',"Field"); - my @count = $dbh->selectrow_array('select count(*) from `'.$table.'`'); my %columnsize; # used for index calculations - # We now work out the DataMemory usage - # sizes for 4.1, 5.0, 5.1 - my @totalsize= (0,0,0); + # sizes for 4.1, 5.0, 5.1 and 5.1-dd + my @totalsize= (0,0,0,0); + @totalsize= @totalsize[0..$#releases]; # limit to releases we're outputting + my $nrvarsize= 0; foreach(keys %$info) { - my @realsize = (0,0,0); + my @realsize = (0,0,0,0); + my @varsize = (0,0,0,0); my $type; my $size; my $name= $_; + my $is_varsize= 0; if($$info{$_}{Type} =~ /^(.*?)\((\d+)\)/) { @@ -112,54 +116,86 @@ foreach(@{$tables}) } if($type =~ /tinyint/) - {@realsize=(1,1,1)} + {@realsize=(1,1,1,1)} elsif($type =~ /smallint/) - {@realsize=(2,2,2)} + {@realsize=(2,2,2,2)} elsif($type =~ /mediumint/) - {@realsize=(3,3,3)} + {@realsize=(3,3,3,3)} elsif($type =~ /bigint/) - {@realsize=(8,8,8)} + {@realsize=(8,8,8,8)} elsif($type =~ /int/) - {@realsize=(4,4,4)} + {@realsize=(4,4,4,4)} elsif($type =~ /float/) { if($size<=24) - {@realsize=(4,4,4)} + {@realsize=(4,4,4,4)} else - {@realsize=(8,8,8)} + {@realsize=(8,8,8,8)} } elsif($type =~ /double/ || $type =~ /real/) - {@realsize=(8,8,8)} + {@realsize=(8,8,8,8)} elsif($type =~ /bit/) { my $a=($size+7)/8; - @realsize = ($a,$a,$a); + @realsize = ($a,$a,$a,$a); } elsif($type =~ /datetime/) - {@realsize=(8,8,8)} + {@realsize=(8,8,8,8)} elsif($type =~ /timestamp/) - {@realsize=(4,4,4)} + {@realsize=(4,4,4,4)} elsif($type =~ /date/ || $type =~ /time/) - {@realsize=(3,3,3)} + {@realsize=(3,3,3,3)} elsif($type =~ /year/) - {@realsize=(1,1,1)} + {@realsize=(1,1,1,1)} elsif($type =~ /varchar/ || $type =~ /varbinary/) { - my $fixed= 1+$size; + my $fixed=$size+ceil($size/256); my @dynamic=$dbh->selectrow_array("select avg(length(`" .$name ."`)) from `".$table.'`'); $dynamic[0]=0 if !$dynamic[0]; - @realsize= ($fixed,$fixed,ceil($dynamic[0])); + $dynamic[0]+=ceil($dynamic[0]/256); # size bit + $nrvarsize++; + $is_varsize= 1; + $varsize[3]= ceil($dynamic[0]); + @realsize= ($fixed,$fixed,ceil($dynamic[0]),$fixed); } elsif($type =~ /binary/ || $type =~ /char/) - {@realsize=($size,$size,$size)} + {@realsize=($size,$size,$size,$size)} elsif($type =~ /text/ || $type =~ /blob/) { - @realsize=(256,256,1); - $NoOfTables[$_]{val} += 1 foreach 0..$#releases; # blob uses table - } # FIXME check if 5.1 is correct + @realsize=(8+256,8+256,8+256,8+256); + + my $blobhunk= 2000; + $blobhunk= 8000 if $type=~ /longblob/; + $blobhunk= 4000 if $type=~ /mediumblob/; + + my @blobsize=$dbh->selectrow_array("select SUM(CEILING(". + "length(`$name`)/$blobhunk))". + "from `".$table."`"); + $blobsize[0]=0 if !defined($blobsize[0]); + #$NoOfTables[$_]{val} += 1 foreach 0..$#releases; # blob uses table + do_table($table."\$BLOB_$name", + {'PK'=>{Type=>'int'}, + 'DIST'=>{Type=>'int'}, + 'PART'=>{Type=>'int'}, + 'DATA'=>{Type=>"binary($blobhunk)"} + }, + {'PRIMARY' => { + 'unique' => 1, + 'comment' => '', + 'columns' => [ + 'PK', + 'DIST', + 'PART', + ], + 'type' => 'HASH' + } + }, + \@blobsize); + } + @realsize= @realsize[0..$#releases]; @realsize= align(4,@realsize); $totalsize[$_]+=$realsize[$_] foreach 0..$#totalsize; @@ -170,6 +206,7 @@ foreach(@{$tables}) push @columns, { name=>$name, type=>$type, + is_varsize=>$is_varsize, size=>$size, key=>$$info{$_}{Key}, datamemory=>\@realout, @@ -183,24 +220,10 @@ foreach(@{$tables}) # Firstly, we assemble some information about the indexes. # We use SHOW INDEX instead of using INFORMATION_SCHEMA so # we can still connect to pre-5.0 mysqlds. - my %indexes; - { - my $sth= $dbh->prepare("show index from `".$table.'`'); - $sth->execute; - while(my $i = $sth->fetchrow_hashref) - { - $indexes{${%$i}{Key_name}}= { - type=>${%$i}{Index_type}, - unique=>!${%$i}{Non_unique}, - comment=>${%$i}{Comment}, - } if !defined($indexes{${%$i}{Key_name}}); - - $indexes{${%$i}{Key_name}}{columns}[${%$i}{Seq_in_index}-1]= - ${%$i}{Column_name}; - } - } if(!defined($indexes{PRIMARY})) { + my @usage= ({val=>8},{val=>8},{val=>8},{val=>8}); + @usage= @usage[0..$#releases]; $indexes{PRIMARY}= { type=>'BTREE', unique=>1, @@ -212,20 +235,22 @@ foreach(@{$tables}) type=>'bigint', size=>8, key=>'PRI', - datamemory=>[{val=>8},{val=>8},{val=>8}], + datamemory=>\@usage, }; $columnsize{'HIDDEN_NDB_PKEY'}= [8,8,8]; } - my @IndexDataMemory= ({val=>0},{val=>0},{val=>0}); - my @RowIndexMemory= ({val=>0},{val=>0},{val=>0}); + my @IndexDataMemory= ({val=>0},{val=>0},{val=>0},{val=>0}); + my @RowIndexMemory= ({val=>0},{val=>0},{val=>0},{val=>0}); + @IndexDataMemory= @IndexDataMemory[0..$#releases]; + @RowIndexMemory= @RowIndexMemory[0..$#releases]; my @indexes; foreach my $index (keys %indexes) { my $im41= 25; $im41+=$columnsize{$_}[0] foreach @{$indexes{$index}{columns}}; - my @im = ({val=>$im41},{val=>25},{val=>25}); - my @dm = ({val=>10},{val=>10},{val=>10}); + my @im = ({val=>$im41},{val=>25},{val=>25}); #,{val=>25}); + my @dm = ({val=>10},{val=>10},{val=>10}); #,{val=>10}); push @indexes, { name=>$index, type=>$indexes{$index}{type}, @@ -233,13 +258,22 @@ foreach(@{$tables}) indexmemory=>\@im, datamemory=>\@dm, }; - $IndexDataMemory[$_]{val}+=$dm[$_]{val} foreach 0..2; - $RowIndexMemory[$_]{val}+=$im[$_]{val} foreach 0..2; + $IndexDataMemory[$_]{val}+=$dm[$_]{val} foreach 0..$#releases; + $RowIndexMemory[$_]{val}+=$im[$_]{val} foreach 0..$#releases; } # total size + 16 bytes overhead my @TotalDataMemory; - $TotalDataMemory[$_]{val}=$IndexDataMemory[$_]{val}+$totalsize[$_]+16 foreach 0..2; + my @RowOverhead = ({val=>16},{val=>16},{val=>16}); #,{val=>24}); + # 5.1 has ptr to varsize page, and per-varsize overhead + my @nrvarsize_mem= ({val=>0},{val=>0}, + {val=>8}); #,{val=>0}); + { + my @a= align(4,$nrvarsize*2); + $nrvarsize_mem[2]{val}+=$a[0]+$nrvarsize*4; + } + + $TotalDataMemory[$_]{val}=$IndexDataMemory[$_]{val}+$totalsize[$_]+$RowOverhead[$_]{val}+$nrvarsize_mem[$_]{val} foreach 0..$#releases; my @RowDataMemory; push @RowDataMemory,{val=>$_} foreach @totalsize; @@ -260,12 +294,18 @@ foreach(@{$tables}) my @counts; $counts[$_]{val}= $count foreach 0..$#releases; + my @nrvarsize_rel= ({val=>0},{val=>0}, + {val=>$nrvarsize}); #,{val=>0}); + push @table_size, { table=>$table, indexes=>\@indexes, columns=>\@columns, count=>\@counts, + RowOverhead=>\@RowOverhead, RowDataMemory=>\@RowDataMemory, + nrvarsize=>\@nrvarsize_rel, + nrvarsize_mem=>\@nrvarsize_mem, releases=>\@releases, IndexDataMemory=>\@IndexDataMemory, TotalDataMemory=>\@TotalDataMemory, @@ -283,6 +323,31 @@ foreach(@{$tables}) $NoOfIndexes[$_]{val} += @indexes foreach 0..$#releases; } +foreach(@{$tables}) +{ + my $table= @{$_}[0]; + my $info= $dbh->selectall_hashref('describe `'.$table.'`',"Field"); + my @count = $dbh->selectrow_array('select count(*) from `'.$table.'`'); + + my %indexes; + { + my $sth= $dbh->prepare("show index from `".$table.'`'); + $sth->execute; + while(my $i = $sth->fetchrow_hashref) + { + $indexes{${%$i}{Key_name}}= { + type=>${%$i}{Index_type}, + unique=>!${%$i}{Non_unique}, + comment=>${%$i}{Comment}, + } if !defined($indexes{${%$i}{Key_name}}); + + $indexes{${%$i}{Key_name}}{columns}[${%$i}{Seq_in_index}-1]= + ${%$i}{Column_name}; + } + } + do_table($table, $info, \%indexes, \@count); +} + my @NoOfTriggers; # for unique hash indexes $NoOfTriggers[$_]{val} += $NoOfIndexes[$_]{val}*3 foreach 0..$#releases; diff --git a/ndb/tools/ndb_size.tmpl b/ndb/tools/ndb_size.tmpl index dc02b5a5970..1e19ea132ba 100644 --- a/ndb/tools/ndb_size.tmpl +++ b/ndb/tools/ndb_size.tmpl @@ -15,6 +15,8 @@ td,th { border: 1px solid black } <p>This information should be valid for MySQL 4.1 and 5.0. Since 5.1 is not a final release yet, the numbers should be used as a guide only.</p> +<p>5.1-dd is for tables stored on disk. The ndb_size.pl estimates are <b>experimental</b> and should not be trusted. Notably we don't take into account indexed columns being in DataMemory versus non-indexed on disk.</p> + <h2>Parameter Settings</h2> <p><b>NOTE</b> the configuration parameters below do not take into account system tables and other requirements.</p> <table> @@ -69,6 +71,7 @@ td,th { border: 1px solid black } <tr> <th>Column</th> <th>Type</th> + <th>VARSIZE</th> <th>Size</th> <th>Key</th> <TMPL_LOOP NAME=releases> @@ -79,6 +82,7 @@ td,th { border: 1px solid black } <tr> <td><TMPL_VAR NAME=name></td> <td><TMPL_VAR NAME=type></td> + <td><TMPL_IF NAME=is_varsize>YES<TMPL_ELSE> </TMPL_IF></td> <td><TMPL_VAR NAME=size></td> <td><TMPL_VAR NAME=key></td> <TMPL_LOOP NAME=datamemory> @@ -129,9 +133,21 @@ td,th { border: 1px solid black } </TMPL_LOOP> </tr> <tr> + <th>Nr Varsized Attributes</th> + <TMPL_LOOP NAME=nrvarsize> + <td><TMPL_VAR NAME=val></td> + </TMPL_LOOP> +</tr> +<tr> <th>Row Overhead</th> - <TMPL_LOOP NAME=releases> - <td>16</td> + <TMPL_LOOP NAME=RowOverhead> + <td><TMPL_VAR NAME=val></td> + </TMPL_LOOP> +</tr> +<tr> + <th>Varsized Overhead</th> + <TMPL_LOOP NAME=nrvarsize_mem> + <td><TMPL_VAR NAME=val></td> </TMPL_LOOP> </tr> <tr> diff --git a/ndb/tools/ndb_test_platform.cpp b/ndb/tools/ndb_test_platform.cpp index 88f21b31d58..27b50df5188 100644 --- a/ndb/tools/ndb_test_platform.cpp +++ b/ndb/tools/ndb_test_platform.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/tools/ndbsql.cpp b/ndb/tools/ndbsql.cpp index 1997e4abebd..c243209afdd 100644 --- a/ndb/tools/ndbsql.cpp +++ b/ndb/tools/ndbsql.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index a808a48b558..c07bfbc2bd4 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -24,6 +23,8 @@ #include <SimpleProperties.hpp> #include <signaldata/DictTabInfo.hpp> +extern NdbRecordPrintFormat g_ndbrecord_print_format; + Uint16 Twiddle16(Uint16 in); // Byte shift 16-bit data Uint32 Twiddle32(Uint32 in); // Byte shift 32-bit data Uint64 Twiddle64(Uint64 in); // Byte shift 64-bit data @@ -55,7 +56,12 @@ BackupFile::Twiddle(const AttributeDesc* attr_desc, AttributeData* attr_data, Ui return true; case 64: for(i = 0; i<arraySize; i++){ - attr_data->u_int64_value[i] = Twiddle64(attr_data->u_int64_value[i]); + // allow unaligned + char* p = (char*)&attr_data->u_int64_value[i]; + Uint64 x; + memcpy(&x, p, sizeof(Uint64)); + x = Twiddle64(x); + memcpy(p, &x, sizeof(Uint64)); } return true; default: @@ -114,6 +120,8 @@ RestoreMetaData::loadContent() return 0; } } + if (! markSysTables()) + return 0; if(!readGCPEntry()) return 0; @@ -172,6 +180,49 @@ RestoreMetaData::readMetaTableDesc() { } bool +RestoreMetaData::markSysTables() +{ + Uint32 i; + for (i = 0; i < getNoOfTables(); i++) { + TableS* table = allTables[i]; + table->m_local_id = i; + const char* tableName = table->getTableName(); + if ( // XXX should use type + strcmp(tableName, "SYSTAB_0") == 0 || + strcmp(tableName, "NDB$EVENTS_0") == 0 || + strcmp(tableName, "sys/def/SYSTAB_0") == 0 || + strcmp(tableName, "sys/def/NDB$EVENTS_0") == 0) + table->isSysTable = true; + } + for (i = 0; i < getNoOfTables(); i++) { + TableS* blobTable = allTables[i]; + const char* blobTableName = blobTable->getTableName(); + // yet another match blob + int cnt, id1, id2; + char buf[256]; + cnt = sscanf(blobTableName, "%[^/]/%[^/]/NDB$BLOB_%d_%d", + buf, buf, &id1, &id2); + if (cnt == 4) { + Uint32 j; + for (j = 0; j < getNoOfTables(); j++) { + TableS* table = allTables[j]; + if (table->getTableId() == (Uint32) id1) { + if (table->isSysTable) + blobTable->isSysTable = true; + blobTable->m_main_table = table; + break; + } + } + if (j == getNoOfTables()) { + err << "Restore: Bad primary table id in " << blobTableName << endl; + return false; + } + } + } + return true; +} + +bool RestoreMetaData::readGCPEntry() { Uint32 data[4]; @@ -255,6 +306,8 @@ TableS::TableS(Uint32 version, NdbTableImpl* tableImpl) m_max_auto_val= 0; m_noOfRecords= 0; backupVersion = version; + isSysTable = false; + m_main_table = NULL; for (int i = 0; i < tableImpl->getNoOfColumns(); i++) createAttr(tableImpl->getColumn(i)); @@ -401,6 +454,7 @@ RestoreDataIterator::getNextTuple(int & res) attr_data->null = false; attr_data->void_value = ptr; + attr_data->size = 4*sz; if(!Twiddle(attr_desc, attr_data)) { @@ -422,6 +476,7 @@ RestoreDataIterator::getNextTuple(int & res) attr_data->null = false; attr_data->void_value = ptr; + attr_data->size = 4*sz; if(!Twiddle(attr_desc, attr_data)) { @@ -458,6 +513,7 @@ RestoreDataIterator::getNextTuple(int & res) attr_data->null = false; attr_data->void_value = &data->Data[0]; + attr_data->size = sz*4; /** * Compute array size @@ -700,6 +756,7 @@ bool RestoreDataIterator::readFragmentHeader(int & ret) return false; } + info.setLevel(254); info << "_____________________________________________________" << endl << "Processing data in table: " << m_currentTable->getTableName() << "(" << Header.TableId << ") fragment " @@ -920,13 +977,14 @@ operator<<(NdbOut& ndbout, const AttributeS& attr){ if (data.null) { - ndbout << "<NULL>"; + ndbout << g_ndbrecord_print_format.null_string; return ndbout; } NdbRecAttr tmprec(0); - tmprec.setup(desc.m_column, (char *)data.void_value); - ndbout << tmprec; + tmprec.setup(desc.m_column, 0); + tmprec.receive_data((Uint32*)data.void_value, (data.size+3)/4); + ndbrecattr_print_formatted(ndbout, tmprec, g_ndbrecord_print_format); return ndbout; } @@ -935,17 +993,15 @@ operator<<(NdbOut& ndbout, const AttributeS& attr){ NdbOut& operator<<(NdbOut& ndbout, const TupleS& tuple) { - ndbout << tuple.getTable()->getTableName() << "; "; for (int i = 0; i < tuple.getNoOfAttributes(); i++) { + if (i > 0) + ndbout << g_ndbrecord_print_format.fields_terminated_by; AttributeData * attr_data = tuple.getData(i); const AttributeDesc * attr_desc = tuple.getDesc(i); const AttributeS attr = {attr_desc, *attr_data}; debug << i << " " << attr_desc->m_column->getName(); ndbout << attr; - - if (i != (tuple.getNoOfAttributes() - 1)) - ndbout << delimiter << " "; } // for return ndbout; } diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp index cf8feb7125c..c1545159ce4 100644 --- a/ndb/tools/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -26,8 +25,6 @@ #include <ndb_version.h> #include <version.h> -static const char * delimiter = ";"; // Delimiter in file dump - const int FileNameLenC = 256; const int TableNameLenC = 256; const int AttrNameLenC = 256; @@ -144,6 +141,10 @@ class TableS { int pos; + bool isSysTable; + TableS *m_main_table; + Uint32 m_local_id; + Uint64 m_noOfRecords; Vector<FragmentInfo *> m_fragmentInfo; @@ -157,6 +158,9 @@ public: Uint32 getTableId() const { return m_dictTable->getTableId(); } + Uint32 getLocalId() const { + return m_local_id; + } Uint32 getNoOfRecords() const { return m_noOfRecords; } @@ -215,6 +219,9 @@ public: memcpy(&val.u32,data,4); v= val.u32; break; + case 24: + v= uint3korr((unsigned char*)data); + break; case 16: memcpy(&val.u16,data,2); v= val.u16; @@ -236,6 +243,14 @@ public: return allAttributesDesc[attributeId]; } + bool getSysTable() const { + return isSysTable; + } + + const TableS *getMainTable() const { + return m_main_table; + } + TableS& operator=(TableS& org) ; }; // TableS; @@ -286,6 +301,7 @@ class RestoreMetaData : public BackupFile { Vector<TableS *> allTables; bool readMetaFileHeader(); bool readMetaTableDesc(); + bool markSysTables(); bool readGCPEntry(); bool readFragmentInfo(); @@ -359,6 +375,7 @@ public: m_values_e.push_back(m_values[i]); m_values.clear(); } + LogEntry() {} ~LogEntry() { Uint32 i; diff --git a/ndb/tools/restore/consumer.cpp b/ndb/tools/restore/consumer.cpp index b130c4998d5..0164860767b 100644 --- a/ndb/tools/restore/consumer.cpp +++ b/ndb/tools/restore/consumer.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/tools/restore/consumer.hpp b/ndb/tools/restore/consumer.hpp index 692c814159f..a4e8e71012b 100644 --- a/ndb/tools/restore/consumer.hpp +++ b/ndb/tools/restore/consumer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -21,6 +20,7 @@ class BackupConsumer { public: + BackupConsumer() {} virtual ~BackupConsumer() { } virtual bool init() { return true;} virtual bool table(const TableS &){return true;} @@ -31,6 +31,7 @@ public: virtual void logEntry(const LogEntry &){} virtual void endOfLogEntrys(){} virtual bool finalize_table(const TableS &){return true;} + virtual bool has_temp_error() {return false;} }; #endif diff --git a/ndb/tools/restore/consumer_printer.cpp b/ndb/tools/restore/consumer_printer.cpp index 0aa5b521d29..e0525522284 100644 --- a/ndb/tools/restore/consumer_printer.cpp +++ b/ndb/tools/restore/consumer_printer.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -15,6 +14,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "consumer_printer.hpp" +extern FilteredNdbOut info; +extern NdbRecordPrintFormat g_ndbrecord_print_format; +extern const char *tab_path; bool BackupPrinter::table(const TableS & tab) @@ -22,7 +24,8 @@ BackupPrinter::table(const TableS & tab) if (m_print || m_print_meta) { m_ndbout << tab; - ndbout_c("Successfully printed table: %s", tab.m_dictTable->getName()); + info.setLevel(254); + info << "Successfully printed table: ", tab.m_dictTable->getName(); } return true; } @@ -32,7 +35,14 @@ BackupPrinter::tuple(const TupleS & tup) { m_dataCount++; if (m_print || m_print_data) - m_ndbout << tup << endl; + { + if (m_ndbout.m_out == info.m_out) + { + info.setLevel(254); + info << tup.getTable()->getTableName() << "; "; + } + m_ndbout << tup << g_ndbrecord_print_format.lines_terminated_by; + } } void @@ -48,8 +58,9 @@ BackupPrinter::endOfLogEntrys() { if (m_print || m_print_log) { - ndbout << "Printed " << m_dataCount << " tuples and " - << m_logCount << " log entries" - << " to stdout." << endl; + info.setLevel(254); + info << "Printed " << m_dataCount << " tuples and " + << m_logCount << " log entries" + << " to stdout." << endl; } } diff --git a/ndb/tools/restore/consumer_printer.hpp b/ndb/tools/restore/consumer_printer.hpp index e47bc56f874..f56fed4677a 100644 --- a/ndb/tools/restore/consumer_printer.hpp +++ b/ndb/tools/restore/consumer_printer.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/tools/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp index dc1399e73b2..811868f3e77 100644 --- a/ndb/tools/restore/consumer_restore.cpp +++ b/ndb/tools/restore/consumer_restore.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -180,6 +179,11 @@ BackupRestore::finalize_table(const TableS & table){ } bool +BackupRestore::has_temp_error(){ + return m_temp_error; +} + +bool BackupRestore::table(const TableS & table){ if (!m_restore && !m_restore_meta) return true; @@ -201,7 +205,7 @@ BackupRestore::table(const TableS & table){ BaseString tmp(name); Vector<BaseString> split; if(tmp.split(split, "/") != 3){ - err << "Invalid table name format " << name << endl; + err << "Invalid table name format `" << name << "`" << endl; return false; } @@ -226,16 +230,17 @@ BackupRestore::table(const TableS & table){ if (dict->createTable(copy) == -1) { - err << "Create table " << table.getTableName() << " failed: " + err << "Create table `" << table.getTableName() << "` failed: " << dict->getNdbError() << endl; return false; } - info << "Successfully restored table " << table.getTableName()<< endl ; + info << "Successfully restored table `" + << table.getTableName() << "`" << endl; } const NdbDictionary::Table* tab = dict->getTable(split[2].c_str()); if(tab == 0){ - err << "Unable to find table: " << split[2].c_str() << endl; + err << "Unable to find table: `" << split[2].c_str() << "`" << endl; return false; } const NdbDictionary::Table* null = 0; @@ -253,12 +258,15 @@ BackupRestore::endOfTables(){ for(size_t i = 0; i<m_indexes.size(); i++){ NdbTableImpl & indtab = NdbTableImpl::getImpl(* m_indexes[i]); - BaseString tmp(indtab.m_primaryTable.c_str()); Vector<BaseString> split; - if(tmp.split(split, "/") != 3){ - err << "Invalid table name format " << indtab.m_primaryTable.c_str() - << endl; - return false; + { + BaseString tmp(indtab.m_primaryTable.c_str()); + if (tmp.split(split, "/") != 3) + { + err << "Invalid table name format `" << indtab.m_primaryTable.c_str() + << "`" << endl; + return false; + } } m_ndb->setDatabaseName(split[0].c_str()); @@ -266,39 +274,41 @@ BackupRestore::endOfTables(){ const NdbDictionary::Table * prim = dict->getTable(split[2].c_str()); if(prim == 0){ - err << "Unable to find base table \"" << split[2].c_str() - << "\" for index " - << indtab.getName() << endl; + err << "Unable to find base table `" << split[2].c_str() + << "` for index `" + << indtab.getName() << "`" << endl; return false; } NdbTableImpl& base = NdbTableImpl::getImpl(*prim); NdbIndexImpl* idx; - int id; - char idxName[255], buf[255]; - if(sscanf(indtab.getName(), "%[^/]/%[^/]/%d/%s", - buf, buf, &id, idxName) != 4){ - err << "Invalid index name format " << indtab.getName() << endl; - return false; + Vector<BaseString> split_idx; + { + BaseString tmp(indtab.getName()); + if (tmp.split(split_idx, "/") != 4) + { + err << "Invalid index name format `" << indtab.getName() << "`" << endl; + return false; + } } if(NdbDictInterface::create_index_obj_from_table(&idx, &indtab, &base)) { - err << "Failed to create index " << idxName - << " on " << split[2].c_str() << endl; + err << "Failed to create index `" << split_idx[3] + << "` on " << split[2].c_str() << endl; return false; } - idx->setName(idxName); + idx->setName(split_idx[3].c_str()); if(dict->createIndex(* idx) != 0) { delete idx; - err << "Failed to create index " << idxName - << " on " << split[2].c_str() << endl + err << "Failed to create index `" << split_idx[3].c_str() + << "` on `" << split[2].c_str() << "`" << endl << dict->getNdbError() << endl; return false; } delete idx; - info << "Successfully created index " << idxName - << " on " << split[2].c_str() << endl; + info << "Successfully created index `" << split_idx[3].c_str() + << "` on `" << split[2].c_str() << "`" << endl; } return true; } @@ -378,7 +388,7 @@ void BackupRestore::tuple_a(restore_callback_t *cb) Uint32 length = (size * arraySize) / 8; if (j == 0 && tup.getTable()->have_auto_inc(i)) - tup.getTable()->update_max_auto_val(dataPtr,size); + tup.getTable()->update_max_auto_val(dataPtr,size*arraySize); if (attr_desc->m_column->getPrimaryKey()) { @@ -485,6 +495,7 @@ bool BackupRestore::errorHandler(restore_callback_t *cb) case NdbError::TemporaryError: err << "Temporary error: " << error << endl; + m_temp_error = true; NdbSleep_MilliSleep(sleepTime); return true; // RETRY @@ -591,7 +602,7 @@ BackupRestore::logEntry(const LogEntry & tup) const char * dataPtr = attr->Data.string_value; if (tup.m_table->have_auto_inc(attr->Desc->attrId)) - tup.m_table->update_max_auto_val(dataPtr,size); + tup.m_table->update_max_auto_val(dataPtr,size*arraySize); const Uint32 length = (size / 8) * arraySize; if (attr->Desc->m_column->getPrimaryKey()) diff --git a/ndb/tools/restore/consumer_restore.hpp b/ndb/tools/restore/consumer_restore.hpp index 1bf6d89a912..09b355c8103 100644 --- a/ndb/tools/restore/consumer_restore.hpp +++ b/ndb/tools/restore/consumer_restore.hpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -42,6 +41,7 @@ public: m_parallelism = parallelism; m_callback = 0; m_free_callback = 0; + m_temp_error = false; m_transactions = 0; m_cache.m_old_table = 0; } @@ -61,6 +61,7 @@ public: virtual void logEntry(const LogEntry &); virtual void endOfLogEntrys(); virtual bool finalize_table(const TableS &); + virtual bool has_temp_error(); void connectToMysql(); Ndb * m_ndb; Ndb_cluster_connection * m_cluster_connection; @@ -74,6 +75,7 @@ public: restore_callback_t *m_callback; restore_callback_t *m_free_callback; + bool m_temp_error; /** * m_new_table_ids[X] = Y; diff --git a/ndb/tools/restore/consumer_restorem.cpp b/ndb/tools/restore/consumer_restorem.cpp index 56179a60ab0..2dc0476b5a6 100644 --- a/ndb/tools/restore/consumer_restorem.cpp +++ b/ndb/tools/restore/consumer_restorem.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp index c2e0697b9c5..9ec59b9b4a6 100644 --- a/ndb/tools/restore/restore_main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -19,7 +18,9 @@ #include <Vector.hpp> #include <ndb_limits.h> #include <NdbTCP.h> +#include <NdbMem.h> #include <NdbOut.hpp> +#include <OutputStream.hpp> #include <NDBT_ReturnCodes.h> #include "consumer_restore.hpp" @@ -34,8 +35,18 @@ static int ga_nParallelism = 128; static int ga_backupId = 0; static bool ga_dont_ignore_systab_0 = false; static Vector<class BackupConsumer *> g_consumers; +static BackupPrinter* g_printer = NULL; -static const char* ga_backupPath = "." DIR_SEPARATOR; +static const char* default_backupPath = "." DIR_SEPARATOR; +static const char* ga_backupPath = default_backupPath; + +const char *opt_ndb_database= NULL; +const char *opt_ndb_table= NULL; +unsigned int opt_verbose; +unsigned int opt_hex_format; +Vector<BaseString> g_databases; +Vector<BaseString> g_tables; +NdbRecordPrintFormat g_ndbrecord_print_format; NDB_STD_OPTS_VARS; @@ -52,6 +63,30 @@ static int _restore_data = 0; static int _restore_meta = 0; BaseString g_options("ndb_restore"); +const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 }; + +enum ndb_restore_options { + OPT_PRINT= NDB_STD_OPTIONS_LAST, + OPT_PRINT_DATA, + OPT_PRINT_LOG, + OPT_PRINT_META, + OPT_BACKUP_PATH, + OPT_HEX_FORMAT, + OPT_FIELDS_ENCLOSED_BY, + OPT_FIELDS_TERMINATED_BY, + OPT_FIELDS_OPTIONALLY_ENCLOSED_BY, + OPT_LINES_TERMINATED_BY, + OPT_APPEND, + OPT_VERBOSE +}; +static const char *opt_fields_enclosed_by= NULL; +static const char *opt_fields_terminated_by= NULL; +static const char *opt_fields_optionally_enclosed_by= NULL; +static const char *opt_lines_terminated_by= NULL; + +static const char *tab_path= NULL; +static int opt_append; + static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_restore"), @@ -77,22 +112,56 @@ static struct my_option my_long_options[] = "(parallelism can be 1 to 1024)", (gptr*) &ga_nParallelism, (gptr*) &ga_nParallelism, 0, GET_INT, REQUIRED_ARG, 128, 1, 1024, 0, 1, 0 }, - { "print", 256, "Print data and log to stdout", + { "print", OPT_PRINT, "Print data and log to stdout", (gptr*) &_print, (gptr*) &_print, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "print_data", 257, "Print data to stdout", + { "print_data", OPT_PRINT_DATA, "Print data to stdout", (gptr*) &_print_data, (gptr*) &_print_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "print_meta", 258, "Print meta data to stdout", + { "print_meta", OPT_PRINT_META, "Print meta data to stdout", (gptr*) &_print_meta, (gptr*) &_print_meta, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "print_log", 259, "Print log to stdout", + { "print_log", OPT_PRINT_LOG, "Print log to stdout", (gptr*) &_print_log, (gptr*) &_print_log, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "backup_path", OPT_BACKUP_PATH, "Path to backup files", + (gptr*) &ga_backupPath, (gptr*) &ga_backupPath, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "dont_ignore_systab_0", 'f', "Experimental. Do not ignore system table during restore.", (gptr*) &ga_dont_ignore_systab_0, (gptr*) &ga_dont_ignore_systab_0, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "fields-enclosed-by", OPT_FIELDS_ENCLOSED_BY, + "Fields are enclosed by ...", + (gptr*) &opt_fields_enclosed_by, (gptr*) &opt_fields_enclosed_by, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "fields-terminated-by", OPT_FIELDS_TERMINATED_BY, + "Fields are terminated by ...", + (gptr*) &opt_fields_terminated_by, + (gptr*) &opt_fields_terminated_by, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "fields-optionally-enclosed-by", OPT_FIELDS_OPTIONALLY_ENCLOSED_BY, + "Fields are optionally enclosed by ...", + (gptr*) &opt_fields_optionally_enclosed_by, + (gptr*) &opt_fields_optionally_enclosed_by, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "hex", OPT_HEX_FORMAT, "print binary types in hex format", + (gptr*) &opt_hex_format, (gptr*) &opt_hex_format, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "tab", 'T', "Creates tab separated textfile for each table to " + "given path. (creates .txt files)", + (gptr*) &tab_path, (gptr*) &tab_path, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "append", OPT_APPEND, "for --tab append data to file", + (gptr*) &opt_append, (gptr*) &opt_append, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "lines-terminated-by", OPT_LINES_TERMINATED_BY, "", + (gptr*) &opt_lines_terminated_by, (gptr*) &opt_lines_terminated_by, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "verbose", OPT_VERBOSE, + "verbosity", + (gptr*) &opt_verbose, (gptr*) &opt_verbose, 0, + GET_INT, REQUIRED_ARG, 1, 0, 255, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -104,6 +173,8 @@ static void usage() { short_usage_sub(); ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -116,19 +187,26 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), #endif ndb_std_get_one_option(optid, opt, argument); switch (optid) { + case OPT_VERBOSE: + info.setThreshold(255-opt_verbose); + break; case 'n': if (ga_nodeId == 0) { - printf("Error in --nodeid,-n setting, see --help\n"); + err << "Error in --nodeid,-n setting, see --help"; exit(NDBT_ProgramExit(NDBT_WRONGARGS)); } + info.setLevel(254); + info << "Nodeid = " << ga_nodeId << endl; break; case 'b': if (ga_backupId == 0) { - printf("Error in --backupid,-b setting, see --help\n"); + err << "Error in --backupid,-b setting, see --help"; exit(NDBT_ProgramExit(NDBT_WRONGARGS)); } + info.setLevel(254); + info << "Backup Id = " << ga_backupId << endl; break; } return 0; @@ -136,21 +214,26 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), bool readArguments(int *pargc, char*** pargv) { + Uint32 i; + debug << "Load defaults" << endl; const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 }; + load_defaults("my",load_default_groups,pargc,pargv); + debug << "handle_options" << endl; if (handle_options(pargc, pargv, my_long_options, get_one_option)) { exit(NDBT_ProgramExit(NDBT_WRONGARGS)); } - BackupPrinter* printer = new BackupPrinter(); - if (printer == NULL) + g_printer = new BackupPrinter(); + if (g_printer == NULL) return false; BackupRestore* restore = new BackupRestore(ga_nParallelism); if (restore == NULL) { - delete printer; + delete g_printer; + g_printer = NULL; return false; } @@ -158,22 +241,22 @@ readArguments(int *pargc, char*** pargv) { ga_print = true; ga_restore = true; - printer->m_print = true; + g_printer->m_print = true; } if (_print_meta) { ga_print = true; - printer->m_print_meta = true; + g_printer->m_print_meta = true; } if (_print_data) { ga_print = true; - printer->m_print_data = true; + g_printer->m_print_data = true; } if (_print_log) { ga_print = true; - printer->m_print_log = true; + g_printer->m_print_log = true; } if (_restore_data) @@ -189,19 +272,64 @@ readArguments(int *pargc, char*** pargv) } { - BackupConsumer * c = printer; + BackupConsumer * c = g_printer; g_consumers.push_back(c); } { BackupConsumer * c = restore; g_consumers.push_back(c); } - // Set backup file path - if (*pargv[0] != NULL) + for (;;) { - ga_backupPath = *pargv[0]; + int i= 0; + if (ga_backupPath == default_backupPath) + { + // Set backup file path + if ((*pargv)[i] == NULL) + break; + ga_backupPath = (*pargv)[i++]; + } + if ((*pargv)[i] == NULL) + break; + g_databases.push_back((*pargv)[i++]); + while ((*pargv)[i] != NULL) + { + g_tables.push_back((*pargv)[i++]); + } + break; } - + info.setLevel(254); + info << "backup path = " << ga_backupPath << endl; + if (g_databases.size() > 0) + { + info << "Restoring only from database " << g_databases[0].c_str() << endl; + if (g_tables.size() > 0) + info << "Restoring only tables:"; + for (unsigned i= 0; i < g_tables.size(); i++) + { + info << " " << g_tables[i].c_str(); + } + if (g_tables.size() > 0) + info << endl; + } + /* + the below formatting follows the formatting from mysqldump + do not change unless to adopt to changes in mysqldump + */ + g_ndbrecord_print_format.fields_enclosed_by= + opt_fields_enclosed_by ? opt_fields_enclosed_by : ""; + g_ndbrecord_print_format.fields_terminated_by= + opt_fields_terminated_by ? opt_fields_terminated_by : "\t"; + g_ndbrecord_print_format.fields_optionally_enclosed_by= + opt_fields_optionally_enclosed_by ? opt_fields_optionally_enclosed_by : ""; + g_ndbrecord_print_format.lines_terminated_by= + opt_lines_terminated_by ? opt_lines_terminated_by : "\n"; + if (g_ndbrecord_print_format.fields_optionally_enclosed_by[0] == '\0') + g_ndbrecord_print_format.null_string= "\\N"; + else + g_ndbrecord_print_format.null_string= ""; + g_ndbrecord_print_format.hex_prefix= ""; + g_ndbrecord_print_format.hex_format= opt_hex_format; return true; } @@ -213,14 +341,81 @@ clearConsumers() g_consumers.clear(); } -static bool -checkSysTable(const char *tableName) +static inline bool +checkSysTable(const TableS* table) { - return ga_dont_ignore_systab_0 || - (strcmp(tableName, "SYSTAB_0") != 0 && - strcmp(tableName, "NDB$EVENTS_0") != 0 && - strcmp(tableName, "sys/def/SYSTAB_0") != 0 && - strcmp(tableName, "sys/def/NDB$EVENTS_0") != 0); + return ga_dont_ignore_systab_0 || ! table->getSysTable(); +} + +static inline bool +checkSysTable(const RestoreMetaData& metaData, uint i) +{ + assert(i < metaData.getNoOfTables()); + return checkSysTable(metaData[i]); +} + +static inline bool +isBlobTable(const TableS* table) +{ + return table->getMainTable() != NULL; +} + +static inline bool +isIndex(const TableS* table) +{ + const NdbTableImpl & tmptab = NdbTableImpl::getImpl(* table->m_dictTable); + return (int) tmptab.m_indexType != (int) NdbDictionary::Index::Undefined; +} + +static inline bool +checkDbAndTableName(const TableS* table) +{ + if (g_tables.size() == 0 && + g_databases.size() == 0) + return true; + if (g_databases.size() == 0) + g_databases.push_back("TEST_DB"); + + // Filter on the main table name for indexes and blobs + const char *table_name; + if (isBlobTable(table)) + table_name= table->getMainTable()->getTableName(); + else if (isIndex(table)) + table_name= + NdbTableImpl::getImpl(*table->m_dictTable).m_primaryTable.c_str(); + else + table_name= table->getTableName(); + + unsigned i; + for (i= 0; i < g_databases.size(); i++) + { + if (strncmp(table_name, g_databases[i].c_str(), + g_databases[i].length()) == 0 && + table_name[g_databases[i].length()] == '/') + { + // we have a match + if (g_databases.size() > 1 || g_tables.size() == 0) + return true; + break; + } + } + if (i == g_databases.size()) + return false; // no match found + + while (*table_name != '/') table_name++; + table_name++; + while (*table_name != '/') table_name++; + table_name++; + + for (i= 0; i < g_tables.size(); i++) + { + if (strcmp(table_name, g_tables[i].c_str()) == 0) + { + // we have a match + return true; + } + } + return false; } static void @@ -245,6 +440,7 @@ main(int argc, char** argv) { NDB_INIT(argv[0]); + debug << "Start readArguments" << endl; if (!readArguments(&argc, &argv)) { exitHandler(NDBT_FAILED); @@ -263,10 +459,11 @@ main(int argc, char** argv) /** * we must always load meta data, even if we will only print it to stdout */ + debug << "Start restoring meta data" << endl; RestoreMetaData metaData(ga_backupPath, ga_nodeId, ga_backupId); if (!metaData.readHeader()) { - ndbout << "Failed to read " << metaData.getFilename() << endl << endl; + err << "Failed to read " << metaData.getFilename() << endl << endl; exitHandler(NDBT_FAILED); } @@ -274,66 +471,108 @@ main(int argc, char** argv) const Uint32 version = tmp.NdbVersion; char buf[NDB_VERSION_STRING_BUF_SZ]; - ndbout << "Ndb version in backup files: " - << getVersionString(version, 0, buf, sizeof(buf)) << endl; + info.setLevel(254); + info << "Ndb version in backup files: " + << getVersionString(version, 0, buf, sizeof(buf)) << endl; /** * check wheater we can restore the backup (right version). */ + if (version > NDB_VERSION) + { + err << "Restore program older than backup version. Not supported. " + << "Use new restore program" << endl; + exitHandler(NDBT_FAILED); + } + + debug << "Load content" << endl; int res = metaData.loadContent(); if (res == 0) { - ndbout_c("Restore: Failed to load content"); + err << "Restore: Failed to load content" << endl; exitHandler(NDBT_FAILED); } - + debug << "Get no of Tables" << endl; if (metaData.getNoOfTables() == 0) { - ndbout_c("Restore: The backup contains no tables "); + err << "The backup contains no tables" << endl; exitHandler(NDBT_FAILED); } - + debug << "Validate Footer" << endl; if (!metaData.validateFooter()) { - ndbout_c("Restore: Failed to validate footer."); + err << "Restore: Failed to validate footer." << endl; exitHandler(NDBT_FAILED); } - + debug << "Init Backup objects" << endl; Uint32 i; for(i= 0; i < g_consumers.size(); i++) { if (!g_consumers[i]->init()) { clearConsumers(); + err << "Failed to initialize consumers" << endl; exitHandler(NDBT_FAILED); } } + Vector<OutputStream *> table_output(metaData.getNoOfTables()); + debug << "Restoring tables" << endl; for(i = 0; i<metaData.getNoOfTables(); i++) { - if (checkSysTable(metaData[i]->getTableName())) + const TableS *table= metaData[i]; + table_output.push_back(NULL); + if (!checkDbAndTableName(table)) + continue; + if (checkSysTable(table)) { + if (!tab_path || isBlobTable(table) || isIndex(table)) + { + table_output[i]= ndbout.m_out; + } + else + { + FILE* res; + char filename[FN_REFLEN], tmp_path[FN_REFLEN]; + const char *table_name; + table_name= table->getTableName(); + while (*table_name != '/') table_name++; + table_name++; + while (*table_name != '/') table_name++; + table_name++; + convert_dirname(tmp_path, tab_path, NullS); + res= my_fopen(fn_format(filename, table_name, tmp_path, ".txt", 4), + opt_append ? + O_WRONLY|O_APPEND|O_CREAT : + O_WRONLY|O_TRUNC|O_CREAT, + MYF(MY_WME)); + if (res == 0) + { + exitHandler(NDBT_FAILED); + } + FileOutputStream *f= new FileOutputStream(res); + table_output[i]= f; + } for(Uint32 j= 0; j < g_consumers.size(); j++) - if (!g_consumers[j]->table(* metaData[i])) + if (!g_consumers[j]->table(* table)) { - ndbout_c("Restore: Failed to restore table: %s. " - "Exiting...", - metaData[i]->getTableName()); + err << "Restore: Failed to restore table: `"; + err << table->getTableName() << "` ... Exiting " << endl; exitHandler(NDBT_FAILED); - } + } } } - + debug << "Close tables" << endl; for(i= 0; i < g_consumers.size(); i++) if (!g_consumers[i]->endOfTables()) { - ndbout_c("Restore: Failed while closing tables"); + err << "Restore: Failed while closing tables" << endl; exitHandler(NDBT_FAILED); } - + debug << "Iterate over data" << endl; if (ga_restore || ga_print) { if(_restore_data || _print_data) @@ -343,7 +582,7 @@ main(int argc, char** argv) // Read data file header if (!dataIter.readHeader()) { - ndbout << "Failed to read header of data file. Exiting..." ; + err << "Failed to read header of data file. Exiting..." << endl; exitHandler(NDBT_FAILED); } @@ -353,20 +592,26 @@ main(int argc, char** argv) const TupleS* tuple; while ((tuple = dataIter.getNextTuple(res= 1)) != 0) { - if (checkSysTable(tuple->getTable()->getTableName())) - for(Uint32 i= 0; i < g_consumers.size(); i++) - g_consumers[i]->tuple(* tuple); + const TableS* table = tuple->getTable(); + OutputStream *output = table_output[table->getLocalId()]; + if (!output) + continue; + OutputStream *tmp = ndbout.m_out; + ndbout.m_out = output; + for(Uint32 j= 0; j < g_consumers.size(); j++) + g_consumers[j]->tuple(* tuple); + ndbout.m_out = tmp; } // while (tuple != NULL); if (res < 0) { - ndbout_c("Restore: An error occured while restoring data. " - "Exiting..."); + err <<" Restore: An error occured while restoring data. Exiting..."; + err << endl; exitHandler(NDBT_FAILED); } if (!dataIter.validateFragmentFooter()) { - ndbout_c("Restore: Error validating fragment footer. " - "Exiting..."); + err << "Restore: Error validating fragment footer. "; + err << "Exiting..." << endl; exitHandler(NDBT_FAILED); } } // while (dataIter.readFragmentHeader(res)) @@ -374,7 +619,7 @@ main(int argc, char** argv) if (res < 0) { err << "Restore: An error occured while restoring data. Exiting... " - << "res=" << res << endl; + << "res= " << res << endl; exitHandler(NDBT_FAILED); } @@ -397,9 +642,12 @@ main(int argc, char** argv) const LogEntry * logEntry = 0; while ((logEntry = logIter.getNextLogEntry(res= 0)) != 0) { - if (checkSysTable(logEntry->m_table->getTableName())) - for(Uint32 i= 0; i < g_consumers.size(); i++) - g_consumers[i]->logEntry(* logEntry); + const TableS* table = logEntry->m_table; + OutputStream *output = table_output[table->getLocalId()]; + if (!output) + continue; + for(Uint32 j= 0; j < g_consumers.size(); j++) + g_consumers[j]->logEntry(* logEntry); } if (res < 0) { @@ -416,22 +664,48 @@ main(int argc, char** argv) { for(i = 0; i<metaData.getNoOfTables(); i++) { - if (checkSysTable(metaData[i]->getTableName())) - { - for(Uint32 j= 0; j < g_consumers.size(); j++) - if (!g_consumers[j]->finalize_table(* metaData[i])) - { - ndbout_c("Restore: Failed to finalize restore table: %s. " - "Exiting...", - metaData[i]->getTableName()); - exitHandler(NDBT_FAILED); - } - } + const TableS* table = metaData[i]; + OutputStream *output = table_output[table->getLocalId()]; + if (!output) + continue; + for(Uint32 j= 0; j < g_consumers.size(); j++) + if (!g_consumers[j]->finalize_table(*table)) + { + err << "Restore: Failed to finalize restore table: %s. "; + err << "Exiting... " << metaData[i]->getTableName() << endl; + exitHandler(NDBT_FAILED); + } } } } + for(Uint32 j= 0; j < g_consumers.size(); j++) + { + if (g_consumers[j]->has_temp_error()) + { + clearConsumers(); + ndbout_c("\nRestore successful, but encountered temporary error, " + "please look at configuration."); + } + } + clearConsumers(); - return NDBT_ProgramExit(NDBT_OK); + + for(i = 0; i < metaData.getNoOfTables(); i++) + { + if (table_output[i] && + table_output[i] != ndbout.m_out) + { + my_fclose(((FileOutputStream *)table_output[i])->getFile(), MYF(MY_WME)); + delete table_output[i]; + table_output[i] = NULL; + } + } + + if (opt_verbose) + return NDBT_ProgramExit(NDBT_OK); + else + return 0; } // main template class Vector<BackupConsumer*>; +template class Vector<OutputStream*>; diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index baa18db1ebd..27d96a9c6ed 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -40,9 +39,11 @@ NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; static const char* _delimiter = "\t"; -static int _unqualified, _header, _parallelism, _useHexFormat, _lock, +static int _header, _parallelism, _useHexFormat, _lock, _order, _descending; +const char *load_default_groups[]= { "mysql_cluster",0 }; + static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_desc"), @@ -74,6 +75,7 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program reads all records from one table in NDB Cluster\n"\ @@ -81,14 +83,16 @@ static void usage() "(It only print error messages if it encounters a permanent error.)\n"\ "It can also be used to dump the content of a table to file \n"\ " ex: select_all --no-header --delimiter=';' T4 > T4.data\n"; +#endif ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); const char* _tabname; int ho_error; @@ -104,6 +108,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_select_all"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index 6fa3c77f15a..552d156b665 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -37,6 +36,9 @@ NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; static int _parallelism = 240; static int _lock = 0; + +const char *load_default_groups[]= { "mysql_cluster",0 }; + static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_desc"), @@ -53,17 +55,20 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname1 ... tabnameN\n"\ "This program will count the number of records in tables\n"; +#endif ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; #ifndef DBUG_OFF @@ -78,6 +83,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_select_count"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index cb02d5e7c36..e221a26182e 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -2,8 +2,7 @@ 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; either version 2 of the License, or - (at your option) any later version. + 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 @@ -31,13 +30,18 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); enum ndb_waiter_options { - OPT_WAIT_STATUS_NOT_STARTED = NDB_STD_OPTIONS_LAST + OPT_WAIT_STATUS_NOT_STARTED = NDB_STD_OPTIONS_LAST, + OPT_WAIT_STATUS_SINGLE_USER }; NDB_STD_OPTS_VARS; static int _no_contact = 0; static int _not_started = 0; +static int _single_user = 0; static int _timeout = 120; + +const char *load_default_groups[]= { "mysql_cluster",0 }; + static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_desc"), @@ -47,6 +51,10 @@ static struct my_option my_long_options[] = { "not-started", OPT_WAIT_STATUS_NOT_STARTED, "Wait for cluster not started", (gptr*) &_not_started, (gptr*) &_not_started, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "single-user", OPT_WAIT_STATUS_SINGLE_USER, + "Wait for cluster to enter single user mode", + (gptr*) &_single_user, (gptr*) &_single_user, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { "timeout", 't', "Timeout to wait", (gptr*) &_timeout, (gptr*) &_timeout, 0, GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 }, @@ -56,13 +64,14 @@ static struct my_option my_long_options[] = static void usage() { ndb_std_print_version(); + print_defaults(MYSQL_CONFIG_NAME,load_default_groups); + puts(""); my_print_help(my_long_options); my_print_variables(my_long_options); } int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); const char* _hostName = NULL; int ho_error; @@ -87,6 +96,10 @@ int main(int argc, char** argv){ { wait_status= NDB_MGM_NODE_STATUS_NOT_STARTED; } + else if (_single_user) + { + wait_status= NDB_MGM_NODE_STATUS_SINGLEUSER; + } else { wait_status= NDB_MGM_NODE_STATUS_STARTED; |