1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2009 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
* Contains methods for creating the various columns for
27
#include <drizzled/server_includes.h>
28
#include <drizzled/session.h>
29
#include <drizzled/show.h>
31
#include "info_schema_columns.h"
33
#define LIST_PROCESS_HOST_LEN 64
37
bool createCharSetColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
40
* Create each column for the CHARACTER_SET table.
42
const drizzled::plugin::ColumnInfo *name_col= new(std::nothrow) drizzled::plugin::ColumnInfo("CHARACTER_SET_NAME",
54
const drizzled::plugin::ColumnInfo *collate_col= new(std::nothrow) drizzled::plugin::ColumnInfo("DEFAULT_COLLATE_NAME",
61
if (collate_col == NULL)
66
const drizzled::plugin::ColumnInfo *descrip_col= new(std::nothrow) drizzled::plugin::ColumnInfo("DESCRIPTION",
73
if (descrip_col == NULL)
78
const drizzled::plugin::ColumnInfo *len_col= new(std::nothrow) drizzled::plugin::ColumnInfo("MAXLEN",
80
DRIZZLE_TYPE_LONGLONG,
91
* Add the columns to the vector.
93
cols.push_back(name_col);
94
cols.push_back(collate_col);
95
cols.push_back(descrip_col);
96
cols.push_back(len_col);
101
bool createCollationColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
104
* Create each column for the COLLATION table.
106
const drizzled::plugin::ColumnInfo *name_col= new(std::nothrow) drizzled::plugin::ColumnInfo("COLLATION_NAME",
108
DRIZZLE_TYPE_VARCHAR,
113
if (name_col == NULL)
118
const drizzled::plugin::ColumnInfo *char_set_col= new(std::nothrow) drizzled::plugin::ColumnInfo("CHARACTER_SET_NAME",
120
DRIZZLE_TYPE_VARCHAR,
125
if (char_set_col == NULL)
130
const drizzled::plugin::ColumnInfo *descrip_col= new(std::nothrow) drizzled::plugin::ColumnInfo("DESCRIPTION",
132
DRIZZLE_TYPE_VARCHAR,
137
if (descrip_col == NULL)
142
const drizzled::plugin::ColumnInfo *id_col= new(std::nothrow) drizzled::plugin::ColumnInfo("ID",
143
MY_INT32_NUM_DECIMAL_DIGITS,
144
DRIZZLE_TYPE_LONGLONG,
154
const drizzled::plugin::ColumnInfo *default_col= new(std::nothrow) drizzled::plugin::ColumnInfo("IS_DEFAULT",
156
DRIZZLE_TYPE_VARCHAR,
161
if (default_col == NULL)
166
const drizzled::plugin::ColumnInfo *compiled_col= new(std::nothrow) drizzled::plugin::ColumnInfo("IS_COMPILED",
168
DRIZZLE_TYPE_VARCHAR,
173
if (compiled_col == NULL)
178
const drizzled::plugin::ColumnInfo *sortlen_col= new(std::nothrow) drizzled::plugin::ColumnInfo("SORTLEN",
180
DRIZZLE_TYPE_LONGLONG,
185
if (sortlen_col == NULL)
191
* Add the columns to the vector.
193
cols.push_back(name_col);
194
cols.push_back(char_set_col);
195
cols.push_back(descrip_col);
196
cols.push_back(id_col);
197
cols.push_back(default_col);
198
cols.push_back(compiled_col);
199
cols.push_back(sortlen_col);
204
bool createCollCharSetColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
207
* Create each column for the table.
209
const drizzled::plugin::ColumnInfo *name_col= new(std::nothrow) drizzled::plugin::ColumnInfo("COLLATION_NAME",
211
DRIZZLE_TYPE_VARCHAR,
216
if (name_col == NULL)
221
const drizzled::plugin::ColumnInfo *char_set_col= new(std::nothrow) drizzled::plugin::ColumnInfo("CHARACTER_SET_NAME",
223
DRIZZLE_TYPE_VARCHAR,
228
if (char_set_col == NULL)
234
* Add the columns to the vector.
236
cols.push_back(name_col);
237
cols.push_back(char_set_col);
242
bool createColColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
245
* Create each column for the COLUMNS table.
247
const drizzled::plugin::ColumnInfo *tab_cat= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_CATALOG",
249
DRIZZLE_TYPE_VARCHAR,
259
const drizzled::plugin::ColumnInfo *tab_sch= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_SCHEMA",
261
DRIZZLE_TYPE_VARCHAR,
271
const drizzled::plugin::ColumnInfo *tab_name= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_NAME",
273
DRIZZLE_TYPE_VARCHAR,
278
if (tab_name == NULL)
283
const drizzled::plugin::ColumnInfo *col_name= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_NAME",
285
DRIZZLE_TYPE_VARCHAR,
290
if (col_name == NULL)
295
const drizzled::plugin::ColumnInfo *ord_pos= new(std::nothrow) drizzled::plugin::ColumnInfo("ORDINAL_POSITION",
296
MY_INT64_NUM_DECIMAL_DIGITS,
297
DRIZZLE_TYPE_LONGLONG,
307
const drizzled::plugin::ColumnInfo *col_def= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_DEFAULT",
308
MAX_FIELD_VARCHARLENGTH,
309
DRIZZLE_TYPE_VARCHAR,
319
const drizzled::plugin::ColumnInfo *is_nullable= new(std::nothrow) drizzled::plugin::ColumnInfo("IS_NULLABLE",
321
DRIZZLE_TYPE_VARCHAR,
326
if (is_nullable == NULL)
331
const drizzled::plugin::ColumnInfo *data_type= new(std::nothrow) drizzled::plugin::ColumnInfo("DATA_TYPE",
333
DRIZZLE_TYPE_VARCHAR,
338
if (data_type == NULL)
343
const drizzled::plugin::ColumnInfo *max_len= new(std::nothrow) drizzled::plugin::ColumnInfo("CHARACTER_MAXIMUM_LENGTH",
344
MY_INT64_NUM_DECIMAL_DIGITS,
345
DRIZZLE_TYPE_LONGLONG,
347
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
355
const drizzled::plugin::ColumnInfo *octet_len= new(std::nothrow) drizzled::plugin::ColumnInfo("CHARACTER_OCTET_LENGTH",
356
MY_INT64_NUM_DECIMAL_DIGITS,
357
DRIZZLE_TYPE_LONGLONG,
359
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
362
if (octet_len == NULL)
367
const drizzled::plugin::ColumnInfo *num_prec= new(std::nothrow) drizzled::plugin::ColumnInfo("NUMERIC_PRECISION",
368
MY_INT64_NUM_DECIMAL_DIGITS,
369
DRIZZLE_TYPE_LONGLONG,
371
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
374
if (num_prec == NULL)
379
const drizzled::plugin::ColumnInfo *num_scale= new(std::nothrow) drizzled::plugin::ColumnInfo("NUMERIC_SCALE",
380
MY_INT64_NUM_DECIMAL_DIGITS,
381
DRIZZLE_TYPE_LONGLONG,
383
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
386
if (num_scale == NULL)
391
const drizzled::plugin::ColumnInfo *char_set_name= new(std::nothrow) drizzled::plugin::ColumnInfo("CHARACTER_SET_NAME",
393
DRIZZLE_TYPE_VARCHAR,
398
if (char_set_name == NULL)
403
const drizzled::plugin::ColumnInfo *coll_name= new(std::nothrow) drizzled::plugin::ColumnInfo("COLLATION_NAME",
405
DRIZZLE_TYPE_VARCHAR,
410
if (coll_name == NULL)
415
const drizzled::plugin::ColumnInfo *col_type= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_TYPE",
417
DRIZZLE_TYPE_VARCHAR,
422
if (col_type == NULL)
427
const drizzled::plugin::ColumnInfo *col_key= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_KEY",
429
DRIZZLE_TYPE_VARCHAR,
439
const drizzled::plugin::ColumnInfo *extra= new(std::nothrow) drizzled::plugin::ColumnInfo("EXTRA",
441
DRIZZLE_TYPE_VARCHAR,
451
const drizzled::plugin::ColumnInfo *priv= new(std::nothrow) drizzled::plugin::ColumnInfo("PRIVILEGES",
453
DRIZZLE_TYPE_VARCHAR,
463
const drizzled::plugin::ColumnInfo *col_comment= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_COMMENT",
464
COLUMN_COMMENT_MAXLEN,
465
DRIZZLE_TYPE_VARCHAR,
470
if (col_comment == NULL)
475
const drizzled::plugin::ColumnInfo *storage= new(std::nothrow) drizzled::plugin::ColumnInfo("STORAGE",
477
DRIZZLE_TYPE_VARCHAR,
487
const drizzled::plugin::ColumnInfo *format= new(std::nothrow) drizzled::plugin::ColumnInfo("FORMAT",
489
DRIZZLE_TYPE_VARCHAR,
500
* Add the columns to the vector.
502
cols.push_back(tab_cat);
503
cols.push_back(tab_sch);
504
cols.push_back(tab_name);
505
cols.push_back(col_name);
506
cols.push_back(ord_pos);
507
cols.push_back(col_def);
508
cols.push_back(is_nullable);
509
cols.push_back(data_type);
510
cols.push_back(max_len);
511
cols.push_back(octet_len);
512
cols.push_back(num_prec);
513
cols.push_back(num_scale);
514
cols.push_back(char_set_name);
515
cols.push_back(coll_name);
516
cols.push_back(col_type);
517
cols.push_back(col_key);
518
cols.push_back(extra);
519
cols.push_back(priv);
520
cols.push_back(col_comment);
521
cols.push_back(storage);
522
cols.push_back(format);
527
bool createKeyColUsageColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
529
const drizzled::plugin::ColumnInfo *cat= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_CATALOG",
531
DRIZZLE_TYPE_VARCHAR,
541
const drizzled::plugin::ColumnInfo *sch= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_SCHEMA",
543
DRIZZLE_TYPE_VARCHAR,
553
const drizzled::plugin::ColumnInfo *name= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_NAME",
555
DRIZZLE_TYPE_VARCHAR,
565
const drizzled::plugin::ColumnInfo *tab_cat= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_CATALOG",
567
DRIZZLE_TYPE_VARCHAR,
577
const drizzled::plugin::ColumnInfo *tab_sch= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_SCHEMA",
579
DRIZZLE_TYPE_VARCHAR,
589
const drizzled::plugin::ColumnInfo *tab_name= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_NAME",
591
DRIZZLE_TYPE_VARCHAR,
596
if (tab_name == NULL)
601
const drizzled::plugin::ColumnInfo *col_name= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_NAME",
603
DRIZZLE_TYPE_VARCHAR,
608
if (col_name == NULL)
612
const drizzled::plugin::ColumnInfo *ord_pos= new(std::nothrow) drizzled::plugin::ColumnInfo("ORDINAL_POSITION",
614
DRIZZLE_TYPE_LONGLONG,
624
const drizzled::plugin::ColumnInfo *pos_in_uniq= new(std::nothrow) drizzled::plugin::ColumnInfo("POSITION_IN_UNIQUE_CONSTRAINT",
626
DRIZZLE_TYPE_LONGLONG,
631
if (pos_in_uniq == NULL)
636
const drizzled::plugin::ColumnInfo *ref_tab_sch= new(std::nothrow) drizzled::plugin::ColumnInfo("REFERENCED_TABLE_SCHEMA",
638
DRIZZLE_TYPE_VARCHAR,
643
if (ref_tab_sch == NULL)
648
const drizzled::plugin::ColumnInfo *ref_tab_name= new(std::nothrow) drizzled::plugin::ColumnInfo("REFERENCED_TABLE_NAME",
650
DRIZZLE_TYPE_VARCHAR,
655
if (ref_tab_name == NULL)
660
const drizzled::plugin::ColumnInfo *ref_col_name= new(std::nothrow) drizzled::plugin::ColumnInfo("REFERENCED_COLUMN_NAME",
662
DRIZZLE_TYPE_VARCHAR,
667
if (ref_col_name == NULL)
674
cols.push_back(name);
675
cols.push_back(tab_cat);
676
cols.push_back(tab_sch);
677
cols.push_back(tab_name);
678
cols.push_back(col_name);
679
cols.push_back(ord_pos);
680
cols.push_back(pos_in_uniq);
681
cols.push_back(ref_tab_sch);
682
cols.push_back(ref_tab_name);
683
cols.push_back(ref_col_name);
688
bool createOpenTabColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
690
const drizzled::plugin::ColumnInfo *db= new(std::nothrow) drizzled::plugin::ColumnInfo("Database",
692
DRIZZLE_TYPE_VARCHAR,
702
const drizzled::plugin::ColumnInfo *tab= new(std::nothrow) drizzled::plugin::ColumnInfo("Table",
704
DRIZZLE_TYPE_VARCHAR,
714
const drizzled::plugin::ColumnInfo *in_use= new(std::nothrow) drizzled::plugin::ColumnInfo("In_use",
716
DRIZZLE_TYPE_LONGLONG,
726
const drizzled::plugin::ColumnInfo *name_locked= new(std::nothrow) drizzled::plugin::ColumnInfo("Name_locked",
728
DRIZZLE_TYPE_LONGLONG,
733
if (name_locked == NULL)
740
cols.push_back(in_use);
741
cols.push_back(name_locked);
746
bool createModulesColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
748
const drizzled::plugin::ColumnInfo *name=
749
new(std::nothrow) drizzled::plugin::ColumnInfo("MODULE_NAME",
751
DRIZZLE_TYPE_VARCHAR,
761
const drizzled::plugin::ColumnInfo *ver=
762
new(std::nothrow) drizzled::plugin::ColumnInfo("MODULE_VERSION",
764
DRIZZLE_TYPE_VARCHAR,
774
const drizzled::plugin::ColumnInfo *aut=
775
new(std::nothrow) drizzled::plugin::ColumnInfo("MODULE_AUTHOR",
777
DRIZZLE_TYPE_VARCHAR,
787
const drizzled::plugin::ColumnInfo *is_builtin=
788
new(std::nothrow) drizzled::plugin::ColumnInfo("IS_BUILTIN",
790
DRIZZLE_TYPE_VARCHAR,
795
if (is_builtin == NULL)
800
const drizzled::plugin::ColumnInfo *library=
801
new(std::nothrow) drizzled::plugin::ColumnInfo("MODULE_LIBRARY",
803
DRIZZLE_TYPE_VARCHAR,
813
const drizzled::plugin::ColumnInfo *descrip=
814
new(std::nothrow) drizzled::plugin::ColumnInfo("MODULE_DESCRIPTION",
816
DRIZZLE_TYPE_VARCHAR,
826
const drizzled::plugin::ColumnInfo *lic=
827
new(std::nothrow) drizzled::plugin::ColumnInfo("MODULE_LICENSE",
829
DRIZZLE_TYPE_VARCHAR,
839
cols.push_back(name);
842
cols.push_back(is_builtin);
843
cols.push_back(library);
844
cols.push_back(descrip);
850
bool createPluginsColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
852
const drizzled::plugin::ColumnInfo *name=
853
new(std::nothrow) drizzled::plugin::ColumnInfo("PLUGIN_NAME",
855
DRIZZLE_TYPE_VARCHAR,
865
const drizzled::plugin::ColumnInfo *ptype=
866
new(std::nothrow) drizzled::plugin::ColumnInfo("PLUGIN_TYPE",
868
DRIZZLE_TYPE_VARCHAR,
878
const drizzled::plugin::ColumnInfo *is_active=
879
new(std::nothrow) drizzled::plugin::ColumnInfo("IS_ACTIVE",
881
DRIZZLE_TYPE_VARCHAR,
886
if (is_active == NULL)
891
const drizzled::plugin::ColumnInfo *mod_name=
892
new(std::nothrow) drizzled::plugin::ColumnInfo("MODULE_NAME",
894
DRIZZLE_TYPE_VARCHAR,
903
cols.push_back(name);
904
cols.push_back(ptype);
905
cols.push_back(is_active);
906
cols.push_back(mod_name);
912
bool createProcessListColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
915
* Create each column for the PROCESSLIST table.
917
const drizzled::plugin::ColumnInfo *id_col= new(std::nothrow) drizzled::plugin::ColumnInfo("ID",
919
DRIZZLE_TYPE_LONGLONG,
929
const drizzled::plugin::ColumnInfo *user_col= new(std::nothrow) drizzled::plugin::ColumnInfo("USER",
931
DRIZZLE_TYPE_VARCHAR,
936
if (user_col == NULL)
941
const drizzled::plugin::ColumnInfo *host_col= new(std::nothrow) drizzled::plugin::ColumnInfo("HOST",
942
LIST_PROCESS_HOST_LEN,
943
DRIZZLE_TYPE_VARCHAR,
948
if (host_col == NULL)
953
const drizzled::plugin::ColumnInfo *db_col= new(std::nothrow) drizzled::plugin::ColumnInfo("DB",
955
DRIZZLE_TYPE_VARCHAR,
965
const drizzled::plugin::ColumnInfo *command_col= new(std::nothrow) drizzled::plugin::ColumnInfo("COMMAND",
967
DRIZZLE_TYPE_VARCHAR,
972
if (command_col == NULL)
977
const drizzled::plugin::ColumnInfo *time_col= new(std::nothrow) drizzled::plugin::ColumnInfo("TIME",
979
DRIZZLE_TYPE_LONGLONG,
984
if (time_col == NULL)
989
const drizzled::plugin::ColumnInfo *state_col= new(std::nothrow) drizzled::plugin::ColumnInfo("STATE",
991
DRIZZLE_TYPE_VARCHAR,
996
if (state_col == NULL)
1001
const drizzled::plugin::ColumnInfo *info_col= new(std::nothrow) drizzled::plugin::ColumnInfo("INFO",
1002
PROCESS_LIST_INFO_WIDTH,
1003
DRIZZLE_TYPE_VARCHAR,
1008
if (info_col == NULL)
1014
* Add the columns to the vector.
1016
cols.push_back(id_col);
1017
cols.push_back(user_col);
1018
cols.push_back(host_col);
1019
cols.push_back(db_col);
1020
cols.push_back(command_col);
1021
cols.push_back(time_col);
1022
cols.push_back(state_col);
1023
cols.push_back(info_col);
1028
bool createRefConstraintColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
1031
* Create the columns for the table.
1033
const drizzled::plugin::ColumnInfo *cat= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_CATALOG",
1035
DRIZZLE_TYPE_VARCHAR,
1046
const drizzled::plugin::ColumnInfo *sch= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_SCHEMA",
1048
DRIZZLE_TYPE_VARCHAR,
1058
const drizzled::plugin::ColumnInfo *name= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_NAME",
1060
DRIZZLE_TYPE_VARCHAR,
1070
const drizzled::plugin::ColumnInfo *uniq_cat= new(std::nothrow) drizzled::plugin::ColumnInfo("UNIQUE_CONSTRAINT_CATALOG",
1072
DRIZZLE_TYPE_VARCHAR,
1077
if (uniq_cat == NULL)
1082
const drizzled::plugin::ColumnInfo *uniq_sch= new(std::nothrow) drizzled::plugin::ColumnInfo("UNIQUE_CONSTRAINT_SCHEMA",
1084
DRIZZLE_TYPE_VARCHAR,
1089
if (uniq_sch == NULL)
1094
const drizzled::plugin::ColumnInfo *uniq_name= new(std::nothrow) drizzled::plugin::ColumnInfo("UNIQUE_CONSTRAINT_NAME",
1096
DRIZZLE_TYPE_VARCHAR,
1101
if (uniq_name == NULL)
1106
const drizzled::plugin::ColumnInfo *match= new(std::nothrow) drizzled::plugin::ColumnInfo("MATCH_OPTION",
1108
DRIZZLE_TYPE_VARCHAR,
1118
const drizzled::plugin::ColumnInfo *update= new(std::nothrow) drizzled::plugin::ColumnInfo("UPDATE_RULE",
1120
DRIZZLE_TYPE_VARCHAR,
1130
const drizzled::plugin::ColumnInfo *del_rule= new(std::nothrow) drizzled::plugin::ColumnInfo("DELETE_RULE",
1132
DRIZZLE_TYPE_VARCHAR,
1137
if (del_rule == NULL)
1142
const drizzled::plugin::ColumnInfo *tab_name= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_NAME",
1144
DRIZZLE_TYPE_VARCHAR,
1149
if (tab_name == NULL)
1154
const drizzled::plugin::ColumnInfo *ref_name= new(std::nothrow) drizzled::plugin::ColumnInfo("REFERENCED_TABLE_NAME",
1156
DRIZZLE_TYPE_VARCHAR,
1161
if (ref_name == NULL)
1167
* Add the columns to the vector.
1169
cols.push_back(cat);
1170
cols.push_back(sch);
1171
cols.push_back(name);
1172
cols.push_back(uniq_cat);
1173
cols.push_back(uniq_sch);
1174
cols.push_back(uniq_name);
1175
cols.push_back(match);
1176
cols.push_back(update);
1177
cols.push_back(del_rule);
1178
cols.push_back(tab_name);
1179
cols.push_back(ref_name);
1184
bool createSchemataColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
1186
const drizzled::plugin::ColumnInfo *cat_name= new(std::nothrow) drizzled::plugin::ColumnInfo("CATALOG_NAME",
1188
DRIZZLE_TYPE_VARCHAR,
1193
if (cat_name == NULL)
1198
const drizzled::plugin::ColumnInfo *sch_name= new(std::nothrow) drizzled::plugin::ColumnInfo("SCHEMA_NAME",
1200
DRIZZLE_TYPE_VARCHAR,
1205
if (sch_name == NULL)
1210
const drizzled::plugin::ColumnInfo *cs_name= new(std::nothrow) drizzled::plugin::ColumnInfo("DEFAULT_CHARACTER_SET_NAME",
1212
DRIZZLE_TYPE_VARCHAR,
1217
if (cs_name == NULL)
1222
const drizzled::plugin::ColumnInfo *coll_name= new(std::nothrow) drizzled::plugin::ColumnInfo("DEFAULT_COLLATION_NAME",
1224
DRIZZLE_TYPE_VARCHAR,
1229
if (coll_name == NULL)
1234
const drizzled::plugin::ColumnInfo *sql_path= new(std::nothrow) drizzled::plugin::ColumnInfo("SQL_PATH",
1236
DRIZZLE_TYPE_VARCHAR,
1241
if (sql_path == NULL)
1246
cols.push_back(cat_name);
1247
cols.push_back(sch_name);
1248
cols.push_back(cs_name);
1249
cols.push_back(coll_name);
1250
cols.push_back(sql_path);
1255
bool createStatsColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
1257
const drizzled::plugin::ColumnInfo *cat= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_CATALOG",
1259
DRIZZLE_TYPE_VARCHAR,
1269
const drizzled::plugin::ColumnInfo *sch= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_SCHEMA",
1271
DRIZZLE_TYPE_VARCHAR,
1281
const drizzled::plugin::ColumnInfo *name= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_NAME",
1283
DRIZZLE_TYPE_VARCHAR,
1293
const drizzled::plugin::ColumnInfo *uniq= new(std::nothrow) drizzled::plugin::ColumnInfo("NON_UNIQUE",
1295
DRIZZLE_TYPE_LONGLONG,
1305
const drizzled::plugin::ColumnInfo *idx_sch= new(std::nothrow) drizzled::plugin::ColumnInfo("INDEX_SCHEMA",
1307
DRIZZLE_TYPE_VARCHAR,
1312
if (idx_sch == NULL)
1317
const drizzled::plugin::ColumnInfo *idx_name= new(std::nothrow) drizzled::plugin::ColumnInfo("INDEX_NAME",
1319
DRIZZLE_TYPE_VARCHAR,
1324
if (idx_name == NULL)
1329
const drizzled::plugin::ColumnInfo *seq_in_idx= new(std::nothrow) drizzled::plugin::ColumnInfo("SEQ_IN_INDEX",
1331
DRIZZLE_TYPE_LONGLONG,
1336
if (seq_in_idx == NULL)
1341
const drizzled::plugin::ColumnInfo *col_name= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_NAME",
1343
DRIZZLE_TYPE_VARCHAR,
1348
if (col_name == NULL)
1353
const drizzled::plugin::ColumnInfo *coll= new(std::nothrow) drizzled::plugin::ColumnInfo("COLLATION",
1355
DRIZZLE_TYPE_VARCHAR,
1365
const drizzled::plugin::ColumnInfo *card= new(std::nothrow) drizzled::plugin::ColumnInfo("CARDINALITY",
1366
MY_INT64_NUM_DECIMAL_DIGITS,
1367
DRIZZLE_TYPE_LONGLONG,
1377
const drizzled::plugin::ColumnInfo *sub_part= new(std::nothrow) drizzled::plugin::ColumnInfo("SUB_PART",
1379
DRIZZLE_TYPE_LONGLONG,
1384
if (sub_part == NULL)
1389
const drizzled::plugin::ColumnInfo *packed= new(std::nothrow) drizzled::plugin::ColumnInfo("PACKED",
1391
DRIZZLE_TYPE_VARCHAR,
1401
const drizzled::plugin::ColumnInfo *nullable= new(std::nothrow) drizzled::plugin::ColumnInfo("NULLABLE",
1403
DRIZZLE_TYPE_VARCHAR,
1408
if (nullable == NULL)
1413
const drizzled::plugin::ColumnInfo *idx_type= new(std::nothrow) drizzled::plugin::ColumnInfo("INDEX_TYPE",
1415
DRIZZLE_TYPE_VARCHAR,
1420
if (idx_type == NULL)
1425
const drizzled::plugin::ColumnInfo *comment= new(std::nothrow) drizzled::plugin::ColumnInfo("COMMENT",
1427
DRIZZLE_TYPE_VARCHAR,
1432
if (comment == NULL)
1437
const drizzled::plugin::ColumnInfo *idx_comment= new(std::nothrow) drizzled::plugin::ColumnInfo("INDEX_COMMENT",
1438
INDEX_COMMENT_MAXLEN,
1439
DRIZZLE_TYPE_VARCHAR,
1444
if (idx_comment == NULL)
1449
cols.push_back(cat);
1450
cols.push_back(sch);
1451
cols.push_back(name);
1452
cols.push_back(uniq);
1453
cols.push_back(idx_sch);
1454
cols.push_back(idx_name);
1455
cols.push_back(seq_in_idx);
1456
cols.push_back(col_name);
1457
cols.push_back(coll);
1458
cols.push_back(card);
1459
cols.push_back(sub_part);
1460
cols.push_back(packed);
1461
cols.push_back(nullable);
1462
cols.push_back(idx_type);
1463
cols.push_back(comment);
1464
cols.push_back(idx_comment);
1469
bool createStatusColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
1471
const drizzled::plugin::ColumnInfo *name= new(std::nothrow) drizzled::plugin::ColumnInfo("VARIABLE_NAME",
1473
DRIZZLE_TYPE_VARCHAR,
1483
const drizzled::plugin::ColumnInfo *value= new(std::nothrow) drizzled::plugin::ColumnInfo("VARIABLE_VALUE",
1485
DRIZZLE_TYPE_VARCHAR,
1495
cols.push_back(name);
1496
cols.push_back(value);
1501
bool createTabConstraintsColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
1503
const drizzled::plugin::ColumnInfo *cat= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_CATALOG",
1505
DRIZZLE_TYPE_VARCHAR,
1515
const drizzled::plugin::ColumnInfo *sch= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_SCHEMA",
1517
DRIZZLE_TYPE_VARCHAR,
1527
const drizzled::plugin::ColumnInfo *name= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_NAME",
1529
DRIZZLE_TYPE_VARCHAR,
1539
const drizzled::plugin::ColumnInfo *tab_sch= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_SCHEMA",
1541
DRIZZLE_TYPE_VARCHAR,
1546
if (tab_sch == NULL)
1551
const drizzled::plugin::ColumnInfo *tab_name= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_NAME",
1553
DRIZZLE_TYPE_VARCHAR,
1558
if (tab_name == NULL)
1563
const drizzled::plugin::ColumnInfo *type= new(std::nothrow) drizzled::plugin::ColumnInfo("CONSTRAINT_TYPE",
1565
DRIZZLE_TYPE_VARCHAR,
1575
cols.push_back(cat);
1576
cols.push_back(sch);
1577
cols.push_back(name);
1578
cols.push_back(tab_sch);
1579
cols.push_back(tab_name);
1580
cols.push_back(type);
1585
bool createTablesColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
1587
const drizzled::plugin::ColumnInfo *cat= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_CATALOG",
1589
DRIZZLE_TYPE_VARCHAR,
1599
const drizzled::plugin::ColumnInfo *sch= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_SCHEMA",
1601
DRIZZLE_TYPE_VARCHAR,
1611
const drizzled::plugin::ColumnInfo *name= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_NAME",
1613
DRIZZLE_TYPE_VARCHAR,
1623
const drizzled::plugin::ColumnInfo *type= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_TYPE",
1625
DRIZZLE_TYPE_VARCHAR,
1635
const drizzled::plugin::ColumnInfo *engine= new(std::nothrow) drizzled::plugin::ColumnInfo("ENGINE",
1637
DRIZZLE_TYPE_VARCHAR,
1647
const drizzled::plugin::ColumnInfo *version= new(std::nothrow) drizzled::plugin::ColumnInfo("VERSION",
1648
MY_INT64_NUM_DECIMAL_DIGITS,
1649
DRIZZLE_TYPE_LONGLONG,
1651
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
1654
if (version == NULL)
1659
const drizzled::plugin::ColumnInfo *row_format= new(std::nothrow) drizzled::plugin::ColumnInfo("ROW_FORMAT",
1661
DRIZZLE_TYPE_VARCHAR,
1666
if (row_format == NULL)
1671
const drizzled::plugin::ColumnInfo *tab_rows= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_ROWS",
1672
MY_INT64_NUM_DECIMAL_DIGITS,
1673
DRIZZLE_TYPE_LONGLONG,
1675
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
1678
if (tab_rows == NULL)
1683
const drizzled::plugin::ColumnInfo *avg_row_len= new(std::nothrow) drizzled::plugin::ColumnInfo("AVG_ROW_LENGTH",
1684
MY_INT64_NUM_DECIMAL_DIGITS,
1685
DRIZZLE_TYPE_LONGLONG,
1687
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
1690
if (avg_row_len == NULL)
1695
const drizzled::plugin::ColumnInfo *data_len= new(std::nothrow) drizzled::plugin::ColumnInfo("DATA_LENGTH",
1696
MY_INT64_NUM_DECIMAL_DIGITS,
1697
DRIZZLE_TYPE_LONGLONG,
1699
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
1702
if (data_len == NULL)
1707
const drizzled::plugin::ColumnInfo *max_data_len= new(std::nothrow) drizzled::plugin::ColumnInfo("MAX_DATA_LENGTH",
1708
MY_INT64_NUM_DECIMAL_DIGITS,
1709
DRIZZLE_TYPE_LONGLONG,
1711
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
1714
if (max_data_len == NULL)
1719
const drizzled::plugin::ColumnInfo *idx_len= new(std::nothrow) drizzled::plugin::ColumnInfo("INDEX_LENGTH",
1720
MY_INT64_NUM_DECIMAL_DIGITS,
1721
DRIZZLE_TYPE_LONGLONG,
1723
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
1726
if (idx_len == NULL)
1731
const drizzled::plugin::ColumnInfo *data_free= new(std::nothrow) drizzled::plugin::ColumnInfo("DATA_FREE",
1732
MY_INT64_NUM_DECIMAL_DIGITS,
1733
DRIZZLE_TYPE_LONGLONG,
1735
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
1738
if (data_free == NULL)
1743
const drizzled::plugin::ColumnInfo *auto_inc= new(std::nothrow) drizzled::plugin::ColumnInfo("AUTO_INCREMENT",
1744
MY_INT64_NUM_DECIMAL_DIGITS,
1745
DRIZZLE_TYPE_LONGLONG,
1747
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
1750
if (auto_inc == NULL)
1755
const drizzled::plugin::ColumnInfo *create_time= new(std::nothrow) drizzled::plugin::ColumnInfo("CREATE_TIME",
1757
DRIZZLE_TYPE_DATETIME,
1762
if (create_time == NULL)
1767
const drizzled::plugin::ColumnInfo *update_time= new(std::nothrow) drizzled::plugin::ColumnInfo("UPDATE_TIME",
1769
DRIZZLE_TYPE_DATETIME,
1774
if (update_time == NULL)
1779
const drizzled::plugin::ColumnInfo *check_time= new(std::nothrow) drizzled::plugin::ColumnInfo("CHECK_TIME",
1781
DRIZZLE_TYPE_DATETIME,
1786
if (check_time == NULL)
1791
const drizzled::plugin::ColumnInfo *table_coll= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_COLLATION",
1793
DRIZZLE_TYPE_VARCHAR,
1798
if (table_coll == NULL)
1803
const drizzled::plugin::ColumnInfo *checksum= new(std::nothrow) drizzled::plugin::ColumnInfo("CHECKSUM",
1804
MY_INT64_NUM_DECIMAL_DIGITS,
1805
DRIZZLE_TYPE_LONGLONG,
1807
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED),
1810
if (checksum == NULL)
1815
const drizzled::plugin::ColumnInfo *create_opt= new(std::nothrow) drizzled::plugin::ColumnInfo("CREATE_OPTIONS",
1817
DRIZZLE_TYPE_VARCHAR,
1822
if (create_opt == NULL)
1827
const drizzled::plugin::ColumnInfo *tab_comment= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_COMMENT",
1828
TABLE_COMMENT_MAXLEN,
1829
DRIZZLE_TYPE_VARCHAR,
1834
if (tab_comment == NULL)
1839
cols.push_back(cat);
1840
cols.push_back(sch);
1841
cols.push_back(name);
1842
cols.push_back(type);
1843
cols.push_back(engine);
1844
cols.push_back(version);
1845
cols.push_back(row_format);
1846
cols.push_back(tab_rows);
1847
cols.push_back(avg_row_len);
1848
cols.push_back(data_len);
1849
cols.push_back(max_data_len);
1850
cols.push_back(idx_len);
1851
cols.push_back(data_free);
1852
cols.push_back(auto_inc);
1853
cols.push_back(create_time);
1854
cols.push_back(update_time);
1855
cols.push_back(check_time);
1856
cols.push_back(table_coll);
1857
cols.push_back(checksum);
1858
cols.push_back(create_opt);
1859
cols.push_back(tab_comment);
1865
bool createTabNamesColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
1867
const drizzled::plugin::ColumnInfo *cat= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_CATALOG",
1869
DRIZZLE_TYPE_VARCHAR,
1879
const drizzled::plugin::ColumnInfo *sch= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_SCHEMA",
1881
DRIZZLE_TYPE_VARCHAR,
1891
const drizzled::plugin::ColumnInfo *name= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_NAME",
1893
DRIZZLE_TYPE_VARCHAR,
1903
const drizzled::plugin::ColumnInfo *type= new(std::nothrow) drizzled::plugin::ColumnInfo("TABLE_TYPE",
1905
DRIZZLE_TYPE_VARCHAR,
1915
cols.push_back(cat);
1916
cols.push_back(sch);
1917
cols.push_back(name);
1918
cols.push_back(type);
1924
* Function object used for deleting the memory allocated
1925
* for the columns contained with the vector of columns.
1930
template<typename T>
1931
inline void operator()(const T *ptr) const
1937
void clearColumns(vector<const drizzled::plugin::ColumnInfo *>& cols)
1939
for_each(cols.begin(), cols.end(), DeleteColumns());