~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_proto_write.cc

  • Committer: Brian Aker
  • Date: 2009-04-28 00:17:10 UTC
  • mto: This revision was merged to the branch mainline in revision 999.
  • Revision ID: brian@gaz-20090428001710-gb4v06c9q6j096pk
First pass on removing virt columns

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#include <drizzled/server_includes.h>
17
17
#include <drizzled/error.h>
18
 
#include <drizzled/virtual_column_info.h>
19
18
#include <drizzled/session.h>
20
19
#include <drizzled/unireg.h>
21
20
 
174
173
      assert(0); /* Tell us, since this shouldn't happend */
175
174
    }
176
175
 
177
 
    if(field_arg->vcol_info)
178
 
    {
179
 
      uint32_t tmp_len;
180
 
      tmp_len= system_charset_info->cset->charpos(system_charset_info,
181
 
                                          field_arg->vcol_info->expr_str.str,
182
 
                                          field_arg->vcol_info->expr_str.str +
183
 
                                          field_arg->vcol_info->expr_str.length,
184
 
                                          VIRTUAL_COLUMN_EXPRESSION_MAXLEN);
185
 
 
186
 
      if (tmp_len < field_arg->vcol_info->expr_str.length)
187
 
      {
188
 
        my_error(ER_WRONG_STRING_LENGTH, MYF(0),
189
 
                 field_arg->vcol_info->expr_str.str,"VIRTUAL COLUMN EXPRESSION",
190
 
                 (uint32_t) VIRTUAL_COLUMN_EXPRESSION_MAXLEN);
191
 
        return(1);
192
 
      }
193
 
 
194
 
      drizzled::message::Table::Field::VirtualFieldOptions *field_options;
195
 
 
196
 
      field_options= attribute->mutable_virtual_options();
197
 
 
198
 
      field_options->set_type(attribute->type());
199
 
      attribute->set_type(drizzled::message::Table::Field::VIRTUAL);
200
 
 
201
 
      string expr(field_arg->vcol_info->expr_str.str,
202
 
                  field_arg->vcol_info->expr_str.length);
203
 
 
204
 
      field_options->set_expression(expr);
205
 
      field_options->set_physically_stored(field_arg->is_stored);
206
 
    }
207
 
 
208
176
#ifdef NOTDONE
209
177
    field_constraints= attribute->mutable_constraints();
210
178
    constraints->set_is_nullable(field_arg->def->null_value);