Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1870 05/08/08 22:21:43 joreland@stripped +11 -0
Merge joreland@stripped:/home/bk/mysql-5.1
into mysql.com:/home/jonas/src/mysql-5.1-push
storage/ndb/tools/ndb_condig.cpp
1.5 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
storage/ndb/tools/Makefile.am
1.19 05/08/08 22:21:37 joreland@stripped +0 -3
Auto merged
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
1.89 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
storage/ndb/src/mgmsrv/ConfigInfo.hpp
1.12 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
storage/ndb/src/mgmapi/mgmapi.cpp
1.52 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
1.58 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
storage/ndb/include/mgmapi/mgmapi.h
1.46 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
sql/ha_ndbcluster.h
1.92 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
sql/ha_ndbcluster.cc
1.203 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
sql/ha_innodb.h
1.102 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
mysql-test/t/ndb_partition_key.test
1.4 05/08/08 22:21:37 joreland@stripped +0 -0
Auto merged
storage/ndb/tools/ndb_condig.cpp
1.1.1.2 05/08/08 22:21:36 joreland@stripped +0 -0
Merge rename: storage/ndb/tools/config.cpp -> storage/ndb/tools/ndb_condig.cpp
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: joreland
# Host: eel.(none)
# Root: /home/jonas/src/mysql-5.1-push/RESYNC
--- 1.1.1.1/storage/ndb/tools/config.cpp 2005-07-26 11:42:38 +02:00
+++ 1.5/storage/ndb/tools/ndb_condig.cpp 2005-08-08 22:21:37 +02:00
@@ -317,8 +317,8 @@
return 0;
}
-template Vector<Apply*>;
-template Vector<Match*>;
+template class Vector<Apply*>;
+template class Vector<Match*>;
static
int
@@ -359,7 +359,7 @@
}
else if(iter.get(m_key, &val64) == 0)
{
- if(atoll(m_value.c_str()) != val64)
+ if(strtoll(m_value.c_str(), (char **)NULL, 10) != val64)
return 0;
}
else if(iter.get(m_key, &valc) == 0)
--- 1.57/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp 2005-07-22 15:29:42 +02:00
+++ 1.58/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp 2005-08-08 22:21:37 +02:00
@@ -731,10 +731,12 @@
ndbrestart1Lab(signal);
clblPagesPerTick = 50;
- //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTick);
+ ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_ACC_SR,
+ &clblPagesPerTick);
clblPagesPerTickAfterSr = 50;
- //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTickAfterSr);
+ ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_ACC,
+ &clblPagesPerTickAfterSr);
tdata0 = 0;
initialiseRecordsLab(signal, ref, senderData);
--- 1.88/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2005-07-22 15:27:09 +02:00
+++ 1.89/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2005-08-08 22:21:37 +02:00
@@ -989,7 +989,13 @@
m_buffer.clear();
// Protected area
- m_transporter->lock_mutex();
+ /*
+ The PollGuard has an implicit call of unlock_and_signal through the
+ ~PollGuard method. This method is called implicitly by the compiler
+ in all places where the object is out of context due to a return,
+ break, continue or simply end of statement block
+ */
+ PollGuard poll_guard(m_transporter, &m_waiter, refToBlock(m_reference));
Uint32 aNodeId;
if (useMasterNodeId) {
if ((m_masterNodeId == 0) ||
@@ -1002,7 +1008,6 @@
}
if(aNodeId == 0){
m_error.code= 4009;
- m_transporter->unlock_mutex();
DBUG_RETURN(-1);
}
{
@@ -1023,21 +1028,15 @@
r = m_transporter->sendSignal(signal, aNodeId);
}
if(r != 0){
- m_transporter->unlock_mutex();
continue;
}
}
m_error.code= 0;
-
- m_waiter.m_node = aNodeId;
- m_waiter.m_state = wst;
-
- m_waiter.wait(theWait);
- m_transporter->unlock_mutex();
+ int ret_val= poll_guard.wait_n_unlock(theWait, aNodeId, wst);
// End of Protected area
- if(m_waiter.m_state == NO_WAIT && m_error.code == 0){
+ if(ret_val == 0 && m_error.code == 0){
// Normal return
DBUG_RETURN(0);
}
@@ -1045,7 +1044,7 @@
/**
* Handle error codes
*/
- if(m_waiter.m_state == WAIT_NODE_FAILURE)
+ if(ret_val == -2) //WAIT_NODE_FAILURE
continue;
if(m_waiter.m_state == WST_WAIT_TIMEOUT)
@@ -3166,26 +3165,28 @@
for (Uint32 i = 0; i < RETRIES; i++) {
m_buffer.clear();
// begin protected
- m_transporter->lock_mutex();
+ /*
+ The PollGuard has an implicit call of unlock_and_signal through the
+ ~PollGuard method. This method is called implicitly by the compiler
+ in all places where the object is out of context due to a return,
+ break, continue or simply end of statement block
+ */
+ PollGuard poll_guard(m_transporter, &m_waiter, refToBlock(m_reference));
Uint16 aNodeId = m_transporter->get_an_alive_node();
if (aNodeId == 0) {
m_error.code= 4009;
- m_transporter->unlock_mutex();
return -1;
}
if (m_transporter->sendSignal(signal, aNodeId) != 0) {
- m_transporter->unlock_mutex();
continue;
}
m_error.code= 0;
- m_waiter.m_node = aNodeId;
- m_waiter.m_state = WAIT_LIST_TABLES_CONF;
- m_waiter.wait(WAITFOR_RESPONSE_TIMEOUT);
- m_transporter->unlock_mutex();
+ int ret_val= poll_guard.wait_n_unlock(WAITFOR_RESPONSE_TIMEOUT,
+ aNodeId, WAIT_LIST_TABLES_CONF);
// end protected
- if (m_waiter.m_state == NO_WAIT && m_error.code == 0)
+ if (ret_val == 0 && m_error.code == 0)
return 0;
- if (m_waiter.m_state == WAIT_NODE_FAILURE)
+ if (ret_val == -2) //WAIT_NODE_FAILURE
continue;
return -1;
}
--- 1.202/sql/ha_ndbcluster.cc 2005-07-25 10:13:08 +02:00
+++ 1.203/sql/ha_ndbcluster.cc 2005-08-08 22:21:37 +02:00
@@ -6312,12 +6312,14 @@
// result type
if (context->expecting(Item::FIELD_ITEM) &&
(context->expecting_field_result(field->result_type()) ||
- // Date and year can be written as strings
+ // Date and year can be written as string or int
((type == MYSQL_TYPE_TIME ||
type == MYSQL_TYPE_DATE ||
type == MYSQL_TYPE_YEAR ||
type == MYSQL_TYPE_DATETIME)
- ? context->expecting_field_result(STRING_RESULT) : true)) &&
+ ? (context->expecting_field_result(STRING_RESULT) ||
+ context->expecting_field_result(INT_RESULT))
+ : true)) &&
// Bit fields no yet supported in scan filter
type != MYSQL_TYPE_BIT)
{
@@ -6385,8 +6387,8 @@
}
else
{
- DBUG_PRINT("info", ("Was not expecting field of type %u",
- field->result_type()));
+ DBUG_PRINT("info", ("Was not expecting field of type %u(%u)",
+ field->result_type(), type));
context->supported= FALSE;
}
}
@@ -6527,17 +6529,6 @@
context->expect(Item::FUNC_ITEM);
break;
}
- case Item_func::NOTLIKE_FUNC:
- {
- DBUG_PRINT("info", ("NOTLIKE_FUNC"));
- curr_cond->ndb_item= new Ndb_item(func_item->functype(),
- func_item);
- context->expect(Item::STRING_ITEM);
- context->expect(Item::FIELD_ITEM);
- context->expect_field_result(STRING_RESULT);
- context->expect(Item::FUNC_ITEM);
- break;
- }
case Item_func::ISNULL_FUNC:
{
DBUG_PRINT("info", ("ISNULL_FUNC"));
@@ -6982,7 +6973,7 @@
switch ((negated) ?
Ndb_item::negate(cond->ndb_item->qualification.function_type)
: cond->ndb_item->qualification.function_type) {
- case Item_func::EQ_FUNC:
+ case NDB_EQ_FUNC:
{
if (!value || !field) break;
// Save value in right format for the field type
@@ -6996,7 +6987,7 @@
cond= cond->next->next->next;
DBUG_RETURN(0);
}
- case Item_func::NE_FUNC:
+ case NDB_NE_FUNC:
{
if (!value || !field) break;
// Save value in right format for the field type
@@ -7010,7 +7001,7 @@
cond= cond->next->next->next;
DBUG_RETURN(0);
}
- case Item_func::LT_FUNC:
+ case NDB_LT_FUNC:
{
if (!value || !field) break;
// Save value in right format for the field type
@@ -7036,7 +7027,7 @@
cond= cond->next->next->next;
DBUG_RETURN(0);
}
- case Item_func::LE_FUNC:
+ case NDB_LE_FUNC:
{
if (!value || !field) break;
// Save value in right format for the field type
@@ -7062,7 +7053,7 @@
cond= cond->next->next->next;
DBUG_RETURN(0);
}
- case Item_func::GE_FUNC:
+ case NDB_GE_FUNC:
{
if (!value || !field) break;
// Save value in right format for the field type
@@ -7088,7 +7079,7 @@
cond= cond->next->next->next;
DBUG_RETURN(0);
}
- case Item_func::GT_FUNC:
+ case NDB_GT_FUNC:
{
if (!value || !field) break;
// Save value in right format for the field type
@@ -7114,7 +7105,7 @@
cond= cond->next->next->next;
DBUG_RETURN(0);
}
- case Item_func::LIKE_FUNC:
+ case NDB_LIKE_FUNC:
{
if (!value || !field) break;
if ((value->qualification.value_type != Item::STRING_ITEM) &&
@@ -7133,12 +7124,12 @@
cond= cond->next->next->next;
DBUG_RETURN(0);
}
- case Item_func::NOTLIKE_FUNC:
+ case NDB_NOTLIKE_FUNC:
{
if (!value || !field) break;
if ((value->qualification.value_type != Item::STRING_ITEM) &&
(value->qualification.value_type != Item::VARBIN_ITEM))
- break;
+ break;
// Save value in right format for the field type
value->save_in_field(field);
DBUG_PRINT("info", ("Generating NOTLIKE filter: notlike(%d,%s,%d)",
@@ -7152,7 +7143,7 @@
cond= cond->next->next->next;
DBUG_RETURN(0);
}
- case Item_func::ISNULL_FUNC:
+ case NDB_ISNULL_FUNC:
if (!field)
break;
DBUG_PRINT("info", ("Generating ISNULL filter"));
@@ -7160,7 +7151,7 @@
DBUG_RETURN(1);
cond= cond->next->next;
DBUG_RETURN(0);
- case Item_func::ISNOTNULL_FUNC:
+ case NDB_ISNOTNULL_FUNC:
{
if (!field)
break;
@@ -7197,7 +7188,7 @@
case NDB_FUNCTION:
{
switch (cond->ndb_item->qualification.function_type) {
- case Item_func::COND_AND_FUNC:
+ case NDB_COND_AND_FUNC:
{
level++;
DBUG_PRINT("info", ("Generating %s group %u", (negated)?"NAND":"AND",
@@ -7209,7 +7200,7 @@
cond= cond->next;
break;
}
- case Item_func::COND_OR_FUNC:
+ case NDB_COND_OR_FUNC:
{
level++;
DBUG_PRINT("info", ("Generating %s group %u", (negated)?"NOR":"OR",
@@ -7221,7 +7212,7 @@
cond= cond->next;
break;
}
- case Item_func::NOT_FUNC:
+ case NDB_NOT_FUNC:
{
DBUG_PRINT("info", ("Generating negated query"));
cond= cond->next;
@@ -7264,8 +7255,8 @@
switch (cond->ndb_item->type) {
case NDB_FUNCTION:
switch (cond->ndb_item->qualification.function_type) {
- case Item_func::COND_AND_FUNC:
- case Item_func::COND_OR_FUNC:
+ case NDB_COND_AND_FUNC:
+ case NDB_COND_OR_FUNC:
simple_cond= FALSE;
break;
default:
--- 1.91/sql/ha_ndbcluster.h 2005-07-26 15:05:00 +02:00
+++ 1.92/sql/ha_ndbcluster.h 2005-08-08 22:21:37 +02:00
@@ -72,10 +72,28 @@
NDB_END_COND = 3 // End marker for condition group
} NDB_ITEM_TYPE;
+typedef enum ndb_func_type {
+ NDB_EQ_FUNC = 0,
+ NDB_NE_FUNC = 1,
+ NDB_LT_FUNC = 2,
+ NDB_LE_FUNC = 3,
+ NDB_GT_FUNC = 4,
+ NDB_GE_FUNC = 5,
+ NDB_ISNULL_FUNC = 6,
+ NDB_ISNOTNULL_FUNC = 7,
+ NDB_LIKE_FUNC = 8,
+ NDB_NOTLIKE_FUNC = 9,
+ NDB_NOT_FUNC = 10,
+ NDB_UNKNOWN_FUNC = 11,
+ NDB_COND_AND_FUNC = 12,
+ NDB_COND_OR_FUNC = 13,
+ NDB_UNSUPPORTED_FUNC = 14
+} NDB_FUNC_TYPE;
+
typedef union ndb_item_qualification {
Item::Type value_type;
- enum_field_types field_type; // Instead of Item::FIELD_ITEM
- Item_func::Functype function_type; // Instead of Item::FUNC_ITEM
+ enum_field_types field_type; // Instead of Item::FIELD_ITEM
+ NDB_FUNC_TYPE function_type; // Instead of Item::FUNC_ITEM
} NDB_ITEM_QUALIFICATION;
typedef struct ndb_item_field_value {
@@ -91,23 +109,31 @@
struct negated_function_mapping
{
- Item_func::Functype pos_fun;
- Item_func::Functype neg_fun;
+ NDB_FUNC_TYPE pos_fun;
+ NDB_FUNC_TYPE neg_fun;
};
+/*
+ Define what functions can be negated in condition pushdown.
+ Note, these HAVE to be in the same order as in definition enum
+*/
static const negated_function_mapping neg_map[]=
{
- {Item_func::EQ_FUNC, Item_func::NE_FUNC},
- {Item_func::NE_FUNC, Item_func::EQ_FUNC},
- {Item_func::LT_FUNC, Item_func::GE_FUNC},
- {Item_func::LE_FUNC, Item_func::GT_FUNC},
- {Item_func::GT_FUNC, Item_func::LE_FUNC},
- {Item_func::GE_FUNC, Item_func::LT_FUNC},
- {Item_func::LIKE_FUNC, Item_func::NOTLIKE_FUNC},
- {Item_func::NOTLIKE_FUNC, Item_func::LIKE_FUNC},
- {Item_func::ISNULL_FUNC, Item_func::ISNOTNULL_FUNC},
- {Item_func::ISNOTNULL_FUNC, Item_func::ISNULL_FUNC},
- {Item_func::UNKNOWN_FUNC, Item_func::NOT_FUNC}
+ {NDB_EQ_FUNC, NDB_NE_FUNC},
+ {NDB_NE_FUNC, NDB_EQ_FUNC},
+ {NDB_LT_FUNC, NDB_GE_FUNC},
+ {NDB_LE_FUNC, NDB_GT_FUNC},
+ {NDB_GT_FUNC, NDB_LE_FUNC},
+ {NDB_GE_FUNC, NDB_LT_FUNC},
+ {NDB_ISNULL_FUNC, NDB_ISNOTNULL_FUNC},
+ {NDB_ISNOTNULL_FUNC, NDB_ISNULL_FUNC},
+ {NDB_LIKE_FUNC, NDB_NOTLIKE_FUNC},
+ {NDB_NOTLIKE_FUNC, NDB_LIKE_FUNC},
+ {NDB_NOT_FUNC, NDB_UNSUPPORTED_FUNC},
+ {NDB_UNKNOWN_FUNC, NDB_UNSUPPORTED_FUNC},
+ {NDB_COND_AND_FUNC, NDB_UNSUPPORTED_FUNC},
+ {NDB_COND_OR_FUNC, NDB_UNSUPPORTED_FUNC},
+ {NDB_UNSUPPORTED_FUNC, NDB_UNSUPPORTED_FUNC}
};
/*
@@ -162,14 +188,14 @@
Ndb_item(Item_func::Functype func_type, const Item *item_value)
: type(NDB_FUNCTION)
{
- qualification.function_type= func_type;
+ qualification.function_type= item_func_to_ndb_func(func_type);
value.item= item_value;
value.arg_count= ((Item_func *) item_value)->argument_count();
};
Ndb_item(Item_func::Functype func_type, uint no_args)
: type(NDB_FUNCTION)
{
- qualification.function_type= func_type;
+ qualification.function_type= item_func_to_ndb_func(func_type);
value.arg_count= no_args;
};
~Ndb_item()
@@ -231,13 +257,30 @@
((Item *)item)->save_in_field(field, false);
};
- static Item_func::Functype negate(Item_func::Functype fun)
+ static NDB_FUNC_TYPE item_func_to_ndb_func(Item_func::Functype fun)
+ {
+ switch (fun) {
+ case (Item_func::EQ_FUNC): { return NDB_EQ_FUNC; }
+ case (Item_func::NE_FUNC): { return NDB_NE_FUNC; }
+ case (Item_func::LT_FUNC): { return NDB_LT_FUNC; }
+ case (Item_func::LE_FUNC): { return NDB_LE_FUNC; }
+ case (Item_func::GT_FUNC): { return NDB_GT_FUNC; }
+ case (Item_func::GE_FUNC): { return NDB_GE_FUNC; }
+ case (Item_func::ISNULL_FUNC): { return NDB_ISNULL_FUNC; }
+ case (Item_func::ISNOTNULL_FUNC): { return NDB_ISNOTNULL_FUNC; }
+ case (Item_func::LIKE_FUNC): { return NDB_LIKE_FUNC; }
+ case (Item_func::NOT_FUNC): { return NDB_NOT_FUNC; }
+ case (Item_func::UNKNOWN_FUNC): { return NDB_UNKNOWN_FUNC; }
+ case (Item_func::COND_AND_FUNC): { return NDB_COND_AND_FUNC; }
+ case (Item_func::COND_OR_FUNC): { return NDB_COND_OR_FUNC; }
+ default: { return NDB_UNSUPPORTED_FUNC; }
+ }
+ };
+
+ static NDB_FUNC_TYPE negate(NDB_FUNC_TYPE fun)
{
- uint i;
- for (i=0;
- fun != neg_map[i].pos_fun &&
- neg_map[i].pos_fun != Item_func::UNKNOWN_FUNC;
- i++);
+ uint i= (uint) fun;
+ DBUG_ASSERT(fun == neg_map[i].pos_fun);
return neg_map[i].neg_fun;
};
--- 1.101/sql/ha_innodb.h 2005-07-26 15:05:00 +02:00
+++ 1.102/sql/ha_innodb.h 2005-08-08 22:21:37 +02:00
@@ -314,7 +314,7 @@
int innobase_rollback_by_xid(
/* out: 0 or error number */
- XID *xid); /* in : X/Open XA Transaction Idenfification */
+ XID *xid); /* in : X/Open XA Transaction Identification */
int innobase_xa_end(THD *thd);
@@ -322,3 +322,35 @@
int innobase_repl_report_sent_binlog(THD *thd, char *log_file_name,
my_off_t end_offset);
+
+/***********************************************************************
+Create a consistent view for a cursor based on current transaction
+which is created if the corresponding MySQL thread still lacks one.
+This consistent view is then used inside of MySQL when accessing records
+using a cursor. */
+
+void*
+innobase_create_cursor_view(void);
+/*=============================*/
+ /* out: Pointer to cursor view or NULL */
+
+/***********************************************************************
+Close the given consistent cursor view of a transaction and restore
+global read view to a transaction read view. Transaction is created if the
+corresponding MySQL thread still lacks one. */
+
+void
+innobase_close_cursor_view(
+/*=======================*/
+ void* curview); /* in: Consistent read view to be closed */
+
+/***********************************************************************
+Set the given consistent cursor view to a transaction which is created
+if the corresponding MySQL thread still lacks one. If the given
+consistent cursor view is NULL global read view of a transaction is
+restored to a transaction read view. */
+
+void
+innobase_set_cursor_view(
+/*=====================*/
+ void* curview); /* in: Consistent read view to be closed */
--- 1.3/mysql-test/t/ndb_partition_key.test 2005-07-26 16:15:22 +02:00
+++ 1.4/mysql-test/t/ndb_partition_key.test 2005-08-08 22:21:37 +02:00
@@ -23,7 +23,7 @@
drop table t1;
# only support for partition key on primary key
---error 1460
+--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b))
ENGINE = NDB
PARTITION BY KEY (c);
--- 1.18/storage/ndb/tools/Makefile.am 2005-07-25 10:18:12 +02:00
+++ 1.19/storage/ndb/tools/Makefile.am 2005-08-08 22:21:37 +02:00
@@ -33,7 +33,7 @@
restore/Restore.cpp \
../test/src/NDBT_ResultRow.cpp $(tools_common_sources)
-ndb_config_SOURCES = config.cpp \
+ndb_config_SOURCES = ndb_condig.cpp \
../src/mgmsrv/Config.cpp \
../src/mgmsrv/ConfigInfo.cpp \
../src/mgmsrv/InitConfigFileParser.cpp
| Thread |
|---|
| • bk commit into 5.1 tree (joreland:1.1870) | jonas.oreland | 8 Aug |