mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge
This commit is contained in:
@@ -259,17 +259,16 @@ static int ndb_to_mysql_error(const NdbError *ndberr)
|
||||
|
||||
int execute_no_commit_ignore_no_key(ha_ndbcluster *h, NdbTransaction *trans)
|
||||
{
|
||||
int res= trans->execute(NdbTransaction::NoCommit,
|
||||
NdbOperation::AO_IgnoreError,
|
||||
h->m_force_send);
|
||||
if (res == -1)
|
||||
if (trans->execute(NdbTransaction::NoCommit,
|
||||
NdbOperation::AO_IgnoreError,
|
||||
h->m_force_send) == -1)
|
||||
return -1;
|
||||
|
||||
const NdbError &err= trans->getNdbError();
|
||||
if (err.classification != NdbError::NoError &&
|
||||
err.classification != NdbError::ConstraintViolation &&
|
||||
err.classification != NdbError::NoDataFound)
|
||||
return res;
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2765,10 +2764,12 @@ int ha_ndbcluster::write_row(byte *record)
|
||||
{
|
||||
Ndb *ndb= get_ndb();
|
||||
Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1;
|
||||
#ifndef DBUG_OFF
|
||||
char buff[22];
|
||||
DBUG_PRINT("info",
|
||||
("Trying to set next auto increment value to %s",
|
||||
llstr(next_val, buff)));
|
||||
#endif
|
||||
Ndb_tuple_id_range_guard g(m_share);
|
||||
if (ndb->setAutoIncrementValue(m_table, g.range, next_val, TRUE)
|
||||
== -1)
|
||||
@@ -2821,7 +2822,7 @@ int ha_ndbcluster::key_cmp(uint keynr, const byte * old_row,
|
||||
|
||||
int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
THD *thd= table->in_use;
|
||||
NdbTransaction *trans= m_active_trans;
|
||||
NdbScanOperation* cursor= m_active_cursor;
|
||||
NdbOperation *op;
|
||||
@@ -3008,7 +3009,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
|
||||
|
||||
int ha_ndbcluster::delete_row(const byte *record)
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
THD *thd= table->in_use;
|
||||
NdbTransaction *trans= m_active_trans;
|
||||
NdbScanOperation* cursor= m_active_cursor;
|
||||
NdbOperation *op;
|
||||
@@ -3811,7 +3812,7 @@ int ha_ndbcluster::info(uint flag)
|
||||
if (flag & HA_STATUS_AUTO)
|
||||
{
|
||||
DBUG_PRINT("info", ("HA_STATUS_AUTO"));
|
||||
if (m_table)
|
||||
if (m_table && table->found_next_number_field)
|
||||
{
|
||||
Ndb *ndb= get_ndb();
|
||||
Ndb_tuple_id_range_guard g(m_share);
|
||||
@@ -4000,7 +4001,7 @@ int ha_ndbcluster::end_bulk_insert()
|
||||
}
|
||||
else
|
||||
{
|
||||
int res= trans->restart();
|
||||
IF_DBUG(int res=) trans->restart();
|
||||
DBUG_ASSERT(res == 0);
|
||||
}
|
||||
}
|
||||
@@ -4718,7 +4719,9 @@ static int create_ndb_column(NDBCOL &col,
|
||||
// Set autoincrement
|
||||
if (field->flags & AUTO_INCREMENT_FLAG)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
char buff[22];
|
||||
#endif
|
||||
col.setAutoIncrement(TRUE);
|
||||
ulonglong value= info->auto_increment_value ?
|
||||
info->auto_increment_value : (ulonglong) 1;
|
||||
@@ -5389,7 +5392,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
|
||||
{
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary use_count: %u",
|
||||
share->key, share->use_count));
|
||||
int r= rename_share(share, to);
|
||||
IF_DBUG(int r=) rename_share(share, to);
|
||||
DBUG_ASSERT(r == 0);
|
||||
}
|
||||
#endif
|
||||
@@ -5410,8 +5413,8 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
if (share)
|
||||
{
|
||||
int r= rename_share(share, from);
|
||||
DBUG_ASSERT(r == 0);
|
||||
IF_DBUG(int ret=) rename_share(share, from);
|
||||
DBUG_ASSERT(ret == 0);
|
||||
/* ndb_share reference temporary free */
|
||||
DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u",
|
||||
share->key, share->use_count));
|
||||
@@ -6017,7 +6020,7 @@ void ha_ndbcluster::set_part_info(partition_info *part_info)
|
||||
int ha_ndbcluster::close(void)
|
||||
{
|
||||
DBUG_ENTER("close");
|
||||
THD *thd= current_thd;
|
||||
THD *thd= table->in_use;
|
||||
Ndb *ndb= thd ? check_ndb_in_thd(thd) : g_ndb;
|
||||
/* ndb_share reference handler free */
|
||||
DBUG_PRINT("NDB_SHARE", ("%s handler free use_count: %u",
|
||||
@@ -7269,7 +7272,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
if (share->commit_count != 0)
|
||||
{
|
||||
*commit_count= share->commit_count;
|
||||
#ifndef DBUG_OFF
|
||||
char buff[22];
|
||||
#endif
|
||||
DBUG_PRINT("info", ("Getting commit_count: %s from share",
|
||||
llstr(share->commit_count, buff)));
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
@@ -7305,7 +7310,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
|
||||
pthread_mutex_lock(&share->mutex);
|
||||
if (share->commit_count_lock == lock)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
char buff[22];
|
||||
#endif
|
||||
DBUG_PRINT("info", ("Setting commit_count to %s",
|
||||
llstr(stat.commit_count, buff)));
|
||||
share->commit_count= stat.commit_count;
|
||||
@@ -7364,7 +7371,9 @@ ndbcluster_cache_retrieval_allowed(THD *thd,
|
||||
bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
|
||||
char *dbname= full_name;
|
||||
char *tabname= dbname+strlen(dbname)+1;
|
||||
#ifndef DBUG_OFF
|
||||
char buff[22], buff2[22];
|
||||
#endif
|
||||
DBUG_ENTER("ndbcluster_cache_retrieval_allowed");
|
||||
DBUG_PRINT("enter", ("dbname: %s, tabname: %s, is_autocommit: %d",
|
||||
dbname, tabname, is_autocommit));
|
||||
@@ -7431,7 +7440,9 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
|
||||
ulonglong *engine_data)
|
||||
{
|
||||
Uint64 commit_count;
|
||||
#ifndef DBUG_OFF
|
||||
char buff[22];
|
||||
#endif
|
||||
bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
|
||||
DBUG_ENTER("ha_ndbcluster::register_query_cache_table");
|
||||
DBUG_PRINT("enter",("dbname: %s, tabname: %s, is_autocommit: %d",
|
||||
@@ -7876,7 +7887,9 @@ ndb_get_table_statistics(ha_ndbcluster* file, bool report_error, Ndb* ndb, const
|
||||
int retries= 10;
|
||||
int reterr= 0;
|
||||
int retry_sleep= 30 * 1000; /* 30 milliseconds */
|
||||
#ifndef DBUG_OFF
|
||||
char buff[22], buff2[22], buff3[22], buff4[22];
|
||||
#endif
|
||||
DBUG_ENTER("ndb_get_table_statistics");
|
||||
DBUG_PRINT("enter", ("table: %s", ndbtab->getName()));
|
||||
|
||||
@@ -8693,7 +8706,9 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
||||
ndb_get_table_statistics(NULL, FALSE, ndb,
|
||||
ndbtab_g.get_table(), &stat) == 0)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
char buff[22], buff2[22];
|
||||
#endif
|
||||
DBUG_PRINT("info",
|
||||
("Table: %s commit_count: %s rows: %s",
|
||||
share->key,
|
||||
@@ -9051,7 +9066,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
|
||||
Check that the field is part of the table of the handler
|
||||
instance and that we expect a field with of this result type.
|
||||
*/
|
||||
if (context->table == field->table)
|
||||
if (context->table->s == field->table->s)
|
||||
{
|
||||
const NDBTAB *tab= (const NDBTAB *) context->ndb_table;
|
||||
DBUG_PRINT("info", ("FIELD_ITEM"));
|
||||
@@ -9545,8 +9560,8 @@ void ndb_serialize_cond(const Item *item, void *arg)
|
||||
DBUG_PRINT("info", ("INT_ITEM"));
|
||||
if (context->expecting(Item::INT_ITEM))
|
||||
{
|
||||
Item_int *int_item= (Item_int *) item;
|
||||
DBUG_PRINT("info", ("value %ld", (long) int_item->value));
|
||||
DBUG_PRINT("info", ("value %ld",
|
||||
(long) ((Item_int*) item)->value));
|
||||
NDB_ITEM_QUALIFICATION q;
|
||||
q.value_type= Item::INT_ITEM;
|
||||
curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
|
||||
@@ -9572,8 +9587,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
|
||||
DBUG_PRINT("info", ("REAL_ITEM"));
|
||||
if (context->expecting(Item::REAL_ITEM))
|
||||
{
|
||||
Item_float *float_item= (Item_float *) item;
|
||||
DBUG_PRINT("info", ("value %f", float_item->value));
|
||||
DBUG_PRINT("info", ("value %f", ((Item_float*) item)->value));
|
||||
NDB_ITEM_QUALIFICATION q;
|
||||
q.value_type= Item::REAL_ITEM;
|
||||
curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
|
||||
@@ -9620,8 +9634,8 @@ void ndb_serialize_cond(const Item *item, void *arg)
|
||||
DBUG_PRINT("info", ("DECIMAL_ITEM"));
|
||||
if (context->expecting(Item::DECIMAL_ITEM))
|
||||
{
|
||||
Item_decimal *decimal_item= (Item_decimal *) item;
|
||||
DBUG_PRINT("info", ("value %f", decimal_item->val_real()));
|
||||
DBUG_PRINT("info", ("value %f",
|
||||
((Item_decimal*) item)->val_real()));
|
||||
NDB_ITEM_QUALIFICATION q;
|
||||
q.value_type= Item::DECIMAL_ITEM;
|
||||
curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
|
||||
|
Reference in New Issue
Block a user