~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/info_schema/collation.cc

  • Committer: Brian Aker
  • Date: 2009-11-30 19:13:19 UTC
  • mfrom: (1225.1.39 figure)
  • Revision ID: brian@gaz-20091130191319-zyt51fidacic3brf
Merge Padraig

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
                                            DRIZZLE_TYPE_VARCHAR,
75
75
                                            0,
76
76
                                            0,
77
 
                                            "Collation",
78
 
                                            SKIP_OPEN_TABLE));
 
77
                                            "Collation"));
79
78
 
80
79
  columns->push_back(new plugin::ColumnInfo("CHARACTER_SET_NAME",
81
80
                                            64,
82
81
                                            DRIZZLE_TYPE_VARCHAR,
83
82
                                            0,
84
83
                                            0,
85
 
                                            "Default collation",
86
 
                                            SKIP_OPEN_TABLE));
 
84
                                            "Default collation"));
87
85
 
88
86
  columns->push_back(new plugin::ColumnInfo("DESCRIPTION",
89
87
                                            60,
90
88
                                            DRIZZLE_TYPE_VARCHAR,
91
89
                                            0,
92
90
                                            0,
93
 
                                            "Charset",
94
 
                                            SKIP_OPEN_TABLE));
 
91
                                            "Charset"));
95
92
 
96
93
  columns->push_back(new plugin::ColumnInfo("ID",
97
94
                                            MY_INT32_NUM_DECIMAL_DIGITS,
98
95
                                            DRIZZLE_TYPE_LONGLONG,
99
96
                                            0,
100
97
                                            0,
101
 
                                            "Id",
102
 
                                            SKIP_OPEN_TABLE));
 
98
                                            "Id"));
103
99
 
104
100
  columns->push_back(new plugin::ColumnInfo("IS_DEFAULT",
105
101
                                            3,
106
102
                                            DRIZZLE_TYPE_VARCHAR,
107
103
                                            0,
108
104
                                            0,
109
 
                                            "Default",
110
 
                                            SKIP_OPEN_TABLE));
 
105
                                            "Default"));
111
106
 
112
107
  columns->push_back(new plugin::ColumnInfo("IS_COMPILED",
113
108
                                            3,
114
109
                                            DRIZZLE_TYPE_VARCHAR,
115
110
                                            0,
116
111
                                            0,
117
 
                                            "Compiled",
118
 
                                            SKIP_OPEN_TABLE));
 
112
                                            "Compiled"));
119
113
 
120
114
  columns->push_back(new plugin::ColumnInfo("SORTLEN",
121
115
                                            3,
122
116
                                            DRIZZLE_TYPE_LONGLONG,
123
117
                                            0,
124
118
                                            0,
125
 
                                            "Sortlen",
126
 
                                            SKIP_OPEN_TABLE));
 
119
                                            "Sortlen"));
127
120
 
128
121
  return columns;
129
122
}
164
157
  delete columns;
165
158
}
166
159
 
167
 
int CollationISMethods::fillTable(Session *session, TableList *tables)
 
160
int CollationISMethods::fillTable(Session *session, 
 
161
                                  Table *table,
 
162
                                  plugin::InfoSchemaTable *schema_table)
168
163
{
169
164
  CHARSET_INFO **cs;
170
165
  const char *wild= session->lex->wild ? session->lex->wild->ptr() : NULL;
171
 
  Table *table= tables->table;
172
166
  const CHARSET_INFO * const scs= system_charset_info;
173
167
  for (cs= all_charsets ; cs < all_charsets+255 ; cs++ )
174
168
  {
189
183
      {
190
184
        const char *tmp_buff;
191
185
        table->restoreRecordAsDefault();
 
186
        /* set the appropriate bits in the write bitset */
 
187
        table->setWriteSet(0);
 
188
        table->setWriteSet(1);
 
189
        table->setWriteSet(2);
 
190
        table->setWriteSet(3);
 
191
        table->setWriteSet(4);
 
192
        table->setWriteSet(5);
192
193
        table->field[0]->store(tmp_cl->name, strlen(tmp_cl->name), scs);
193
194
        table->field[1]->store(tmp_cl->csname , strlen(tmp_cl->csname), scs);
194
195
        table->field[2]->store((int64_t) tmp_cl->number, true);
197
198
        tmp_buff= (tmp_cl->state & MY_CS_COMPILED)? "Yes" : "";
198
199
        table->field[4]->store(tmp_buff, strlen(tmp_buff), scs);
199
200
        table->field[5]->store((int64_t) tmp_cl->strxfrm_multiply, true);
200
 
        if (schema_table_store_record(session, table))
201
 
          return 1;
 
201
        schema_table->addRow(table->record[0], table->s->reclength);
202
202
      }
203
203
    }
204
204
  }