Commit f54afc79 authored by tomas@poseidon.ndb.mysql.com's avatar tomas@poseidon.ndb.mysql.com

Merge

parents f97c11fe cd590a6a
...@@ -785,12 +785,14 @@ INSERT INTO t1 VALUES ...@@ -785,12 +785,14 @@ INSERT INTO t1 VALUES
(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми','ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01 17:30:43','1234567890'), (1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми','ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01 17:30:43','1234567890'),
(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02 22:43:10','1234567890'); (2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02 22:43:10','1234567890');
--disable_warnings
CREATE TABLE t2 ( CREATE TABLE t2 (
`msisdn` varchar(15) NOT NULL default '', `msisdn` varchar(15) NOT NULL default '',
`operator_id` int(11) NOT NULL default '0', `operator_id` int(11) NOT NULL default '0',
`created` datetime NOT NULL default '0000-00-00 00:00:00', `created` datetime NOT NULL default '0000-00-00 00:00:00',
UNIQUE KEY `PK_user` (`msisdn`) UNIQUE KEY `PK_user` (`msisdn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--enable_warnings
INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25'); INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
......
...@@ -268,6 +268,8 @@ public: ...@@ -268,6 +268,8 @@ public:
Transporter* get_transporter(NodeId nodeId); Transporter* get_transporter(NodeId nodeId);
NodeId get_localNodeId() { return localNodeId; }; NodeId get_localNodeId() { return localNodeId; };
struct in_addr get_connect_address(NodeId node_id) const;
protected: protected:
private: private:
......
...@@ -142,14 +142,14 @@ ConfigRetriever::getConfig() { ...@@ -142,14 +142,14 @@ ConfigRetriever::getConfig() {
} }
ndb_mgm_configuration * ndb_mgm_configuration *
ConfigRetriever::getConfig(NdbMgmHandle m_handle){ ConfigRetriever::getConfig(NdbMgmHandle m_handle)
{
ndb_mgm_configuration * conf = ndb_mgm_get_configuration(m_handle,m_version); ndb_mgm_configuration * conf = ndb_mgm_get_configuration(m_handle,m_version);
if(conf == 0){ 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));
return 0; return 0;
} }
return conf; return conf;
} }
......
...@@ -76,6 +76,7 @@ Transporter::Transporter(TransporterRegistry &t_reg, ...@@ -76,6 +76,7 @@ Transporter::Transporter(TransporterRegistry &t_reg,
m_connected = false; m_connected = false;
m_timeOutMillis = 1000; m_timeOutMillis = 1000;
m_connect_address.s_addr= 0;
if(s_port<0) if(s_port<0)
s_port= -s_port; // was dynamic s_port= -s_port; // was dynamic
...@@ -103,6 +104,13 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { ...@@ -103,6 +104,13 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) {
DBUG_RETURN(true); // TODO assert(0); DBUG_RETURN(true); // TODO assert(0);
} }
{
struct sockaddr addr;
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
int r= getpeername(sockfd, &addr, &addrlen);
m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr;
}
bool res = connect_server_impl(sockfd); bool res = connect_server_impl(sockfd);
if(res){ if(res){
m_connected = true; m_connected = true;
...@@ -189,6 +197,13 @@ Transporter::connect_client(NDB_SOCKET_TYPE sockfd) { ...@@ -189,6 +197,13 @@ Transporter::connect_client(NDB_SOCKET_TYPE sockfd) {
g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId); g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId);
} }
{
struct sockaddr addr;
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
int r= getpeername(sockfd, &addr, &addrlen);
m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr;
}
bool res = connect_client_impl(sockfd); bool res = connect_client_impl(sockfd);
if(res){ if(res){
m_connected = true; m_connected = true;
......
...@@ -147,6 +147,7 @@ private: ...@@ -147,6 +147,7 @@ private:
bool isMgmConnection; bool isMgmConnection;
SocketClient *m_socket_client; SocketClient *m_socket_client;
struct in_addr m_connect_address;
protected: protected:
Uint32 getErrorCount(); Uint32 getErrorCount();
......
...@@ -55,6 +55,12 @@ extern int g_ndb_shm_signum; ...@@ -55,6 +55,12 @@ extern int g_ndb_shm_signum;
#include <EventLogger.hpp> #include <EventLogger.hpp>
extern EventLogger g_eventLogger; extern EventLogger g_eventLogger;
struct in_addr
TransporterRegistry::get_connect_address(NodeId node_id) const
{
return theTransporters[node_id]->m_connect_address;
}
SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
{ {
DBUG_ENTER("SocketServer::Session * TransporterService::newSession"); DBUG_ENTER("SocketServer::Session * TransporterService::newSession");
......
...@@ -2142,6 +2142,24 @@ MgmtSrvr::getNodeType(NodeId nodeId) const ...@@ -2142,6 +2142,24 @@ MgmtSrvr::getNodeType(NodeId nodeId) const
return nodeTypes[nodeId]; return nodeTypes[nodeId];
} }
const char *MgmtSrvr::get_connect_address(Uint32 node_id)
{
if (m_connect_address[node_id].s_addr == 0 &&
theFacade && theFacade->theTransporterRegistry &&
theFacade->theClusterMgr &&
getNodeType(node_id) == NDB_MGM_NODE_TYPE_NDB)
{
const ClusterMgr::Node &node=
theFacade->theClusterMgr->getNodeInfo(node_id);
if (node.connected)
{
m_connect_address[node_id]=
theFacade->theTransporterRegistry->get_connect_address(node_id);
}
}
return inet_ntoa(m_connect_address[node_id]);
}
void void
MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const
{ {
......
...@@ -520,7 +520,7 @@ public: ...@@ -520,7 +520,7 @@ public:
ConfigRetriever *get_config_retriever() { return m_config_retriever; }; ConfigRetriever *get_config_retriever() { return m_config_retriever; };
const char *get_connect_address(Uint32 node_id) { return inet_ntoa(m_connect_address[node_id]); } const char *get_connect_address(Uint32 node_id);
void get_connected_nodes(NodeBitmask &connected_nodes) const; void get_connected_nodes(NodeBitmask &connected_nodes) const;
SocketServer *get_socket_server() { return m_socket_server; } SocketServer *get_socket_server() { return m_socket_server; }
......
...@@ -313,24 +313,28 @@ static void set_param_int64(Item_param *param, uchar **pos, ulong len) ...@@ -313,24 +313,28 @@ static void set_param_int64(Item_param *param, uchar **pos, ulong len)
static void set_param_float(Item_param *param, uchar **pos, ulong len) static void set_param_float(Item_param *param, uchar **pos, ulong len)
{ {
float data;
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (len < 4) if (len < 4)
return; return;
#endif
float data;
float4get(data,*pos); float4get(data,*pos);
#else
data= *(float*) *pos;
#endif
param->set_double((double) data); param->set_double((double) data);
*pos+= 4; *pos+= 4;
} }
static void set_param_double(Item_param *param, uchar **pos, ulong len) static void set_param_double(Item_param *param, uchar **pos, ulong len)
{ {
double data;
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (len < 8) if (len < 8)
return; return;
#endif
double data;
float8get(data,*pos); float8get(data,*pos);
#else
data= *(double*) *pos;
#endif
param->set_double((double) data); param->set_double((double) data);
*pos+= 8; *pos+= 8;
} }
......
...@@ -440,19 +440,20 @@ then ...@@ -440,19 +440,20 @@ then
/sbin/chkconfig --add mysql /sbin/chkconfig --add mysql
fi fi
# Create a MySQL user. Do not report any problems if it already # Create a MySQL user and group. Do not report any problems if it already
# exists. This is redhat specific and should be handled more portable # exists.
useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" %{mysqld_user} 2> /dev/null || true groupadd -r -c "MySQL server" %{mysqld_user} 2> /dev/null || true
useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_user} %{mysqld_user} 2> /dev/null || true
# Change permissions so that the user that will run the MySQL daemon # Change permissions so that the user that will run the MySQL daemon
# owns all database files. # owns all database files.
chown -R %{mysqld_user} $mysql_datadir chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir
# Initiate databases # Initiate databases
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
# Change permissions again to fix any new files. # Change permissions again to fix any new files.
chown -R %{mysqld_user} $mysql_datadir chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir
# Fix permissions for the permission database so that only the user # Fix permissions for the permission database so that only the user
# can read them. # can read them.
...@@ -667,6 +668,11 @@ fi ...@@ -667,6 +668,11 @@ fi
# itself - note that they must be ordered by date (important when # itself - note that they must be ordered by date (important when
# merging BK trees) # merging BK trees)
%changelog %changelog
* Fri Jul 15 2005 Lenz Grimmer <lenz@mysql.com>
- create a "mysql" user group and assign the mysql user account to that group
in the server postinstall section. (BUG 10984)
* Tue Jun 14 2005 Lenz Grimmer <lenz@mysql.com> * Tue Jun 14 2005 Lenz Grimmer <lenz@mysql.com>
- Do not build statically on i386 by default, only when adding either "--with - Do not build statically on i386 by default, only when adding either "--with
......
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