Merge lp:~posulliv/drizzle/info-schema-plugin into lp:~drizzle-trunk/drizzle/development

Proposed by Padraig O'Sullivan
Status: Merged
Approved by: Jay Pipes
Approved revision: no longer in the revision history of the source branch.
Merged at revision: not available
Proposed branch: lp:~posulliv/drizzle/info-schema-plugin
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: None lines
To merge this branch: bzr merge lp:~posulliv/drizzle/info-schema-plugin
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Review via email: mp+8249@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Padraig O'Sullivan (posulliv) wrote :

This patch completes the work on extracting the current I_S into a plugin by extracting the final 6 I_S tables into the I_S plugin. No I_S tables are created in show.cc anymore.

-Padraig

1090. By Brian Aker <brian@gaz>

Merge from Monty

1091. By Brian Aker <brian@gaz>

Collection of patches from new-cleanup (includes asserts for field in debug)

1092. By Brian Aker <brian@gaz>

Merge Monty

1093. By Brian Aker <brian@gaz>

Merge Brian

1094. By Brian Aker <brian@gaz>

Merge Stewart

1095. By Brian Aker <brian@gaz>

Merge Jay

1096. By Brian Aker <brian@gaz>

Merge Monty

1097. By Brian Aker <brian@gaz>

Merge Jay

1098. By Brian Aker <brian@gaz>

Merge Jay

Revision history for this message
Jay Pipes (jaypipes) wrote :

Merged into my captain branch...all tests pass. Looks good.

review: Approve
1099. By Brian Aker <brian@gaz>

