mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.0/mysql-5.0-ndb
into dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.0/mysql-5.0-ndb-bj.merge sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/sql_table.cc: Auto merged
This commit is contained in:
@ -382,7 +382,7 @@ create table t1 (a int primary key) engine=ndb;
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
select * from t1;
|
select * from t1;
|
||||||
ERROR HY000: Can't lock file (errno: 4009)
|
ERROR HY000: Can't lock file (errno: 157)
|
||||||
use test;
|
use test;
|
||||||
drop database test_only_ndb_tables;
|
drop database test_only_ndb_tables;
|
||||||
CREATE TABLE t9 (
|
CREATE TABLE t9 (
|
||||||
|
@ -155,6 +155,8 @@ TCP_Transporter::initTransporter() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
TCP_Transporter::setSocketOptions(){
|
TCP_Transporter::setSocketOptions(){
|
||||||
|
int sockOptKeepAlive = 1;
|
||||||
|
|
||||||
if (setsockopt(theSocket, SOL_SOCKET, SO_RCVBUF,
|
if (setsockopt(theSocket, SOL_SOCKET, SO_RCVBUF,
|
||||||
(char*)&sockOptRcvBufSize, sizeof(sockOptRcvBufSize)) < 0) {
|
(char*)&sockOptRcvBufSize, sizeof(sockOptRcvBufSize)) < 0) {
|
||||||
#ifdef DEBUG_TRANSPORTER
|
#ifdef DEBUG_TRANSPORTER
|
||||||
@ -169,6 +171,11 @@ TCP_Transporter::setSocketOptions(){
|
|||||||
#endif
|
#endif
|
||||||
}//if
|
}//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
|
// Set the TCP_NODELAY option so also small packets are sent
|
||||||
// as soon as possible
|
// as soon as possible
|
||||||
|
@ -2026,6 +2026,9 @@ CommandInterpreter::executeRestart(Vector<BaseString> &command_list,
|
|||||||
return -1;
|
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,
|
result= ndb_mgm_restart3(m_mgmsrv, no_of_nodes, node_ids,
|
||||||
initialstart, nostart, abort, &need_disconnect);
|
initialstart, nostart, abort, &need_disconnect);
|
||||||
|
|
||||||
|
@ -328,12 +328,18 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){
|
|||||||
|
|
||||||
int
|
int
|
||||||
NdbScanFilter::isnull(int AttrId){
|
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
|
int
|
||||||
NdbScanFilter::isnotnull(int AttrId){
|
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 {
|
struct tab3 {
|
||||||
|
@ -203,6 +203,8 @@ static const err_code_mapping err_map[]=
|
|||||||
|
|
||||||
{ 284, HA_ERR_TABLE_DEF_CHANGED, 0 },
|
{ 284, HA_ERR_TABLE_DEF_CHANGED, 0 },
|
||||||
|
|
||||||
|
{4009, HA_ERR_NO_CONNECTION, 1 },
|
||||||
|
|
||||||
{ 0, 1, 0 },
|
{ 0, 1, 0 },
|
||||||
|
|
||||||
{ -1, -1, 1 }
|
{ -1, -1, 1 }
|
||||||
@ -5068,14 +5070,11 @@ int ndbcluster_table_exists_in_engine(THD* thd, const char *db, const char *name
|
|||||||
dict->invalidateTable(name);
|
dict->invalidateTable(name);
|
||||||
if (!(tab= dict->getTable(name)))
|
if (!(tab= dict->getTable(name)))
|
||||||
{
|
{
|
||||||
const NdbError err= dict->getNdbError();
|
ERR_RETURN(dict->getNdbError());
|
||||||
if (err.code == 709)
|
|
||||||
DBUG_RETURN(0);
|
|
||||||
ERR_RETURN(err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_PRINT("info", ("Found table %s", tab->getName()));
|
DBUG_PRINT("info", ("Found table %s", tab->getName()));
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(HA_ERR_TABLE_EXIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -5260,7 +5259,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
|
|||||||
DBUG_PRINT("info", ("%s existed on disk", name));
|
DBUG_PRINT("info", ("%s existed on disk", name));
|
||||||
// The .ndb file exists on disk, but it's not in list of tables in ndb
|
// The .ndb file exists on disk, but it's not in list of tables in ndb
|
||||||
// Verify that handler agrees table is gone.
|
// Verify that handler agrees table is gone.
|
||||||
if (ndbcluster_table_exists_in_engine(thd, db, file_name) == 0)
|
if (ndbcluster_table_exists_in_engine(thd, db, file_name) == HA_ERR_NO_SUCH_TABLE)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("NDB says %s does not exists", file_name));
|
DBUG_PRINT("info", ("NDB says %s does not exists", file_name));
|
||||||
it.remove();
|
it.remove();
|
||||||
|
@ -2438,14 +2438,14 @@ ha_find_files(THD *thd,const char *db,const char *path,
|
|||||||
Ask handler if the table exists in engine
|
Ask handler if the table exists in engine
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
0 Table does not exist
|
HA_ERR_NO_SUCH_TABLE Table does not exist
|
||||||
1 Table exists
|
HA_ERR_TABLE_EXIST Table exists
|
||||||
# Error code
|
# Error code
|
||||||
|
|
||||||
*/
|
*/
|
||||||
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name)
|
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name)
|
||||||
{
|
{
|
||||||
int error= 0;
|
int error= HA_ERR_NO_SUCH_TABLE;
|
||||||
DBUG_ENTER("ha_table_exists_in_engine");
|
DBUG_ENTER("ha_table_exists_in_engine");
|
||||||
DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
|
DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
|
||||||
#ifdef HAVE_NDBCLUSTER_DB
|
#ifdef HAVE_NDBCLUSTER_DB
|
||||||
|
@ -1697,6 +1697,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
|
|||||||
alias);
|
alias);
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
DBUG_PRINT("info",("1"));
|
||||||
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias);
|
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias);
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
@ -1707,6 +1708,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
|
|||||||
{
|
{
|
||||||
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
|
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
|
||||||
goto warn;
|
goto warn;
|
||||||
|
DBUG_PRINT("info",("2"));
|
||||||
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@ -1725,14 +1727,25 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
|
|||||||
{
|
{
|
||||||
bool create_if_not_exists =
|
bool create_if_not_exists =
|
||||||
create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS;
|
create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS;
|
||||||
if (ha_table_exists_in_engine(thd, db, table_name))
|
int retcode = ha_table_exists_in_engine(thd, db, table_name);
|
||||||
|
DBUG_PRINT("info", ("exists_in_engine: %u",retcode));
|
||||||
|
switch (retcode)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("Table with same name already existed in handler"));
|
case HA_ERR_NO_SUCH_TABLE:
|
||||||
|
/* Normal case, no table exists. we can go and create it */
|
||||||
|
break;
|
||||||
|
case HA_ERR_TABLE_EXIST:
|
||||||
|
DBUG_PRINT("info", ("Table existed in handler"));
|
||||||
|
|
||||||
if (create_if_not_exists)
|
if (create_if_not_exists)
|
||||||
goto warn;
|
goto warn;
|
||||||
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
||||||
goto end;
|
goto end;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
DBUG_PRINT("info", ("error: %u from storage engine", retcode));
|
||||||
|
my_error(retcode, MYF(0),table_name);
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user