~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-25 13:36:24 UTC
  • mto: This revision was merged to the branch mainline in revision 2349.
  • Revision ID: olafvdspek@gmail.com-20110625133624-hzy2ordecn161qco
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
  if (value_arg && value_arg->type() == Item::FIELD_ITEM)
95
95
  {
96
96
    Item_field *item= (Item_field*) value_arg;
97
 
    if (!(value=new Item_string(item->field_name,
98
 
                                (uint32_t) strlen(item->field_name),
99
 
                                item->collation.collation)))
100
 
      value=value_arg;                  /* Give error message later */
 
97
    value=new Item_string(item->field_name, (uint32_t) strlen(item->field_name), item->collation.collation);
101
98
  }
102
99
  else
103
100
  {
119
116
    return -1;
120
117
  }
121
118
  /* value is a NULL pointer if we are using SET ... = DEFAULT */
122
 
  if (!value)
 
119
  if (not value)
123
120
  {
124
121
    if (var->check_default(type))
125
122
    {
156
153
{
157
154
  try
158
155
  {
159
 
    if (! value)
 
156
    if (not value)
160
157
      var->set_default(session, type);
161
158
    else if (var->update(session, this))
162
159
      return -1;                                // should never happen