Mege Jay

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'drizzled/info_schema.h'
--- drizzled/info_schema.h 2009-07-01 03:36:14 +0000
+++ drizzled/info_schema.h 2009-07-05 17:44:13 +0000
@@ -199,22 +199,6 @@
199 InfoSchemaTable *schema_table) const;199 InfoSchemaTable *schema_table) const;
200};200};
201201
202class StatusISMethods : public InfoSchemaMethods
203{
204public:
205 virtual int fillTable(Session *session,
206 TableList *tables,
207 COND *cond);
208};
209
210class VariablesISMethods : public InfoSchemaMethods
211{
212public:
213 virtual int fillTable(Session *session,
214 TableList *tables,
215 COND *cond);
216};
217
218/**202/**
219 * @class InfoSchemaTable203 * @class InfoSchemaTable
220 * @brief 204 * @brief
221205
=== modified file 'drizzled/show.cc'
--- drizzled/show.cc 2009-07-03 19:45:58 +0000
+++ drizzled/show.cc 2009-07-05 17:44:13 +0000
@@ -1005,6 +1005,11 @@
1005 }1005 }
1006};1006};
10071007
1008SHOW_VAR *getFrontOfStatusVars()
1009{
1010 return all_status_vars.front();
1011}
1012
1008/*1013/*
1009 Adds an array of SHOW_VAR entries to the output of SHOW STATUS1014 Adds an array of SHOW_VAR entries to the output of SHOW STATUS
10101015
@@ -1143,172 +1148,6 @@
1143 }1148 }
1144}1149}
11451150
1146inline void make_upper(char *buf)
1147{
1148 for (; *buf; buf++)
1149 *buf= my_toupper(system_charset_info, *buf);
1150}
1151
1152static bool show_status_array(Session *session, const char *wild,
1153 SHOW_VAR *variables,
1154 enum enum_var_type value_type,
1155 struct system_status_var *status_var,
1156 const char *prefix, Table *table,
1157 bool ucase_names)
1158{
1159 MY_ALIGNED_BYTE_ARRAY(buff_data, SHOW_VAR_FUNC_BUFF_SIZE, int64_t);
1160 char * const buff= (char *) &buff_data;
1161 char *prefix_end;
1162 /* the variable name should not be longer than 64 characters */
1163 char name_buffer[64];
1164 int len;
1165 SHOW_VAR tmp, *var;
1166
1167 prefix_end= strncpy(name_buffer, prefix, sizeof(name_buffer)-1);
1168 prefix_end+= strlen(prefix);
1169
1170 if (*prefix)
1171 *prefix_end++= '_';
1172 len=name_buffer + sizeof(name_buffer) - prefix_end;
1173
1174 for (; variables->name; variables++)
1175 {
1176 strncpy(prefix_end, variables->name, len);
1177 name_buffer[sizeof(name_buffer)-1]=0; /* Safety */
1178 if (ucase_names)
1179 make_upper(name_buffer);
1180
1181 /*
1182 if var->type is SHOW_FUNC, call the function.
1183 Repeat as necessary, if new var is again SHOW_FUNC
1184 */
1185 for (var=variables; var->type == SHOW_FUNC; var= &tmp)
1186 ((mysql_show_var_func)((st_show_var_func_container *)var->value)->func)(&tmp, buff);
1187
1188 SHOW_TYPE show_type=var->type;
1189 if (show_type == SHOW_ARRAY)
1190 {
1191 show_status_array(session, wild, (SHOW_VAR *) var->value, value_type,
1192 status_var, name_buffer, table, ucase_names);
1193 }
1194 else
1195 {
1196 if (!(wild && wild[0] && wild_case_compare(system_charset_info,
1197 name_buffer, wild)))
1198 {
1199 char *value=var->value;
1200 const char *pos, *end; // We assign a lot of const's
1201 pthread_mutex_lock(&LOCK_global_system_variables);
1202
1203 if (show_type == SHOW_SYS)
1204 {
1205 show_type= ((sys_var*) value)->show_type();
1206 value= (char*) ((sys_var*) value)->value_ptr(session, value_type,
1207 &null_lex_str);
1208 }
1209
1210 pos= end= buff;
1211 /*
1212 note that value may be == buff. All SHOW_xxx code below
1213 should still work in this case
1214 */
1215 switch (show_type) {
1216 case SHOW_DOUBLE_STATUS:
1217 value= ((char *) status_var + (ulong) value);
1218 /* fall through */
1219 case SHOW_DOUBLE:
1220 /* 6 is the default precision for '%f' in sprintf() */
1221 end= buff + my_fcvt(*(double *) value, 6, buff, NULL);
1222 break;
1223 case SHOW_LONG_STATUS:
1224 value= ((char *) status_var + (ulong) value);
1225 /* fall through */
1226 case SHOW_LONG:
1227 end= int10_to_str(*(long*) value, buff, 10);
1228 break;
1229 case SHOW_LONGLONG_STATUS:
1230 value= ((char *) status_var + (uint64_t) value);
1231 /* fall through */
1232 case SHOW_LONGLONG:
1233 end= int64_t10_to_str(*(int64_t*) value, buff, 10);
1234 break;
1235 case SHOW_SIZE:
1236 {
1237 stringstream ss (stringstream::in);
1238 ss << *(size_t*) value;
1239
1240 string str= ss.str();
1241 strncpy(buff, str.c_str(), str.length());
1242 end= buff+ str.length();
1243 }
1244 break;
1245 case SHOW_HA_ROWS:
1246 end= int64_t10_to_str((int64_t) *(ha_rows*) value, buff, 10);
1247 break;
1248 case SHOW_BOOL:
1249 end+= sprintf(buff,"%s", *(bool*) value ? "ON" : "OFF");
1250 break;
1251 case SHOW_MY_BOOL:
1252 end+= sprintf(buff,"%s", *(bool*) value ? "ON" : "OFF");
1253 break;
1254 case SHOW_INT:
1255 case SHOW_INT_NOFLUSH: // the difference lies in refresh_status()
1256 end= int10_to_str((long) *(uint32_t*) value, buff, 10);
1257 break;
1258 case SHOW_HAVE:
1259 {
1260 SHOW_COMP_OPTION tmp_option= *(SHOW_COMP_OPTION *)value;
1261 pos= show_comp_option_name[(int) tmp_option];
1262 end= strchr(pos, '\0');
1263 break;
1264 }
1265 case SHOW_CHAR:
1266 {
1267 if (!(pos= value))
1268 pos= "";
1269 end= strchr(pos, '\0');
1270 break;
1271 }
1272 case SHOW_CHAR_PTR:
1273 {
1274 if (!(pos= *(char**) value))
1275 pos= "";
1276 end= strchr(pos, '\0');
1277 break;
1278 }
1279 case SHOW_KEY_CACHE_LONG:
1280 value= (char*) dflt_key_cache + (ulong)value;
1281 end= int10_to_str(*(long*) value, buff, 10);
1282 break;
1283 case SHOW_KEY_CACHE_LONGLONG:
1284 value= (char*) dflt_key_cache + (ulong)value;
1285 end= int64_t10_to_str(*(int64_t*) value, buff, 10);
1286 break;
1287 case SHOW_UNDEF:
1288 break; // Return empty string
1289 case SHOW_SYS: // Cannot happen
1290 default:
1291 assert(0);
1292 break;
1293 }
1294 table->restoreRecordAsDefault();
1295 table->field[0]->store(name_buffer, strlen(name_buffer),
1296 system_charset_info);
1297 table->field[1]->store(pos, (uint32_t) (end - pos), system_charset_info);
1298 table->field[1]->set_notnull();
1299
1300 pthread_mutex_unlock(&LOCK_global_system_variables);
1301
1302 if (schema_table_store_record(session, table))
1303 return true;
1304 }
1305 }
1306 }
1307
1308 return false;
1309}
1310
1311
1312/* collect status for all running threads */1151/* collect status for all running threads */
13131152
1314void calc_sum_of_all_status(STATUS_VAR *to)1153void calc_sum_of_all_status(STATUS_VAR *to)
@@ -1329,10 +1168,6 @@
1329 return;1168 return;
1330}1169}
13311170
1332
1333/* This is only used internally, but we need it here as a forward reference */
1334extern InfoSchemaTable schema_tables[];
1335
1336/*1171/*
1337 Store record to I_S table, convert HEAP table1172 Store record to I_S table, convert HEAP table
1338 to MyISAM if necessary1173 to MyISAM if necessary
@@ -1773,39 +1608,14 @@
17731608
1774int schema_tables_add(Session *session, vector<LEX_STRING*> &files, const char *wild)1609int schema_tables_add(Session *session, vector<LEX_STRING*> &files, const char *wild)
1775{1610{
1776 InfoSchemaTable *tmp_schema_table= schema_tables;
1777
1778 for (; tmp_schema_table->getTableName().length() != 0; tmp_schema_table++)
1779 {
1780 if (tmp_schema_table->isHidden())
1781 {
1782 continue;
1783 }
1784
1785 const string &schema_table_name= tmp_schema_table->getTableName();
1786
1787 if (wild && wild_case_compare(files_charset_info, schema_table_name.c_str(), wild))
1788 {
1789 continue;
1790 }
1791
1792 LEX_STRING *file_name= 0;
1793 file_name= session->make_lex_string(file_name, schema_table_name.c_str(),
1794 schema_table_name.length(), true);
1795 if (file_name == NULL)
1796 {
1797 return 1;
1798 }
1799
1800 files.push_back(file_name);
1801 }
1802
1803 vector<InfoSchemaTable *>::iterator iter= find_if(all_schema_tables.begin(),1611 vector<InfoSchemaTable *>::iterator iter= find_if(all_schema_tables.begin(),
1804 all_schema_tables.end(),1612 all_schema_tables.end(),
1805 AddSchemaTable(session, files, wild));1613 AddSchemaTable(session, files, wild));
18061614
1807 if (iter != all_schema_tables.end())1615 if (iter != all_schema_tables.end())
1616 {
1808 return 1;1617 return 1;
1618 }
18091619
1810 return 0;1620 return 0;
1811}1621}
@@ -2576,71 +2386,6 @@
2576}2386}
25772387
25782388
2579int VariablesISMethods::fillTable(Session *session, TableList *tables, COND *)
2580{
2581 int res= 0;
2582 LEX *lex= session->lex;
2583 const char *wild= lex->wild ? lex->wild->ptr() : NULL;
2584 const string schema_table_name= tables->schema_table->getTableName();
2585 enum enum_var_type option_type= OPT_SESSION;
2586 bool upper_case_names= (schema_table_name.compare("VARIABLES") != 0);
2587 bool sorted_vars= (schema_table_name.compare("VARIABLES") == 0);
2588
2589 if (lex->option_type == OPT_GLOBAL ||
2590 schema_table_name.compare("GLOBAL_VARIABLES") == 0)
2591 {
2592 option_type= OPT_GLOBAL;
2593 }
2594
2595 pthread_rwlock_rdlock(&LOCK_system_variables_hash);
2596 res= show_status_array(session, wild, enumerate_sys_vars(session, sorted_vars),
2597 option_type, NULL, "", tables->table, upper_case_names);
2598 pthread_rwlock_unlock(&LOCK_system_variables_hash);
2599 return(res);
2600}
2601
2602
2603int StatusISMethods::fillTable(Session *session, TableList *tables, COND *)
2604{
2605 LEX *lex= session->lex;
2606 const char *wild= lex->wild ? lex->wild->ptr() : NULL;
2607 int res= 0;
2608 STATUS_VAR *tmp1, tmp;
2609 const string schema_table_name= tables->schema_table->getTableName();
2610 enum enum_var_type option_type;
2611 bool upper_case_names= (schema_table_name.compare("STATUS") != 0);
2612
2613 if (schema_table_name.compare("STATUS") == 0)
2614 {
2615 option_type= lex->option_type;
2616 if (option_type == OPT_GLOBAL)
2617 tmp1= &tmp;
2618 else
2619 tmp1= session->initial_status_var;
2620 }
2621 else if (schema_table_name.compare("GLOBAL_STATUS") == 0)
2622 {
2623 option_type= OPT_GLOBAL;
2624 tmp1= &tmp;
2625 }
2626 else
2627 {
2628 option_type= OPT_SESSION;
2629 tmp1= &session->status_var;
2630 }
2631
2632 pthread_mutex_lock(&LOCK_status);
2633 if (option_type == OPT_GLOBAL)
2634 calc_sum_of_all_status(&tmp);
2635 res= show_status_array(session, wild,
2636 (SHOW_VAR *) all_status_vars.front(),
2637 option_type, tmp1, "", tables->table,
2638 upper_case_names);
2639 pthread_mutex_unlock(&LOCK_status);
2640 return(res);
2641}
2642
2643
2644class FindSchemaTableByName : public unary_function<InfoSchemaTable *, bool>2389class FindSchemaTableByName : public unary_function<InfoSchemaTable *, bool>
2645{2390{
2646 const char *table_name;2391 const char *table_name;
@@ -2670,21 +2415,14 @@
26702415
2671InfoSchemaTable *find_schema_table(const char* table_name)2416InfoSchemaTable *find_schema_table(const char* table_name)
2672{2417{
2673 InfoSchemaTable *schema_table= schema_tables;
2674
2675 for (; schema_table->getTableName().length() != 0; schema_table++)
2676 {
2677 if (! my_strcasecmp(system_charset_info,
2678 schema_table->getTableName().c_str(),
2679 table_name))
2680 return(schema_table);
2681 }
2682
2683 vector<InfoSchemaTable *>::iterator iter= 2418 vector<InfoSchemaTable *>::iterator iter=
2684 find_if(all_schema_tables.begin(), all_schema_tables.end(),2419 find_if(all_schema_tables.begin(), all_schema_tables.end(),
2685 FindSchemaTableByName(table_name));2420 FindSchemaTableByName(table_name));
2686 if (iter != all_schema_tables.end())2421 if (iter != all_schema_tables.end())
2422 {
2687 return *iter;2423 return *iter;
2424 }
2425
2688 return NULL;2426 return NULL;
2689}2427}
26902428
@@ -2997,51 +2735,3 @@
2997 session->no_warnings_for_error= 0;2735 session->no_warnings_for_error= 0;
2998 return(result);2736 return(result);
2999}2737}
3000
3001ColumnInfo variables_fields_info[]=
3002{
3003 ColumnInfo("VARIABLE_NAME", 64, DRIZZLE_TYPE_VARCHAR, 0, 0, "Variable_name",
3004 SKIP_OPEN_TABLE),
3005 ColumnInfo("VARIABLE_VALUE", 16300, DRIZZLE_TYPE_VARCHAR, 0, 1, "Value", SKIP_OPEN_TABLE),
3006 ColumnInfo()
3007};
3008
3009
3010static StatusISMethods status_methods;
3011static VariablesISMethods variables_methods;
3012
3013static InfoSchemaTable global_stat_table("GLOBAL_STATUS",
3014 variables_fields_info,
3015 -1, -1, false, false, 0,
3016 &status_methods);
3017static InfoSchemaTable global_var_table("GLOBAL_VARIABLES",
3018 variables_fields_info,
3019 -1, -1, false, false, 0,
3020 &variables_methods);
3021static InfoSchemaTable sess_stat_table("SESSION_STATUS",
3022 variables_fields_info,
3023 -1, -1, false, false, 0,
3024 &status_methods);
3025static InfoSchemaTable sess_var_table("SESSION_VARIABLES",
3026 variables_fields_info,
3027 -1, -1, false, false, 0,
3028 &variables_methods);
3029static InfoSchemaTable status_table("STATUS",
3030 variables_fields_info,
3031 -1, -1, true, false, 0,
3032 &status_methods);
3033static InfoSchemaTable var_table("VARIABLES",
3034 variables_fields_info,
3035 -1, -1, true, false, 0,
3036 &variables_methods);
3037
3038InfoSchemaTable schema_tables[]=
3039{
3040 global_stat_table,
3041 global_var_table,
3042 sess_stat_table,
3043 sess_var_table,
3044 status_table,
3045 var_table,
3046 InfoSchemaTable()
3047};
30482738
=== modified file 'drizzled/show.h'
--- drizzled/show.h 2009-07-02 06:54:37 +0000
+++ drizzled/show.h 2009-07-05 17:44:13 +0000
@@ -65,6 +65,7 @@
65 LOOKUP_FIELD_VALUES *lookup_field_values);65 LOOKUP_FIELD_VALUES *lookup_field_values);
66int make_db_list(Session *session, std::vector<LEX_STRING*> &files,66int make_db_list(Session *session, std::vector<LEX_STRING*> &files,
67 LOOKUP_FIELD_VALUES *lookup_field_vals, bool *with_i_schema);67 LOOKUP_FIELD_VALUES *lookup_field_vals, bool *with_i_schema);
68SHOW_VAR *getFrontOfStatusVars();
6869
69int store_create_info(TableList *table_list, String *packet, HA_CREATE_INFO *create_info_arg);70int store_create_info(TableList *table_list, String *packet, HA_CREATE_INFO *create_info_arg);
70bool store_db_create_info(const char *dbname, String *buffer, HA_CREATE_INFO *create_info);71bool store_db_create_info(const char *dbname, String *buffer, HA_CREATE_INFO *create_info);
7172
=== modified file 'plugin/info_schema/info_schema.cc'
--- plugin/info_schema/info_schema.cc 2009-07-01 03:36:14 +0000
+++ plugin/info_schema/info_schema.cc 2009-07-05 17:44:13 +0000
@@ -48,6 +48,7 @@
48static vector<const ColumnInfo *> ref_constraint_columns;48static vector<const ColumnInfo *> ref_constraint_columns;
49static vector<const ColumnInfo *> schemata_columns;49static vector<const ColumnInfo *> schemata_columns;
50static vector<const ColumnInfo *> stats_columns;50static vector<const ColumnInfo *> stats_columns;
51static vector<const ColumnInfo *> status_columns;
51static vector<const ColumnInfo *> tab_constraints_columns;52static vector<const ColumnInfo *> tab_constraints_columns;
52static vector<const ColumnInfo *> tables_columns;53static vector<const ColumnInfo *> tables_columns;
53static vector<const ColumnInfo *> tab_names_columns;54static vector<const ColumnInfo *> tab_names_columns;
@@ -66,9 +67,11 @@
66static InfoSchemaMethods *ref_constraint_methods= NULL;67static InfoSchemaMethods *ref_constraint_methods= NULL;
67static InfoSchemaMethods *schemata_methods= NULL;68static InfoSchemaMethods *schemata_methods= NULL;
68static InfoSchemaMethods *stats_methods= NULL;69static InfoSchemaMethods *stats_methods= NULL;
70static InfoSchemaMethods *status_methods= NULL;
69static InfoSchemaMethods *tab_constraints_methods= NULL;71static InfoSchemaMethods *tab_constraints_methods= NULL;
70static InfoSchemaMethods *tables_methods= NULL;72static InfoSchemaMethods *tables_methods= NULL;
71static InfoSchemaMethods *tab_names_methods= NULL;73static InfoSchemaMethods *tab_names_methods= NULL;
74static InfoSchemaMethods *variables_methods= NULL;
7275
73/*76/*
74 * I_S tables.77 * I_S tables.
@@ -78,15 +81,21 @@
78static InfoSchemaTable *coll_char_set_table= NULL;81static InfoSchemaTable *coll_char_set_table= NULL;
79static InfoSchemaTable *columns_table= NULL;82static InfoSchemaTable *columns_table= NULL;
80static InfoSchemaTable *key_col_usage_table= NULL;83static InfoSchemaTable *key_col_usage_table= NULL;
84static InfoSchemaTable *global_stat_table= NULL;
85static InfoSchemaTable *global_var_table= NULL;
81static InfoSchemaTable *open_tab_table= NULL;86static InfoSchemaTable *open_tab_table= NULL;
82static InfoSchemaTable *plugins_table= NULL;87static InfoSchemaTable *plugins_table= NULL;
83static InfoSchemaTable *processlist_table= NULL;88static InfoSchemaTable *processlist_table= NULL;
84static InfoSchemaTable *ref_constraint_table= NULL;89static InfoSchemaTable *ref_constraint_table= NULL;
85static InfoSchemaTable *schemata_table= NULL;90static InfoSchemaTable *schemata_table= NULL;
91static InfoSchemaTable *sess_stat_table= NULL;
92static InfoSchemaTable *sess_var_table= NULL;
86static InfoSchemaTable *stats_table= NULL;93static InfoSchemaTable *stats_table= NULL;
94static InfoSchemaTable *status_table= NULL;
87static InfoSchemaTable *tab_constraints_table= NULL;95static InfoSchemaTable *tab_constraints_table= NULL;
88static InfoSchemaTable *tables_table= NULL;96static InfoSchemaTable *tables_table= NULL;
89static InfoSchemaTable *tab_names_table= NULL;97static InfoSchemaTable *tab_names_table= NULL;
98static InfoSchemaTable *var_table= NULL;
9099
91/**100/**
92 * Populate the vectors of columns for each I_S table.101 * Populate the vectors of columns for each I_S table.
@@ -152,6 +161,11 @@
152 return true;161 return true;
153 }162 }
154163
164 if ((retval= createStatusColumns(status_columns)) == true)
165 {
166 return true;
167 }
168
155 if ((retval= createTabConstraintsColumns(tab_constraints_columns)) == true)169 if ((retval= createTabConstraintsColumns(tab_constraints_columns)) == true)
156 {170 {
157 return true;171 return true;
@@ -186,6 +200,7 @@
186 clearColumns(ref_constraint_columns);200 clearColumns(ref_constraint_columns);
187 clearColumns(schemata_columns);201 clearColumns(schemata_columns);
188 clearColumns(stats_columns);202 clearColumns(stats_columns);
203 clearColumns(status_columns);
189 clearColumns(tab_constraints_columns);204 clearColumns(tab_constraints_columns);
190 clearColumns(tables_columns);205 clearColumns(tables_columns);
191 clearColumns(tab_names_columns);206 clearColumns(tab_names_columns);
@@ -253,6 +268,11 @@
253 return true;268 return true;
254 }269 }
255270
271 if ((status_methods= new(std::nothrow) StatusISMethods()) == NULL)
272 {
273 return true;
274 }
275
256 if ((tab_constraints_methods= new(std::nothrow) TabConstraintsISMethods()) == NULL)276 if ((tab_constraints_methods= new(std::nothrow) TabConstraintsISMethods()) == NULL)
257 {277 {
258 return true;278 return true;
@@ -268,6 +288,11 @@
268 return true;288 return true;
269 }289 }
270290
291 if ((variables_methods= new(std::nothrow) VariablesISMethods()) == NULL)
292 {
293 return true;
294 }
295
271 return false;296 return false;
272}297}
273298
@@ -287,9 +312,11 @@
287 delete ref_constraint_methods;312 delete ref_constraint_methods;
288 delete schemata_methods;313 delete schemata_methods;
289 delete stats_methods;314 delete stats_methods;
315 delete status_methods;
290 delete tab_constraints_methods;316 delete tab_constraints_methods;
291 delete tables_methods;317 delete tables_methods;
292 delete tab_names_methods;318 delete tab_names_methods;
319 delete variables_methods;
293}320}
294321
295/**322/**
@@ -347,6 +374,24 @@
347 return true;374 return true;
348 }375 }
349376
377 global_stat_table= new(std::nothrow) InfoSchemaTable("GLOBAL_STATUS",
378 status_columns,
379 -1, -1, false, false,
380 0, status_methods);
381 if (global_stat_table == NULL)
382 {
383 return true;
384 }
385
386 global_var_table= new(std::nothrow) InfoSchemaTable("GLOBAL_VARIABLES",
387 status_columns,
388 -1, -1, false, false,
389 0, variables_methods);
390 if (global_var_table == NULL)
391 {
392 return true;
393 }
394
350 open_tab_table= new(std::nothrow) InfoSchemaTable("OPEN_TABLES",395 open_tab_table= new(std::nothrow) InfoSchemaTable("OPEN_TABLES",
351 open_tab_columns,396 open_tab_columns,
352 -1, -1, true, false, 0,397 -1, -1, true, false, 0,
@@ -393,6 +438,24 @@
393 return true;438 return true;
394 }439 }
395440
441 sess_stat_table= new(std::nothrow) InfoSchemaTable("SESSION_STATUS",
442 status_columns,
443 -1, -1, false, false,
444 0, status_methods);
445 if (sess_stat_table == NULL)
446 {
447 return true;
448 }
449
450 sess_var_table= new(std::nothrow) InfoSchemaTable("SESSION_VARIABLES",
451 status_columns,
452 -1, -1, false, false, 0,
453 variables_methods);
454 if (sess_var_table == NULL)
455 {
456 return true;
457 }
458
396 stats_table= new(std::nothrow) InfoSchemaTable("STATISTICS",459 stats_table= new(std::nothrow) InfoSchemaTable("STATISTICS",
397 stats_columns,460 stats_columns,
398 1, 2, false, true,461 1, 2, false, true,
@@ -403,6 +466,15 @@
403 return true;466 return true;
404 }467 }
405468
469 status_table= new(std::nothrow) InfoSchemaTable("STATUS",
470 status_columns,
471 -1, -1, true, false, 0,
472 status_methods);
473 if (status_table == NULL)
474 {
475 return true;
476 }
477
406 tab_constraints_table= new(std::nothrow) InfoSchemaTable("TABLE_CONSTRAINTS",478 tab_constraints_table= new(std::nothrow) InfoSchemaTable("TABLE_CONSTRAINTS",
407 tab_constraints_columns,479 tab_constraints_columns,
408 3, 4, false, true,480 3, 4, false, true,
@@ -432,6 +504,15 @@
432 return true;504 return true;
433 }505 }
434506
507 var_table= new(std::nothrow) InfoSchemaTable("VARIABLES",
508 status_columns,
509 -1, -1, true, false, 0,
510 variables_methods);
511 if (var_table == NULL)
512 {
513 return true;
514 }
515
435 return false;516 return false;
436}517}
437518
@@ -445,15 +526,21 @@
445 delete coll_char_set_table;526 delete coll_char_set_table;
446 delete columns_table;527 delete columns_table;
447 delete key_col_usage_table;528 delete key_col_usage_table;
529 delete global_stat_table;
530 delete global_var_table;
448 delete open_tab_table;531 delete open_tab_table;
449 delete plugins_table;532 delete plugins_table;
450 delete processlist_table;533 delete processlist_table;
451 delete ref_constraint_table;534 delete ref_constraint_table;
452 delete schemata_table;535 delete schemata_table;
536 delete sess_stat_table;
537 delete sess_var_table;
453 delete stats_table;538 delete stats_table;
539 delete status_table;
454 delete tab_constraints_table;540 delete tab_constraints_table;
455 delete tables_table;541 delete tables_table;
456 delete tab_names_table;542 delete tab_names_table;
543 delete var_table;
457}544}
458545
459/**546/**
@@ -486,15 +573,21 @@
486 registry.add(coll_char_set_table);573 registry.add(coll_char_set_table);
487 registry.add(columns_table);574 registry.add(columns_table);
488 registry.add(key_col_usage_table);575 registry.add(key_col_usage_table);
576 registry.add(global_stat_table);
577 registry.add(global_var_table);
489 registry.add(open_tab_table);578 registry.add(open_tab_table);
490 registry.add(plugins_table);579 registry.add(plugins_table);
491 registry.add(processlist_table);580 registry.add(processlist_table);
492 registry.add(ref_constraint_table);581 registry.add(ref_constraint_table);
493 registry.add(schemata_table);582 registry.add(schemata_table);
583 registry.add(sess_stat_table);
584 registry.add(sess_var_table);
494 registry.add(stats_table);585 registry.add(stats_table);
586 registry.add(status_table);
495 registry.add(tab_constraints_table);587 registry.add(tab_constraints_table);
496 registry.add(tables_table);588 registry.add(tables_table);
497 registry.add(tab_names_table);589 registry.add(tab_names_table);
590 registry.add(var_table);
498591
499 return 0;592 return 0;
500}593}
@@ -512,15 +605,21 @@
512 registry.remove(coll_char_set_table);605 registry.remove(coll_char_set_table);
513 registry.remove(columns_table);606 registry.remove(columns_table);
514 registry.remove(key_col_usage_table);607 registry.remove(key_col_usage_table);
608 registry.remove(global_stat_table);
609 registry.remove(global_var_table);
515 registry.remove(open_tab_table);610 registry.remove(open_tab_table);
516 registry.remove(plugins_table);611 registry.remove(plugins_table);
517 registry.remove(processlist_table);612 registry.remove(processlist_table);
518 registry.remove(ref_constraint_table);613 registry.remove(ref_constraint_table);
519 registry.remove(schemata_table);614 registry.remove(schemata_table);
615 registry.remove(sess_stat_table);
616 registry.remove(sess_var_table);
520 registry.remove(stats_table);617 registry.remove(stats_table);
618 registry.remove(status_table);
521 registry.remove(tab_constraints_table);619 registry.remove(tab_constraints_table);
522 registry.remove(tables_table);620 registry.remove(tables_table);
523 registry.remove(tab_names_table);621 registry.remove(tab_names_table);
622 registry.remove(var_table);
524623
525 cleanupTableMethods();624 cleanupTableMethods();
526 cleanupTableColumns();625 cleanupTableColumns();
527626
=== modified file 'plugin/info_schema/info_schema_columns.cc'
--- plugin/info_schema/info_schema_columns.cc 2009-07-01 03:36:14 +0000
+++ plugin/info_schema/info_schema_columns.cc 2009-07-05 17:26:20 +0000
@@ -1384,6 +1384,38 @@
1384 return false;1384 return false;
1385}1385}
13861386
1387bool createStatusColumns(vector<const ColumnInfo *>& cols)
1388{
1389 const ColumnInfo *name= new(std::nothrow) ColumnInfo("VARIABLE_NAME",
1390 64,
1391 DRIZZLE_TYPE_VARCHAR,
1392 0,
1393 0,
1394 "Variable_name",
1395 SKIP_OPEN_TABLE);
1396 if (name == NULL)
1397 {
1398 return true;
1399 }
1400
1401 const ColumnInfo *value= new(std::nothrow) ColumnInfo("VARIABLE_VALUE",
1402 16300,
1403 DRIZZLE_TYPE_VARCHAR,
1404 0,
1405 1,
1406 "Value",
1407 SKIP_OPEN_TABLE);
1408 if (value == NULL)
1409 {
1410 return true;
1411 }
1412
1413 cols.push_back(name);
1414 cols.push_back(value);
1415
1416 return false;
1417}
1418
1387bool createTabConstraintsColumns(vector<const ColumnInfo *>& cols)1419bool createTabConstraintsColumns(vector<const ColumnInfo *>& cols)
1388{1420{
1389 const ColumnInfo *cat= new(std::nothrow) ColumnInfo("CONSTRAINT_CATALOG",1421 const ColumnInfo *cat= new(std::nothrow) ColumnInfo("CONSTRAINT_CATALOG",
13901422
=== modified file 'plugin/info_schema/info_schema_columns.h'
--- plugin/info_schema/info_schema_columns.h 2009-07-01 03:36:14 +0000
+++ plugin/info_schema/info_schema_columns.h 2009-07-05 17:26:20 +0000
@@ -130,6 +130,15 @@
130bool createStatsColumns(std::vector<const ColumnInfo *>& cols);130bool createStatsColumns(std::vector<const ColumnInfo *>& cols);
131131
132/**132/**
133 * Create the various volumns for numerous I_S tables
134 * and add them to the std::vector of columns for these table.
135 *
136 * @param[out] cols vector to add columns to
137 * @return false on success; true on failure
138 */
139bool createStatusColumns(std::vector<const ColumnInfo *>& cols);
140
141/**
133 * Create the various volumns for the TABLE_CONSTRAINTS I_S table 142 * Create the various volumns for the TABLE_CONSTRAINTS I_S table
134 * and add them to the std::vector of columns for this table.143 * and add them to the std::vector of columns for this table.
135 *144 *
136145
=== modified file 'plugin/info_schema/info_schema_methods.cc'
--- plugin/info_schema/info_schema_methods.cc 2009-07-02 06:54:37 +0000
+++ plugin/info_schema/info_schema_methods.cc 2009-07-05 17:44:13 +0000
@@ -36,6 +36,171 @@
3636
37using namespace std;37using namespace std;
3838
39static inline void make_upper(char *buf)
40{
41 for (; *buf; buf++)
42 *buf= my_toupper(system_charset_info, *buf);
43}
44
45static bool show_status_array(Session *session, const char *wild,
46 SHOW_VAR *variables,
47 enum enum_var_type value_type,
48 struct system_status_var *status_var,
49 const char *prefix, Table *table,
50 bool ucase_names)
51{
52 MY_ALIGNED_BYTE_ARRAY(buff_data, SHOW_VAR_FUNC_BUFF_SIZE, int64_t);
53 char * const buff= (char *) &buff_data;
54 char *prefix_end;
55 /* the variable name should not be longer than 64 characters */
56 char name_buffer[64];
57 int len;
58 SHOW_VAR tmp, *var;
59
60 prefix_end= strncpy(name_buffer, prefix, sizeof(name_buffer)-1);
61 prefix_end+= strlen(prefix);
62
63 if (*prefix)
64 *prefix_end++= '_';
65 len=name_buffer + sizeof(name_buffer) - prefix_end;
66
67 for (; variables->name; variables++)
68 {
69 strncpy(prefix_end, variables->name, len);
70 name_buffer[sizeof(name_buffer)-1]=0; /* Safety */
71 if (ucase_names)
72 make_upper(name_buffer);
73
74 /*
75 if var->type is SHOW_FUNC, call the function.
76 Repeat as necessary, if new var is again SHOW_FUNC
77 */
78 for (var=variables; var->type == SHOW_FUNC; var= &tmp)
79 ((mysql_show_var_func)((st_show_var_func_container *)var->value)->func)(&tmp, buff);
80
81 SHOW_TYPE show_type=var->type;
82 if (show_type == SHOW_ARRAY)
83 {
84 show_status_array(session, wild, (SHOW_VAR *) var->value, value_type,
85 status_var, name_buffer, table, ucase_names);
86 }
87 else
88 {
89 if (!(wild && wild[0] && wild_case_compare(system_charset_info,
90 name_buffer, wild)))
91 {
92 char *value=var->value;
93 const char *pos, *end; // We assign a lot of const's
94 pthread_mutex_lock(&LOCK_global_system_variables);
95
96 if (show_type == SHOW_SYS)
97 {
98 show_type= ((sys_var*) value)->show_type();
99 value= (char*) ((sys_var*) value)->value_ptr(session, value_type,
100 &null_lex_str);
101 }
102
103 pos= end= buff;
104 /*
105 note that value may be == buff. All SHOW_xxx code below
106 should still work in this case
107 */
108 switch (show_type) {
109 case SHOW_DOUBLE_STATUS:
110 value= ((char *) status_var + (ulong) value);
111 /* fall through */
112 case SHOW_DOUBLE:
113 /* 6 is the default precision for '%f' in sprintf() */
114 end= buff + my_fcvt(*(double *) value, 6, buff, NULL);
115 break;
116 case SHOW_LONG_STATUS:
117 value= ((char *) status_var + (ulong) value);
118 /* fall through */
119 case SHOW_LONG:
120 end= int10_to_str(*(long*) value, buff, 10);
121 break;
122 case SHOW_LONGLONG_STATUS:
123 value= ((char *) status_var + (uint64_t) value);
124 /* fall through */
125 case SHOW_LONGLONG:
126 end= int64_t10_to_str(*(int64_t*) value, buff, 10);
127 break;
128 case SHOW_SIZE:
129 {
130 stringstream ss (stringstream::in);
131 ss << *(size_t*) value;
132
133 string str= ss.str();
134 strncpy(buff, str.c_str(), str.length());
135 end= buff+ str.length();
136 }
137 break;
138 case SHOW_HA_ROWS:
139 end= int64_t10_to_str((int64_t) *(ha_rows*) value, buff, 10);
140 break;
141 case SHOW_BOOL:
142 end+= sprintf(buff,"%s", *(bool*) value ? "ON" : "OFF");
143 break;
144 case SHOW_MY_BOOL:
145 end+= sprintf(buff,"%s", *(bool*) value ? "ON" : "OFF");
146 break;
147 case SHOW_INT:
148 case SHOW_INT_NOFLUSH: // the difference lies in refresh_status()
149 end= int10_to_str((long) *(uint32_t*) value, buff, 10);
150 break;
151 case SHOW_HAVE:
152 {
153 SHOW_COMP_OPTION tmp_option= *(SHOW_COMP_OPTION *)value;
154 pos= show_comp_option_name[(int) tmp_option];
155 end= strchr(pos, '\0');
156 break;
157 }
158 case SHOW_CHAR:
159 {
160 if (!(pos= value))
161 pos= "";
162 end= strchr(pos, '\0');
163 break;
164 }
165 case SHOW_CHAR_PTR:
166 {
167 if (!(pos= *(char**) value))
168 pos= "";
169 end= strchr(pos, '\0');
170 break;
171 }
172 case SHOW_KEY_CACHE_LONG:
173 value= (char*) dflt_key_cache + (ulong)value;
174 end= int10_to_str(*(long*) value, buff, 10);
175 break;
176 case SHOW_KEY_CACHE_LONGLONG:
177 value= (char*) dflt_key_cache + (ulong)value;
178 end= int64_t10_to_str(*(int64_t*) value, buff, 10);
179 break;
180 case SHOW_UNDEF:
181 break; // Return empty string
182 case SHOW_SYS: // Cannot happen
183 default:
184 assert(0);
185 break;
186 }
187 table->restoreRecordAsDefault();
188 table->field[0]->store(name_buffer, strlen(name_buffer),
189 system_charset_info);
190 table->field[1]->store(pos, (uint32_t) (end - pos), system_charset_info);
191 table->field[1]->set_notnull();
192
193 pthread_mutex_unlock(&LOCK_global_system_variables);
194
195 if (schema_table_store_record(session, table))
196 return true;
197 }
198 }
199 }
200
201 return false;
202}
203
39int CharSetISMethods::fillTable(Session *session, TableList *tables, COND *)204int CharSetISMethods::fillTable(Session *session, TableList *tables, COND *)
40{205{
41 CHARSET_INFO **cs;206 CHARSET_INFO **cs;
@@ -786,6 +951,46 @@
786 return(res);951 return(res);
787}952}
788953
954int StatusISMethods::fillTable(Session *session, TableList *tables, COND *)
955{
956 LEX *lex= session->lex;
957 const char *wild= lex->wild ? lex->wild->ptr() : NULL;
958 int res= 0;
959 STATUS_VAR *tmp1, tmp;
960 const string schema_table_name= tables->schema_table->getTableName();
961 enum enum_var_type option_type;
962 bool upper_case_names= (schema_table_name.compare("STATUS") != 0);
963
964 if (schema_table_name.compare("STATUS") == 0)
965 {
966 option_type= lex->option_type;
967 if (option_type == OPT_GLOBAL)
968 tmp1= &tmp;
969 else
970 tmp1= session->initial_status_var;
971 }
972 else if (schema_table_name.compare("GLOBAL_STATUS") == 0)
973 {
974 option_type= OPT_GLOBAL;
975 tmp1= &tmp;
976 }
977 else
978 {
979 option_type= OPT_SESSION;
980 tmp1= &session->status_var;
981 }
982
983 pthread_mutex_lock(&LOCK_status);
984 if (option_type == OPT_GLOBAL)
985 calc_sum_of_all_status(&tmp);
986 res= show_status_array(session, wild,
987 getFrontOfStatusVars(),
988 option_type, tmp1, "", tables->table,
989 upper_case_names);
990 pthread_mutex_unlock(&LOCK_status);
991 return(res);
992}
993
789static bool store_constraints(Session *session, Table *table, LEX_STRING *db_name,994static bool store_constraints(Session *session, Table *table, LEX_STRING *db_name,
790 LEX_STRING *table_name, const char *key_name,995 LEX_STRING *table_name, const char *key_name,
791 uint32_t key_len, const char *con_type, uint32_t con_len)996 uint32_t key_len, const char *con_type, uint32_t con_len)
@@ -1118,3 +1323,27 @@
1118 }1323 }
1119 return 0;1324 return 0;
1120}1325}
1326
1327int VariablesISMethods::fillTable(Session *session, TableList *tables, COND *)
1328{
1329 int res= 0;
1330 LEX *lex= session->lex;
1331 const char *wild= lex->wild ? lex->wild->ptr() : NULL;
1332 const string schema_table_name= tables->schema_table->getTableName();
1333 enum enum_var_type option_type= OPT_SESSION;
1334 bool upper_case_names= (schema_table_name.compare("VARIABLES") != 0);
1335 bool sorted_vars= (schema_table_name.compare("VARIABLES") == 0);
1336
1337 if (lex->option_type == OPT_GLOBAL ||
1338 schema_table_name.compare("GLOBAL_VARIABLES") == 0)
1339 {
1340 option_type= OPT_GLOBAL;
1341 }
1342
1343 pthread_rwlock_rdlock(&LOCK_system_variables_hash);
1344 res= show_status_array(session, wild, enumerate_sys_vars(session, sorted_vars),
1345 option_type, NULL, "", tables->table, upper_case_names);
1346 pthread_rwlock_unlock(&LOCK_system_variables_hash);
1347 return(res);
1348}
1349
11211350
=== modified file 'plugin/info_schema/info_schema_methods.h'
--- plugin/info_schema/info_schema_methods.h 2009-07-01 03:36:14 +0000
+++ plugin/info_schema/info_schema_methods.h 2009-07-05 17:44:13 +0000
@@ -192,6 +192,20 @@
192};192};
193193
194/**194/**
195 * @class StatusISMethods
196 * @brief
197 * Class which implements any methods that the STATUS
198 * I_S table needs besides the default methods
199 */
200class StatusISMethods : public InfoSchemaMethods
201{
202public:
203 virtual int fillTable(Session *session,
204 TableList *tables,
205 COND *cond);
206};
207
208/**
195 * @class TabConstraintsISMethods209 * @class TabConstraintsISMethods
196 * @brief210 * @brief
197 * Class which implements any methods that the TABLE_CONSTRAINTS211 * Class which implements any methods that the TABLE_CONSTRAINTS
@@ -231,4 +245,18 @@
231 virtual int oldFormat(Session *session, InfoSchemaTable *schema_table) const;245 virtual int oldFormat(Session *session, InfoSchemaTable *schema_table) const;
232};246};
233247
248/**
249 * @class VariablesISMethods
250 * @brief
251 * Class which implements any methods that the VARIABLES
252 * I_S table needs besides the default methods
253 */
254class VariablesISMethods : public InfoSchemaMethods
255{
256public:
257 virtual int fillTable(Session *session,
258 TableList *tables,
259 COND *cond);
260};
261
234#endif /* DRIZZLE_INFO_SCHEMA_METHODS_H */262#endif /* DRIZZLE_INFO_SCHEMA_METHODS_H */
235263
=== modified file 'tests/r/information_schema.result'
--- tests/r/information_schema.result 2009-07-01 03:38:19 +0000
+++ tests/r/information_schema.result 2009-07-05 18:46:45 +0000
@@ -244,10 +244,6 @@
244 )244 )
245AND t.table_name NOT LIKE 'falcon%';245AND t.table_name NOT LIKE 'falcon%';
246table_name column_name246table_name column_name
247GLOBAL_STATUS VARIABLE_NAME
248GLOBAL_VARIABLES VARIABLE_NAME
249SESSION_STATUS VARIABLE_NAME
250SESSION_VARIABLES VARIABLE_NAME
251INNODB_TRX trx_id247INNODB_TRX trx_id
252INNODB_LOCKS lock_id248INNODB_LOCKS lock_id
253INNODB_LOCK_WAITS requesting_trx_id249INNODB_LOCK_WAITS requesting_trx_id
@@ -260,10 +256,14 @@
260COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME256COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
261COLUMNS TABLE_SCHEMA257COLUMNS TABLE_SCHEMA
262KEY_COLUMN_USAGE CONSTRAINT_SCHEMA258KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
259GLOBAL_STATUS VARIABLE_NAME
260GLOBAL_VARIABLES VARIABLE_NAME
263PLUGINS PLUGIN_NAME261PLUGINS PLUGIN_NAME
264PROCESSLIST ID262PROCESSLIST ID
265REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA263REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
266SCHEMATA SCHEMA_NAME264SCHEMATA SCHEMA_NAME
265SESSION_STATUS VARIABLE_NAME
266SESSION_VARIABLES VARIABLE_NAME
267STATISTICS TABLE_SCHEMA267STATISTICS TABLE_SCHEMA
268TABLE_CONSTRAINTS CONSTRAINT_SCHEMA268TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
269TABLES TABLE_SCHEMA269TABLES TABLE_SCHEMA
@@ -283,10 +283,6 @@
283 )283 )
284AND t.table_name NOT LIKE 'falcon%';284AND t.table_name NOT LIKE 'falcon%';
285table_name column_name285table_name column_name
286GLOBAL_STATUS VARIABLE_NAME
287GLOBAL_VARIABLES VARIABLE_NAME
288SESSION_STATUS VARIABLE_NAME
289SESSION_VARIABLES VARIABLE_NAME
290INNODB_TRX trx_id286INNODB_TRX trx_id
291INNODB_LOCKS lock_id287INNODB_LOCKS lock_id
292INNODB_LOCK_WAITS requesting_trx_id288INNODB_LOCK_WAITS requesting_trx_id
@@ -299,10 +295,14 @@
299COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME295COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
300COLUMNS TABLE_SCHEMA296COLUMNS TABLE_SCHEMA
301KEY_COLUMN_USAGE CONSTRAINT_SCHEMA297KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
298GLOBAL_STATUS VARIABLE_NAME
299GLOBAL_VARIABLES VARIABLE_NAME
302PLUGINS PLUGIN_NAME300PLUGINS PLUGIN_NAME
303PROCESSLIST ID301PROCESSLIST ID
304REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA302REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
305SCHEMATA SCHEMA_NAME303SCHEMATA SCHEMA_NAME
304SESSION_STATUS VARIABLE_NAME
305SESSION_VARIABLES VARIABLE_NAME
306STATISTICS TABLE_SCHEMA306STATISTICS TABLE_SCHEMA
307TABLE_CONSTRAINTS CONSTRAINT_SCHEMA307TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
308TABLES TABLE_SCHEMA308TABLES TABLE_SCHEMA
@@ -465,151 +465,156 @@
465FROM information_schema.processlist465FROM information_schema.processlist
466WHERE id = CONNECTION_ID() Query test466WHERE id = CONNECTION_ID() Query test
467SELECT *467SELECT *
468FROM information_schema.character_sets;468FROM information_schema.character_sets
469ORDER BY character_set_name;
469CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN470CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
471binary binary 1
470utf8 utf8_general_ci UTF-8 Unicode 4472utf8 utf8_general_ci UTF-8 Unicode 4
471binary binary 1
472SELECT *473SELECT *
473FROM information_schema.collations;474FROM information_schema.collations
475ORDER BY collation_name;
474COLLATION_NAME CHARACTER_SET_NAME DESCRIPTION ID IS_DEFAULT IS_COMPILED SORTLEN476COLLATION_NAME CHARACTER_SET_NAME DESCRIPTION ID IS_DEFAULT IS_COMPILED SORTLEN
477binary binary 63 0 Yes 1 0
478utf8_bin utf8 46 0 Yes 1 0
479utf8_czech_ci utf8 234 0 Yes 8 0
480utf8_danish_ci utf8 235 0 Yes 8 0
481utf8_esperanto_ci utf8 241 0 Yes 8 0
482utf8_estonian_ci utf8 230 0 Yes 8 0
475utf8_general_ci utf8 45 0 Yes 1 0483utf8_general_ci utf8 45 0 Yes 1 0
476utf8_bin utf8 46 0 Yes 1 0484utf8_hungarian_ci utf8 242 0 Yes 8 0
477utf8_unicode_ci utf8 224 0 Yes 8 0
478utf8_icelandic_ci utf8 225 0 Yes 8 0485utf8_icelandic_ci utf8 225 0 Yes 8 0
479utf8_latvian_ci utf8 226 0 Yes 8 0486utf8_latvian_ci utf8 226 0 Yes 8 0
487utf8_lithuanian_ci utf8 236 0 Yes 8 0
488utf8_persian_ci utf8 240 0 Yes 8 0
489utf8_polish_ci utf8 229 0 Yes 8 0
480utf8_romanian_ci utf8 227 0 Yes 8 0490utf8_romanian_ci utf8 227 0 Yes 8 0
491utf8_roman_ci utf8 239 0 Yes 8 0
492utf8_sinhala_ci utf8 243 0 Yes 8 0
493utf8_slovak_ci utf8 237 0 Yes 8 0
481utf8_slovenian_ci utf8 228 0 Yes 8 0494utf8_slovenian_ci utf8 228 0 Yes 8 0
482utf8_polish_ci utf8 229 0 Yes 8 0495utf8_spanish2_ci utf8 238 0 Yes 8 0
483utf8_estonian_ci utf8 230 0 Yes 8 0
484utf8_spanish_ci utf8 231 0 Yes 8 0496utf8_spanish_ci utf8 231 0 Yes 8 0
485utf8_swedish_ci utf8 232 0 Yes 8 0497utf8_swedish_ci utf8 232 0 Yes 8 0
486utf8_turkish_ci utf8 233 0 Yes 8 0498utf8_turkish_ci utf8 233 0 Yes 8 0
487utf8_czech_ci utf8 234 0 Yes 8 0499utf8_unicode_ci utf8 224 0 Yes 8 0
488utf8_danish_ci utf8 235 0 Yes 8 0
489utf8_lithuanian_ci utf8 236 0 Yes 8 0
490utf8_slovak_ci utf8 237 0 Yes 8 0
491utf8_spanish2_ci utf8 238 0 Yes 8 0
492utf8_roman_ci utf8 239 0 Yes 8 0
493utf8_persian_ci utf8 240 0 Yes 8 0
494utf8_esperanto_ci utf8 241 0 Yes 8 0
495utf8_hungarian_ci utf8 242 0 Yes 8 0
496utf8_sinhala_ci utf8 243 0 Yes 8 0
497binary binary 63 0 Yes 1 0
498SELECT * 500SELECT *
499FROM information_schema.collation_character_set_applicability;501FROM information_schema.collation_character_set_applicability
502ORDER BY collation_name;
500COLLATION_NAME CHARACTER_SET_NAME503COLLATION_NAME CHARACTER_SET_NAME
504binary binary
505utf8_bin utf8
506utf8_czech_ci utf8
507utf8_danish_ci utf8
508utf8_esperanto_ci utf8
509utf8_estonian_ci utf8
501utf8_general_ci utf8510utf8_general_ci utf8
502utf8_bin utf8511utf8_hungarian_ci utf8
503utf8_unicode_ci utf8
504utf8_icelandic_ci utf8512utf8_icelandic_ci utf8
505utf8_latvian_ci utf8513utf8_latvian_ci utf8
514utf8_lithuanian_ci utf8
515utf8_persian_ci utf8
516utf8_polish_ci utf8
506utf8_romanian_ci utf8517utf8_romanian_ci utf8
518utf8_roman_ci utf8
519utf8_sinhala_ci utf8
520utf8_slovak_ci utf8
507utf8_slovenian_ci utf8521utf8_slovenian_ci utf8
508utf8_polish_ci utf8522utf8_spanish2_ci utf8
509utf8_estonian_ci utf8
510utf8_spanish_ci utf8523utf8_spanish_ci utf8
511utf8_swedish_ci utf8524utf8_swedish_ci utf8
512utf8_turkish_ci utf8525utf8_turkish_ci utf8
513utf8_czech_ci utf8526utf8_unicode_ci utf8
514utf8_danish_ci utf8
515utf8_lithuanian_ci utf8
516utf8_slovak_ci utf8
517utf8_spanish2_ci utf8
518utf8_roman_ci utf8
519utf8_persian_ci utf8
520utf8_esperanto_ci utf8
521utf8_hungarian_ci utf8
522utf8_sinhala_ci utf8
523binary binary
524SELECT table_name, column_name527SELECT table_name, column_name
525FROM information_schema.columns;528FROM information_schema.columns
529ORDER BY table_name;
526table_name column_name530table_name column_name
527GLOBAL_STATUS VARIABLE_NAME531CHARACTER_SETS MAXLEN
528GLOBAL_STATUS VARIABLE_VALUE532CHARACTER_SETS DESCRIPTION
529GLOBAL_VARIABLES VARIABLE_NAME
530GLOBAL_VARIABLES VARIABLE_VALUE
531SESSION_STATUS VARIABLE_NAME
532SESSION_STATUS VARIABLE_VALUE
533SESSION_VARIABLES VARIABLE_NAME
534SESSION_VARIABLES VARIABLE_VALUE
535INNODB_TRX trx_id
536INNODB_TRX trx_state
537INNODB_TRX trx_started
538INNODB_TRX trx_requested_lock_id
539INNODB_TRX trx_wait_started
540INNODB_TRX trx_weight
541INNODB_TRX trx_mysql_thread_id
542INNODB_TRX trx_query
543INNODB_LOCKS lock_id
544INNODB_LOCKS lock_trx_id
545INNODB_LOCKS lock_mode
546INNODB_LOCKS lock_type
547INNODB_LOCKS lock_table
548INNODB_LOCKS lock_index
549INNODB_LOCKS lock_space
550INNODB_LOCKS lock_page
551INNODB_LOCKS lock_rec
552INNODB_LOCKS lock_data
553INNODB_LOCK_WAITS requesting_trx_id
554INNODB_LOCK_WAITS requested_lock_id
555INNODB_LOCK_WAITS blocking_trx_id
556INNODB_LOCK_WAITS blocking_lock_id
557INNODB_CMP page_size
558INNODB_CMP compress_ops
559INNODB_CMP compress_ops_ok
560INNODB_CMP compress_time
561INNODB_CMP uncompress_ops
562INNODB_CMP uncompress_time
563INNODB_CMP_RESET page_size
564INNODB_CMP_RESET compress_ops
565INNODB_CMP_RESET compress_ops_ok
566INNODB_CMP_RESET compress_time
567INNODB_CMP_RESET uncompress_ops
568INNODB_CMP_RESET uncompress_time
569INNODB_CMPMEM page_size
570INNODB_CMPMEM pages_used
571INNODB_CMPMEM pages_free
572INNODB_CMPMEM relocation_ops
573INNODB_CMPMEM relocation_time
574INNODB_CMPMEM_RESET page_size
575INNODB_CMPMEM_RESET pages_used
576INNODB_CMPMEM_RESET pages_free
577INNODB_CMPMEM_RESET relocation_ops
578INNODB_CMPMEM_RESET relocation_time
579CHARACTER_SETS CHARACTER_SET_NAME
580CHARACTER_SETS DEFAULT_COLLATE_NAME533CHARACTER_SETS DEFAULT_COLLATE_NAME
581CHARACTER_SETS DESCRIPTION534CHARACTER_SETS CHARACTER_SET_NAME
582CHARACTER_SETS MAXLEN
583COLLATIONS COLLATION_NAME
584COLLATIONS CHARACTER_SET_NAME
585COLLATIONS DESCRIPTION
586COLLATIONS ID
587COLLATIONS IS_DEFAULT
588COLLATIONS IS_COMPILED535COLLATIONS IS_COMPILED
536COLLATIONS COLLATION_NAME
589COLLATIONS SORTLEN537COLLATIONS SORTLEN
590COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME538COLLATIONS IS_DEFAULT
539COLLATIONS ID
540COLLATIONS DESCRIPTION
541COLLATIONS CHARACTER_SET_NAME
591COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME542COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME
543COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
544COLUMNS PRIVILEGES
545COLUMNS TABLE_SCHEMA
546COLUMNS TABLE_NAME
592COLUMNS TABLE_CATALOG547COLUMNS TABLE_CATALOG
593COLUMNS TABLE_SCHEMA
594COLUMNS TABLE_NAME
595COLUMNS COLUMN_NAME548COLUMNS COLUMN_NAME
596COLUMNS ORDINAL_POSITION549COLUMNS ORDINAL_POSITION
597COLUMNS COLUMN_DEFAULT550COLUMNS COLUMN_DEFAULT
598COLUMNS IS_NULLABLE551COLUMNS IS_NULLABLE
599COLUMNS DATA_TYPE552COLUMNS FORMAT
600COLUMNS CHARACTER_MAXIMUM_LENGTH553COLUMNS COLLATION_NAME
601COLUMNS CHARACTER_OCTET_LENGTH
602COLUMNS NUMERIC_PRECISION
603COLUMNS NUMERIC_SCALE
604COLUMNS CHARACTER_SET_NAME554COLUMNS CHARACTER_SET_NAME
605COLUMNS COLLATION_NAME555COLUMNS COLUMN_COMMENT
606COLUMNS COLUMN_TYPE556COLUMNS COLUMN_TYPE
607COLUMNS COLUMN_KEY557COLUMNS COLUMN_KEY
608COLUMNS EXTRA558COLUMNS EXTRA
609COLUMNS PRIVILEGES
610COLUMNS COLUMN_COMMENT
611COLUMNS STORAGE559COLUMNS STORAGE
612COLUMNS FORMAT560COLUMNS NUMERIC_SCALE
561COLUMNS NUMERIC_PRECISION
562COLUMNS CHARACTER_OCTET_LENGTH
563COLUMNS DATA_TYPE
564COLUMNS CHARACTER_MAXIMUM_LENGTH
565GLOBAL_STATUS VARIABLE_NAME
566GLOBAL_STATUS VARIABLE_VALUE
567GLOBAL_VARIABLES VARIABLE_VALUE
568GLOBAL_VARIABLES VARIABLE_NAME
569INNODB_CMP compress_time
570INNODB_CMP uncompress_ops
571INNODB_CMP compress_ops
572INNODB_CMP page_size
573INNODB_CMP uncompress_time
574INNODB_CMP compress_ops_ok
575INNODB_CMPMEM relocation_time
576INNODB_CMPMEM relocation_ops
577INNODB_CMPMEM pages_used
578INNODB_CMPMEM page_size
579INNODB_CMPMEM pages_free
580INNODB_CMPMEM_RESET relocation_time
581INNODB_CMPMEM_RESET relocation_ops
582INNODB_CMPMEM_RESET pages_free
583INNODB_CMPMEM_RESET pages_used
584INNODB_CMPMEM_RESET page_size
585INNODB_CMP_RESET page_size
586INNODB_CMP_RESET compress_ops
587INNODB_CMP_RESET compress_ops_ok
588INNODB_CMP_RESET compress_time
589INNODB_CMP_RESET uncompress_ops
590INNODB_CMP_RESET uncompress_time
591INNODB_LOCKS lock_index
592INNODB_LOCKS lock_table
593INNODB_LOCKS lock_type
594INNODB_LOCKS lock_trx_id
595INNODB_LOCKS lock_id
596INNODB_LOCKS lock_mode
597INNODB_LOCKS lock_space
598INNODB_LOCKS lock_page
599INNODB_LOCKS lock_rec
600INNODB_LOCKS lock_data
601INNODB_LOCK_WAITS blocking_lock_id
602INNODB_LOCK_WAITS blocking_trx_id
603INNODB_LOCK_WAITS requested_lock_id
604INNODB_LOCK_WAITS requesting_trx_id
605INNODB_TRX trx_id
606INNODB_TRX trx_state
607INNODB_TRX trx_started
608INNODB_TRX trx_requested_lock_id
609INNODB_TRX trx_wait_started
610INNODB_TRX trx_weight
611INNODB_TRX trx_mysql_thread_id
612INNODB_TRX trx_query
613KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME
614KEY_COLUMN_USAGE REFERENCED_TABLE_NAME
615KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA
616KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT
617KEY_COLUMN_USAGE ORDINAL_POSITION
613KEY_COLUMN_USAGE CONSTRAINT_CATALOG618KEY_COLUMN_USAGE CONSTRAINT_CATALOG
614KEY_COLUMN_USAGE CONSTRAINT_SCHEMA619KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
615KEY_COLUMN_USAGE CONSTRAINT_NAME620KEY_COLUMN_USAGE CONSTRAINT_NAME
@@ -617,50 +622,40 @@
617KEY_COLUMN_USAGE TABLE_SCHEMA622KEY_COLUMN_USAGE TABLE_SCHEMA
618KEY_COLUMN_USAGE TABLE_NAME623KEY_COLUMN_USAGE TABLE_NAME
619KEY_COLUMN_USAGE COLUMN_NAME624KEY_COLUMN_USAGE COLUMN_NAME
620KEY_COLUMN_USAGE ORDINAL_POSITION625PLUGINS PLUGIN_LICENSE
621KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT626PLUGINS PLUGIN_DESCRIPTION
622KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA627PLUGINS PLUGIN_AUTHOR
623KEY_COLUMN_USAGE REFERENCED_TABLE_NAME628PLUGINS PLUGIN_STATUS
624KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME
625PLUGINS PLUGIN_NAME
626PLUGINS PLUGIN_VERSION629PLUGINS PLUGIN_VERSION
627PLUGINS PLUGIN_STATUS630PLUGINS PLUGIN_NAME
628PLUGINS PLUGIN_AUTHOR631PROCESSLIST INFO
629PLUGINS PLUGIN_DESCRIPTION632PROCESSLIST STATE
630PLUGINS PLUGIN_LICENSE633PROCESSLIST TIME
631PROCESSLIST ID634PROCESSLIST COMMAND
635PROCESSLIST DB
636PROCESSLIST HOST
632PROCESSLIST USER637PROCESSLIST USER
633PROCESSLIST HOST638PROCESSLIST ID
634PROCESSLIST DB639REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME
635PROCESSLIST COMMAND640REFERENTIAL_CONSTRAINTS TABLE_NAME
636PROCESSLIST TIME641REFERENTIAL_CONSTRAINTS DELETE_RULE
637PROCESSLIST STATE642REFERENTIAL_CONSTRAINTS UPDATE_RULE
638PROCESSLIST INFO643REFERENTIAL_CONSTRAINTS MATCH_OPTION
644REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME
645REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA
646REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG
647REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME
648REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
639REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG649REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG
640REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA650SCHEMATA SQL_PATH
641REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME651SCHEMATA DEFAULT_COLLATION_NAME
642REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG652SCHEMATA DEFAULT_CHARACTER_SET_NAME
643REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA653SCHEMATA SCHEMA_NAME
644REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME
645REFERENTIAL_CONSTRAINTS MATCH_OPTION
646REFERENTIAL_CONSTRAINTS UPDATE_RULE
647REFERENTIAL_CONSTRAINTS DELETE_RULE
648REFERENTIAL_CONSTRAINTS TABLE_NAME
649REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME
650SCHEMATA CATALOG_NAME654SCHEMATA CATALOG_NAME
651SCHEMATA SCHEMA_NAME655SESSION_STATUS VARIABLE_VALUE
652SCHEMATA DEFAULT_CHARACTER_SET_NAME656SESSION_STATUS VARIABLE_NAME
653SCHEMATA DEFAULT_COLLATION_NAME657SESSION_VARIABLES VARIABLE_NAME
654SCHEMATA SQL_PATH658SESSION_VARIABLES VARIABLE_VALUE
655STATISTICS TABLE_CATALOG
656STATISTICS TABLE_SCHEMA
657STATISTICS TABLE_NAME
658STATISTICS NON_UNIQUE
659STATISTICS INDEX_SCHEMA
660STATISTICS INDEX_NAME
661STATISTICS SEQ_IN_INDEX
662STATISTICS COLUMN_NAME
663STATISTICS COLLATION
664STATISTICS CARDINALITY659STATISTICS CARDINALITY
665STATISTICS SUB_PART660STATISTICS SUB_PART
666STATISTICS PACKED661STATISTICS PACKED
@@ -668,20 +663,15 @@
668STATISTICS INDEX_TYPE663STATISTICS INDEX_TYPE
669STATISTICS COMMENT664STATISTICS COMMENT
670STATISTICS INDEX_COMMENT665STATISTICS INDEX_COMMENT
671TABLE_CONSTRAINTS CONSTRAINT_CATALOG666STATISTICS COLLATION
672TABLE_CONSTRAINTS CONSTRAINT_SCHEMA667STATISTICS COLUMN_NAME
673TABLE_CONSTRAINTS CONSTRAINT_NAME668STATISTICS TABLE_CATALOG
674TABLE_CONSTRAINTS TABLE_SCHEMA669STATISTICS TABLE_SCHEMA
675TABLE_CONSTRAINTS TABLE_NAME670STATISTICS TABLE_NAME
676TABLE_CONSTRAINTS CONSTRAINT_TYPE671STATISTICS NON_UNIQUE
677TABLES TABLE_CATALOG672STATISTICS INDEX_SCHEMA
678TABLES TABLE_SCHEMA673STATISTICS INDEX_NAME
679TABLES TABLE_NAME674STATISTICS SEQ_IN_INDEX
680TABLES TABLE_TYPE
681TABLES ENGINE
682TABLES VERSION
683TABLES ROW_FORMAT
684TABLES TABLE_ROWS
685TABLES AVG_ROW_LENGTH675TABLES AVG_ROW_LENGTH
686TABLES DATA_LENGTH676TABLES DATA_LENGTH
687TABLES MAX_DATA_LENGTH677TABLES MAX_DATA_LENGTH
@@ -694,7 +684,21 @@
694TABLES TABLE_COLLATION684TABLES TABLE_COLLATION
695TABLES CHECKSUM685TABLES CHECKSUM
696TABLES CREATE_OPTIONS686TABLES CREATE_OPTIONS
687TABLES TABLE_ROWS
688TABLES ROW_FORMAT
697TABLES TABLE_COMMENT689TABLES TABLE_COMMENT
690TABLES TABLE_CATALOG
691TABLES TABLE_SCHEMA
692TABLES TABLE_NAME
693TABLES TABLE_TYPE
694TABLES ENGINE
695TABLES VERSION
696TABLE_CONSTRAINTS TABLE_NAME
697TABLE_CONSTRAINTS TABLE_SCHEMA
698TABLE_CONSTRAINTS CONSTRAINT_NAME
699TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
700TABLE_CONSTRAINTS CONSTRAINT_CATALOG
701TABLE_CONSTRAINTS CONSTRAINT_TYPE
698SELECT *702SELECT *
699FROM information_schema.key_column_usage;703FROM information_schema.key_column_usage;
700CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME704CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
@@ -702,37 +706,373 @@
702FROM information_schema.referential_constraints;706FROM information_schema.referential_constraints;
703CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME707CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
704SELECT catalog_name, schema_name708SELECT catalog_name, schema_name
705FROM information_schema.schemata;709FROM information_schema.schemata
710ORDER BY schema_name;
706catalog_name schema_name711catalog_name schema_name
707NULL information_schema712NULL information_schema
708NULL mysql713NULL mysql
709NULL test714NULL test
710SELECT *715SELECT *
716FROM information_schema.session_status
717ORDER BY variable_name;
718VARIABLE_NAME VARIABLE_VALUE
719# #
720# #
721# #
722# #
723# #
724# #
725# #
726# #
727# #
728# #
729# #
730# #
731# #
732# #
733# #
734# #
735# #
736# #
737# #
738# #
739# #
740# #
741# #
742# #
743# #
744# #
745# #
746# #
747# #
748# #
749# #
750# #
751# #
752# #
753# #
754# #
755# #
756# #
757# #
758# #
759# #
760# #
761# #
762# #
763# #
764# #
765# #
766# #
767# #
768# #
769# #
770# #
771# #
772# #
773# #
774# #
775# #
776# #
777# #
778# #
779# #
780# #
781# #
782# #
783# #
784# #
785# #
786# #
787# #
788# #
789# #
790# #
791# #
792# #
793# #
794# #
795# #
796# #
797# #
798# #
799# #
800# #
801# #
802# #
803# #
804# #
805# #
806# #
807# #
808# #
809# #
810# #
811# #
812# #
813# #
814# #
815# #
816# #
817# #
818# #
819# #
820# #
821# #
822# #
823# #
824# #
825# #
826# #
827SHOW STATUS;
828Variable_name Value
829# #
830# #
831# #
832# #
833# #
834# #
835# #
836# #
837# #
838# #
839# #
840# #
841# #
842# #
843# #
844# #
845# #
846# #
847# #
848# #
849# #
850# #
851# #
852# #
853# #
854# #
855# #
856# #
857# #
858# #
859# #
860# #
861# #
862# #
863# #
864# #
865# #
866# #
867# #
868# #
869# #
870# #
871# #
872# #
873# #
874# #
875# #
876# #
877# #
878# #
879# #
880# #
881# #
882# #
883# #
884# #
885# #
886# #
887# #
888# #
889# #
890# #
891# #
892# #
893# #
894# #
895# #
896# #
897# #
898# #
899# #
900# #
901# #
902# #
903# #
904# #
905# #
906# #
907# #
908# #
909# #
910# #
911# #
912# #
913# #
914# #
915# #
916# #
917# #
918# #
919# #
920# #
921# #
922# #
923# #
924# #
925# #
926# #
927# #
928# #
929# #
930# #
931# #
932# #
933# #
934# #
935# #
936# #
937SELECT *
938FROM information_schema.global_status
939ORDER BY variable_name;
940VARIABLE_NAME VARIABLE_VALUE
941# #
942# #
943# #
944# #
945# #
946# #
947# #
948# #
949# #
950# #
951# #
952# #
953# #
954# #
955# #
956# #
957# #
958# #
959# #
960# #
961# #
962# #
963# #
964# #
965# #
966# #
967# #
968# #
969# #
970# #
971# #
972# #
973# #
974# #
975# #
976# #
977# #
978# #
979# #
980# #
981# #
982# #
983# #
984# #
985# #
986# #
987# #
988# #
989# #
990# #
991# #
992# #
993# #
994# #
995# #
996# #
997# #
998# #
999# #
1000# #
1001# #
1002# #
1003# #
1004# #
1005# #
1006# #
1007# #
1008# #
1009# #
1010# #
1011# #
1012# #
1013# #
1014# #
1015# #
1016# #
1017# #
1018# #
1019# #
1020# #
1021# #
1022# #
1023# #
1024# #
1025# #
1026# #
1027# #
1028# #
1029# #
1030# #
1031# #
1032# #
1033# #
1034# #
1035# #
1036# #
1037# #
1038# #
1039# #
1040# #
1041# #
1042# #
1043# #
1044# #
1045# #
1046# #
1047# #
1048# #
1049SELECT *
711FROM information_schema.table_constraints;1050FROM information_schema.table_constraints;
712CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE1051CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
713SELECT table_schema, table_name1052SELECT table_schema, table_name
714FROM information_schema.tables;1053FROM information_schema.tables
1054ORDER BY table_name;
715table_schema table_name1055table_schema table_name
1056information_schema CHARACTER_SETS
1057information_schema COLLATIONS
1058information_schema COLLATION_CHARACTER_SET_APPLICABILITY
1059information_schema COLUMNS
716information_schema GLOBAL_STATUS1060information_schema GLOBAL_STATUS
717information_schema GLOBAL_VARIABLES1061information_schema GLOBAL_VARIABLES
718information_schema SESSION_STATUS
719information_schema SESSION_VARIABLES
720information_schema INNODB_TRX
721information_schema INNODB_LOCKS
722information_schema INNODB_LOCK_WAITS
723information_schema INNODB_CMP1062information_schema INNODB_CMP
724information_schema INNODB_CMP_RESET
725information_schema INNODB_CMPMEM1063information_schema INNODB_CMPMEM
726information_schema INNODB_CMPMEM_RESET1064information_schema INNODB_CMPMEM_RESET
727information_schema CHARACTER_SETS1065information_schema INNODB_CMP_RESET
728information_schema COLLATIONS1066information_schema INNODB_LOCKS
729information_schema COLLATION_CHARACTER_SET_APPLICABILITY1067information_schema INNODB_LOCK_WAITS
730information_schema COLUMNS1068information_schema INNODB_TRX
731information_schema KEY_COLUMN_USAGE1069information_schema KEY_COLUMN_USAGE
732information_schema PLUGINS1070information_schema PLUGINS
733information_schema PROCESSLIST1071information_schema PROCESSLIST
734information_schema REFERENTIAL_CONSTRAINTS1072information_schema REFERENTIAL_CONSTRAINTS
735information_schema SCHEMATA1073information_schema SCHEMATA
1074information_schema SESSION_STATUS
1075information_schema SESSION_VARIABLES
736information_schema STATISTICS1076information_schema STATISTICS
1077information_schema TABLES
737information_schema TABLE_CONSTRAINTS1078information_schema TABLE_CONSTRAINTS
738information_schema TABLES
7391079
=== modified file 'tests/t/information_schema.test'
--- tests/t/information_schema.test 2009-07-01 02:05:39 +0000
+++ tests/t/information_schema.test 2009-07-05 18:46:45 +0000
@@ -412,25 +412,29 @@
412# do a query on the CHARACTER_SET table in I_S 412# do a query on the CHARACTER_SET table in I_S
413#413#
414SELECT *414SELECT *
415FROM information_schema.character_sets;415FROM information_schema.character_sets
416ORDER BY character_set_name;
416417
417#418#
418# perform a query on the COLLATIONS table419# perform a query on the COLLATIONS table
419#420#
420SELECT *421SELECT *
421FROM information_schema.collations;422FROM information_schema.collations
423ORDER BY collation_name;
422424
423#425#
424# perform a query on COLLATION_CHARACTER_SET_APPLICABILITY426# perform a query on COLLATION_CHARACTER_SET_APPLICABILITY
425#427#
426SELECT * 428SELECT *
427FROM information_schema.collation_character_set_applicability;429FROM information_schema.collation_character_set_applicability
430ORDER BY collation_name;
428431
429#432#
430# perform a query on COLUMNS433# perform a query on COLUMNS
431#434#
432SELECT table_name, column_name435SELECT table_name, column_name
433FROM information_schema.columns;436FROM information_schema.columns
437ORDER BY table_name;
434438
435#439#
436# perform a query on KEY_COLUMN_USAGE440# perform a query on KEY_COLUMN_USAGE
@@ -448,7 +452,38 @@
448# query the SCHEMATA table452# query the SCHEMATA table
449#453#
450SELECT catalog_name, schema_name454SELECT catalog_name, schema_name
451FROM information_schema.schemata;455FROM information_schema.schemata
456ORDER BY schema_name;
457
458#
459# Query the STATUS and VARIABLES related
460# I_S related tables.
461#
462--replace_column 1 # 2 #
463SELECT *
464FROM information_schema.session_status
465ORDER BY variable_name;
466
467--replace_column 1 # 2 #
468SHOW STATUS;
469
470#--replace_column 1 # 2 #
471#SELECT *
472#FROM information_schema.session_variables
473#ORDER BY variable_name;
474
475#--replace_column 1 # 2 #
476#SHOW VARIABLES;
477
478--replace_column 1 # 2 #
479SELECT *
480FROM information_schema.global_status
481ORDER BY variable_name;
482
483#--replace_column 1 # 2 #
484#SELECT *
485#FROM information_schema.global_variables
486#ORDER BY variable_name;
452487
453#488#
454# query TABLE_CONSTRAINTS table489# query TABLE_CONSTRAINTS table
@@ -460,7 +495,8 @@
460# query TABLES495# query TABLES
461#496#
462SELECT table_schema, table_name497SELECT table_schema, table_name
463FROM information_schema.tables;498FROM information_schema.tables
499ORDER BY table_name;
464500
465# 501#
466# do a query on the PLUGINS table in I_S to ensure it works correctly502# do a query on the PLUGINS table in I_S to ensure it works correctly