Commit fe89684a authored by unknown's avatar unknown
Browse files

Bug #26490 duplicate cluster error code

- fixed error code
- added test program run in mysql-test-run bk version


mysql-test/ndb/ndbcluster.sh:
  Bug #26490 duplicate cluster error code
  - added check for duplicate error in mysql-test run
storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp:
  Bug #26490 duplicate cluster error code
  - fixed error code
storage/ndb/src/ndbapi/Makefile.am:
  Bug #26490 duplicate cluster error code
  - added test program for duplicate error messages
storage/ndb/src/ndbapi/ndberror.c:
  Bug #26490 duplicate cluster error code
  - fixed error code
storage/ndb/src/ndbapi/ndberror_check.c:
  New BitKeeper file ``storage/ndb/src/ndbapi/ndberror_check.c''
parent 25aa87e6
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ if [ -d ../sql ] ; then
   exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd
   exec_waiter=$ndbtop/tools/ndb_waiter
   exec_test=$ndbtop/tools/ndb_test_platform
   exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgm
   exec_test_ndberror=
   exec_test_ndberror=$ndbtop/src/ndbapi/ndberror_check
else
   BINARY_DIST=1
   if test -x "$BASEDIR/libexec/ndbd"
@@ -48,6 +49,7 @@ else
   fi
   exec_waiter=$BASEDIR/bin/ndb_waiter
   exec_test=$BASEDIR/bin/ndb_test_platform
   exec_test_ndberror=
   exec_mgmtclient=$BASEDIR/bin/ndb_mgm
fi

@@ -56,6 +58,13 @@ if $exec_test ; then :; else
  exit 1
fi

if [ $exec_test_ndberror ] ; then
if $exec_test_ndberror ; then :; else
  echo "please fix in ndberror.c"
  exit 1
fi
fi

pidfile=ndbcluster.pid
cfgfile=Ndb.cfg
test_ndb=
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ struct CreateFilegroupRef {
    InvalidFormat = 740,
    OutOfFilegroupRecords = 765,
    InvalidExtentSize = 764,
    InvalidUndoBufferSize = 763,
    InvalidUndoBufferSize = 779,
    NoSuchLogfileGroup = 767,
    InvalidFilegroupVersion = 768
  };
+9 −0
Original line number Diff line number Diff line
@@ -15,6 +15,10 @@

#SUBDIRS = signal-sender

noinst_PROGRAMS = ndberror_check

ndberror_check_SOURCES = ndberror_check.c

noinst_LTLIBRARIES = libndbapi.la

libndbapi_la_SOURCES = \
@@ -61,6 +65,11 @@ NDB_CXXFLAGS_RELEASE_LOC = -O2
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_ndbapi.mk.am

ndberror_check_LDFLAGS = \
         $(top_builddir)/dbug/libdbug.a \
         $(top_builddir)/mysys/libmysys.a \
         $(top_builddir)/strings/libmystrings.a

# Don't update the files from bitkeeper
%::SCCS/s.%

+1 −1
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ ErrorBundle ErrorCodes[] = {
  { 771,  HA_WRONG_CREATE_OPTION, AE, "Given NODEGROUP doesn't exist in this cluster" },
  { 772,  HA_WRONG_CREATE_OPTION, IE, "Given fragmentType doesn't exist" },
  { 749,  HA_WRONG_CREATE_OPTION, IE, "Primary Table in wrong state" },
  { 763,  HA_WRONG_CREATE_OPTION, SE, "Invalid undo buffer size" },
  { 779,  HA_WRONG_CREATE_OPTION, SE, "Invalid undo buffer size" },
  { 764,  HA_WRONG_CREATE_OPTION, SE, "Invalid extent size" },
  { 765,  DMEC, SE, "Out of filegroup records" },
  { 750,  IE, SE, "Invalid file type" },
+38 −0
Original line number Diff line number Diff line
/* 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 <stdio.h>
#include "ndberror.c"

int main()
{
  int i, j, error = 0;

  // check for duplicate error codes
  for(i = 0; i < NbErrorCodes; i++)
  {
    for(j = i + 1; j < NbErrorCodes; j++)
    {
      if (ErrorCodes[i].code == ErrorCodes[j].code)
      {
        fprintf(stderr, "Duplicate error code %u\n", ErrorCodes[i].code);
        error = 1;
      }
    }
  }
  if (error)
    return -1;
  return 0;
}