~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/table_writer.cc

  • Committer: Brian Aker
  • Date: 2010-10-28 17:12:01 UTC
  • mfrom: (1887.1.3 merge)
  • Revision ID: brian@tangent.org-20101028171201-baj6l1bnntn1s4ad
Merge in POTFILES changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
125
125
    field->set_name(buffer);
126
126
    field->set_type(message::Table::Field::VARCHAR);
127
127
 
128
 
    field_constraints->set_is_notnull((x % 2));
 
128
    field_constraints->set_is_nullable((x % 2));
129
129
 
130
130
    string_field_options->set_length(rand() % 100);
131
131
 
166
166
    field->set_type(message::Table::Field::DECIMAL);
167
167
 
168
168
    field_constraints= field->mutable_constraints();
169
 
    field_constraints->set_is_notnull(false);
 
169
    field_constraints->set_is_nullable(true);
170
170
 
171
171
    numeric_field_options= field->mutable_numeric_options();
172
172
    numeric_field_options->set_precision(8);
203
203
  message::Table::TableOptions *tableopts;
204
204
 
205
205
  table->set_name("t1");
206
 
  table->set_catalog("LOCAL");
207
206
  table->set_type(message::Table::INTERNAL);
208
207
 
209
208
  tableopts= table->mutable_options();
264
263
 
265
264
  fstream output(vm["table-name"].as<string>().c_str(),
266
265
                 ios::out | ios::trunc | ios::binary);
267
 
  if (not table.SerializeToOstream(&output))
 
266
  if (!table.SerializeToOstream(&output))
268
267
  {
269
268
    cerr << "Failed to write schema." << endl;
270
269
    return -1;