Commit c216278a authored by mskold@mysql.com's avatar mskold@mysql.com

Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/usr/local/home/marty/MySQL/mysql-5.0
parents 65170a23 66f881a8
...@@ -764,7 +764,7 @@ Ndb::getAutoIncrementValue(const char* aTableName, Uint32 cacheSize) ...@@ -764,7 +764,7 @@ Ndb::getAutoIncrementValue(const char* aTableName, Uint32 cacheSize)
DBUG_RETURN(~(Uint64)0); DBUG_RETURN(~(Uint64)0);
const NdbTableImpl *table= info->m_table_impl; const NdbTableImpl *table= info->m_table_impl;
Uint64 tupleId = getTupleIdFromNdb(table->m_tableId, cacheSize); Uint64 tupleId = getTupleIdFromNdb(table->m_tableId, cacheSize);
DBUG_PRINT("info", ("value %u", tupleId)); DBUG_PRINT("info", ("value %ul", (ulong) tupleId));
DBUG_RETURN(tupleId); DBUG_RETURN(tupleId);
} }
...@@ -776,7 +776,7 @@ Ndb::getAutoIncrementValue(const NdbDictionary::Table * aTable, Uint32 cacheSize ...@@ -776,7 +776,7 @@ Ndb::getAutoIncrementValue(const NdbDictionary::Table * aTable, Uint32 cacheSize
DBUG_RETURN(~(Uint64)0); DBUG_RETURN(~(Uint64)0);
const NdbTableImpl* table = & NdbTableImpl::getImpl(*aTable); const NdbTableImpl* table = & NdbTableImpl::getImpl(*aTable);
Uint64 tupleId = getTupleIdFromNdb(table->m_tableId, cacheSize); Uint64 tupleId = getTupleIdFromNdb(table->m_tableId, cacheSize);
DBUG_PRINT("info", ("value %u", tupleId)); DBUG_PRINT("info", ("value %ul", (ulong) tupleId));
DBUG_RETURN(tupleId); DBUG_RETURN(tupleId);
} }
...@@ -796,7 +796,8 @@ Ndb::getTupleIdFromNdb(Uint32 aTableId, Uint32 cacheSize) ...@@ -796,7 +796,8 @@ Ndb::getTupleIdFromNdb(Uint32 aTableId, Uint32 cacheSize)
if ( theFirstTupleId[aTableId] != theLastTupleId[aTableId] ) if ( theFirstTupleId[aTableId] != theLastTupleId[aTableId] )
{ {
theFirstTupleId[aTableId]++; theFirstTupleId[aTableId]++;
DBUG_PRINT("info", ("next cached value %u", theFirstTupleId[aTableId])); DBUG_PRINT("info", ("next cached value %ul",
(ulong) theFirstTupleId[aTableId]));
DBUG_RETURN(theFirstTupleId[aTableId]); DBUG_RETURN(theFirstTupleId[aTableId]);
} }
else // theFirstTupleId == theLastTupleId else // theFirstTupleId == theLastTupleId
...@@ -817,7 +818,7 @@ Ndb::readAutoIncrementValue(const char* aTableName) ...@@ -817,7 +818,7 @@ Ndb::readAutoIncrementValue(const char* aTableName)
DBUG_RETURN(~(Uint64)0); DBUG_RETURN(~(Uint64)0);
} }
Uint64 tupleId = readTupleIdFromNdb(table->m_tableId); Uint64 tupleId = readTupleIdFromNdb(table->m_tableId);
DBUG_PRINT("info", ("value %u", tupleId)); DBUG_PRINT("info", ("value %ul", (ulong) tupleId));
DBUG_RETURN(tupleId); DBUG_RETURN(tupleId);
} }
...@@ -829,7 +830,7 @@ Ndb::readAutoIncrementValue(const NdbDictionary::Table * aTable) ...@@ -829,7 +830,7 @@ Ndb::readAutoIncrementValue(const NdbDictionary::Table * aTable)
DBUG_RETURN(~(Uint64)0); DBUG_RETURN(~(Uint64)0);
const NdbTableImpl* table = & NdbTableImpl::getImpl(*aTable); const NdbTableImpl* table = & NdbTableImpl::getImpl(*aTable);
Uint64 tupleId = readTupleIdFromNdb(table->m_tableId); Uint64 tupleId = readTupleIdFromNdb(table->m_tableId);
DBUG_PRINT("info", ("value %u", tupleId)); DBUG_PRINT("info", ("value %ul", (ulong) tupleId));
DBUG_RETURN(tupleId); DBUG_RETURN(tupleId);
} }
......
...@@ -3050,8 +3050,10 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows) ...@@ -3050,8 +3050,10 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows)
m_rows_inserted= (ha_rows) 0; m_rows_inserted= (ha_rows) 0;
if (rows == (ha_rows) 0) if (rows == (ha_rows) 0)
{
/* We don't know how many will be inserted, guess */ /* We don't know how many will be inserted, guess */
m_rows_to_insert= m_autoincrement_prefetch; m_rows_to_insert= m_autoincrement_prefetch;
}
else else
m_rows_to_insert= rows; m_rows_to_insert= rows;
...@@ -4174,8 +4176,10 @@ ulonglong ha_ndbcluster::get_auto_increment() ...@@ -4174,8 +4176,10 @@ ulonglong ha_ndbcluster::get_auto_increment()
Ndb *ndb= get_ndb(); Ndb *ndb= get_ndb();
if (m_rows_inserted > m_rows_to_insert) if (m_rows_inserted > m_rows_to_insert)
{
/* We guessed too low */ /* We guessed too low */
m_rows_to_insert+= m_autoincrement_prefetch; m_rows_to_insert+= m_autoincrement_prefetch;
}
cache_size= cache_size=
(int) (int)
(m_rows_to_insert - m_rows_inserted < m_autoincrement_prefetch) ? (m_rows_to_insert - m_rows_inserted < m_autoincrement_prefetch) ?
...@@ -6101,8 +6105,8 @@ const ...@@ -6101,8 +6105,8 @@ const
COND* COND*
ha_ndbcluster::cond_push(const COND *cond) ha_ndbcluster::cond_push(const COND *cond)
{ {
Ndb_cond_stack *ndb_cond = new Ndb_cond_stack();
DBUG_ENTER("cond_push"); DBUG_ENTER("cond_push");
Ndb_cond_stack *ndb_cond = new Ndb_cond_stack();
DBUG_EXECUTE("where",print_where((COND *)cond, m_tabname);); DBUG_EXECUTE("where",print_where((COND *)cond, m_tabname););
if (m_cond_stack) if (m_cond_stack)
ndb_cond->next= m_cond_stack; ndb_cond->next= m_cond_stack;
...@@ -6118,7 +6122,6 @@ ha_ndbcluster::cond_push(const COND *cond) ...@@ -6118,7 +6122,6 @@ ha_ndbcluster::cond_push(const COND *cond)
{ {
cond_pop(); cond_pop();
} }
DBUG_RETURN(cond); DBUG_RETURN(cond);
} }
......
...@@ -5403,10 +5403,15 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) ...@@ -5403,10 +5403,15 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
tab->select_cond=sel->cond=tmp; tab->select_cond=sel->cond=tmp;
if (thd->variables.engine_condition_pushdown) if (thd->variables.engine_condition_pushdown)
{ {
COND *push_cond=
make_cond_for_table(cond,current_map,current_map);
tab->table->file->pushed_cond= NULL; tab->table->file->pushed_cond= NULL;
if (push_cond)
{
/* Push condition to handler */ /* Push condition to handler */
if (!tab->table->file->cond_push(tmp)) if (!tab->table->file->cond_push(push_cond))
tab->table->file->pushed_cond= tmp; tab->table->file->pushed_cond= push_cond;
}
} }
} }
else else
...@@ -5530,13 +5535,6 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) ...@@ -5530,13 +5535,6 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
thd->memdup((gptr) sel, sizeof(SQL_SELECT)); thd->memdup((gptr) sel, sizeof(SQL_SELECT));
tab->cache.select->cond=tmp; tab->cache.select->cond=tmp;
tab->cache.select->read_tables=join->const_table_map; tab->cache.select->read_tables=join->const_table_map;
if (thd->variables.engine_condition_pushdown &&
(!tab->table->file->pushed_cond))
{
/* Push condition to handler */
if (!tab->table->file->cond_push(tmp))
tab->table->file->pushed_cond= tmp;
}
} }
} }
} }
......
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