Commit c62a26f7 authored by unknown's avatar unknown

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb

into mysql.com:/home/jonas/src/mysql-4.1-ndb

parents d1af6f5a e8b2c2c3
......@@ -1515,6 +1515,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
--with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation],
[ndb_docs="$withval"],
[ndb_docs=no])
AC_ARG_WITH([ndb-port-base],
[
--with-ndb-port-base Base port for NDB Cluster],
[ndb_port_base="$withval"],
[ndb_port_base="default"])
AC_MSG_CHECKING([for NDB Cluster options])
AC_MSG_RESULT([])
......
......@@ -389,8 +389,6 @@ then
# Disable exceptions as they seams to create problems with gcc and threads.
# mysqld doesn't use run-time-type-checking, so we disable it.
CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
# ndb cannot be compiled with -fno-implicit-templaces
ndb_cxxflags_fix="$ndb_cxxflags_fix -fimplicit-templates"
# If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux,
# we will gets some problems when linking static programs.
......@@ -2985,6 +2983,13 @@ then
AC_SUBST([NDB_DEFS])
AC_SUBST([ndb_cxxflags_fix])
if test X"$ndb_port_base" = Xdefault
then
ndb_port_base="2200"
fi
AC_SUBST([ndb_port_base])
ndb_transporter_opt_objs=""
if test X"$have_ndb_shm" = Xyes
then
......
......@@ -1451,12 +1451,10 @@ then
then
echo "Starting ndbcluster"
./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
export NDB_CONNECTSTRING
USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"host=localhost:$NDBCLUSTER_PORT\""
else
NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
export NDB_CONNECTSTRING
echo "Using ndbcluster at $NDB_CONNECTSTRING"
USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$USE_RUNNING_NDBCLUSTER\""
echo "Using ndbcluster at $USE_NDBCLUSTER"
fi
fi
......
......@@ -7,19 +7,11 @@ Diskless: CHOOSE_Diskless
TimeBetweenWatchDogCheck: 30000
FileSystemPath: CHOOSE_FILESYSTEM
[COMPUTER]
Id: 1
HostName: CHOOSE_HOSTNAME_1
[COMPUTER]
Id: 2
HostName: CHOOSE_HOSTNAME_2
[DB]
ExecuteOnComputer: 1
HostName: CHOOSE_HOSTNAME_1
[DB]
ExecuteOnComputer: 2
HostName: CHOOSE_HOSTNAME_2
[MGM]
PortNumber: CHOOSE_PORT_MGM
......
......@@ -116,3 +116,21 @@ select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
collation(a) collation(b) collation(binary 'ccc')
latin1_bin binary latin1_bin
drop table t1;
create table t1( firstname char(20), lastname char(20));
insert into t1 values ("john","doe"),("John","Doe");
select * from t1 where firstname='john' and firstname like binary 'john';
firstname lastname
john doe
select * from t1 where firstname='john' and binary 'john' = firstname;
firstname lastname
john doe
select * from t1 where firstname='john' and firstname = binary 'john';
firstname lastname
john doe
select * from t1 where firstname='John' and firstname like binary 'john';
firstname lastname
john doe
select * from t1 where firstname='john' and firstname like binary 'John';
firstname lastname
John Doe
drop table t1;
......@@ -560,3 +560,13 @@ select * from t1 where str='str';
str
str
drop table t1;
create table t1 (
str varchar(255) character set utf8 not null,
key str using hash (str(2))
) engine=heap;
INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
str
str
drop table t1;
......@@ -634,7 +634,7 @@ insert into t2 values (10,1),(20,2),(30,3);
explain select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL PRIMARY 4 NULL 3 Using index
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 2 const 1 Using where; Using index
1 SIMPLE t1 const PRIMARY PRIMARY 2 const 1 Using where; Using index
select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
fooID barID fooID
10 1 NULL
......@@ -682,3 +682,72 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2
1 SIMPLE t3 ALL NULL NULL NULL NULL 2
drop table t1, t2, t3;
create table t1 (
match_id tinyint(3) unsigned not null auto_increment,
home tinyint(3) unsigned default '0',
unique key match_id (match_id),
key match_id_2 (match_id)
);
insert into t1 values("1", "2");
create table t2 (
player_id tinyint(3) unsigned default '0',
match_1_h tinyint(3) unsigned default '0',
key player_id (player_id)
);
insert into t2 values("1", "5");
insert into t2 values("2", "9");
insert into t2 values("3", "3");
insert into t2 values("4", "7");
insert into t2 values("5", "6");
insert into t2 values("6", "8");
insert into t2 values("7", "4");
insert into t2 values("8", "12");
insert into t2 values("9", "11");
insert into t2 values("10", "10");
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
(t2 s left join t1 m on m.match_id = 1)
order by m.match_id desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s ALL NULL NULL NULL NULL 10
1 SIMPLE m const match_id,match_id_2 match_id 1 const 1 Using where
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
(t2 s left join t1 m on m.match_id = 1)
order by UUX desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s ALL NULL NULL NULL NULL 10 Using temporary; Using filesort
1 SIMPLE m const match_id,match_id_2 match_id 1 const 1 Using where
select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
(t2 s left join t1 m on m.match_id = 1)
order by UUX desc;
player_id match_1_h * match_id home UUX
8 12 * 1 2 10
9 11 * 1 2 9
10 10 * 1 2 8
2 9 * 1 2 7
6 8 * 1 2 6
4 7 * 1 2 5
5 6 * 1 2 4
1 5 * 1 2 3
7 4 * 1 2 2
3 3 * 1 2 1
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
t2 s straight_join t1 m where m.match_id = 1
order by UUX desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s ALL NULL NULL NULL NULL 10 Using temporary; Using filesort
1 SIMPLE m const match_id,match_id_2 match_id 1 const 1 Using where
select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
t2 s straight_join t1 m where m.match_id = 1
order by UUX desc;
player_id match_1_h * match_id home UUX
8 12 * 1 2 10
9 11 * 1 2 9
10 10 * 1 2 8
2 9 * 1 2 7
6 8 * 1 2 6
4 7 * 1 2 5
5 6 * 1 2 4
1 5 * 1 2 3
7 4 * 1 2 2
3 3 * 1 2 1
drop table t1, t2;
......@@ -401,10 +401,3 @@ where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
delete from mysql.db
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
flush privileges;
set names latin1;
create database ``;
create table ``.`` (a int) engine=heap;
show table status from `` LIKE '';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
drop database ``;
......@@ -67,3 +67,16 @@ select * from t1 where lower(b)='bbb';
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
drop table t1;
#
# Bug5134: WHERE x = 'bar' AND x LIKE BINARY 'bar' returns wrong results
#
create table t1( firstname char(20), lastname char(20));
insert into t1 values ("john","doe"),("John","Doe");
select * from t1 where firstname='john' and firstname like binary 'john';
select * from t1 where firstname='john' and binary 'john' = firstname;
select * from t1 where firstname='john' and firstname = binary 'john';
select * from t1 where firstname='John' and firstname like binary 'john';
select * from t1 where firstname='john' and firstname like binary 'John';
drop table t1;
......@@ -417,3 +417,15 @@ INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
drop table t1;
# the same for HEAP+HASH
#
create table t1 (
str varchar(255) character set utf8 not null,
key str using hash (str(2))
) engine=heap;
INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
drop table t1;
......@@ -451,3 +451,53 @@ select * from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is
explain select * from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is null;
drop table t1, t2, t3;
# Test for BUG#5088
create table t1 (
match_id tinyint(3) unsigned not null auto_increment,
home tinyint(3) unsigned default '0',
unique key match_id (match_id),
key match_id_2 (match_id)
);
insert into t1 values("1", "2");
create table t2 (
player_id tinyint(3) unsigned default '0',
match_1_h tinyint(3) unsigned default '0',
key player_id (player_id)
);
insert into t2 values("1", "5");
insert into t2 values("2", "9");
insert into t2 values("3", "3");
insert into t2 values("4", "7");
insert into t2 values("5", "6");
insert into t2 values("6", "8");
insert into t2 values("7", "4");
insert into t2 values("8", "12");
insert into t2 values("9", "11");
insert into t2 values("10", "10");
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
(t2 s left join t1 m on m.match_id = 1)
order by m.match_id desc;
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
(t2 s left join t1 m on m.match_id = 1)
order by UUX desc;
select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
(t2 s left join t1 m on m.match_id = 1)
order by UUX desc;
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
t2 s straight_join t1 m where m.match_id = 1
order by UUX desc;
select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
t2 s straight_join t1 m where m.match_id = 1
order by UUX desc;
drop table t1, t2;
......@@ -307,9 +307,11 @@ where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
flush privileges;
#Bug #4374 SHOW TABLE STATUS FROM ignores collation_connection
set names latin1;
create database ``;
create table ``.`` (a int) engine=heap;
--replace_column 7 # 8 # 9 #
show table status from `` LIKE '';
drop database ``;
# This test fails on MAC OSX, so it is temporary disabled.
# This needs WL#1324 to be done.
#set names latin1;
#create database ``;
#create table ``.`` (a int) engine=heap;
#--replace_column 7 # 8 # 9 #
#show table status from `` LIKE '';
#drop database ``;
LDADD += $(top_builddir)/ndb/test/src/libNDBT.a \
$(top_builddir)/ndb/src/libndbclient.la
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
-I$(top_srcdir)/ndb/include \
......
LDADD += $(top_builddir)/ndb/src/libndbclient.la
LDADD += \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
-I$(top_srcdir)/ndb/include \
......
......@@ -3,7 +3,6 @@
#define NDBGLOBAL_H
#include <my_global.h>
#define NDB_BASE_PORT 2200
/** signal & SIG_PIPE */
#include <my_alarm.h>
......
......@@ -18,10 +18,15 @@
#include "ConfigInfo.hpp"
#include <mgmapi_config_parameters.h>
#include <ndb_limits.h>
#include "InitConfigFileParser.hpp"
#define MAX_LINE_LENGTH 255
#define KEY_INTERNAL 0
#define MAX_INT_RNIL (RNIL - 1)
#define RNIL_STRING "0xffffff00"
#define MAX_INT_RNIL_STRING "0xfffffeff"
#define MAX_NODES_STRING "63"
/****************************************************************************
* Section names
****************************************************************************/
......@@ -207,6 +212,7 @@ const DepricationTransform f_deprication[] = {
* Parameters used under development should be marked "NOTIMPLEMENTED"
* *******************************************************************
*/
const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
/****************************************************************************
......@@ -232,8 +238,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
MANDATORY,
0,
0 },
0, 0 },
{
KEY_INTERNAL,
......@@ -244,8 +249,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
MANDATORY,
0,
MAX_INT_RNIL },
0, 0 },
/****************************************************************************
* SYSTEM
......@@ -258,9 +262,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::SECTION,
CFG_SECTION_SYSTEM,
0,
0 },
(const char *)CFG_SECTION_SYSTEM,
0, 0 },
{
CFG_SYS_NAME,
......@@ -271,8 +274,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
MANDATORY,
0,
0 },
0, 0 },
{
CFG_SYS_REPLICATION_ROLE,
......@@ -283,8 +285,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
0 },
0, 0 },
{
CFG_SYS_PRIMARY_MGM_NODE,
......@@ -294,9 +295,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
MAX_INT_RNIL },
"0",
"0",
MAX_INT_RNIL_STRING },
{
CFG_SYS_CONFIG_GENERATION,
......@@ -306,9 +307,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
MAX_INT_RNIL },
"0",
"0",
MAX_INT_RNIL_STRING },
/***************************************************************************
* DB
......@@ -321,7 +322,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::SECTION,
NODE_TYPE_DB,
(const char *)NODE_TYPE_DB,
0, 0
},
......@@ -334,8 +335,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_NODE_SYSTEM,
......@@ -346,8 +346,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_NODE_ID,
......@@ -358,8 +357,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
1,
(MAX_NODES - 1) },
"1",
MAX_NODES_STRING },
{
KEY_INTERNAL,
......@@ -370,8 +369,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
UNDEFINED,
1,
65535 },
"1",
MAX_INT_RNIL_STRING },
{
CFG_DB_NO_REPLICAS,
......@@ -382,8 +381,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
1,
4 },
"1",
"4" },
{
CFG_DB_NO_ATTRIBUTES,
......@@ -393,9 +392,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
1000,
32,
MAX_INT_RNIL/16 },
"1000",
"32",
MAX_INT_RNIL_STRING },
{
CFG_DB_NO_TABLES,
......@@ -405,9 +404,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
128,
8,
MAX_INT_RNIL },
"128",
"8",
MAX_INT_RNIL_STRING },
{
CFG_DB_NO_INDEXES,
......@@ -417,9 +416,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
128,
0,
MAX_INT_RNIL },
"128",
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_NO_INDEX_OPS,
......@@ -429,9 +428,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
8192,
0,
MAX_INT_RNIL
"8K",
"0",
MAX_INT_RNIL_STRING
},
{
......@@ -442,9 +441,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
768,
0,
MAX_INT_RNIL },
"768",
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_NO_TRIGGER_OPS,
......@@ -454,9 +453,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
4000,
0,
MAX_INT_RNIL },
"4000",
"0",
MAX_INT_RNIL_STRING },
{
KEY_INTERNAL,
......@@ -466,9 +465,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::STRING,
MANDATORY,
0,
MAX_INT_RNIL },
UNDEFINED,
0, 0 },
{
CFG_DB_NO_SAVE_MSGS,
......@@ -478,9 +476,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
25,
0,
MAX_INT_RNIL },
"25",
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_MEMLOCK,
......@@ -490,9 +488,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::BOOL,
false,
0,
MAX_INT_RNIL },
"false",
"false",
"true" },
{
CFG_DB_WATCHDOG_INTERVAL,
......@@ -502,9 +500,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
6000,
70,
MAX_INT_RNIL },
"6000",
"70",
MAX_INT_RNIL_STRING },
{
CFG_DB_STOP_ON_ERROR,
......@@ -514,9 +512,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::BOOL,
true,
0,
MAX_INT_RNIL },
"true",
"false",
"true" },
{
CFG_DB_STOP_ON_ERROR_INSERT,
......@@ -526,9 +524,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::INTERNAL,
true,
ConfigInfo::INT,
2,
0,
4 },
"2",
"0",
"4" },
{
CFG_DB_NO_OPS,
......@@ -538,9 +536,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
32768,
32,
MAX_INT_RNIL },
"32K",
"32",
MAX_INT_RNIL_STRING },
{
CFG_DB_NO_TRANSACTIONS,
......@@ -550,9 +548,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
4096,
32,
MAX_INT_RNIL },
"4096",
"32",
MAX_INT_RNIL_STRING },
{
CFG_DB_NO_SCANS,
......@@ -562,9 +560,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
256,
2,
500 },
"256",
"2",
"500" },
{
CFG_DB_TRANS_BUFFER_MEM,
......@@ -574,9 +572,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
(1024 * 1024),
1024,
MAX_INT_RNIL },
"1M",
"1K",
MAX_INT_RNIL_STRING },
{
CFG_DB_INDEX_MEM,
......@@ -586,9 +584,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT64,
3 * 1024 * 8192,
128 * 8192,
((Uint64)MAX_INT_RNIL) * ((Uint64)8192) },
"18M",
"1M",
"1024G" },
{
CFG_DB_DATA_MEM,
......@@ -598,9 +596,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT64,
10 * 1024 * 8192,
128 * 8192,
((Uint64)MAX_INT_RNIL) * ((Uint64)8192) },
"80M",
"1M",
"1024G" },
{
CFG_DB_START_PARTIAL_TIMEOUT,
......@@ -610,9 +608,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
30000,
0,
~0 },
"30000",
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_START_PARTITION_TIMEOUT,
......@@ -622,9 +620,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
60000,
0,
~0 },
"60000",
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_START_FAILURE_TIMEOUT,
......@@ -634,9 +632,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
0,
0,
~0 },
"0",
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_HEARTBEAT_INTERVAL,
......@@ -646,9 +644,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
1500,
10,
MAX_INT_RNIL },
"1500",
"10",
MAX_INT_RNIL_STRING },
{
CFG_DB_API_HEARTBEAT_INTERVAL,
......@@ -658,9 +656,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
1500,
100,
MAX_INT_RNIL },
"1500",
"100",
MAX_INT_RNIL_STRING },
{
CFG_DB_LCP_INTERVAL,
......@@ -670,9 +668,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
20,
0,
31 },
"20",
"0",
"31" },
{
CFG_DB_GCP_INTERVAL,
......@@ -682,9 +680,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
2000,
10,
32000 },
"2000",
"10",
"32000" },
{
CFG_DB_NO_REDOLOG_FILES,
......@@ -694,9 +692,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
8,
1,
MAX_INT_RNIL },
"8",
"1",
MAX_INT_RNIL_STRING },
{
KEY_INTERNAL,
......@@ -706,9 +704,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
40,
20,
256 },
"40",
"20",
"256" },
{
......@@ -719,9 +717,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
1000,
1000,
MAX_INT_RNIL },
"1000",
"1000",
MAX_INT_RNIL_STRING },
{
CFG_DB_TRANSACTION_INACTIVE_TIMEOUT,
......@@ -735,9 +733,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
MAX_INT_RNIL,
0,
MAX_INT_RNIL },
MAX_INT_RNIL_STRING,
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT,
......@@ -750,9 +748,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
1200,
50,
MAX_INT_RNIL },
"1200",
"50",
MAX_INT_RNIL_STRING },
{
KEY_INTERNAL,
......@@ -762,9 +760,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
40,
1,
MAX_INT_RNIL },
"40",
"1",
MAX_INT_RNIL_STRING },
{
KEY_INTERNAL,
......@@ -774,9 +772,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
40,
1,
MAX_INT_RNIL },
"40",
"1",
MAX_INT_RNIL_STRING },
{
KEY_INTERNAL,
......@@ -786,9 +784,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
20,
1,
MAX_INT_RNIL },
"20",
"1",
MAX_INT_RNIL_STRING },
{
KEY_INTERNAL,
......@@ -798,9 +796,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
20,
1,
MAX_INT_RNIL },
"20",
"1",
MAX_INT_RNIL_STRING },
{
......@@ -811,9 +809,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::BOOL,
0,
0,
1},
"false",
"false",
"true"},
{
KEY_INTERNAL,
......@@ -823,9 +821,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::DEPRICATED,
true,
ConfigInfo::BOOL,
0,
0,
1},
"false",
"false",
"true"},
......@@ -837,9 +835,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
3000,
10,
MAX_INT_RNIL },
"3000",
"10",
MAX_INT_RNIL_STRING },
{
CFG_DB_FILESYSTEM_PATH,
......@@ -849,9 +847,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
DATADIR,
0, 0 },
{
CFG_LOGLEVEL_STARTUP,
......@@ -861,9 +858,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
1,
0,
15 },
"1",
"0",
"15" },
{
CFG_LOGLEVEL_SHUTDOWN,
......@@ -873,9 +870,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
15 },
"0",
"0",
"15" },
{
CFG_LOGLEVEL_STATISTICS,
......@@ -885,9 +882,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
15 },
"0",
"0",
"15" },
{
CFG_LOGLEVEL_CHECKPOINT,
......@@ -897,9 +894,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
15 },
"0",
"0",
"15" },
{
CFG_LOGLEVEL_NODERESTART,
......@@ -909,9 +906,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
15 },
"0",
"0",
"15" },
{
CFG_LOGLEVEL_CONNECTION,
......@@ -921,9 +918,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
15 },
"0",
"0",
"15" },
{
CFG_LOGLEVEL_ERROR,
......@@ -933,9 +930,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
15 },
"0",
"0",
"15" },
{
CFG_LOGLEVEL_INFO,
......@@ -945,9 +942,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
15 },
"0",
"0",
"15" },
/**
* Backup
......@@ -960,9 +957,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::NOTIMPLEMENTED,
false,
ConfigInfo::INT,
1,
1,
1 },
"1",
"1",
"1" },
{
CFG_DB_BACKUP_MEM,
......@@ -972,9 +969,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
(2 * 1024 * 1024) + (2 * 1024 * 1024), // sum of BackupDataBufferSize and BackupLogBufferSize
0,
MAX_INT_RNIL },
"4M", // sum of BackupDataBufferSize and BackupLogBufferSize
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_BACKUP_DATA_BUFFER_MEM,
......@@ -984,9 +981,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
(2 * 1024 * 1024), // remember to change BackupMemory
0,
MAX_INT_RNIL },
"2M", // remember to change BackupMemory
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_BACKUP_LOG_BUFFER_MEM,
......@@ -996,9 +993,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
(2 * 1024 * 1024), // remember to change BackupMemory
0,
MAX_INT_RNIL },
"2M", // remember to change BackupMemory
"0",
MAX_INT_RNIL_STRING },
{
CFG_DB_BACKUP_WRITE_SIZE,
......@@ -1008,9 +1005,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
32768,
0,
MAX_INT_RNIL },
"32K",
"0",
MAX_INT_RNIL_STRING },
/***************************************************************************
* REP
......@@ -1023,7 +1020,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::SECTION,
NODE_TYPE_REP,
(const char *)NODE_TYPE_REP,
0, 0
},
......@@ -1036,8 +1033,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_NODE_SYSTEM,
......@@ -1048,8 +1044,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_NODE_ID,
......@@ -1060,8 +1055,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
1,
(MAX_NODES - 1) },
"1",
MAX_NODES_STRING },
{
KEY_INTERNAL,
......@@ -1072,8 +1067,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
MANDATORY,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_REP_HEARTBEAT_INTERVAL,
......@@ -1083,9 +1077,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
true,
ConfigInfo::INT,
3000,
100,
MAX_INT_RNIL },
"3000",
"100",
MAX_INT_RNIL_STRING },
/***************************************************************************
* API
......@@ -1098,7 +1092,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::SECTION,
NODE_TYPE_API,
(const char *)NODE_TYPE_API,
0, 0
},
......@@ -1111,8 +1105,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_NODE_SYSTEM,
......@@ -1123,8 +1116,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_NODE_ID,
......@@ -1135,8 +1127,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
1,
(MAX_NODES - 1) },
"1",
MAX_NODES_STRING },
{
KEY_INTERNAL,
......@@ -1146,9 +1138,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::STRING,
0,
0,
MAX_INT_RNIL },
UNDEFINED,
0, 0 },
{
CFG_NODE_ARBIT_RANK,
......@@ -1158,9 +1149,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
2 },
"0",
"0",
"2" },
{
CFG_NODE_ARBIT_DELAY,
......@@ -1170,9 +1161,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
MAX_INT_RNIL },
"0",
"0",
MAX_INT_RNIL_STRING },
/****************************************************************************
* MGM
......@@ -1185,7 +1176,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::SECTION,
NODE_TYPE_MGM,
(const char *)NODE_TYPE_MGM,
0, 0
},
......@@ -1198,8 +1189,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_NODE_SYSTEM,
......@@ -1210,8 +1200,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_NODE_ID,
......@@ -1222,8 +1211,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
1,
(MAX_NODES - 1) },
"1",
MAX_NODES_STRING },
{
CFG_LOG_DESTINATION,
......@@ -1234,8 +1223,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
0,
0,
MAX_INT_RNIL },
0, 0 },
{
KEY_INTERNAL,
......@@ -1246,8 +1234,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
0,
0,
MAX_INT_RNIL },
0, 0 },
{
KEY_INTERNAL,
......@@ -1257,9 +1244,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
100,
0,
MAX_INT_RNIL },
"100",
"0",
MAX_INT_RNIL_STRING },
{
CFG_MGM_PORT,
......@@ -1270,8 +1257,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
NDB_BASE_PORT,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
KEY_INTERNAL,
......@@ -1281,9 +1268,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
2199,
0,
MAX_INT_RNIL },
"2199",
"0",
MAX_INT_RNIL_STRING },
{
CFG_NODE_ARBIT_RANK,
......@@ -1293,9 +1280,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
1,
0,
2 },
"1",
"0",
"2" },
{
CFG_NODE_ARBIT_DELAY,
......@@ -1305,9 +1292,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
0,
0,
MAX_INT_RNIL },
"0",
"0",
MAX_INT_RNIL_STRING },
/****************************************************************************
* TCP
......@@ -1320,7 +1307,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::SECTION,
CONNECTION_TYPE_TCP,
(const char *)CONNECTION_TYPE_TCP,
0, 0
},
......@@ -1333,8 +1320,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_TCP_HOSTNAME_2,
......@@ -1345,8 +1331,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_CONNECTION_NODE_1,
......@@ -1357,8 +1342,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
MANDATORY,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_CONNECTION_NODE_2,
......@@ -1369,8 +1353,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
MANDATORY,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_CONNECTION_SEND_SIGNAL_ID,
......@@ -1380,9 +1363,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::BOOL,
true,
0,
MAX_INT_RNIL },
"true",
"false",
"true" },
{
......@@ -1393,9 +1376,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::BOOL,
false,
0,
MAX_INT_RNIL },
"false",
"false",
"true" },
{
CFG_CONNECTION_SERVER_PORT,
......@@ -1406,8 +1389,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
CFG_TCP_SEND_BUFFER_SIZE,
......@@ -1417,9 +1400,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
16 * 16384,
1 * 16384,
MAX_INT_RNIL },
"256K",
"16K",
MAX_INT_RNIL_STRING },
{
CFG_TCP_RECEIVE_BUFFER_SIZE,
......@@ -1429,9 +1412,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
4 * 16384,
1 * 16384,
MAX_INT_RNIL },
"64K",
"16K",
MAX_INT_RNIL_STRING },
{
CFG_TCP_PROXY,
......@@ -1442,8 +1425,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
0 },
0, 0 },
{
CFG_CONNECTION_NODE_1_SYSTEM,
......@@ -1454,8 +1436,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_CONNECTION_NODE_2_SYSTEM,
......@@ -1466,8 +1447,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
/****************************************************************************
......@@ -1481,9 +1461,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::SECTION,
CONNECTION_TYPE_SHM,
0, 0
},
(const char *)CONNECTION_TYPE_SHM,
0, 0 },
{
CFG_CONNECTION_NODE_1,
......@@ -1494,8 +1473,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
MANDATORY,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_CONNECTION_SERVER_PORT,
......@@ -1506,8 +1484,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
CFG_CONNECTION_NODE_2,
......@@ -1518,8 +1496,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
MANDATORY,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_CONNECTION_SEND_SIGNAL_ID,
......@@ -1529,9 +1506,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::BOOL,
false,
0,
MAX_INT_RNIL },
"false",
"false",
"true" },
{
......@@ -1542,9 +1519,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::BOOL,
true,
0,
MAX_INT_RNIL },
"true",
"false",
"true" },
{
CFG_SHM_KEY,
......@@ -1555,8 +1532,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
CFG_SHM_BUFFER_MEM,
......@@ -1566,9 +1543,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
1048576,
4096,
MAX_INT_RNIL },
"1M",
"4K",
MAX_INT_RNIL_STRING },
{
CFG_CONNECTION_NODE_1_SYSTEM,
......@@ -1579,8 +1556,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_CONNECTION_NODE_2_SYSTEM,
......@@ -1591,8 +1567,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
/****************************************************************************
* SCI
......@@ -1605,7 +1580,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::SECTION,
CONNECTION_TYPE_SCI,
(const char *)CONNECTION_TYPE_SCI,
0, 0
},
......@@ -1618,8 +1593,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
CFG_CONNECTION_NODE_2,
......@@ -1630,8 +1605,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
CFG_SCI_ID_0,
......@@ -1642,8 +1617,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
CFG_SCI_ID_1,
......@@ -1654,8 +1629,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
CFG_CONNECTION_SEND_SIGNAL_ID,
......@@ -1665,9 +1640,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::BOOL,
true,
0,
MAX_INT_RNIL },
"true",
"false",
"true" },
{
CFG_CONNECTION_CHECKSUM,
......@@ -1677,9 +1652,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::BOOL,
false,
0,
MAX_INT_RNIL },
"false",
"false",
"true" },
{
CFG_SCI_SEND_LIMIT,
......@@ -1689,9 +1664,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
2048,
512,
MAX_INT_RNIL },
"2K",
"512",
MAX_INT_RNIL_STRING },
{
CFG_SCI_BUFFER_MEM,
......@@ -1701,9 +1676,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
1048576,
262144,
MAX_INT_RNIL },
"1M",
"256K",
MAX_INT_RNIL_STRING },
{
CFG_CONNECTION_NODE_1_SYSTEM,
......@@ -1714,8 +1689,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_CONNECTION_NODE_2_SYSTEM,
......@@ -1726,8 +1700,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
/****************************************************************************
* OSE
......@@ -1740,7 +1713,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::SECTION,
CONNECTION_TYPE_OSE,
(const char *)CONNECTION_TYPE_OSE,
0, 0
},
......@@ -1753,8 +1726,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_OSE_HOSTNAME_2,
......@@ -1765,8 +1737,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
{
CFG_CONNECTION_NODE_1,
......@@ -1777,8 +1748,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
MANDATORY,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
CFG_CONNECTION_NODE_2,
......@@ -1789,8 +1760,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::INT,
UNDEFINED,
0,
MAX_INT_RNIL },
"0",
MAX_INT_RNIL_STRING },
{
CFG_CONNECTION_SEND_SIGNAL_ID,
......@@ -1800,9 +1771,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::BOOL,
true,
0,
MAX_INT_RNIL },
"true",
"false",
"true" },
{
CFG_CONNECTION_CHECKSUM,
......@@ -1812,9 +1783,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::BOOL,
false,
0,
MAX_INT_RNIL },
"false",
"false",
"true" },
{
CFG_OSE_PRIO_A_SIZE,
......@@ -1824,9 +1795,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
1000,
0,
MAX_INT_RNIL },
"1000",
"0",
MAX_INT_RNIL_STRING },
{
CFG_OSE_PRIO_B_SIZE,
......@@ -1836,9 +1807,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
1000,
0,
MAX_INT_RNIL },
"1000",
"0",
MAX_INT_RNIL_STRING },
{
CFG_OSE_RECEIVE_ARRAY_SIZE,
......@@ -1848,9 +1819,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::USED,
false,
ConfigInfo::INT,
10,
0,
MAX_INT_RNIL },
"10",
"0",
MAX_INT_RNIL_STRING },
{
CFG_CONNECTION_NODE_1_SYSTEM,
......@@ -1861,8 +1832,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL},
0, 0 },
{
CFG_CONNECTION_NODE_2_SYSTEM,
......@@ -1873,8 +1843,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::STRING,
UNDEFINED,
0,
MAX_INT_RNIL },
0, 0 },
};
const int ConfigInfo::m_NoOfParams = sizeof(m_ParamInfo) / sizeof(ParamInfo);
......@@ -1893,8 +1862,20 @@ ConfigInfo::ConfigInfo() {
m_info.setCaseInsensitiveNames(true);
m_systemDefaults.setCaseInsensitiveNames(true);
{
Uint64 tmp_uint64;
require(InitConfigFileParser::convertStringToUint64(RNIL_STRING, tmp_uint64));
require(tmp_uint64 == RNIL);
require(InitConfigFileParser::convertStringToUint64(MAX_INT_RNIL_STRING, tmp_uint64));
require(tmp_uint64 == ((Uint64)RNIL-1));
require(InitConfigFileParser::convertStringToUint64(MAX_NODES_STRING, tmp_uint64));
require(tmp_uint64 == (MAX_NODES-1));
}
for (i=0; i<m_NoOfParams; i++) {
const ParamInfo & param = m_ParamInfo[i];
Uint64 default_uint64;
bool default_bool;
// Create new section if it did not exist
if (!m_info.getCopy(param._section, &section)) {
......@@ -1914,9 +1895,37 @@ ConfigInfo::ConfigInfo() {
pinfo.put("Updateable", param._updateable);
pinfo.put("Type", param._type);
pinfo.put("Status", param._status);
pinfo.put64("Default", param._default);
pinfo.put64("Min", param._min);
pinfo.put64("Max", param._max);
if(param._default == MANDATORY){
pinfo.put("Mandatory", (Uint32)1);
}
switch (param._type) {
case BOOL:
{
bool tmp_bool;
require(InitConfigFileParser::convertStringToBool(param._min, tmp_bool));
pinfo.put64("Min", tmp_bool);
require(InitConfigFileParser::convertStringToBool(param._max, tmp_bool));
pinfo.put64("Max", tmp_bool);
break;
}
case INT:
case INT64:
{
Uint64 tmp_uint64;
require(InitConfigFileParser::convertStringToUint64(param._min, tmp_uint64));
pinfo.put64("Min", tmp_uint64);
require(InitConfigFileParser::convertStringToUint64(param._max, tmp_uint64));
pinfo.put64("Max", tmp_uint64);
break;
}
case SECTION:
pinfo.put("SectionType", (Uint32)param._default);
break;
case STRING:
break;
}
// Check that pinfo is really new
if (section->get(param._fname, &oldpinfo)) {
......@@ -1938,10 +1947,31 @@ ConfigInfo::ConfigInfo() {
p = new Properties();
p->setCaseInsensitiveNames(true);
}
if(param._type != STRING &&
param._default != UNDEFINED &&
if(param._default != UNDEFINED &&
param._default != MANDATORY){
switch (param._type)
{
case SECTION:
break;
case STRING:
require(p->put(param._fname, param._default));
break;
case BOOL:
{
bool tmp_bool;
require(InitConfigFileParser::convertStringToBool(param._default, default_bool));
require(p->put(param._fname, default_bool));
break;
}
case INT:
case INT64:
{
Uint64 tmp_uint64;
require(InitConfigFileParser::convertStringToUint64(param._default, default_uint64));
require(p->put(param._fname, default_uint64));
break;
}
}
}
require(m_systemDefaults.put(param._section, p, true));
delete p;
......@@ -2125,7 +2155,7 @@ void ConfigInfo::print(const Properties * section,
ndbout << "Default: N (Legal values: Y, N)" << endl;
} else if (getDefault(section, parameter) == true) {
ndbout << "Default: Y (Legal values: Y, N)" << endl;
} else if (getDefault(section, parameter) == MANDATORY) {
} else if (getDefault(section, parameter) == (UintPtr)MANDATORY) {
ndbout << "MANDATORY (Legal values: Y, N)" << endl;
} else {
ndbout << "UNKNOWN" << endl;
......@@ -2137,9 +2167,9 @@ void ConfigInfo::print(const Properties * section,
case ConfigInfo::INT64:
ndbout << " (Non-negative Integer)" << endl;
ndbout << getDescription(section, parameter) << endl;
if (getDefault(section, parameter) == MANDATORY) {
if (getDefault(section, parameter) == (UintPtr)MANDATORY) {
ndbout << "MANDATORY (";
} else if (getDefault(section, parameter) == UNDEFINED) {
} else if (getDefault(section, parameter) == (UintPtr)UNDEFINED) {
ndbout << "UNDEFINED (";
} else {
ndbout << "Default: " << getDefault(section, parameter) << " (";
......@@ -2152,7 +2182,7 @@ void ConfigInfo::print(const Properties * section,
case ConfigInfo::STRING:
ndbout << " (String)" << endl;
ndbout << getDescription(section, parameter) << endl;
if (getDefault(section, parameter) == MANDATORY) {
if (getDefault(section, parameter) == (UintPtr)MANDATORY) {
ndbout << "MANDATORY" << endl;
} else {
ndbout << "No default value" << endl;
......@@ -2218,17 +2248,17 @@ transformNode(InitConfigFileParser::Context & ctx, const char * data){
bool
fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){
const char * hostname;
if (ctx.m_currentSection->get("HostName", &hostname))
return true;
const char * compId;
if(!ctx.m_currentSection->get("ExecuteOnComputer", &compId)){
require(ctx.m_currentSection->put("HostName", ""));
const char * type;
if(ctx.m_currentSection->get("Type", &type) && strcmp(type,"DB") == 0) {
ctx.reportError("Parameter \"ExecuteOnComputer\" missing from DB section"
" [%s] starting at line: %d",
ctx.fname, ctx.m_sectionLineno);
return false;
}
if(ctx.m_currentSection->get("Type", &type) && strcmp(type,"DB") == 0)
require(ctx.m_currentSection->put("HostName", "localhost"));
else
require(ctx.m_currentSection->put("HostName", ""));
return true;
}
......@@ -2242,7 +2272,6 @@ fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){
return false;
}
const char * hostname;
if(!computer->get("HostName", &hostname)){
ctx.reportError("HostName missing in [COMPUTER] (Id: %d) "
" - [%s] starting at line: %d",
......@@ -2440,7 +2469,7 @@ checkMandatory(InitConfigFileParser::Context & ctx, const char * data){
const Properties * info = NULL;
::require(ctx.m_currentInfo->get(name, &info));
Uint32 val;
if(info->get("Default", &val) && val == MANDATORY){
if(info->get("Mandatory", &val)){
const char * fname;
::require(info->get("Fname", &fname));
if(!ctx.m_currentSection->contains(fname)){
......@@ -2634,7 +2663,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
if (!ctx.m_userProperties.get("ServerPortBase", &base)){
if(!(ctx.m_userDefaults && ctx.m_userDefaults->get("PortNumber", &base)) &&
!ctx.m_systemDefaults->get("PortNumber", &base)) {
base= NDB_BASE_PORT+2;
base= strtoll(NDB_BASE_PORT,0,0)+2;
// ctx.reportError("Cannot retrieve base port number");
// return false;
}
......@@ -2886,7 +2915,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){
require(sec->get("Fname", &secName));
require(sec->get("Id", &id));
require(sec->get("Status", &status));
require(sec->get("Default", &typeVal));
require(sec->get("SectionType", &typeVal));
if(id == KEY_INTERNAL || status == ConfigInfo::INTERNAL){
ndbout_c("skipping section %s", ctx.fname);
......
......@@ -27,8 +27,8 @@
* 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 Uint64 MANDATORY = ~0; // Default value for mandatory params.
static const Uint64 UNDEFINED = (~0)-1; // Default value for undefined params.
static const char* MANDATORY = (char*)~(UintPtr)0; // Default value for mandatory params.
static const char* UNDEFINED = 0; // Default value for undefined params.
/**
* @class ConfigInfo
......@@ -56,9 +56,9 @@ public:
Status _status;
bool _updateable;
Type _type;
Uint64 _default;
Uint64 _min;
Uint64 _max;
const char* _default;
const char* _min;
const char* _max;
};
/**
......
......@@ -31,7 +31,6 @@ static void require(bool v) { if(!v) abort();}
// Ctor / Dtor
//****************************************************************************
InitConfigFileParser::InitConfigFileParser(){
m_info = new ConfigInfo();
}
......@@ -111,7 +110,6 @@ InitConfigFileParser::parseConfig(FILE * file) {
"of configuration file.");
return 0;
}
snprintf(ctx.fname, sizeof(ctx.fname), section); free(section);
ctx.type = InitConfigFileParser::DefaultSection;
ctx.m_sectionLineno = ctx.m_lineno;
......@@ -132,7 +130,6 @@ InitConfigFileParser::parseConfig(FILE * file) {
"of configuration file.");
return 0;
}
snprintf(ctx.fname, sizeof(ctx.fname), section);
free(section);
ctx.type = InitConfigFileParser::Section;
......@@ -162,7 +159,6 @@ InitConfigFileParser::parseConfig(FILE * file) {
ctx.reportError("Could not store section of configuration file.");
return 0;
}
for(size_t i = 0; ConfigInfo::m_ConfigRules[i].m_configRule != 0; i++){
ctx.type = InitConfigFileParser::Undefined;
ctx.m_currentSection = 0;
......@@ -378,7 +374,7 @@ bool InitConfigFileParser::convertStringToUint64(const char* s,
errno = 0;
char* p;
long long v = strtoll(s, &p, 10);
long long v = strtoll(s, &p, log10base);
if (errno != 0)
return false;
......@@ -536,20 +532,18 @@ InitConfigFileParser::storeSection(Context& ctx){
if(ctx.type == InitConfigFileParser::Section){
for(int i = 0; i<m_info->m_NoOfRules; i++){
const ConfigInfo::SectionRule & rule = m_info->m_SectionRules[i];
if(!strcmp(rule.m_section, "*") || !strcmp(rule.m_section, ctx.fname))
if(!(* rule.m_sectionRule)(ctx, rule.m_ruleData))
if(!strcmp(rule.m_section, "*") || !strcmp(rule.m_section, ctx.fname)){
if(!(* rule.m_sectionRule)(ctx, rule.m_ruleData)){
return false;
}
}
}
}
if(ctx.type == InitConfigFileParser::DefaultSection)
require(ctx.m_defaults->put(ctx.pname, ctx.m_currentSection));
if(ctx.type == InitConfigFileParser::Section)
require(ctx.m_config->put(ctx.pname, ctx.m_currentSection));
delete ctx.m_currentSection; ctx.m_currentSection = NULL;
return true;
}
......
......@@ -86,6 +86,9 @@ public:
void reportWarning(const char * msg, ...);
};
static bool convertStringToUint64(const char* s, Uint64& val, Uint32 log10base = 0);
static bool convertStringToBool(const char* s, bool& val);
private:
/**
* Check if line only contains space/comments
......@@ -111,8 +114,6 @@ private:
bool parseNameValuePair(Context&, const char* line);
bool storeNameValuePair(Context&, const char* fname, const char* value);
bool convertStringToUint64(const char* s, Uint64& val, Uint32 log10base = 0);
bool convertStringToBool(const char* s, bool& val);
bool storeSection(Context&);
const Properties* getSection(const char * name, const Properties* src);
......
......@@ -89,7 +89,7 @@ LocalConfig::init(const char *connectString,
//7. Check
{
char buf[256];
snprintf(buf, sizeof(buf), "host=localhost:%u", NDB_BASE_PORT);
snprintf(buf, sizeof(buf), "host=localhost:%s", NDB_BASE_PORT);
if(readConnectString(buf))
return true;
}
......
MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
noinst_LTLIBRARIES = libmgmsrvcommon.la
libmgmsrvcommon_la_SOURCES = \
......@@ -10,6 +14,11 @@ libmgmsrvcommon_la_SOURCES = \
INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi
DEFS_LOC = -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
-DNDB_BASE_PORT="\"@ndb_port_base@\""
include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am
......
......@@ -3,7 +3,11 @@ ndbbin_PROGRAMS = ndb_cpcd
ndb_cpcd_SOURCES = main.cpp CPCD.cpp Process.cpp APIService.cpp Monitor.cpp common.cpp
LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la
LDADD_LOC = \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_util.mk.am
......
......@@ -3,7 +3,11 @@ ndbtools_PROGRAMS = ndb_restore
ndb_restore_SOURCES = main.cpp consumer.cpp consumer_restore.cpp consumer_printer.cpp Restore.cpp
LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la
LDADD_LOC = \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
include $(top_srcdir)/ndb/config/common.mk.am
......
......@@ -405,3 +405,7 @@ operator<<(NdbOut& out, const Dbtup::Th& th)
return out;
}
#endif
#ifdef VM_TRACE
template class Vector<Chunk>;
#endif
......@@ -44,7 +44,7 @@
ParserRow_t::IgnoreMinMax, \
0, 0, \
0, \
(desc) }
(desc), 0 }
#define CPC_END() \
{ 0, \
......@@ -55,7 +55,7 @@
ParserRow_t::IgnoreMinMax, \
0, 0, \
0, \
0 }
0, 0 }
#ifdef DEBUG_PRINT_PROPERTIES
static void printprop(const Properties &p) {
......
......@@ -19,6 +19,10 @@ INCLUDES_LOC = -I$(top_srcdir)/ndb/src/ndbapi \
LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/ndb/src/common/editline/libeditline.a \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
@TERMCAP_LIB@
include $(top_srcdir)/ndb/config/common.mk.am
......
......@@ -31,6 +31,8 @@
#include "Services.hpp"
extern bool g_StopServer;
static const unsigned int MAX_READ_TIMEOUT = 1000 ;
static const unsigned int MAX_WRITE_TIMEOUT = 100 ;
......@@ -1012,11 +1014,28 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
nodes.push_back(atoi(p));
}
int stop_self= 0;
for(size_t i=0; i < nodes.size(); i++) {
if (nodes[i] == m_mgmsrv.getOwnNodeId()) {
stop_self= 1;
if (i != nodes.size()-1) {
m_output->println("stop reply");
m_output->println("result: server must be stopped last");
m_output->println("");
return;
}
}
}
int stopped = 0, result = 0;
for(size_t i=0; i < nodes.size(); i++)
if (nodes[i] != m_mgmsrv.getOwnNodeId()) {
if((result = m_mgmsrv.stopNode(nodes[i], abort != 0)) == 0)
stopped++;
} else
stopped++;
m_output->println("stop reply");
if(result != 0)
......@@ -1025,6 +1044,9 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
m_output->println("result: Ok");
m_output->println("stopped: %d", stopped);
m_output->println("");
if (stop_self)
g_StopServer= true;
}
......
......@@ -265,9 +265,10 @@ NDB_MAIN(mgmsrv){
NdbSleep_MilliSleep(500);
}
g_EventLogger.info("Shutting down server...");
glob.socketServer->stopServer();
glob.socketServer->stopSessions();
g_EventLogger.info("Shutdown complete");
return 0;
error_end:
return 1;
......
......@@ -296,6 +296,7 @@ Remark: Start transaction. Synchronous.
NdbConnection*
Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen)
{
DBUG_ENTER("Ndb::startTransaction");
if (theInitState == Initialised) {
theError.code = 0;
......@@ -312,9 +313,9 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen)
} else {
nodeId = 0;
}//if
return startTransactionLocal(aPriority, nodeId);
DBUG_RETURN(startTransactionLocal(aPriority, nodeId));
} else {
return NULL;
DBUG_RETURN(NULL);
}//if
}//Ndb::startTransaction()
......@@ -329,9 +330,11 @@ Remark: Start transaction. Synchronous.
NdbConnection*
Ndb::hupp(NdbConnection* pBuddyTrans)
{
DBUG_ENTER("Ndb::hupp");
Uint32 aPriority = 0;
if (pBuddyTrans == NULL){
return startTransaction();
DBUG_RETURN(startTransaction());
}
if (theInitState == Initialised) {
......@@ -341,19 +344,19 @@ Ndb::hupp(NdbConnection* pBuddyTrans)
Uint32 nodeId = pBuddyTrans->getConnectedNodeId();
NdbConnection* pCon = startTransactionLocal(aPriority, nodeId);
if(pCon == NULL)
return NULL;
DBUG_RETURN(NULL);
if (pCon->getConnectedNodeId() != nodeId){
// We could not get a connection to the desired node
// release the connection and return NULL
closeTransaction(pCon);
return NULL;
DBUG_RETURN(NULL);
}
pCon->setTransactionId(pBuddyTrans->getTransactionId());
pCon->setBuddyConPtr((Uint32)pBuddyTrans->getTC_ConnectPtr());
return pCon;
DBUG_RETURN(pCon);
} else {
return NULL;
DBUG_RETURN(NULL);
}//if
}//Ndb::hupp()
......@@ -443,6 +446,8 @@ Remark: Close transaction by releasing the connection and all operations
void
Ndb::closeTransaction(NdbConnection* aConnection)
{
DBUG_ENTER("Ndb::closeTransaction");
NdbConnection* tCon;
NdbConnection* tPreviousCon;
......@@ -454,7 +459,7 @@ Ndb::closeTransaction(NdbConnection* aConnection)
#ifdef VM_TRACE
printf("NULL into closeTransaction\n");
#endif
return;
DBUG_VOID_RETURN;
}//if
CHECK_STATUS_MACRO_VOID;
......@@ -479,14 +484,14 @@ Ndb::closeTransaction(NdbConnection* aConnection)
printf("Scan timeout:ed NdbConnection-> "
"not returning it-> memory leak\n");
#endif
return;
DBUG_VOID_RETURN;
}
#ifdef VM_TRACE
printf("Non-existing transaction into closeTransaction\n");
abort();
#endif
return;
DBUG_VOID_RETURN;
}//if
tPreviousCon = tCon;
tCon = tCon->next();
......@@ -505,7 +510,7 @@ Ndb::closeTransaction(NdbConnection* aConnection)
#ifdef VM_TRACE
printf("Con timeout:ed NdbConnection-> not returning it-> memory leak\n");
#endif
return;
DBUG_VOID_RETURN;
}
if (aConnection->theReleaseOnClose == false) {
......@@ -515,11 +520,12 @@ Ndb::closeTransaction(NdbConnection* aConnection)
Uint32 nodeId = aConnection->getConnectedNodeId();
aConnection->theNext = theConnectionArray[nodeId];
theConnectionArray[nodeId] = aConnection;
return;
DBUG_VOID_RETURN;
} else {
aConnection->theReleaseOnClose = false;
releaseNdbCon(aConnection);
}//if
DBUG_VOID_RETURN;
}//Ndb::closeTransaction()
/*****************************************************************************
......
......@@ -12,7 +12,11 @@ test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \
atrt_SOURCES = main.cpp
INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient
LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o $(top_builddir)/ndb/src/libndbclient.la
LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
# Don't update the files from bitkeeper
%::SCCS/s.%
......@@ -46,6 +46,9 @@ static const int max_transactions= 256;
// Default value for prefetch of autoincrement values
static const ha_rows autoincrement_prefetch= 32;
// connectstring to cluster if given by mysqld
const char *ndbcluster_connectstring= 0;
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
......@@ -3375,6 +3378,12 @@ int ndb_discover_tables()
bool ndbcluster_init()
{
DBUG_ENTER("ndbcluster_init");
// Set connectstring if specified
if (ndbcluster_connectstring != 0)
{
DBUG_PRINT("connectstring", ("%s", ndbcluster_connectstring));
Ndb::setConnectString(ndbcluster_connectstring);
}
// Create a Ndb object to open the connection to NDB
g_ndb= new Ndb("sys");
if (g_ndb->init() != 0)
......
......@@ -37,6 +37,8 @@ class NdbScanOperation;
class NdbIndexScanOperation;
class NdbBlob;
// connectstring to cluster if given by mysqld
extern const char *ndbcluster_connectstring;
typedef enum ndb_index_type {
UNDEFINED_INDEX = 0,
......
......@@ -159,10 +159,7 @@ Item *Item_sum::get_tmp_table_item(THD *thd)
if (!arg->const_item())
{
if (arg->type() == Item::FIELD_ITEM)
{
arg->maybe_null= result_field_tmp->maybe_null();
((Item_field*) arg)->field= result_field_tmp++;
}
else
sum_item->args[i]= new Item_field(result_field_tmp++);
}
......
......@@ -211,10 +211,17 @@ bool key_cmp_if_same(TABLE *table,const byte *key,uint idx,uint key_length)
if (!(key_part->key_type & (FIELDFLAG_NUMBER+FIELDFLAG_BINARY+
FIELDFLAG_PACK)))
{
if (my_strnncoll(key_part->field->charset(),
CHARSET_INFO *cs= key_part->field->charset();
uint char_length= key_part->length / cs->mbmaxlen;
const byte *pos= table->record[0] + key_part->offset;
if (length > char_length)
{
char_length= my_charpos(cs, pos, pos + length, char_length);
set_if_smaller(char_length, length);
}
if (cs->coll->strnncollsp(cs,
(const uchar*) key, length,
(const uchar*) table->record[0]+key_part->offset,
length))
(const uchar*) pos, char_length))
return 1;
}
else if (memcmp(key,table->record[0]+key_part->offset,length))
......
......@@ -3893,7 +3893,7 @@ enum options_mysqld
OPT_INNODB_FILE_PER_TABLE, OPT_CRASH_BINLOG_INNODB,
OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG,
OPT_SAFE_SHOW_DB, OPT_INNODB_SAFE_BINLOG,
OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_SKIP_SAFEMALLOC,
OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_SKIP_SAFEMALLOC,
OPT_TEMP_POOL, OPT_TX_ISOLATION,
OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
......@@ -4318,6 +4318,11 @@ master-ssl",
Disable with --skip-ndbcluster (will save memory).",
(gptr*) &opt_ndbcluster, (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 1, 0, 0,
0, 0, 0},
#ifdef HAVE_NDBCLUSTER_DB
{"ndb-connectstring", OPT_NDB_CONNECTSTRING, "Connect string for ndbcluster.",
(gptr*) &ndbcluster_connectstring, (gptr*) &ndbcluster_connectstring, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"new", 'n', "Use very new possible 'unsafe' functions.",
(gptr*) &global_system_variables.new_mode,
(gptr*) &max_system_variables.new_mode,
......@@ -5972,15 +5977,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
case OPT_BDB_SHARED:
berkeley_init_flags&= ~(DB_PRIVATE);
berkeley_shared_data=1;
berkeley_shared_data= 1;
break;
#endif /* HAVE_BERKELEY_DB */
case OPT_BDB:
#ifdef HAVE_BERKELEY_DB
if (opt_bdb)
have_berkeley_db=SHOW_OPTION_YES;
have_berkeley_db= SHOW_OPTION_YES;
else
have_berkeley_db=SHOW_OPTION_DISABLED;
have_berkeley_db= SHOW_OPTION_DISABLED;
#endif
break;
case OPT_ISAM:
......@@ -5994,22 +5999,22 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case OPT_NDBCLUSTER:
#ifdef HAVE_NDBCLUSTER_DB
if (opt_ndbcluster)
have_ndbcluster=SHOW_OPTION_YES;
have_ndbcluster= SHOW_OPTION_YES;
else
have_ndbcluster=SHOW_OPTION_DISABLED;
have_ndbcluster= SHOW_OPTION_DISABLED;
#endif
break;
case OPT_INNODB:
#ifdef HAVE_INNOBASE_DB
if (opt_innodb)
have_innodb=SHOW_OPTION_YES;
have_innodb= SHOW_OPTION_YES;
else
have_innodb=SHOW_OPTION_DISABLED;
have_innodb= SHOW_OPTION_DISABLED;
#endif
break;
case OPT_INNODB_DATA_FILE_PATH:
#ifdef HAVE_INNOBASE_DB
innobase_data_file_path=argument;
innobase_data_file_path= argument;
#endif
break;
#ifdef HAVE_INNOBASE_DB
......
......@@ -3215,6 +3215,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
store_key **ref_key= j->ref.key_copy;
byte *key_buff=j->ref.key_buff, *null_ref_key= 0;
bool keyuse_uses_no_tables= true;
if (ftkey)
{
j->ref.items[0]=((Item_func*)(keyuse->val))->key_item();
......@@ -3234,6 +3235,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
uint maybe_null= test(keyinfo->key_part[i].null_bit);
j->ref.items[i]=keyuse->val; // Save for cond removal
keyuse_uses_no_tables= keyuse_uses_no_tables & !keyuse->used_tables;
if (!keyuse->used_tables &&
!(join->select_options & SELECT_DESCRIBE))
{ // Compare against constant
......@@ -3273,7 +3275,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
j->type= null_ref_key ? JT_REF_OR_NULL : JT_REF;
j->ref.null_ref_key= null_ref_key;
}
else if (ref_key == j->ref.key_copy)
else if (keyuse_uses_no_tables)
{
/*
This happen if we are using a constant expression in the ON part
......@@ -4062,7 +4064,7 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order)
}
if ((ref=order_tables & (not_const_tables ^ first_table)))
{
if (only_eq_ref_tables(join,first_order,ref))
if (!(order_tables & first_table) && only_eq_ref_tables(join,first_order,ref))
{
DBUG_PRINT("info",("removing: %s", order->item[0]->full_name()));
continue;
......@@ -4184,7 +4186,10 @@ change_cond_ref_to_const(I_List<COND_CMP> *save_list,Item *and_father,
Item *right_item= func->arguments()[1];
Item_func::Functype functype= func->functype();
if (right_item->eq(field,0) && left_item != value)
if (right_item->eq(field,0) && left_item != value &&
(left_item->result_type() != STRING_RESULT ||
value->result_type() != STRING_RESULT ||
left_item->collation.collation == value->collation.collation))
{
Item *tmp=value->new_item();
if (tmp)
......@@ -4202,7 +4207,10 @@ change_cond_ref_to_const(I_List<COND_CMP> *save_list,Item *and_father,
func->set_cmp_func();
}
}
else if (left_item->eq(field,0) && right_item != value)
else if (left_item->eq(field,0) && right_item != value &&
(right_item->result_type() != STRING_RESULT ||
value->result_type() != STRING_RESULT ||
right_item->collation.collation == value->collation.collation))
{
Item *tmp=value->new_item();
if (tmp)
......@@ -5003,16 +5011,21 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
tmp_from_field++;
*(reg_field++)= new_field;
reclength+=new_field->pack_length();
if (!(new_field->flags & NOT_NULL_FLAG))
null_count++;
if (new_field->flags & BLOB_FLAG)
{
*blob_field++= new_field;
blob_count++;
}
((Item_sum*) item)->args[i]= new Item_field(new_field);
if (((Item_sum*) item)->arg_count == 1)
((Item_sum*) item)->result_field= new_field;
if (!(new_field->flags & NOT_NULL_FLAG))
{
null_count++;
/*
new_field->maybe_null() is still false, it will be
changed below. But we have to setup Item_field correctly
*/
((Item_sum*) item)->args[i]->maybe_null=1;
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment