~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/info_schema/key_column_usage.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:
71
71
                                            DRIZZLE_TYPE_VARCHAR,
72
72
                                            0,
73
73
                                            1,
74
 
                                            "",
75
 
                                            OPEN_FULL_TABLE));
 
74
                                            ""));
76
75
 
77
76
  columns->push_back(new plugin::ColumnInfo("CONSTRAINT_SCHEMA",
78
77
                                            NAME_CHAR_LEN,
79
78
                                            DRIZZLE_TYPE_VARCHAR,
80
79
                                            0,
81
80
                                            0,
82
 
                                            "",
83
 
                                            OPEN_FULL_TABLE));
 
81
                                            ""));
84
82
 
85
83
  columns->push_back(new plugin::ColumnInfo("CONSTRAINT_NAME",
86
84
                                            NAME_CHAR_LEN,
87
85
                                            DRIZZLE_TYPE_VARCHAR,
88
86
                                            0,
89
87
                                            0,
90
 
                                            "",
91
 
                                            OPEN_FULL_TABLE));
 
88
                                            ""));
92
89
 
93
90
  columns->push_back(new plugin::ColumnInfo("TABLE_CATALOG",
94
91
                                            FN_REFLEN,
95
92
                                            DRIZZLE_TYPE_VARCHAR,
96
93
                                            0,
97
94
                                            1,
98
 
                                            "",
99
 
                                            OPEN_FULL_TABLE));
 
95
                                            ""));
100
96
 
101
97
  columns->push_back(new plugin::ColumnInfo("TABLE_SCHEMA",
102
98
                                            NAME_CHAR_LEN,
103
99
                                            DRIZZLE_TYPE_VARCHAR,
104
100
                                            0,
105
101
                                            0,
106
 
                                            "",
107
 
                                            OPEN_FULL_TABLE));
 
102
                                            ""));
108
103
 
109
104
  columns->push_back(new plugin::ColumnInfo("TABLE_NAME",
110
105
                                            NAME_CHAR_LEN,
111
106
                                            DRIZZLE_TYPE_VARCHAR,
112
107
                                            0,
113
108
                                            0,
114
 
                                            "",
115
 
                                            OPEN_FULL_TABLE));
 
109
                                            ""));
116
110
 
117
111
  columns->push_back(new plugin::ColumnInfo("COLUMN_NAME",
118
112
                                            NAME_CHAR_LEN,
119
113
                                            DRIZZLE_TYPE_VARCHAR,
120
114
                                            0,
121
115
                                            0,
122
 
                                            "",
123
 
                                            OPEN_FULL_TABLE));
 
116
                                            ""));
124
117
 
125
118
  columns->push_back(new plugin::ColumnInfo("ORDINAL_POSITION",
126
119
                                            10,
127
120
                                            DRIZZLE_TYPE_LONGLONG,
128
121
                                            0,
129
122
                                            0,
130
 
                                            "",
131
 
                                            OPEN_FULL_TABLE));
 
123
                                            ""));
132
124
 
133
125
  columns->push_back(new plugin::ColumnInfo("POSITION_IN_UNIQUE_CONSTRAINT",
134
126
                                            10,
135
127
                                            DRIZZLE_TYPE_LONGLONG,
136
128
                                            0,
137
129
                                            1,
138
 
                                            "",
139
 
                                            OPEN_FULL_TABLE));
 
130
                                            ""));
140
131
 
141
132
  columns->push_back(new plugin::ColumnInfo("REFERENCED_TABLE_SCHEMA",
142
133
                                            NAME_CHAR_LEN,
143
134
                                            DRIZZLE_TYPE_VARCHAR,
144
135
                                            0,
145
136
                                            1,
146
 
                                            "",
147
 
                                            OPEN_FULL_TABLE));
 
137
                                            ""));
148
138
 
149
139
  columns->push_back(new plugin::ColumnInfo("REFERENCED_TABLE_NAME",
150
140
                                            NAME_CHAR_LEN,
151
141
                                            DRIZZLE_TYPE_VARCHAR,
152
142
                                            0,
153
143
                                            1,
154
 
                                            "",
155
 
                                            OPEN_FULL_TABLE));
 
144
                                            ""));
156
145
 
157
146
  columns->push_back(new plugin::ColumnInfo("REFERENCED_COLUMN_NAME",
158
147
                                            NAME_CHAR_LEN,
159
148
                                            DRIZZLE_TYPE_VARCHAR,
160
149
                                            0,
161
150
                                            1,
162
 
                                            "",
163
 
                                            OPEN_FULL_TABLE));
 
151
                                            ""));
164
152
 
165
153
  return columns;
166
154
}
202
190
  delete columns;
203
191
}
204
192
 
205
 
int KeyColUsageISMethods::processTable(Session *session,
 
193
int KeyColUsageISMethods::processTable(plugin::InfoSchemaTable *store_table,
 
194
                                       Session *session,
206
195
                                       TableList *tables,
207
196
                                       Table *table, bool res,
208
197
                                       LEX_STRING *db_name,
209
 
                                       LEX_STRING *table_name) const
 
198
                                       LEX_STRING *table_name)
210
199
{
211
200
  if (res)
212
201
  {
245
234
                                 key_part->field->field_name,
246
235
                                 strlen(key_part->field->field_name),
247
236
                                 (int64_t) f_idx);
248
 
          if (schema_table_store_record(session, table))
249
 
          {
250
 
            return (1);
251
 
          }
 
237
          store_table->addRow(table->record[0],
 
238
                                       table->s->reclength);
252
239
        }
253
240
      }
254
241
    }
273
260
                               f_key_info->forein_id->length,
274
261
                               f_info->str, f_info->length,
275
262
                               (int64_t) f_idx);
 
263
        table->setWriteSet(8);
 
264
        table->setWriteSet(9);
 
265
        table->setWriteSet(10);
 
266
        table->setWriteSet(11);
276
267
        table->field[8]->store((int64_t) f_idx, true);
277
268
        table->field[8]->set_notnull();
278
269
        table->field[9]->store(f_key_info->referenced_db->str,
286
277
        table->field[11]->store(r_info->str, r_info->length,
287
278
                                system_charset_info);
288
279
        table->field[11]->set_notnull();
289
 
        if (schema_table_store_record(session, table))
290
 
        {
291
 
          return (1);
292
 
        }
 
280
        store_table->addRow(table->record[0], table->s->reclength);
293
281
      }
294
282
    }
295
283
  }