Commit 25b372b3 authored by unknown's avatar unknown

Back-ported compiler warning fixes from 5.1 to ease merging

parent 417eba83
...@@ -270,7 +270,7 @@ void ndb_serialize_cond(const Item *item, void *arg) ...@@ -270,7 +270,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
type == MYSQL_TYPE_DATETIME) type == MYSQL_TYPE_DATETIME)
? (context->expecting_field_result(STRING_RESULT) || ? (context->expecting_field_result(STRING_RESULT) ||
context->expecting_field_result(INT_RESULT)) context->expecting_field_result(INT_RESULT))
: true)) && : TRUE)) &&
// Bit fields no yet supported in scan filter // Bit fields no yet supported in scan filter
type != MYSQL_TYPE_BIT && type != MYSQL_TYPE_BIT &&
// No BLOB support in scan filter // No BLOB support in scan filter
...@@ -350,7 +350,7 @@ void ndb_serialize_cond(const Item *item, void *arg) ...@@ -350,7 +350,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
} }
else else
{ {
DBUG_PRINT("info", ("Was not expecting field from table %s(%s)", DBUG_PRINT("info", ("Was not expecting field from table %s (%s)",
context->table->s->table_name, context->table->s->table_name,
field->table->s->table_name)); field->table->s->table_name));
context->supported= FALSE; context->supported= FALSE;
...@@ -770,7 +770,7 @@ void ndb_serialize_cond(const Item *item, void *arg) ...@@ -770,7 +770,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
DBUG_PRINT("info", ("REAL_ITEM")); DBUG_PRINT("info", ("REAL_ITEM"));
if (context->expecting(Item::REAL_ITEM)) if (context->expecting(Item::REAL_ITEM))
{ {
DBUG_PRINT("info", ("value %f", ((Item_float *) item)->value)); DBUG_PRINT("info", ("value %f", ((Item_float*) item)->value));
NDB_ITEM_QUALIFICATION q; NDB_ITEM_QUALIFICATION q;
q.value_type= Item::REAL_ITEM; q.value_type= Item::REAL_ITEM;
curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
...@@ -990,27 +990,28 @@ ha_ndbcluster_cond::build_scan_filter_predicate(Ndb_cond * &cond, ...@@ -990,27 +990,28 @@ ha_ndbcluster_cond::build_scan_filter_predicate(Ndb_cond * &cond,
break; break;
Ndb_item *a= cond->next->ndb_item; Ndb_item *a= cond->next->ndb_item;
Ndb_item *b, *field, *value= NULL; Ndb_item *b, *field, *value= NULL;
LINT_INIT(field);
switch (cond->ndb_item->argument_count()) { switch (cond->ndb_item->argument_count()) {
case 1: case 1:
field= field= (a->type == NDB_FIELD)? a : NULL;
(a->type == NDB_FIELD)? a : NULL;
break; break;
case 2: case 2:
if (!cond->next->next) if (!cond->next->next)
{
field= NULL;
break; break;
}
b= cond->next->next->ndb_item; b= cond->next->next->ndb_item;
value= value= ((a->type == NDB_VALUE) ? a :
(a->type == NDB_VALUE)? a (b->type == NDB_VALUE) ? b :
: (b->type == NDB_VALUE)? b NULL);
: NULL; field= ((a->type == NDB_FIELD) ? a :
field= (b->type == NDB_FIELD) ? b :
(a->type == NDB_FIELD)? a NULL);
: (b->type == NDB_FIELD)? b
: NULL;
break; break;
default: default:
field= NULL; //Keep compiler happy
DBUG_ASSERT(0);
break; break;
} }
switch ((negated) ? switch ((negated) ?
......
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