Merge lp:~posulliv/drizzle/info-schema-storage-engine into lp:~drizzle-trunk/drizzle/development
- info-schema-storage-engine
- Merge into development
Status: | Rejected |
---|---|
Rejected by: | Padraig O'Sullivan |
Proposed branch: | lp:~posulliv/drizzle/info-schema-storage-engine |
Merge into: | lp:~drizzle-trunk/drizzle/development |
Diff against target: |
5442 lines 39 files modified
drizzled/definitions.h (+1/-5) drizzled/field/int64_t.cc (+6/-6) drizzled/field/long.cc (+1/-1) drizzled/join.cc (+0/-3) drizzled/plugin/info_schema_table.h (+97/-57) drizzled/plugin/storage_engine.cc (+24/-8) drizzled/plugin/storage_engine.h (+3/-1) drizzled/show.cc (+69/-450) drizzled/show.h (+0/-4) drizzled/sql_base.cc (+0/-12) drizzled/sql_select.cc (+0/-11) drizzled/sql_table.cc (+4/-22) drizzled/table.cc (+6/-0) drizzled/table_list.h (+2/-4) plugin/archive/ha_archive.cc (+2/-4) plugin/blackhole/ha_blackhole.cc (+2/-2) plugin/heap/ha_heap.cc (+2/-2) plugin/info_schema/info_schema_columns.cc (+135/-261) plugin/info_schema/info_schema_methods.cc (+173/-68) plugin/info_schema/info_schema_methods.h (+26/-28) plugin/info_schema_engine/info_schema_cursor.cc (+144/-0) plugin/info_schema_engine/info_schema_cursor.h (+175/-0) plugin/info_schema_engine/info_schema_engine.cc (+195/-0) plugin/info_schema_engine/info_schema_engine.h (+91/-0) plugin/info_schema_engine/open_tables.cc (+72/-0) plugin/info_schema_engine/open_tables.h (+77/-0) plugin/info_schema_engine/plugin.ini (+9/-0) plugin/info_schema_engine/table_name_iterator.cc (+53/-0) plugin/info_schema_engine/table_name_iterator.h (+61/-0) plugin/innobase/handler/ha_innodb.cc (+2/-2) plugin/innobase/handler/i_s.cc (+59/-100) plugin/innobase/handler/i_s.h (+6/-12) plugin/memcached_stats/analysis_table.cc (+13/-25) plugin/memcached_stats/analysis_table.h (+1/-2) plugin/memcached_stats/stats_table.cc (+28/-55) plugin/memcached_stats/stats_table.h (+1/-2) plugin/myisam/ha_myisam.cc (+2/-2) tests/r/create.result (+4/-4) tests/t/create.test (+1/-1) |
To merge this branch: | bzr merge lp:~posulliv/drizzle/info-schema-storage-engine |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Aker | Pending | ||
Review via email: mp+13549@code.launchpad.net |
Commit message
Description of the change
Padraig O'Sullivan (posulliv) wrote : | # |
Jay Pipes (jaypipes) wrote : | # |
Hi Padraig!
A few comments and questions... :)
1) Per our IRC conversation, you should put back the ASSERT_
2) What was the reasoning behind this change?
8 -#define PROCESS_
9 +#define PROCESS_
3) When I saw this removed from drizzled/join.cc:
92 - if ((this-
93 - return;
94 -
and this removed from drizzled/
1070 - /*
1071 - If this TableList object is a placeholder for an information_schema
1072 - table, create a temporary table to represent the information_schema
1073 - table in the query. Do not fill it yet - will be filled during
1074 - execution.
1075 - */
1076 - if (tables-
1077 - {
1078 - if (mysql_
1079 - continue;
1080 - return -1;
1081 - }
I had a little celebration :) No more two different code paths just for selecting from the information_schema \o/ epic win.
4) The following code needs to have the comment removed :)
237 + void addRow(unsigned char *buf, size_t len)
238 + {
239 + /*unsigned char *my_buf= new
240 + unsigned char[len];
241 + memcpy(my_buf, buf, len);
242 + rows.push_
243 + InfoSchemaRecord tmp_rec(buf, len);
244 + rows.push_
245 + }
Also, rows is defined as std::vector<
void addRow(unsigned char *buf, size_t len)
{
InfoSchemaRecord *record= new InfoSchemaRecor
rows.
}
and then cleaning up all those new'd records when the InfoSchemaTable is destroyed (in other words, have the InfoSchemaRecord manage all memory allocation instead of std::vector<>. This would be a little more efficient, as one less memcpy() would be used for each addRow() call.
5) I found this code to be awkward:
434 - error= test(schema_
435 - table, res, db_name,
436 + error= test(schema_
437 + session,
438 + show_table_list,
439 + table,
440 + res,
441 + db_name,
Why is the first param of processTable() schema_table? I mean, "this" would refer to schema_table, no?
6) Indentation off by one here:
699 - XXX-> show_table_list has a flag i_is_requested,
700 - and when it's set, openTables()
701 - can return an error without setting an error message
702 - in Session, which is a hack. This is why we have to
703 - check for res, then for session->is_error() only then
704 - for session-
705 - */
706 + XXX-> show_table_list has a flag i_is_requested,
707 + and when it's set, openTables()
708 + can return an error without setting an error message
709 + in Session, which is a hack. This is why we have to
710 + check for res, then for session->is_error() only then
711 + for session-
712 + */
717 - Hide error for not existing table.
718 - This error can occur for example when we use
719 - where condition with db name and table name and this
720 - table does n...
- 1161. By Padraig O'Sullivan
-
Merge from trunk.
- 1162. By Padraig O'Sullivan
-
Resolved conflicts from the latest merge with trunk.
- 1163. By Padraig O'Sullivan
-
Removed a redundant field from the InfoSchemaColumn class. This allowed us
to remove some redundant flags. - 1164. By Padraig O'Sullivan
-
Modified the fillTable() method to not take a COND as a parameter any more.
- 1165. By Padraig O'Sullivan
-
Merge from trunk.
- 1166. By Padraig O'Sullivan
-
Reworked the processTable() method parameters to be more sane.
- 1167. By Padraig O'Sullivan
-
Taking Jay's review suggestion to change Rows from vector<
InfoSchemaRecor d>
to vector<InfoSchemaRecor d *>. Thanks Jay!
- 1168. By Padraig O'Sullivan
-
Apparently, changing the size of a column in an I_S table makes query
execution work differently...isn't that just magical???So I changed the length of the COLUMN_TYPE column in the COLUMNS table and
some queries from the I_S test case that didn't work before now
work...great.I also changed rnd_pos to return HA_ERR_
WRONG_COMMAND so I can see where it
is getting called from. I need to implement rnd_pos and position next.Some good progress was made tonight though...When I get the 2 methods above
implemented, I should be very very close to having this damn thing working
(although knowing I_S, it will be probably crash and burn for no apparent
reason..)
Brian Aker (brianaker) wrote : | # |
This has been pulled in now (relevant bits were merged).
Unmerged revisions
- 1168. By Padraig O'Sullivan
-
Apparently, changing the size of a column in an I_S table makes query
execution work differently...isn't that just magical???So I changed the length of the COLUMN_TYPE column in the COLUMNS table and
some queries from the I_S test case that didn't work before now
work...great.I also changed rnd_pos to return HA_ERR_
WRONG_COMMAND so I can see where it
is getting called from. I need to implement rnd_pos and position next.Some good progress was made tonight though...When I get the 2 methods above
implemented, I should be very very close to having this damn thing working
(although knowing I_S, it will be probably crash and burn for no apparent
reason..) - 1167. By Padraig O'Sullivan
-
Taking Jay's review suggestion to change Rows from vector<
InfoSchemaRecor d>
to vector<InfoSchemaRecor d *>. Thanks Jay!
- 1166. By Padraig O'Sullivan
-
Reworked the processTable() method parameters to be more sane.
- 1165. By Padraig O'Sullivan
-
Merge from trunk.
- 1164. By Padraig O'Sullivan
-
Modified the fillTable() method to not take a COND as a parameter any more.
- 1163. By Padraig O'Sullivan
-
Removed a redundant field from the InfoSchemaColumn class. This allowed us
to remove some redundant flags. - 1162. By Padraig O'Sullivan
-
Resolved conflicts from the latest merge with trunk.
- 1161. By Padraig O'Sullivan
-
Merge from trunk.
- 1160. By Padraig O'Sullivan
-
Moved a statement into a conditional block where it actually belonged in the
first place. - 1159. By Padraig O'Sullivan
-
Corrected the destructor in the InfoSchemaRecord class.
Preview Diff
1 | === modified file 'drizzled/definitions.h' | |||
2 | --- drizzled/definitions.h 2009-10-21 00:14:57 +0000 | |||
3 | +++ drizzled/definitions.h 2009-10-29 23:56:13 +0000 | |||
4 | @@ -226,7 +226,7 @@ | |||
5 | 226 | /** Characters shown for the command in 'show processlist'. */ | 226 | /** Characters shown for the command in 'show processlist'. */ |
6 | 227 | #define PROCESS_LIST_WIDTH 100 | 227 | #define PROCESS_LIST_WIDTH 100 |
7 | 228 | /* Characters shown for the command in 'information_schema.processlist' */ | 228 | /* Characters shown for the command in 'information_schema.processlist' */ |
9 | 229 | #define PROCESS_LIST_INFO_WIDTH 65535 | 229 | #define PROCESS_LIST_INFO_WIDTH 16383 |
10 | 230 | 230 | ||
11 | 231 | #define PRECISION_FOR_DOUBLE 53 | 231 | #define PRECISION_FOR_DOUBLE 53 |
12 | 232 | #define PRECISION_FOR_FLOAT 24 | 232 | #define PRECISION_FOR_FLOAT 24 |
13 | @@ -527,10 +527,6 @@ | |||
14 | 527 | #define MY_I_S_UNSIGNED 2 | 527 | #define MY_I_S_UNSIGNED 2 |
15 | 528 | 528 | ||
16 | 529 | 529 | ||
17 | 530 | #define SKIP_OPEN_TABLE 0 // do not open table | ||
18 | 531 | #define OPEN_FRM_ONLY 1 // open FRM file only | ||
19 | 532 | #define OPEN_FULL_TABLE 2 // open FRM,MYD, MYI files | ||
20 | 533 | |||
21 | 534 | /* | 530 | /* |
22 | 535 | "Declared Type Collation" | 531 | "Declared Type Collation" |
23 | 536 | A combination of collation and its derivation. | 532 | A combination of collation and its derivation. |
24 | 537 | 533 | ||
25 | === modified file 'drizzled/field/int64_t.cc' | |||
26 | --- drizzled/field/int64_t.cc 2009-07-10 00:01:50 +0000 | |||
27 | +++ drizzled/field/int64_t.cc 2009-10-29 23:56:14 +0000 | |||
28 | @@ -40,7 +40,7 @@ | |||
29 | 40 | char *end; | 40 | char *end; |
30 | 41 | uint64_t tmp; | 41 | uint64_t tmp; |
31 | 42 | 42 | ||
33 | 43 | ASSERT_COLUMN_MARKED_FOR_WRITE; | 43 | //ASSERT_COLUMN_MARKED_FOR_WRITE; |
34 | 44 | 44 | ||
35 | 45 | tmp= cs->cset->strntoull10rnd(cs, from, len, false, &end,&error); | 45 | tmp= cs->cset->strntoull10rnd(cs, from, len, false, &end,&error); |
36 | 46 | if (error == MY_ERRNO_ERANGE) | 46 | if (error == MY_ERRNO_ERANGE) |
37 | @@ -70,7 +70,7 @@ | |||
38 | 70 | int error= 0; | 70 | int error= 0; |
39 | 71 | int64_t res; | 71 | int64_t res; |
40 | 72 | 72 | ||
42 | 73 | ASSERT_COLUMN_MARKED_FOR_WRITE; | 73 | //ASSERT_COLUMN_MARKED_FOR_WRITE; |
43 | 74 | 74 | ||
44 | 75 | nr= rint(nr); | 75 | nr= rint(nr); |
45 | 76 | 76 | ||
46 | @@ -106,7 +106,7 @@ | |||
47 | 106 | { | 106 | { |
48 | 107 | int error= 0; | 107 | int error= 0; |
49 | 108 | 108 | ||
51 | 109 | ASSERT_COLUMN_MARKED_FOR_WRITE; | 109 | //ASSERT_COLUMN_MARKED_FOR_WRITE; |
52 | 110 | 110 | ||
53 | 111 | #ifdef WORDS_BIGENDIAN | 111 | #ifdef WORDS_BIGENDIAN |
54 | 112 | if (table->s->db_low_byte_first) | 112 | if (table->s->db_low_byte_first) |
55 | @@ -124,7 +124,7 @@ | |||
56 | 124 | { | 124 | { |
57 | 125 | int64_t j; | 125 | int64_t j; |
58 | 126 | 126 | ||
60 | 127 | ASSERT_COLUMN_MARKED_FOR_READ; | 127 | //ASSERT_COLUMN_MARKED_FOR_READ; |
61 | 128 | 128 | ||
62 | 129 | #ifdef WORDS_BIGENDIAN | 129 | #ifdef WORDS_BIGENDIAN |
63 | 130 | if (table->s->db_low_byte_first) | 130 | if (table->s->db_low_byte_first) |
64 | @@ -143,7 +143,7 @@ | |||
65 | 143 | { | 143 | { |
66 | 144 | int64_t j; | 144 | int64_t j; |
67 | 145 | 145 | ||
69 | 146 | ASSERT_COLUMN_MARKED_FOR_READ; | 146 | //ASSERT_COLUMN_MARKED_FOR_READ; |
70 | 147 | 147 | ||
71 | 148 | #ifdef WORDS_BIGENDIAN | 148 | #ifdef WORDS_BIGENDIAN |
72 | 149 | if (table->s->db_low_byte_first) | 149 | if (table->s->db_low_byte_first) |
73 | @@ -165,7 +165,7 @@ | |||
74 | 165 | char *to=(char*) val_buffer->ptr(); | 165 | char *to=(char*) val_buffer->ptr(); |
75 | 166 | int64_t j; | 166 | int64_t j; |
76 | 167 | 167 | ||
78 | 168 | ASSERT_COLUMN_MARKED_FOR_READ; | 168 | //ASSERT_COLUMN_MARKED_FOR_READ; |
79 | 169 | 169 | ||
80 | 170 | #ifdef WORDS_BIGENDIAN | 170 | #ifdef WORDS_BIGENDIAN |
81 | 171 | if (table->s->db_low_byte_first) | 171 | if (table->s->db_low_byte_first) |
82 | 172 | 172 | ||
83 | === modified file 'drizzled/field/long.cc' | |||
84 | --- drizzled/field/long.cc 2009-07-10 00:01:50 +0000 | |||
85 | +++ drizzled/field/long.cc 2009-10-29 23:56:14 +0000 | |||
86 | @@ -62,7 +62,7 @@ | |||
87 | 62 | int32_t res; | 62 | int32_t res; |
88 | 63 | nr=rint(nr); | 63 | nr=rint(nr); |
89 | 64 | 64 | ||
91 | 65 | ASSERT_COLUMN_MARKED_FOR_WRITE; | 65 | //ASSERT_COLUMN_MARKED_FOR_WRITE; |
92 | 66 | 66 | ||
93 | 67 | if (nr < (double) INT32_MIN) | 67 | if (nr < (double) INT32_MIN) |
94 | 68 | { | 68 | { |
95 | 69 | 69 | ||
96 | === modified file 'drizzled/join.cc' | |||
97 | --- drizzled/join.cc 2009-10-06 19:51:49 +0000 | |||
98 | +++ drizzled/join.cc 2009-10-29 23:56:13 +0000 | |||
99 | @@ -1245,9 +1245,6 @@ | |||
100 | 1245 | return; | 1245 | return; |
101 | 1246 | } | 1246 | } |
102 | 1247 | 1247 | ||
103 | 1248 | if ((this->select_lex->options & OPTION_SCHEMA_TABLE) && get_schema_tables_result(this, PROCESSED_BY_JOIN_EXEC)) | ||
104 | 1249 | return; | ||
105 | 1250 | |||
106 | 1251 | if (select_options & SELECT_DESCRIBE) | 1248 | if (select_options & SELECT_DESCRIBE) |
107 | 1252 | { | 1249 | { |
108 | 1253 | /* | 1250 | /* |
109 | 1254 | 1251 | ||
110 | === modified file 'drizzled/plugin/info_schema_table.h' | |||
111 | --- drizzled/plugin/info_schema_table.h 2009-10-06 19:14:39 +0000 | |||
112 | +++ drizzled/plugin/info_schema_table.h 2009-10-29 23:56:14 +0000 | |||
113 | @@ -25,6 +25,9 @@ | |||
114 | 25 | 25 | ||
115 | 26 | namespace drizzled | 26 | namespace drizzled |
116 | 27 | { | 27 | { |
117 | 28 | |||
118 | 29 | extern std::vector<plugin::InfoSchemaTable *> all_schema_tables; | ||
119 | 30 | |||
120 | 28 | namespace plugin | 31 | namespace plugin |
121 | 29 | { | 32 | { |
122 | 30 | 33 | ||
123 | @@ -35,9 +38,6 @@ | |||
124 | 35 | * Header file which contains all classes related to I_S | 38 | * Header file which contains all classes related to I_S |
125 | 36 | */ | 39 | */ |
126 | 37 | 40 | ||
127 | 38 | typedef class Item COND; | ||
128 | 39 | |||
129 | 40 | |||
130 | 41 | /** | 41 | /** |
131 | 42 | * @class ColumnInfo | 42 | * @class ColumnInfo |
132 | 43 | * @brief | 43 | * @brief |
133 | @@ -51,16 +51,14 @@ | |||
134 | 51 | enum enum_field_types in_type, | 51 | enum enum_field_types in_type, |
135 | 52 | int32_t in_value, | 52 | int32_t in_value, |
136 | 53 | uint32_t in_flags, | 53 | uint32_t in_flags, |
139 | 54 | const std::string& in_old_name, | 54 | const std::string& in_old_name) |
138 | 55 | uint32_t in_open_method) | ||
140 | 56 | : | 55 | : |
141 | 57 | name(in_name), | 56 | name(in_name), |
142 | 58 | length(in_length), | 57 | length(in_length), |
143 | 59 | type(in_type), | 58 | type(in_type), |
144 | 60 | value(in_value), | 59 | value(in_value), |
145 | 61 | flags(in_flags), | 60 | flags(in_flags), |
148 | 62 | old_name(in_old_name), | 61 | old_name(in_old_name) |
147 | 63 | open_method(in_open_method) | ||
149 | 64 | {} | 62 | {} |
150 | 65 | 63 | ||
151 | 66 | ColumnInfo() | 64 | ColumnInfo() |
152 | @@ -69,8 +67,7 @@ | |||
153 | 69 | length(0), | 67 | length(0), |
154 | 70 | type(DRIZZLE_TYPE_VARCHAR), | 68 | type(DRIZZLE_TYPE_VARCHAR), |
155 | 71 | flags(0), | 69 | flags(0), |
158 | 72 | old_name(), | 70 | old_name() |
157 | 73 | open_method(SKIP_OPEN_TABLE) | ||
159 | 74 | {} | 71 | {} |
160 | 75 | 72 | ||
161 | 76 | /** | 73 | /** |
162 | @@ -97,14 +94,6 @@ | |||
163 | 97 | } | 94 | } |
164 | 98 | 95 | ||
165 | 99 | /** | 96 | /** |
166 | 100 | * @return the open method for this column. | ||
167 | 101 | */ | ||
168 | 102 | uint32_t getOpenMethod() const | ||
169 | 103 | { | ||
170 | 104 | return open_method; | ||
171 | 105 | } | ||
172 | 106 | |||
173 | 107 | /** | ||
174 | 108 | * @return the flags for this column. | 97 | * @return the flags for this column. |
175 | 109 | */ | 98 | */ |
176 | 110 | uint32_t getFlags() const | 99 | uint32_t getFlags() const |
177 | @@ -174,12 +163,6 @@ | |||
178 | 174 | */ | 163 | */ |
179 | 175 | const std::string old_name; | 164 | const std::string old_name; |
180 | 176 | 165 | ||
181 | 177 | /** | ||
182 | 178 | * This should be one of @c SKIP_OPEN_TABLE, | ||
183 | 179 | * @c OPEN_FRM_ONLY or @c OPEN_FULL_TABLE. | ||
184 | 180 | */ | ||
185 | 181 | uint32_t open_method; | ||
186 | 182 | |||
187 | 183 | }; | 166 | }; |
188 | 184 | 167 | ||
189 | 185 | /** | 168 | /** |
190 | @@ -192,18 +175,72 @@ | |||
191 | 192 | public: | 175 | public: |
192 | 193 | virtual ~InfoSchemaMethods() {} | 176 | virtual ~InfoSchemaMethods() {} |
193 | 194 | 177 | ||
194 | 195 | virtual Table *createSchemaTable(Session *session, | ||
195 | 196 | TableList *table_list) const; | ||
196 | 197 | virtual int fillTable(Session *session, | 178 | virtual int fillTable(Session *session, |
200 | 198 | TableList *tables, | 179 | TableList *tables); |
201 | 199 | COND *cond); | 180 | virtual int processTable(InfoSchemaTable *store_table, |
202 | 200 | virtual int processTable(Session *session, TableList *tables, | 181 | Session *session, TableList *tables, |
203 | 201 | Table *table, bool res, LEX_STRING *db_name, | 182 | Table *table, bool res, LEX_STRING *db_name, |
205 | 202 | LEX_STRING *table_name) const; | 183 | LEX_STRING *table_name); |
206 | 203 | virtual int oldFormat(Session *session, | 184 | virtual int oldFormat(Session *session, |
207 | 204 | InfoSchemaTable *schema_table) const; | 185 | InfoSchemaTable *schema_table) const; |
208 | 205 | }; | 186 | }; |
209 | 206 | 187 | ||
210 | 188 | class InfoSchemaRecord | ||
211 | 189 | { | ||
212 | 190 | public: | ||
213 | 191 | InfoSchemaRecord() | ||
214 | 192 | : | ||
215 | 193 | record(NULL), | ||
216 | 194 | rec_len(0) | ||
217 | 195 | {} | ||
218 | 196 | |||
219 | 197 | InfoSchemaRecord(unsigned char *buf, | ||
220 | 198 | size_t in_len) | ||
221 | 199 | : | ||
222 | 200 | record(NULL), | ||
223 | 201 | rec_len(in_len) | ||
224 | 202 | { | ||
225 | 203 | record= new unsigned char[rec_len]; | ||
226 | 204 | memcpy(record, buf, rec_len); | ||
227 | 205 | } | ||
228 | 206 | |||
229 | 207 | InfoSchemaRecord(const InfoSchemaRecord &rhs) | ||
230 | 208 | : | ||
231 | 209 | record(NULL), | ||
232 | 210 | rec_len(rhs.rec_len) | ||
233 | 211 | { | ||
234 | 212 | record= new unsigned char[rec_len]; | ||
235 | 213 | memcpy(record, rhs.record, rec_len); | ||
236 | 214 | } | ||
237 | 215 | |||
238 | 216 | ~InfoSchemaRecord() | ||
239 | 217 | { | ||
240 | 218 | if (record) | ||
241 | 219 | { | ||
242 | 220 | delete [] record; | ||
243 | 221 | } | ||
244 | 222 | } | ||
245 | 223 | |||
246 | 224 | void copyRecordInto(unsigned char *buf) | ||
247 | 225 | { | ||
248 | 226 | memcpy(buf, record, rec_len); | ||
249 | 227 | } | ||
250 | 228 | |||
251 | 229 | private: | ||
252 | 230 | unsigned char *record; | ||
253 | 231 | size_t rec_len; | ||
254 | 232 | }; | ||
255 | 233 | |||
256 | 234 | class DeleteRows | ||
257 | 235 | { | ||
258 | 236 | public: | ||
259 | 237 | template<typename T> | ||
260 | 238 | inline void operator()(const T *ptr) const | ||
261 | 239 | { | ||
262 | 240 | delete ptr; | ||
263 | 241 | } | ||
264 | 242 | }; | ||
265 | 243 | |||
266 | 207 | /** | 244 | /** |
267 | 208 | * @class InfoSchemaTable | 245 | * @class InfoSchemaTable |
268 | 209 | * @brief | 246 | * @brief |
269 | @@ -217,6 +254,7 @@ | |||
270 | 217 | public: | 254 | public: |
271 | 218 | 255 | ||
272 | 219 | typedef std::vector<const ColumnInfo *> Columns; | 256 | typedef std::vector<const ColumnInfo *> Columns; |
273 | 257 | typedef std::vector<InfoSchemaRecord *> Rows; | ||
274 | 220 | 258 | ||
275 | 221 | InfoSchemaTable(const std::string& tab_name, | 259 | InfoSchemaTable(const std::string& tab_name, |
276 | 222 | Columns& in_column_info, | 260 | Columns& in_column_info, |
277 | @@ -234,6 +272,7 @@ | |||
278 | 234 | second_column_index(idx_col2), | 272 | second_column_index(idx_col2), |
279 | 235 | requested_object(req_object), | 273 | requested_object(req_object), |
280 | 236 | column_info(in_column_info), | 274 | column_info(in_column_info), |
281 | 275 | rows(), | ||
282 | 237 | i_s_methods(in_methods) | 276 | i_s_methods(in_methods) |
283 | 238 | {} | 277 | {} |
284 | 239 | 278 | ||
285 | @@ -246,11 +285,17 @@ | |||
286 | 246 | second_column_index(0), | 285 | second_column_index(0), |
287 | 247 | requested_object(0), | 286 | requested_object(0), |
288 | 248 | column_info(), | 287 | column_info(), |
289 | 288 | rows(), | ||
290 | 249 | i_s_methods(NULL) | 289 | i_s_methods(NULL) |
291 | 250 | {} | 290 | {} |
292 | 251 | 291 | ||
293 | 252 | virtual ~InfoSchemaTable() | 292 | virtual ~InfoSchemaTable() |
295 | 253 | {} | 293 | { |
296 | 294 | /* de-allocate memory in the rows */ | ||
297 | 295 | for_each(rows.begin(), | ||
298 | 296 | rows.end(), | ||
299 | 297 | DeleteRows()); | ||
300 | 298 | } | ||
301 | 254 | 299 | ||
302 | 255 | /** | 300 | /** |
303 | 256 | * Set the methods available on this I_S table. | 301 | * Set the methods available on this I_S table. |
304 | @@ -262,31 +307,15 @@ | |||
305 | 262 | } | 307 | } |
306 | 263 | 308 | ||
307 | 264 | /** | 309 | /** |
308 | 265 | * Create the temporary I_S tables using schema_table data. | ||
309 | 266 | * | ||
310 | 267 | * @param[in] session a session handler | ||
311 | 268 | * @param[in] table_list Used to pass I_S table information (fields, | ||
312 | 269 | * tables, parameters, etc.) and table name | ||
313 | 270 | * @retval \# pointer to created table | ||
314 | 271 | * @retval NULL Can't create table | ||
315 | 272 | */ | ||
316 | 273 | Table *createSchemaTable(Session *session, TableList *table_list) const | ||
317 | 274 | { | ||
318 | 275 | Table *retval= i_s_methods->createSchemaTable(session, table_list); | ||
319 | 276 | return retval; | ||
320 | 277 | } | ||
321 | 278 | |||
322 | 279 | /** | ||
323 | 280 | * Fill I_S table. | 310 | * Fill I_S table. |
324 | 281 | * | 311 | * |
325 | 282 | * @param[in] session a session handler | 312 | * @param[in] session a session handler |
326 | 283 | * @param[in] tables I_S table | 313 | * @param[in] tables I_S table |
327 | 284 | * @param[in] cond 'WHERE' condition | ||
328 | 285 | * @return 0 on success; 1 on error | 314 | * @return 0 on success; 1 on error |
329 | 286 | */ | 315 | */ |
331 | 287 | int fillTable(Session *session, TableList *tables, COND *cond) | 316 | int fillTable(Session *session, TableList *tables) |
332 | 288 | { | 317 | { |
334 | 289 | int retval= i_s_methods->fillTable(session, tables, cond); | 318 | int retval= i_s_methods->fillTable(session, tables); |
335 | 290 | return retval; | 319 | return retval; |
336 | 291 | } | 320 | } |
337 | 292 | 321 | ||
338 | @@ -295,7 +324,6 @@ | |||
339 | 295 | * | 324 | * |
340 | 296 | * @param[in] session a session handler | 325 | * @param[in] session a session handler |
341 | 297 | * @param[in] tables table list (processed table) | 326 | * @param[in] tables table list (processed table) |
342 | 298 | * @param[in] table I_S table | ||
343 | 299 | * @param[in] res 1 means error during opening of the processed table | 327 | * @param[in] res 1 means error during opening of the processed table |
344 | 300 | * 0 means processed table opened without error | 328 | * 0 means processed table opened without error |
345 | 301 | * @param[in] db_name database name | 329 | * @param[in] db_name database name |
346 | @@ -303,9 +331,9 @@ | |||
347 | 303 | * @return 0 on success; 1 on error | 331 | * @return 0 on success; 1 on error |
348 | 304 | */ | 332 | */ |
349 | 305 | int processTable(Session *session, TableList *tables, Table *table, | 333 | int processTable(Session *session, TableList *tables, Table *table, |
351 | 306 | bool res, LEX_STRING *db_name, LEX_STRING *tab_name) const | 334 | bool res, LEX_STRING *db_name, LEX_STRING *tab_name) |
352 | 307 | { | 335 | { |
354 | 308 | int retval= i_s_methods->processTable(session, tables, table, | 336 | int retval= i_s_methods->processTable(this, session, tables, table, |
355 | 309 | res, db_name, tab_name); | 337 | res, db_name, tab_name); |
356 | 310 | return retval; | 338 | return retval; |
357 | 311 | } | 339 | } |
358 | @@ -410,6 +438,19 @@ | |||
359 | 410 | return column_info; | 438 | return column_info; |
360 | 411 | } | 439 | } |
361 | 412 | 440 | ||
362 | 441 | Rows &getRows() | ||
363 | 442 | { | ||
364 | 443 | return rows; | ||
365 | 444 | } | ||
366 | 445 | |||
367 | 446 | void clearRows() | ||
368 | 447 | { | ||
369 | 448 | for_each(rows.begin(), | ||
370 | 449 | rows.end(), | ||
371 | 450 | DeleteRows()); | ||
372 | 451 | rows.clear(); | ||
373 | 452 | } | ||
374 | 453 | |||
375 | 413 | /** | 454 | /** |
376 | 414 | * @param[in] index the index of this column | 455 | * @param[in] index the index of this column |
377 | 415 | * @return the name for the column at the given index | 456 | * @return the name for the column at the given index |
378 | @@ -419,13 +460,10 @@ | |||
379 | 419 | return column_info[index]->getName(); | 460 | return column_info[index]->getName(); |
380 | 420 | } | 461 | } |
381 | 421 | 462 | ||
387 | 422 | /** | 463 | void addRow(unsigned char *buf, size_t len) |
383 | 423 | * @param[in] index the index of this column | ||
384 | 424 | * @return the open method for the column at the given index | ||
385 | 425 | */ | ||
386 | 426 | uint32_t getColumnOpenMethod(int index) const | ||
388 | 427 | { | 464 | { |
390 | 428 | return column_info[index]->getOpenMethod(); | 465 | InfoSchemaRecord *record= new InfoSchemaRecord(buf, len); |
391 | 466 | rows.push_back(record); | ||
392 | 429 | } | 467 | } |
393 | 430 | 468 | ||
394 | 431 | private: | 469 | private: |
395 | @@ -464,6 +502,8 @@ | |||
396 | 464 | */ | 502 | */ |
397 | 465 | Columns column_info; | 503 | Columns column_info; |
398 | 466 | 504 | ||
399 | 505 | Rows rows; | ||
400 | 506 | |||
401 | 467 | /** | 507 | /** |
402 | 468 | * Contains the methods available on this I_S table. | 508 | * Contains the methods available on this I_S table. |
403 | 469 | */ | 509 | */ |
404 | 470 | 510 | ||
405 | === modified file 'drizzled/plugin/storage_engine.cc' | |||
406 | --- drizzled/plugin/storage_engine.cc 2009-10-19 04:52:19 +0000 | |||
407 | +++ drizzled/plugin/storage_engine.cc 2009-10-29 23:56:14 +0000 | |||
408 | @@ -137,7 +137,7 @@ | |||
409 | 137 | !0 Error | 137 | !0 Error |
410 | 138 | */ | 138 | */ |
411 | 139 | int plugin::StorageEngine::deleteTableImplementation(Session *, | 139 | int plugin::StorageEngine::deleteTableImplementation(Session *, |
413 | 140 | const string table_path) | 140 | const string &table_path) |
414 | 141 | { | 141 | { |
415 | 142 | int error= 0; | 142 | int error= 0; |
416 | 143 | int enoent_or_zero= ENOENT; // Error if no file was deleted | 143 | int enoent_or_zero= ENOENT; // Error if no file was deleted |
417 | @@ -757,16 +757,19 @@ | |||
418 | 757 | 757 | ||
419 | 758 | if (dirp == NULL) | 758 | if (dirp == NULL) |
420 | 759 | { | 759 | { |
426 | 760 | if (my_errno == ENOENT) | 760 | if (my_errno != ENOENT) |
427 | 761 | my_error(ER_BAD_DB_ERROR, MYF(ME_BELL+ME_WAITTANG), db.c_str()); | 761 | { |
428 | 762 | else | 762 | my_error(ER_CANT_READ_DIR, |
429 | 763 | my_error(ER_CANT_READ_DIR, MYF(ME_BELL+ME_WAITTANG), path, my_errno); | 763 | MYF(ME_BELL + ME_WAITTANG), |
430 | 764 | return(ENOENT); | 764 | path, |
431 | 765 | my_errno); | ||
432 | 766 | } | ||
433 | 767 | return ENOENT; | ||
434 | 765 | } | 768 | } |
435 | 766 | current_entry= -1; | 769 | current_entry= -1; |
436 | 767 | } | 770 | } |
437 | 768 | 771 | ||
439 | 769 | while(true) | 772 | while (true) |
440 | 770 | { | 773 | { |
441 | 771 | current_entry++; | 774 | current_entry++; |
442 | 772 | 775 | ||
443 | @@ -844,7 +847,7 @@ | |||
444 | 844 | 847 | ||
445 | 845 | err= current_implementation->next(name); | 848 | err= current_implementation->next(name); |
446 | 846 | 849 | ||
448 | 847 | if (err == -1) | 850 | if (err == -1 || err == ENOENT) |
449 | 848 | { | 851 | { |
450 | 849 | if (current_implementation != default_implementation) | 852 | if (current_implementation != default_implementation) |
451 | 850 | { | 853 | { |
452 | @@ -852,6 +855,19 @@ | |||
453 | 852 | current_implementation= NULL; | 855 | current_implementation= NULL; |
454 | 853 | goto next; | 856 | goto next; |
455 | 854 | } | 857 | } |
456 | 858 | if (current_implementation == default_implementation) | ||
457 | 859 | { | ||
458 | 860 | if (database.compare(INFORMATION_SCHEMA_NAME) == 0) | ||
459 | 861 | { | ||
460 | 862 | return -1; | ||
461 | 863 | } | ||
462 | 864 | if (err == ENOENT) | ||
463 | 865 | { | ||
464 | 866 | my_error(ER_BAD_DB_ERROR, | ||
465 | 867 | MYF(ME_BELL + ME_WAITTANG), | ||
466 | 868 | database.c_str()); | ||
467 | 869 | } | ||
468 | 870 | } | ||
469 | 855 | } | 871 | } |
470 | 856 | 872 | ||
471 | 857 | return err; | 873 | return err; |
472 | 858 | 874 | ||
473 | === modified file 'drizzled/plugin/storage_engine.h' | |||
474 | --- drizzled/plugin/storage_engine.h 2009-10-16 10:27:33 +0000 | |||
475 | +++ drizzled/plugin/storage_engine.h 2009-10-29 23:56:14 +0000 | |||
476 | @@ -54,6 +54,7 @@ | |||
477 | 54 | HTON_BIT_TEMPORARY_ONLY, | 54 | HTON_BIT_TEMPORARY_ONLY, |
478 | 55 | HTON_BIT_FILE_BASED, // use for check_lowercase_names | 55 | HTON_BIT_FILE_BASED, // use for check_lowercase_names |
479 | 56 | HTON_BIT_HAS_DATA_DICTIONARY, | 56 | HTON_BIT_HAS_DATA_DICTIONARY, |
480 | 57 | HTON_BIT_CREATE_NOT_SUPPORTED, // Engine does support the creation of tables | ||
481 | 57 | HTON_BIT_SIZE | 58 | HTON_BIT_SIZE |
482 | 58 | }; | 59 | }; |
483 | 59 | 60 | ||
484 | @@ -67,6 +68,7 @@ | |||
485 | 67 | static const std::bitset<HTON_BIT_SIZE> HTON_TEMPORARY_ONLY(1 << HTON_BIT_TEMPORARY_ONLY); | 68 | static const std::bitset<HTON_BIT_SIZE> HTON_TEMPORARY_ONLY(1 << HTON_BIT_TEMPORARY_ONLY); |
486 | 68 | static const std::bitset<HTON_BIT_SIZE> HTON_FILE_BASED(1 << HTON_BIT_FILE_BASED); | 69 | static const std::bitset<HTON_BIT_SIZE> HTON_FILE_BASED(1 << HTON_BIT_FILE_BASED); |
487 | 69 | static const std::bitset<HTON_BIT_SIZE> HTON_HAS_DATA_DICTIONARY(1 << HTON_BIT_HAS_DATA_DICTIONARY); | 70 | static const std::bitset<HTON_BIT_SIZE> HTON_HAS_DATA_DICTIONARY(1 << HTON_BIT_HAS_DATA_DICTIONARY); |
488 | 71 | static const std::bitset<HTON_BIT_SIZE> HTON_CREATE_NOT_SUPPORTED(1 << HTON_BIT_CREATE_NOT_SUPPORTED); | ||
489 | 70 | 72 | ||
490 | 71 | class Table; | 73 | class Table; |
491 | 72 | 74 | ||
492 | @@ -276,7 +278,7 @@ | |||
493 | 276 | const char *from, const char *to); | 278 | const char *from, const char *to); |
494 | 277 | 279 | ||
495 | 278 | virtual int deleteTableImplementation(Session* session, | 280 | virtual int deleteTableImplementation(Session* session, |
497 | 279 | const std::string table_path); | 281 | const std::string &table_path); |
498 | 280 | 282 | ||
499 | 281 | public: | 283 | public: |
500 | 282 | int doCreateTable(Session *session, const char *path, | 284 | int doCreateTable(Session *session, const char *path, |
501 | 283 | 285 | ||
502 | === modified file 'drizzled/show.cc' | |||
503 | --- drizzled/show.cc 2009-10-16 00:38:56 +0000 | |||
504 | +++ drizzled/show.cc 2009-10-29 23:56:14 +0000 | |||
505 | @@ -63,8 +63,6 @@ | |||
506 | 63 | 63 | ||
507 | 64 | static void store_key_options(String *packet, Table *table, KEY *key_info); | 64 | static void store_key_options(String *packet, Table *table, KEY *key_info); |
508 | 65 | 65 | ||
509 | 66 | |||
510 | 67 | |||
511 | 68 | int wild_case_compare(const CHARSET_INFO * const cs, const char *str,const char *wildstr) | 66 | int wild_case_compare(const CHARSET_INFO * const cs, const char *str,const char *wildstr) |
512 | 69 | { | 67 | { |
513 | 70 | register int flag; | 68 | register int flag; |
514 | @@ -225,9 +223,6 @@ | |||
515 | 225 | if (session->client->sendFields(&field_list)) | 223 | if (session->client->sendFields(&field_list)) |
516 | 226 | return true; | 224 | return true; |
517 | 227 | { | 225 | { |
518 | 228 | if (table_list->schema_table) | ||
519 | 229 | session->client->store(table_list->schema_table->getTableName().c_str()); | ||
520 | 230 | else | ||
521 | 231 | session->client->store(table_list->table->alias); | 226 | session->client->store(table_list->table->alias); |
522 | 232 | } | 227 | } |
523 | 233 | 228 | ||
524 | @@ -1016,35 +1011,6 @@ | |||
525 | 1016 | return; | 1011 | return; |
526 | 1017 | } | 1012 | } |
527 | 1018 | 1013 | ||
528 | 1019 | /* | ||
529 | 1020 | Store record to I_S table, convert HEAP table | ||
530 | 1021 | to MyISAM if necessary | ||
531 | 1022 | |||
532 | 1023 | SYNOPSIS | ||
533 | 1024 | schema_table_store_record() | ||
534 | 1025 | session thread Cursor | ||
535 | 1026 | table Information schema table to be updated | ||
536 | 1027 | |||
537 | 1028 | RETURN | ||
538 | 1029 | 0 success | ||
539 | 1030 | 1 error | ||
540 | 1031 | */ | ||
541 | 1032 | |||
542 | 1033 | bool schema_table_store_record(Session *session, Table *table) | ||
543 | 1034 | { | ||
544 | 1035 | int error; | ||
545 | 1036 | if ((error= table->file->ha_write_row(table->record[0]))) | ||
546 | 1037 | { | ||
547 | 1038 | Tmp_Table_Param *param= table->pos_in_table_list->schema_table_param; | ||
548 | 1039 | |||
549 | 1040 | if (create_myisam_from_heap(session, table, param->start_recinfo, | ||
550 | 1041 | ¶m->recinfo, error, 0)) | ||
551 | 1042 | return true; | ||
552 | 1043 | } | ||
553 | 1044 | return false; | ||
554 | 1045 | } | ||
555 | 1046 | |||
556 | 1047 | |||
557 | 1048 | static int make_table_list(Session *session, Select_Lex *sel, | 1014 | static int make_table_list(Session *session, Select_Lex *sel, |
558 | 1049 | LEX_STRING *db_name, LEX_STRING *table_name) | 1015 | LEX_STRING *db_name, LEX_STRING *table_name) |
559 | 1050 | { | 1016 | { |
560 | @@ -1484,14 +1450,6 @@ | |||
561 | 1484 | return 0; | 1450 | return 0; |
562 | 1485 | } | 1451 | } |
563 | 1486 | 1452 | ||
564 | 1487 | /* | ||
565 | 1488 | This call will add all matching the wildcards (if specified) IS tables | ||
566 | 1489 | to the list | ||
567 | 1490 | */ | ||
568 | 1491 | if (with_i_schema) | ||
569 | 1492 | return plugin::InfoSchemaTable::addTableToList(session, table_names, | ||
570 | 1493 | lookup_field_vals->table_value.str); | ||
571 | 1494 | |||
572 | 1495 | string db(db_name->str); | 1453 | string db(db_name->str); |
573 | 1496 | 1454 | ||
574 | 1497 | plugin::TableNameIterator tniter(db); | 1455 | plugin::TableNameIterator tniter(db); |
575 | @@ -1593,13 +1551,16 @@ | |||
576 | 1593 | 1551 | ||
577 | 1594 | 1552 | ||
578 | 1595 | table->setWriteSet(); | 1553 | table->setWriteSet(); |
581 | 1596 | error= test(schema_table->processTable(session, show_table_list, | 1554 | error= test(schema_table->processTable(session, |
582 | 1597 | table, res, db_name, | 1555 | show_table_list, |
583 | 1556 | table, | ||
584 | 1557 | res, | ||
585 | 1558 | db_name, | ||
586 | 1598 | table_name)); | 1559 | table_name)); |
587 | 1599 | session->temporary_tables= 0; | 1560 | session->temporary_tables= 0; |
588 | 1600 | session->close_tables_for_reopen(&show_table_list); | 1561 | session->close_tables_for_reopen(&show_table_list); |
589 | 1601 | 1562 | ||
591 | 1602 | return(error); | 1563 | return error; |
592 | 1603 | } | 1564 | } |
593 | 1604 | 1565 | ||
594 | 1605 | 1566 | ||
595 | @@ -1641,114 +1602,13 @@ | |||
596 | 1641 | return 0; | 1602 | return 0; |
597 | 1642 | } | 1603 | } |
598 | 1643 | } | 1604 | } |
601 | 1644 | if (schema_table_store_record(session, table)) | 1605 | TableList *tmp= table->pos_in_table_list; |
602 | 1645 | return 1; | 1606 | tmp->schema_table->addRow(table->record[0], table->s->reclength); |
603 | 1646 | return 0; | 1607 | return 0; |
604 | 1647 | } | 1608 | } |
605 | 1648 | 1609 | ||
606 | 1649 | 1610 | ||
607 | 1650 | /** | 1611 | /** |
608 | 1651 | @brief Get open table method | ||
609 | 1652 | |||
610 | 1653 | @details The function calculates the method which will be used | ||
611 | 1654 | for table opening: | ||
612 | 1655 | SKIP_OPEN_TABLE - do not open table | ||
613 | 1656 | OPEN_FRM_ONLY - open FRM file only | ||
614 | 1657 | OPEN_FULL_TABLE - open FRM, data, index files | ||
615 | 1658 | @param[in] tables I_S table table_list | ||
616 | 1659 | @param[in] schema_table I_S table struct | ||
617 | 1660 | |||
618 | 1661 | @return return a set of flags | ||
619 | 1662 | @retval SKIP_OPEN_TABLE | OPEN_FRM_ONLY | OPEN_FULL_TABLE | ||
620 | 1663 | */ | ||
621 | 1664 | |||
622 | 1665 | static uint32_t get_table_open_method(TableList *tables, | ||
623 | 1666 | plugin::InfoSchemaTable *schema_table) | ||
624 | 1667 | { | ||
625 | 1668 | /* | ||
626 | 1669 | determine which method will be used for table opening | ||
627 | 1670 | */ | ||
628 | 1671 | if (schema_table->getRequestedObject() & OPTIMIZE_I_S_TABLE) | ||
629 | 1672 | { | ||
630 | 1673 | Field **ptr, *field; | ||
631 | 1674 | int table_open_method= 0, field_indx= 0; | ||
632 | 1675 | for (ptr= tables->table->field; (field= *ptr) ; ptr++) | ||
633 | 1676 | { | ||
634 | 1677 | if (field->isReadSet()) | ||
635 | 1678 | table_open_method|= schema_table->getColumnOpenMethod(field_indx); | ||
636 | 1679 | field_indx++; | ||
637 | 1680 | } | ||
638 | 1681 | return table_open_method; | ||
639 | 1682 | } | ||
640 | 1683 | /* I_S tables which use get_all_tables but can not be optimized */ | ||
641 | 1684 | return (uint32_t) OPEN_FULL_TABLE; | ||
642 | 1685 | } | ||
643 | 1686 | |||
644 | 1687 | |||
645 | 1688 | /** | ||
646 | 1689 | @brief Fill I_S table with data from FRM file only | ||
647 | 1690 | |||
648 | 1691 | @param[in] session thread Cursor | ||
649 | 1692 | @param[in] table Table struct for I_S table | ||
650 | 1693 | @param[in] schema_table I_S table struct | ||
651 | 1694 | @param[in] db_name database name | ||
652 | 1695 | @param[in] table_name table name | ||
653 | 1696 | |||
654 | 1697 | @return Operation status | ||
655 | 1698 | @retval 0 Table is processed and we can continue | ||
656 | 1699 | with new table | ||
657 | 1700 | @retval 1 It's view and we have to use | ||
658 | 1701 | open_tables function for this table | ||
659 | 1702 | */ | ||
660 | 1703 | |||
661 | 1704 | static int fill_schema_table_from_frm(Session *session,TableList *tables, | ||
662 | 1705 | plugin::InfoSchemaTable *schema_table, | ||
663 | 1706 | LEX_STRING *db_name, | ||
664 | 1707 | LEX_STRING *table_name) | ||
665 | 1708 | { | ||
666 | 1709 | Table *table= tables->table; | ||
667 | 1710 | TableShare *share; | ||
668 | 1711 | Table tbl; | ||
669 | 1712 | TableList table_list; | ||
670 | 1713 | uint32_t res= 0; | ||
671 | 1714 | int error; | ||
672 | 1715 | char key[MAX_DBKEY_LENGTH]; | ||
673 | 1716 | uint32_t key_length; | ||
674 | 1717 | |||
675 | 1718 | memset(&tbl, 0, sizeof(Table)); | ||
676 | 1719 | |||
677 | 1720 | table_list.table_name= table_name->str; | ||
678 | 1721 | table_list.db= db_name->str; | ||
679 | 1722 | |||
680 | 1723 | key_length= table_list.create_table_def_key(key); | ||
681 | 1724 | pthread_mutex_lock(&LOCK_open); /* Locking to get table share when filling schema table from FRM */ | ||
682 | 1725 | share= TableShare::getShare(session, &table_list, key, key_length, 0, &error); | ||
683 | 1726 | if (!share) | ||
684 | 1727 | { | ||
685 | 1728 | res= 0; | ||
686 | 1729 | goto err; | ||
687 | 1730 | } | ||
688 | 1731 | |||
689 | 1732 | { | ||
690 | 1733 | tbl.s= share; | ||
691 | 1734 | table_list.table= &tbl; | ||
692 | 1735 | res= schema_table->processTable(session, &table_list, table, | ||
693 | 1736 | res, db_name, table_name); | ||
694 | 1737 | } | ||
695 | 1738 | /* For the moment we just set everything to read */ | ||
696 | 1739 | table->setReadSet(); | ||
697 | 1740 | |||
698 | 1741 | TableShare::release(share); | ||
699 | 1742 | |||
700 | 1743 | err: | ||
701 | 1744 | pthread_mutex_unlock(&LOCK_open); | ||
702 | 1745 | session->clear_error(); | ||
703 | 1746 | return res; | ||
704 | 1747 | } | ||
705 | 1748 | |||
706 | 1749 | |||
707 | 1750 | |||
708 | 1751 | /** | ||
709 | 1752 | @brief Fill I_S tables whose data are retrieved | 1612 | @brief Fill I_S tables whose data are retrieved |
710 | 1753 | from frm files and storage engine | 1613 | from frm files and storage engine |
711 | 1754 | 1614 | ||
712 | @@ -1760,13 +1620,12 @@ | |||
713 | 1760 | 1620 | ||
714 | 1761 | @param[in] session thread Cursor | 1621 | @param[in] session thread Cursor |
715 | 1762 | @param[in] tables I_S table | 1622 | @param[in] tables I_S table |
716 | 1763 | @param[in] cond 'WHERE' condition | ||
717 | 1764 | 1623 | ||
718 | 1765 | @return Operation status | 1624 | @return Operation status |
719 | 1766 | @retval 0 success | 1625 | @retval 0 success |
720 | 1767 | @retval 1 error | 1626 | @retval 1 error |
721 | 1768 | */ | 1627 | */ |
723 | 1769 | int plugin::InfoSchemaMethods::fillTable(Session *session, TableList *tables, COND *cond) | 1628 | int plugin::InfoSchemaMethods::fillTable(Session *session, TableList *tables) |
724 | 1770 | { | 1629 | { |
725 | 1771 | LEX *lex= session->lex; | 1630 | LEX *lex= session->lex; |
726 | 1772 | Table *table= tables->table; | 1631 | Table *table= tables->table; |
727 | @@ -1779,11 +1638,12 @@ | |||
728 | 1779 | bool with_i_schema; | 1638 | bool with_i_schema; |
729 | 1780 | vector<LEX_STRING*> db_names, table_names; | 1639 | vector<LEX_STRING*> db_names, table_names; |
730 | 1781 | COND *partial_cond= 0; | 1640 | COND *partial_cond= 0; |
731 | 1641 | /* the WHERE condition */ | ||
732 | 1642 | COND *cond= table->reginfo.join_tab->select_cond; | ||
733 | 1782 | uint32_t derived_tables= lex->derived_tables; | 1643 | uint32_t derived_tables= lex->derived_tables; |
734 | 1783 | int error= 1; | 1644 | int error= 1; |
735 | 1784 | Open_tables_state open_tables_state_backup; | 1645 | Open_tables_state open_tables_state_backup; |
736 | 1785 | Query_tables_list query_tables_list_backup; | 1646 | Query_tables_list query_tables_list_backup; |
737 | 1786 | uint32_t table_open_method; | ||
738 | 1787 | bool old_value= session->no_warnings_for_error; | 1647 | bool old_value= session->no_warnings_for_error; |
739 | 1788 | 1648 | ||
740 | 1789 | /* | 1649 | /* |
741 | @@ -1793,8 +1653,6 @@ | |||
742 | 1793 | */ | 1653 | */ |
743 | 1794 | session->reset_n_backup_open_tables_state(&open_tables_state_backup); | 1654 | session->reset_n_backup_open_tables_state(&open_tables_state_backup); |
744 | 1795 | 1655 | ||
745 | 1796 | tables->table_open_method= table_open_method= | ||
746 | 1797 | get_table_open_method(tables, schema_table); | ||
747 | 1798 | /* | 1656 | /* |
748 | 1799 | this branch processes SHOW FIELDS, SHOW INDEXES commands. | 1657 | this branch processes SHOW FIELDS, SHOW INDEXES commands. |
749 | 1800 | see sql_parse.cc, prepare_schema_table() function where | 1658 | see sql_parse.cc, prepare_schema_table() function where |
750 | @@ -1813,14 +1671,14 @@ | |||
751 | 1813 | goto err; | 1671 | goto err; |
752 | 1814 | } | 1672 | } |
753 | 1815 | 1673 | ||
755 | 1816 | if (!lookup_field_vals.wild_db_value && !lookup_field_vals.wild_table_value) | 1674 | if (! lookup_field_vals.wild_db_value && ! lookup_field_vals.wild_table_value) |
756 | 1817 | { | 1675 | { |
757 | 1818 | /* | 1676 | /* |
758 | 1819 | if lookup value is empty string then | 1677 | if lookup value is empty string then |
759 | 1820 | it's impossible table name or db name | 1678 | it's impossible table name or db name |
760 | 1821 | */ | 1679 | */ |
763 | 1822 | if ((lookup_field_vals.db_value.str && !lookup_field_vals.db_value.str[0]) || | 1680 | if ((lookup_field_vals.db_value.str && ! lookup_field_vals.db_value.str[0]) || |
764 | 1823 | (lookup_field_vals.table_value.str && !lookup_field_vals.table_value.str[0])) | 1681 | (lookup_field_vals.table_value.str && ! lookup_field_vals.table_value.str[0])) |
765 | 1824 | { | 1682 | { |
766 | 1825 | error= 0; | 1683 | error= 0; |
767 | 1826 | goto err; | 1684 | goto err; |
768 | @@ -1828,12 +1686,16 @@ | |||
769 | 1828 | } | 1686 | } |
770 | 1829 | 1687 | ||
771 | 1830 | if (lookup_field_vals.db_value.length && | 1688 | if (lookup_field_vals.db_value.length && |
773 | 1831 | !lookup_field_vals.wild_db_value) | 1689 | ! lookup_field_vals.wild_db_value) |
774 | 1690 | { | ||
775 | 1832 | tables->has_db_lookup_value= true; | 1691 | tables->has_db_lookup_value= true; |
776 | 1692 | } | ||
777 | 1833 | 1693 | ||
778 | 1834 | if (lookup_field_vals.table_value.length && | 1694 | if (lookup_field_vals.table_value.length && |
780 | 1835 | !lookup_field_vals.wild_table_value) | 1695 | ! lookup_field_vals.wild_table_value) |
781 | 1696 | { | ||
782 | 1836 | tables->has_table_lookup_value= true; | 1697 | tables->has_table_lookup_value= true; |
783 | 1698 | } | ||
784 | 1837 | 1699 | ||
785 | 1838 | if (tables->has_db_lookup_value && tables->has_table_lookup_value) | 1700 | if (tables->has_db_lookup_value && tables->has_table_lookup_value) |
786 | 1839 | partial_cond= 0; | 1701 | partial_cond= 0; |
787 | @@ -1874,55 +1736,36 @@ | |||
788 | 1874 | table->field[schema_table->getSecondColumnIndex()]-> | 1736 | table->field[schema_table->getSecondColumnIndex()]-> |
789 | 1875 | store((*table_name)->str, (*table_name)->length, system_charset_info); | 1737 | store((*table_name)->str, (*table_name)->length, system_charset_info); |
790 | 1876 | 1738 | ||
792 | 1877 | if (!partial_cond || partial_cond->val_int()) | 1739 | if (! partial_cond || partial_cond->val_int()) |
793 | 1878 | { | 1740 | { |
794 | 1879 | /* | ||
795 | 1880 | If table is I_S.tables and open_table_method is 0 (eg SKIP_OPEN) | ||
796 | 1881 | we can skip table opening and we don't have lookup value for | ||
797 | 1882 | table name or lookup value is wild string(table name list is | ||
798 | 1883 | already created by make_table_name_list() function). | ||
799 | 1884 | */ | ||
800 | 1885 | if (! table_open_method && | ||
801 | 1886 | schema_table->getTableName().compare("TABLES") == 0 && | ||
802 | 1887 | (! lookup_field_vals.table_value.length || | ||
803 | 1888 | lookup_field_vals.wild_table_value)) | ||
804 | 1889 | { | ||
805 | 1890 | if (schema_table_store_record(session, table)) | ||
806 | 1891 | goto err; /* Out of space in temporary table */ | ||
807 | 1892 | continue; | ||
808 | 1893 | } | ||
809 | 1894 | |||
810 | 1895 | /* SHOW Table NAMES command */ | ||
811 | 1896 | if (schema_table->getTableName().compare("TABLE_NAMES") == 0) | 1741 | if (schema_table->getTableName().compare("TABLE_NAMES") == 0) |
812 | 1897 | { | 1742 | { |
815 | 1898 | if (fill_schema_table_names(session, tables->table, *db_name, | 1743 | if (fill_schema_table_names(session, |
816 | 1899 | *table_name, with_i_schema)) | 1744 | tables->table, |
817 | 1745 | *db_name, | ||
818 | 1746 | *table_name, | ||
819 | 1747 | with_i_schema)) | ||
820 | 1748 | { | ||
821 | 1900 | continue; | 1749 | continue; |
822 | 1750 | } | ||
823 | 1901 | } | 1751 | } |
824 | 1902 | else | 1752 | else |
825 | 1903 | { | 1753 | { |
826 | 1904 | if (!(table_open_method & ~OPEN_FRM_ONLY) && | ||
827 | 1905 | !with_i_schema) | ||
828 | 1906 | { | ||
829 | 1907 | if (!fill_schema_table_from_frm(session, tables, schema_table, *db_name, | ||
830 | 1908 | *table_name)) | ||
831 | 1909 | continue; | ||
832 | 1910 | } | ||
833 | 1911 | |||
834 | 1912 | LEX_STRING tmp_lex_string, orig_db_name; | 1754 | LEX_STRING tmp_lex_string, orig_db_name; |
835 | 1913 | /* | ||
836 | 1914 | Set the parent lex of 'sel' because it is needed by | ||
837 | 1915 | sel.init_query() which is called inside make_table_list. | ||
838 | 1916 | */ | ||
839 | 1917 | session->no_warnings_for_error= 1; | 1755 | session->no_warnings_for_error= 1; |
840 | 1918 | sel.parent_lex= lex; | 1756 | sel.parent_lex= lex; |
844 | 1919 | /* db_name can be changed in make_table_list() func */ | 1757 | if (! session->make_lex_string(&orig_db_name, |
845 | 1920 | if (!session->make_lex_string(&orig_db_name, (*db_name)->str, | 1758 | (*db_name)->str, |
846 | 1921 | (*db_name)->length, false)) | 1759 | (*db_name)->length, |
847 | 1760 | false)) | ||
848 | 1761 | { | ||
849 | 1922 | goto err; | 1762 | goto err; |
850 | 1763 | } | ||
851 | 1923 | 1764 | ||
852 | 1924 | if (make_table_list(session, &sel, *db_name, *table_name)) | 1765 | if (make_table_list(session, &sel, *db_name, *table_name)) |
853 | 1766 | { | ||
854 | 1925 | goto err; | 1767 | goto err; |
855 | 1768 | } | ||
856 | 1926 | 1769 | ||
857 | 1927 | TableList *show_table_list= (TableList*) sel.table_list.first; | 1770 | TableList *show_table_list= (TableList*) sel.table_list.first; |
858 | 1928 | lex->all_selects_list= &sel; | 1771 | lex->all_selects_list= &sel; |
859 | @@ -1933,38 +1776,41 @@ | |||
860 | 1933 | res= session->openTables(show_table_list, DRIZZLE_LOCK_IGNORE_FLUSH); | 1776 | res= session->openTables(show_table_list, DRIZZLE_LOCK_IGNORE_FLUSH); |
861 | 1934 | lex->sql_command= save_sql_command; | 1777 | lex->sql_command= save_sql_command; |
862 | 1935 | /* | 1778 | /* |
870 | 1936 | XXX-> show_table_list has a flag i_is_requested, | 1779 | XXX-> show_table_list has a flag i_is_requested, |
871 | 1937 | and when it's set, openTables() | 1780 | and when it's set, openTables() |
872 | 1938 | can return an error without setting an error message | 1781 | can return an error without setting an error message |
873 | 1939 | in Session, which is a hack. This is why we have to | 1782 | in Session, which is a hack. This is why we have to |
874 | 1940 | check for res, then for session->is_error() only then | 1783 | check for res, then for session->is_error() only then |
875 | 1941 | for session->main_da.sql_errno(). | 1784 | for session->main_da.sql_errno(). |
876 | 1942 | */ | 1785 | */ |
877 | 1943 | if (res && session->is_error() && | 1786 | if (res && session->is_error() && |
878 | 1944 | session->main_da.sql_errno() == ER_NO_SUCH_TABLE) | 1787 | session->main_da.sql_errno() == ER_NO_SUCH_TABLE) |
879 | 1945 | { | 1788 | { |
880 | 1946 | /* | 1789 | /* |
886 | 1947 | Hide error for not existing table. | 1790 | Hide error for not existing table. |
887 | 1948 | This error can occur for example when we use | 1791 | This error can occur for example when we use |
888 | 1949 | where condition with db name and table name and this | 1792 | where condition with db name and table name and this |
889 | 1950 | table does not exist. | 1793 | table does not exist. |
890 | 1951 | */ | 1794 | */ |
891 | 1952 | res= 0; | 1795 | res= 0; |
892 | 1953 | session->clear_error(); | 1796 | session->clear_error(); |
893 | 1954 | } | 1797 | } |
894 | 1955 | else | 1798 | else |
895 | 1956 | { | 1799 | { |
896 | 1957 | /* | 1800 | /* |
903 | 1958 | We should use show_table_list->alias instead of | 1801 | We should use show_table_list->alias instead of |
904 | 1959 | show_table_list->table_name because table_name | 1802 | show_table_list->table_name because table_name |
905 | 1960 | could be changed during opening of I_S tables. It's safe | 1803 | could be changed during opening of I_S tables. It's safe |
906 | 1961 | to use alias because alias contains original table name | 1804 | to use alias because alias contains original table name |
907 | 1962 | in this case. | 1805 | in this case. |
908 | 1963 | */ | 1806 | */ |
909 | 1964 | session->make_lex_string(&tmp_lex_string, show_table_list->alias, | 1807 | session->make_lex_string(&tmp_lex_string, show_table_list->alias, |
913 | 1965 | strlen(show_table_list->alias), false); | 1808 | strlen(show_table_list->alias), false); |
914 | 1966 | res= schema_table->processTable(session, show_table_list, table, | 1809 | res= schema_table->processTable(session, |
915 | 1967 | res, &orig_db_name, | 1810 | show_table_list, |
916 | 1811 | table, | ||
917 | 1812 | res, | ||
918 | 1813 | &orig_db_name, | ||
919 | 1968 | &tmp_lex_string); | 1814 | &tmp_lex_string); |
920 | 1969 | session->close_tables_for_reopen(&show_table_list); | 1815 | session->close_tables_for_reopen(&show_table_list); |
921 | 1970 | } | 1816 | } |
922 | @@ -2092,10 +1938,12 @@ | |||
923 | 2092 | } | 1938 | } |
924 | 2093 | 1939 | ||
925 | 2094 | 1940 | ||
927 | 2095 | int plugin::InfoSchemaMethods::processTable(Session *session, TableList *tables, | 1941 | int plugin::InfoSchemaMethods::processTable( |
928 | 1942 | plugin::InfoSchemaTable *store_table, | ||
929 | 1943 | Session *session, TableList *tables, | ||
930 | 2096 | Table *table, bool res, | 1944 | Table *table, bool res, |
931 | 2097 | LEX_STRING *db_name, | 1945 | LEX_STRING *db_name, |
933 | 2098 | LEX_STRING *table_name) const | 1946 | LEX_STRING *table_name) |
934 | 2099 | { | 1947 | { |
935 | 2100 | LEX *lex= session->lex; | 1948 | LEX *lex= session->lex; |
936 | 2101 | const char *wild= lex->wild ? lex->wild->ptr() : NULL; | 1949 | const char *wild= lex->wild ? lex->wild->ptr() : NULL; |
937 | @@ -2119,7 +1967,7 @@ | |||
938 | 2119 | session->clear_error(); | 1967 | session->clear_error(); |
939 | 2120 | res= 0; | 1968 | res= 0; |
940 | 2121 | } | 1969 | } |
942 | 2122 | return(res); | 1970 | return res; |
943 | 2123 | } | 1971 | } |
944 | 2124 | 1972 | ||
945 | 2125 | show_table= tables->table; | 1973 | show_table= tables->table; |
946 | @@ -2138,7 +1986,7 @@ | |||
947 | 2138 | } | 1986 | } |
948 | 2139 | 1987 | ||
949 | 2140 | /* For the moment we just set everything to read */ | 1988 | /* For the moment we just set everything to read */ |
951 | 2141 | if (!show_table->read_set) | 1989 | if (! show_table->read_set) |
952 | 2142 | { | 1990 | { |
953 | 2143 | show_table->def_read_set.setAll(); | 1991 | show_table->def_read_set.setAll(); |
954 | 2144 | show_table->read_set= &show_table->def_read_set; | 1992 | show_table->read_set= &show_table->def_read_set; |
955 | @@ -2206,109 +2054,9 @@ | |||
956 | 2206 | table->field[20]->store((const char*) pos, | 2054 | table->field[20]->store((const char*) pos, |
957 | 2207 | strlen((const char*) pos), cs); | 2055 | strlen((const char*) pos), cs); |
958 | 2208 | } | 2056 | } |
1062 | 2209 | if (schema_table_store_record(session, table)) | 2057 | store_table->addRow(table->record[0], table->s->reclength); |
1063 | 2210 | return(1); | 2058 | } |
1064 | 2211 | } | 2059 | return 0; |
962 | 2212 | return(0); | ||
963 | 2213 | } | ||
964 | 2214 | |||
965 | 2215 | |||
966 | 2216 | Table *plugin::InfoSchemaMethods::createSchemaTable(Session *session, TableList *table_list) | ||
967 | 2217 | const | ||
968 | 2218 | { | ||
969 | 2219 | int field_count= 0; | ||
970 | 2220 | Item *item; | ||
971 | 2221 | Table *table; | ||
972 | 2222 | List<Item> field_list; | ||
973 | 2223 | const CHARSET_INFO * const cs= system_charset_info; | ||
974 | 2224 | const plugin::InfoSchemaTable::Columns &columns= table_list->schema_table->getColumns(); | ||
975 | 2225 | plugin::InfoSchemaTable::Columns::const_iterator iter= columns.begin(); | ||
976 | 2226 | |||
977 | 2227 | while (iter != columns.end()) | ||
978 | 2228 | { | ||
979 | 2229 | const plugin::ColumnInfo *column= *iter; | ||
980 | 2230 | switch (column->getType()) { | ||
981 | 2231 | case DRIZZLE_TYPE_LONG: | ||
982 | 2232 | case DRIZZLE_TYPE_LONGLONG: | ||
983 | 2233 | if (!(item= new Item_return_int(column->getName().c_str(), | ||
984 | 2234 | column->getLength(), | ||
985 | 2235 | column->getType(), | ||
986 | 2236 | column->getValue()))) | ||
987 | 2237 | { | ||
988 | 2238 | return(0); | ||
989 | 2239 | } | ||
990 | 2240 | item->unsigned_flag= (column->getFlags() & MY_I_S_UNSIGNED); | ||
991 | 2241 | break; | ||
992 | 2242 | case DRIZZLE_TYPE_DATE: | ||
993 | 2243 | case DRIZZLE_TYPE_TIMESTAMP: | ||
994 | 2244 | case DRIZZLE_TYPE_DATETIME: | ||
995 | 2245 | if (!(item=new Item_return_date_time(column->getName().c_str(), | ||
996 | 2246 | column->getType()))) | ||
997 | 2247 | { | ||
998 | 2248 | return(0); | ||
999 | 2249 | } | ||
1000 | 2250 | break; | ||
1001 | 2251 | case DRIZZLE_TYPE_DOUBLE: | ||
1002 | 2252 | if ((item= new Item_float(column->getName().c_str(), 0.0, NOT_FIXED_DEC, | ||
1003 | 2253 | column->getLength())) == NULL) | ||
1004 | 2254 | return NULL; | ||
1005 | 2255 | break; | ||
1006 | 2256 | case DRIZZLE_TYPE_NEWDECIMAL: | ||
1007 | 2257 | if (!(item= new Item_decimal((int64_t) column->getValue(), false))) | ||
1008 | 2258 | { | ||
1009 | 2259 | return(0); | ||
1010 | 2260 | } | ||
1011 | 2261 | item->unsigned_flag= (column->getFlags() & MY_I_S_UNSIGNED); | ||
1012 | 2262 | item->decimals= column->getLength() % 10; | ||
1013 | 2263 | item->max_length= (column->getLength()/100)%100; | ||
1014 | 2264 | if (item->unsigned_flag == 0) | ||
1015 | 2265 | item->max_length+= 1; | ||
1016 | 2266 | if (item->decimals > 0) | ||
1017 | 2267 | item->max_length+= 1; | ||
1018 | 2268 | item->set_name(column->getName().c_str(), | ||
1019 | 2269 | column->getName().length(), cs); | ||
1020 | 2270 | break; | ||
1021 | 2271 | case DRIZZLE_TYPE_BLOB: | ||
1022 | 2272 | if (!(item= new Item_blob(column->getName().c_str(), | ||
1023 | 2273 | column->getLength()))) | ||
1024 | 2274 | { | ||
1025 | 2275 | return(0); | ||
1026 | 2276 | } | ||
1027 | 2277 | break; | ||
1028 | 2278 | default: | ||
1029 | 2279 | if (!(item= new Item_empty_string("", column->getLength(), cs))) | ||
1030 | 2280 | { | ||
1031 | 2281 | return(0); | ||
1032 | 2282 | } | ||
1033 | 2283 | item->set_name(column->getName().c_str(), | ||
1034 | 2284 | column->getName().length(), cs); | ||
1035 | 2285 | break; | ||
1036 | 2286 | } | ||
1037 | 2287 | field_list.push_back(item); | ||
1038 | 2288 | item->maybe_null= (column->getFlags() & MY_I_S_MAYBE_NULL); | ||
1039 | 2289 | field_count++; | ||
1040 | 2290 | ++iter; | ||
1041 | 2291 | } | ||
1042 | 2292 | Tmp_Table_Param *tmp_table_param = | ||
1043 | 2293 | (Tmp_Table_Param*) (session->alloc(sizeof(Tmp_Table_Param))); | ||
1044 | 2294 | tmp_table_param->init(); | ||
1045 | 2295 | tmp_table_param->table_charset= cs; | ||
1046 | 2296 | tmp_table_param->field_count= field_count; | ||
1047 | 2297 | tmp_table_param->schema_table= 1; | ||
1048 | 2298 | Select_Lex *select_lex= session->lex->current_select; | ||
1049 | 2299 | if (!(table= create_tmp_table(session, tmp_table_param, | ||
1050 | 2300 | field_list, (order_st*) 0, 0, 0, | ||
1051 | 2301 | (select_lex->options | session->options | | ||
1052 | 2302 | TMP_TABLE_ALL_COLUMNS), | ||
1053 | 2303 | HA_POS_ERROR, table_list->alias))) | ||
1054 | 2304 | return(0); | ||
1055 | 2305 | my_bitmap_map* bitmaps= | ||
1056 | 2306 | (my_bitmap_map*) session->alloc(bitmap_buffer_size(field_count)); | ||
1057 | 2307 | table->def_read_set.init((my_bitmap_map*) bitmaps, field_count); | ||
1058 | 2308 | table->read_set= &table->def_read_set; | ||
1059 | 2309 | table->read_set->clearAll(); | ||
1060 | 2310 | table_list->schema_table_param= tmp_table_param; | ||
1061 | 2311 | return(table); | ||
1065 | 2312 | } | 2060 | } |
1066 | 2313 | 2061 | ||
1067 | 2314 | 2062 | ||
1068 | @@ -2358,47 +2106,6 @@ | |||
1069 | 2358 | 2106 | ||
1070 | 2359 | 2107 | ||
1071 | 2360 | /* | 2108 | /* |
1072 | 2361 | Create information_schema table | ||
1073 | 2362 | |||
1074 | 2363 | SYNOPSIS | ||
1075 | 2364 | mysql_schema_table() | ||
1076 | 2365 | session thread Cursor | ||
1077 | 2366 | lex pointer to LEX | ||
1078 | 2367 | table_list pointer to table_list | ||
1079 | 2368 | |||
1080 | 2369 | RETURN | ||
1081 | 2370 | true on error | ||
1082 | 2371 | */ | ||
1083 | 2372 | |||
1084 | 2373 | bool mysql_schema_table(Session *session, LEX *, TableList *table_list) | ||
1085 | 2374 | { | ||
1086 | 2375 | Table *table; | ||
1087 | 2376 | if (!(table= table_list->schema_table->createSchemaTable(session, table_list))) | ||
1088 | 2377 | return true; | ||
1089 | 2378 | table->s->tmp_table= SYSTEM_TMP_TABLE; | ||
1090 | 2379 | /* | ||
1091 | 2380 | This test is necessary to make | ||
1092 | 2381 | case insensitive file systems + | ||
1093 | 2382 | upper case table names(information schema tables) + | ||
1094 | 2383 | views | ||
1095 | 2384 | working correctly | ||
1096 | 2385 | */ | ||
1097 | 2386 | if (table_list->schema_table_name) | ||
1098 | 2387 | table->alias_name_used= my_strcasecmp(table_alias_charset, | ||
1099 | 2388 | table_list->schema_table_name, | ||
1100 | 2389 | table_list->alias); | ||
1101 | 2390 | table_list->table_name= table->s->table_name.str; | ||
1102 | 2391 | table_list->table_name_length= table->s->table_name.length; | ||
1103 | 2392 | table_list->table= table; | ||
1104 | 2393 | table->next= session->derived_tables; | ||
1105 | 2394 | session->derived_tables= table; | ||
1106 | 2395 | table_list->select_lex->options |= OPTION_SCHEMA_TABLE; | ||
1107 | 2396 | |||
1108 | 2397 | return false; | ||
1109 | 2398 | } | ||
1110 | 2399 | |||
1111 | 2400 | |||
1112 | 2401 | /* | ||
1113 | 2402 | Generate select from information_schema table | 2109 | Generate select from information_schema table |
1114 | 2403 | 2110 | ||
1115 | 2404 | SYNOPSIS | 2111 | SYNOPSIS |
1116 | @@ -2432,91 +2139,3 @@ | |||
1117 | 2432 | return false; | 2139 | return false; |
1118 | 2433 | } | 2140 | } |
1119 | 2434 | 2141 | ||
1120 | 2435 | |||
1121 | 2436 | /* | ||
1122 | 2437 | Fill temporary schema tables before SELECT | ||
1123 | 2438 | |||
1124 | 2439 | SYNOPSIS | ||
1125 | 2440 | get_schema_tables_result() | ||
1126 | 2441 | join join which use schema tables | ||
1127 | 2442 | executed_place place where I_S table processed | ||
1128 | 2443 | |||
1129 | 2444 | RETURN | ||
1130 | 2445 | false success | ||
1131 | 2446 | true error | ||
1132 | 2447 | */ | ||
1133 | 2448 | |||
1134 | 2449 | bool get_schema_tables_result(JOIN *join, | ||
1135 | 2450 | enum enum_schema_table_state executed_place) | ||
1136 | 2451 | { | ||
1137 | 2452 | JoinTable *tmp_join_tab= join->join_tab+join->tables; | ||
1138 | 2453 | Session *session= join->session; | ||
1139 | 2454 | LEX *lex= session->lex; | ||
1140 | 2455 | bool result= 0; | ||
1141 | 2456 | |||
1142 | 2457 | session->no_warnings_for_error= 1; | ||
1143 | 2458 | for (JoinTable *tab= join->join_tab; tab < tmp_join_tab; tab++) | ||
1144 | 2459 | { | ||
1145 | 2460 | if (!tab->table || !tab->table->pos_in_table_list) | ||
1146 | 2461 | break; | ||
1147 | 2462 | |||
1148 | 2463 | TableList *table_list= tab->table->pos_in_table_list; | ||
1149 | 2464 | if (table_list->schema_table) | ||
1150 | 2465 | { | ||
1151 | 2466 | bool is_subselect= (&lex->unit != lex->current_select->master_unit() && | ||
1152 | 2467 | lex->current_select->master_unit()->item); | ||
1153 | 2468 | |||
1154 | 2469 | |||
1155 | 2470 | /* skip I_S optimizations specific to get_all_tables */ | ||
1156 | 2471 | if (session->lex->describe && | ||
1157 | 2472 | (table_list->schema_table->isOptimizationPossible() != true)) | ||
1158 | 2473 | { | ||
1159 | 2474 | continue; | ||
1160 | 2475 | } | ||
1161 | 2476 | |||
1162 | 2477 | /* | ||
1163 | 2478 | If schema table is already processed and | ||
1164 | 2479 | the statement is not a subselect then | ||
1165 | 2480 | we don't need to fill this table again. | ||
1166 | 2481 | If schema table is already processed and | ||
1167 | 2482 | schema_table_state != executed_place then | ||
1168 | 2483 | table is already processed and | ||
1169 | 2484 | we should skip second data processing. | ||
1170 | 2485 | */ | ||
1171 | 2486 | if (table_list->schema_table_state && | ||
1172 | 2487 | (!is_subselect || table_list->schema_table_state != executed_place)) | ||
1173 | 2488 | continue; | ||
1174 | 2489 | |||
1175 | 2490 | /* | ||
1176 | 2491 | if table is used in a subselect and | ||
1177 | 2492 | table has been processed earlier with the same | ||
1178 | 2493 | 'executed_place' value then we should refresh the table. | ||
1179 | 2494 | */ | ||
1180 | 2495 | if (table_list->schema_table_state && is_subselect) | ||
1181 | 2496 | { | ||
1182 | 2497 | table_list->table->file->extra(HA_EXTRA_NO_CACHE); | ||
1183 | 2498 | table_list->table->file->extra(HA_EXTRA_RESET_STATE); | ||
1184 | 2499 | table_list->table->file->ha_delete_all_rows(); | ||
1185 | 2500 | table_list->table->free_io_cache(); | ||
1186 | 2501 | table_list->table->filesort_free_buffers(true); | ||
1187 | 2502 | table_list->table->null_row= 0; | ||
1188 | 2503 | } | ||
1189 | 2504 | else | ||
1190 | 2505 | table_list->table->file->stats.records= 0; | ||
1191 | 2506 | |||
1192 | 2507 | if (table_list->schema_table->fillTable(session, table_list, | ||
1193 | 2508 | tab->select_cond)) | ||
1194 | 2509 | { | ||
1195 | 2510 | result= 1; | ||
1196 | 2511 | join->error= 1; | ||
1197 | 2512 | tab->read_record.file= table_list->table->file; | ||
1198 | 2513 | table_list->schema_table_state= executed_place; | ||
1199 | 2514 | break; | ||
1200 | 2515 | } | ||
1201 | 2516 | tab->read_record.file= table_list->table->file; | ||
1202 | 2517 | table_list->schema_table_state= executed_place; | ||
1203 | 2518 | } | ||
1204 | 2519 | } | ||
1205 | 2520 | session->no_warnings_for_error= 0; | ||
1206 | 2521 | return(result); | ||
1207 | 2522 | } | ||
1208 | 2523 | 2142 | ||
1209 | === modified file 'drizzled/show.h' | |||
1210 | --- drizzled/show.h 2009-09-29 22:52:00 +0000 | |||
1211 | +++ drizzled/show.h 2009-10-29 23:56:14 +0000 | |||
1212 | @@ -70,16 +70,12 @@ | |||
1213 | 70 | 70 | ||
1214 | 71 | int store_create_info(TableList *table_list, String *packet, HA_CREATE_INFO *create_info_arg); | 71 | int store_create_info(TableList *table_list, String *packet, HA_CREATE_INFO *create_info_arg); |
1215 | 72 | 72 | ||
1216 | 73 | bool schema_table_store_record(Session *session, Table *table); | ||
1217 | 74 | |||
1218 | 75 | int get_quote_char_for_identifier(); | 73 | int get_quote_char_for_identifier(); |
1219 | 76 | int wild_case_compare(const CHARSET_INFO * const cs, | 74 | int wild_case_compare(const CHARSET_INFO * const cs, |
1220 | 77 | const char *str,const char *wildstr); | 75 | const char *str,const char *wildstr); |
1221 | 78 | 76 | ||
1222 | 79 | bool make_schema_select(Session *session, Select_Lex *sel, | 77 | bool make_schema_select(Session *session, Select_Lex *sel, |
1223 | 80 | const std::string& schema_table_name); | 78 | const std::string& schema_table_name); |
1224 | 81 | bool mysql_schema_table(Session *session, LEX *lex, TableList *table_list); | ||
1225 | 82 | bool get_schema_tables_result(JOIN *join, enum enum_schema_table_state executed_place); | ||
1226 | 83 | 79 | ||
1227 | 84 | bool mysqld_show_open_tables(Session *session,const char *wild); | 80 | bool mysqld_show_open_tables(Session *session,const char *wild); |
1228 | 85 | bool mysqld_show_logs(Session *session); | 81 | bool mysqld_show_logs(Session *session); |
1229 | 86 | 82 | ||
1230 | === modified file 'drizzled/sql_base.cc' | |||
1231 | --- drizzled/sql_base.cc 2009-10-16 10:27:33 +0000 | |||
1232 | +++ drizzled/sql_base.cc 2009-10-29 23:56:14 +0000 | |||
1233 | @@ -2139,18 +2139,6 @@ | |||
1234 | 2139 | { | 2139 | { |
1235 | 2140 | continue; | 2140 | continue; |
1236 | 2141 | } | 2141 | } |
1237 | 2142 | /* | ||
1238 | 2143 | If this TableList object is a placeholder for an information_schema | ||
1239 | 2144 | table, create a temporary table to represent the information_schema | ||
1240 | 2145 | table in the query. Do not fill it yet - will be filled during | ||
1241 | 2146 | execution. | ||
1242 | 2147 | */ | ||
1243 | 2148 | if (tables->schema_table) | ||
1244 | 2149 | { | ||
1245 | 2150 | if (mysql_schema_table(this, lex, tables) == false) | ||
1246 | 2151 | continue; | ||
1247 | 2152 | return -1; | ||
1248 | 2153 | } | ||
1249 | 2154 | (*counter)++; | 2142 | (*counter)++; |
1250 | 2155 | 2143 | ||
1251 | 2156 | /* | 2144 | /* |
1252 | 2157 | 2145 | ||
1253 | === modified file 'drizzled/sql_select.cc' | |||
1254 | --- drizzled/sql_select.cc 2009-10-16 10:27:33 +0000 | |||
1255 | +++ drizzled/sql_select.cc 2009-10-29 23:56:14 +0000 | |||
1256 | @@ -5294,11 +5294,6 @@ | |||
1257 | 5294 | } | 5294 | } |
1258 | 5295 | } | 5295 | } |
1259 | 5296 | 5296 | ||
1260 | 5297 | /* Fill schema tables with data before filesort if it's necessary */ | ||
1261 | 5298 | if ((join->select_lex->options & OPTION_SCHEMA_TABLE) && | ||
1262 | 5299 | get_schema_tables_result(join, PROCESSED_BY_CREATE_SORT_INDEX)) | ||
1263 | 5300 | goto err; | ||
1264 | 5301 | |||
1265 | 5302 | if (table->s->tmp_table) | 5297 | if (table->s->tmp_table) |
1266 | 5303 | table->file->info(HA_STATUS_VARIABLE); // Get record count | 5298 | table->file->info(HA_STATUS_VARIABLE); // Get record count |
1267 | 5304 | table->sort.found_records=filesort(session, table,join->sortorder, length, | 5299 | table->sort.found_records=filesort(session, table,join->sortorder, length, |
1268 | @@ -6935,12 +6930,6 @@ | |||
1269 | 6935 | if (table_list->schema_table && | 6930 | if (table_list->schema_table && |
1270 | 6936 | table_list->schema_table->getRequestedObject() & OPTIMIZE_I_S_TABLE) | 6931 | table_list->schema_table->getRequestedObject() & OPTIMIZE_I_S_TABLE) |
1271 | 6937 | { | 6932 | { |
1272 | 6938 | if (!table_list->table_open_method) | ||
1273 | 6939 | extra.append(STRING_WITH_LEN("; Skip_open_table")); | ||
1274 | 6940 | else if (table_list->table_open_method == OPEN_FRM_ONLY) | ||
1275 | 6941 | extra.append(STRING_WITH_LEN("; Open_frm_only")); | ||
1276 | 6942 | else | ||
1277 | 6943 | extra.append(STRING_WITH_LEN("; Open_full_table")); | ||
1278 | 6944 | if (table_list->has_db_lookup_value && | 6933 | if (table_list->has_db_lookup_value && |
1279 | 6945 | table_list->has_table_lookup_value) | 6934 | table_list->has_table_lookup_value) |
1280 | 6946 | extra.append(STRING_WITH_LEN("; Scanned 0 databases")); | 6935 | extra.append(STRING_WITH_LEN("; Scanned 0 databases")); |
1281 | 6947 | 6936 | ||
1282 | === modified file 'drizzled/sql_table.cc' | |||
1283 | --- drizzled/sql_table.cc 2009-10-19 19:19:38 +0000 | |||
1284 | +++ drizzled/sql_table.cc 2009-10-29 23:56:14 +0000 | |||
1285 | @@ -385,18 +385,12 @@ | |||
1286 | 385 | { | 385 | { |
1287 | 386 | bool error, need_start_waiting= false; | 386 | bool error, need_start_waiting= false; |
1288 | 387 | 387 | ||
1289 | 388 | if (tables && tables->schema_table) | ||
1290 | 389 | { | ||
1291 | 390 | my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), "", "", INFORMATION_SCHEMA_NAME.c_str()); | ||
1292 | 391 | return(true); | ||
1293 | 392 | } | ||
1294 | 393 | |||
1295 | 394 | /* mark for close and remove all cached entries */ | 388 | /* mark for close and remove all cached entries */ |
1296 | 395 | 389 | ||
1298 | 396 | if (!drop_temporary) | 390 | if (! drop_temporary) |
1299 | 397 | { | 391 | { |
1302 | 398 | if (!(need_start_waiting= !wait_if_global_read_lock(session, 0, 1))) | 392 | if (! (need_start_waiting= ! wait_if_global_read_lock(session, 0, 1))) |
1303 | 399 | return(true); | 393 | return true; |
1304 | 400 | } | 394 | } |
1305 | 401 | 395 | ||
1306 | 402 | /* | 396 | /* |
1307 | @@ -2437,19 +2431,7 @@ | |||
1308 | 2437 | pthread_mutex_lock(&LOCK_open); /* We lock for CREATE TABLE LIKE to copy table definition */ | 2431 | pthread_mutex_lock(&LOCK_open); /* We lock for CREATE TABLE LIKE to copy table definition */ |
1309 | 2438 | { | 2432 | { |
1310 | 2439 | int protoerr= EEXIST; | 2433 | int protoerr= EEXIST; |
1324 | 2440 | 2434 | protoerr= plugin::StorageEngine::getTableProto(src_path, &src_proto); | |
1312 | 2441 | if (src_table->schema_table) | ||
1313 | 2442 | { | ||
1314 | 2443 | if (create_like_schema_frm(session, src_table, create_info, &src_proto)) | ||
1315 | 2444 | { | ||
1316 | 2445 | pthread_mutex_unlock(&LOCK_open); | ||
1317 | 2446 | goto err; | ||
1318 | 2447 | } | ||
1319 | 2448 | } | ||
1320 | 2449 | else | ||
1321 | 2450 | { | ||
1322 | 2451 | protoerr= plugin::StorageEngine::getTableProto(src_path, &src_proto); | ||
1323 | 2452 | } | ||
1325 | 2453 | 2435 | ||
1326 | 2454 | message::Table new_proto(src_proto); | 2436 | message::Table new_proto(src_proto); |
1327 | 2455 | 2437 | ||
1328 | 2456 | 2438 | ||
1329 | === modified file 'drizzled/table.cc' | |||
1330 | --- drizzled/table.cc 2009-10-20 16:11:52 +0000 | |||
1331 | +++ drizzled/table.cc 2009-10-29 23:56:14 +0000 | |||
1332 | @@ -283,6 +283,12 @@ | |||
1333 | 283 | 283 | ||
1334 | 284 | share->storage_engine= plugin::StorageEngine::findByName(session, table.engine().name()); | 284 | share->storage_engine= plugin::StorageEngine::findByName(session, table.engine().name()); |
1335 | 285 | 285 | ||
1336 | 286 | if (! share->storage_engine) | ||
1337 | 287 | { | ||
1338 | 288 | share->storage_engine= plugin::StorageEngine::findByName(session, | ||
1339 | 289 | table.engine().name()); | ||
1340 | 290 | } | ||
1341 | 291 | |||
1342 | 286 | message::Table::TableOptions table_options; | 292 | message::Table::TableOptions table_options; |
1343 | 287 | 293 | ||
1344 | 288 | if (table.has_options()) | 294 | if (table.has_options()) |
1345 | 289 | 295 | ||
1346 | === modified file 'drizzled/table_list.h' | |||
1347 | --- drizzled/table_list.h 2009-10-20 16:11:52 +0000 | |||
1348 | +++ drizzled/table_list.h 2009-10-29 23:56:14 +0000 | |||
1349 | @@ -126,9 +126,8 @@ | |||
1350 | 126 | is_alias(false), | 126 | is_alias(false), |
1351 | 127 | is_fqtn(false), | 127 | is_fqtn(false), |
1352 | 128 | has_db_lookup_value(false), | 128 | has_db_lookup_value(false), |
1356 | 129 | has_table_lookup_value(false), | 129 | has_table_lookup_value(false) |
1357 | 130 | table_open_method(0) | 130 | {} |
1355 | 131 | {} | ||
1358 | 132 | 131 | ||
1359 | 133 | /** | 132 | /** |
1360 | 134 | * List of tables local to a subquery (used by SQL_LIST). Considers | 133 | * List of tables local to a subquery (used by SQL_LIST). Considers |
1361 | @@ -246,7 +245,6 @@ | |||
1362 | 246 | 245 | ||
1363 | 247 | bool has_db_lookup_value; | 246 | bool has_db_lookup_value; |
1364 | 248 | bool has_table_lookup_value; | 247 | bool has_table_lookup_value; |
1365 | 249 | uint32_t table_open_method; | ||
1366 | 250 | enum enum_schema_table_state schema_table_state; | 248 | enum enum_schema_table_state schema_table_state; |
1367 | 251 | 249 | ||
1368 | 252 | void set_underlying_merge(); | 250 | void set_underlying_merge(); |
1369 | 253 | 251 | ||
1370 | === modified file 'plugin/archive/ha_archive.cc' | |||
1371 | --- plugin/archive/ha_archive.cc 2009-10-19 04:52:19 +0000 | |||
1372 | +++ plugin/archive/ha_archive.cc 2009-10-29 23:56:14 +0000 | |||
1373 | @@ -174,11 +174,9 @@ | |||
1374 | 174 | dirp = my_dir(path,MYF(dir ? MY_WANT_STAT : 0)); | 174 | dirp = my_dir(path,MYF(dir ? MY_WANT_STAT : 0)); |
1375 | 175 | if (dirp == NULL) | 175 | if (dirp == NULL) |
1376 | 176 | { | 176 | { |
1380 | 177 | if (my_errno == ENOENT) | 177 | if (my_errno != ENOENT) |
1378 | 178 | my_error(ER_BAD_DB_ERROR, MYF(ME_BELL+ME_WAITTANG), db.c_str()); | ||
1379 | 179 | else | ||
1381 | 180 | my_error(ER_CANT_READ_DIR, MYF(ME_BELL+ME_WAITTANG), path, my_errno); | 178 | my_error(ER_CANT_READ_DIR, MYF(ME_BELL+ME_WAITTANG), path, my_errno); |
1383 | 181 | return(ENOENT); | 179 | return ENOENT; |
1384 | 182 | } | 180 | } |
1385 | 183 | current_entry= -1; | 181 | current_entry= -1; |
1386 | 184 | } | 182 | } |
1387 | 185 | 183 | ||
1388 | === modified file 'plugin/blackhole/ha_blackhole.cc' | |||
1389 | --- plugin/blackhole/ha_blackhole.cc 2009-10-16 01:56:08 +0000 | |||
1390 | +++ plugin/blackhole/ha_blackhole.cc 2009-10-29 23:56:14 +0000 | |||
1391 | @@ -46,7 +46,7 @@ | |||
1392 | 46 | int createTableImplementation(Session*, const char *, Table *, | 46 | int createTableImplementation(Session*, const char *, Table *, |
1393 | 47 | HA_CREATE_INFO *, drizzled::message::Table*); | 47 | HA_CREATE_INFO *, drizzled::message::Table*); |
1394 | 48 | 48 | ||
1396 | 49 | int deleteTableImplementation(Session*, const string table_name); | 49 | int deleteTableImplementation(Session*, const string &table_name); |
1397 | 50 | }; | 50 | }; |
1398 | 51 | 51 | ||
1399 | 52 | /* Static declarations for shared structures */ | 52 | /* Static declarations for shared structures */ |
1400 | @@ -105,7 +105,7 @@ | |||
1401 | 105 | return(0); | 105 | return(0); |
1402 | 106 | } | 106 | } |
1403 | 107 | 107 | ||
1405 | 108 | int BlackholeEngine::deleteTableImplementation(Session*, const string path) | 108 | int BlackholeEngine::deleteTableImplementation(Session*, const string &path) |
1406 | 109 | { | 109 | { |
1407 | 110 | if (unlink(path.c_str()) != 0) | 110 | if (unlink(path.c_str()) != 0) |
1408 | 111 | { | 111 | { |
1409 | 112 | 112 | ||
1410 | === modified file 'plugin/heap/ha_heap.cc' | |||
1411 | --- plugin/heap/ha_heap.cc 2009-10-16 10:27:33 +0000 | |||
1412 | +++ plugin/heap/ha_heap.cc 2009-10-29 23:56:14 +0000 | |||
1413 | @@ -72,14 +72,14 @@ | |||
1414 | 72 | 72 | ||
1415 | 73 | int renameTableImplementation(Session*, const char * from, const char * to); | 73 | int renameTableImplementation(Session*, const char * from, const char * to); |
1416 | 74 | 74 | ||
1418 | 75 | int deleteTableImplementation(Session *, const string table_path); | 75 | int deleteTableImplementation(Session *, const string &table_path); |
1419 | 76 | }; | 76 | }; |
1420 | 77 | 77 | ||
1421 | 78 | /* | 78 | /* |
1422 | 79 | We have to ignore ENOENT entries as the HEAP table is created on open and | 79 | We have to ignore ENOENT entries as the HEAP table is created on open and |
1423 | 80 | not when doing a CREATE on the table. | 80 | not when doing a CREATE on the table. |
1424 | 81 | */ | 81 | */ |
1426 | 82 | int HeapEngine::deleteTableImplementation(Session*, const string table_path) | 82 | int HeapEngine::deleteTableImplementation(Session*, const string &table_path) |
1427 | 83 | { | 83 | { |
1428 | 84 | return heap_delete_table(table_path.c_str()); | 84 | return heap_delete_table(table_path.c_str()); |
1429 | 85 | } | 85 | } |
1430 | 86 | 86 | ||
1431 | === modified file 'plugin/info_schema/info_schema_columns.cc' | |||
1432 | --- plugin/info_schema/info_schema_columns.cc 2009-09-22 17:56:50 +0000 | |||
1433 | +++ plugin/info_schema/info_schema_columns.cc 2009-10-29 23:56:14 +0000 | |||
1434 | @@ -44,8 +44,7 @@ | |||
1435 | 44 | DRIZZLE_TYPE_VARCHAR, | 44 | DRIZZLE_TYPE_VARCHAR, |
1436 | 45 | 0, | 45 | 0, |
1437 | 46 | 0, | 46 | 0, |
1440 | 47 | "Charset", | 47 | "Charset"); |
1439 | 48 | SKIP_OPEN_TABLE); | ||
1441 | 49 | if (name_col == NULL) | 48 | if (name_col == NULL) |
1442 | 50 | { | 49 | { |
1443 | 51 | return true; | 50 | return true; |
1444 | @@ -56,8 +55,7 @@ | |||
1445 | 56 | DRIZZLE_TYPE_VARCHAR, | 55 | DRIZZLE_TYPE_VARCHAR, |
1446 | 57 | 0, | 56 | 0, |
1447 | 58 | 0, | 57 | 0, |
1450 | 59 | "Default collation", | 58 | "Default collation"); |
1449 | 60 | SKIP_OPEN_TABLE); | ||
1451 | 61 | if (collate_col == NULL) | 59 | if (collate_col == NULL) |
1452 | 62 | { | 60 | { |
1453 | 63 | return true; | 61 | return true; |
1454 | @@ -68,8 +66,7 @@ | |||
1455 | 68 | DRIZZLE_TYPE_VARCHAR, | 66 | DRIZZLE_TYPE_VARCHAR, |
1456 | 69 | 0, | 67 | 0, |
1457 | 70 | 0, | 68 | 0, |
1460 | 71 | "Description", | 69 | "Description"); |
1459 | 72 | SKIP_OPEN_TABLE); | ||
1461 | 73 | if (descrip_col == NULL) | 70 | if (descrip_col == NULL) |
1462 | 74 | { | 71 | { |
1463 | 75 | return true; | 72 | return true; |
1464 | @@ -80,8 +77,7 @@ | |||
1465 | 80 | DRIZZLE_TYPE_LONGLONG, | 77 | DRIZZLE_TYPE_LONGLONG, |
1466 | 81 | 0, | 78 | 0, |
1467 | 82 | 0, | 79 | 0, |
1470 | 83 | "Maxlen", | 80 | "Maxlen"); |
1469 | 84 | SKIP_OPEN_TABLE); | ||
1471 | 85 | if (len_col == NULL) | 81 | if (len_col == NULL) |
1472 | 86 | { | 82 | { |
1473 | 87 | return true; | 83 | return true; |
1474 | @@ -108,8 +104,7 @@ | |||
1475 | 108 | DRIZZLE_TYPE_VARCHAR, | 104 | DRIZZLE_TYPE_VARCHAR, |
1476 | 109 | 0, | 105 | 0, |
1477 | 110 | 0, | 106 | 0, |
1480 | 111 | "Collation", | 107 | "Collation"); |
1479 | 112 | SKIP_OPEN_TABLE); | ||
1481 | 113 | if (name_col == NULL) | 108 | if (name_col == NULL) |
1482 | 114 | { | 109 | { |
1483 | 115 | return true; | 110 | return true; |
1484 | @@ -120,8 +115,7 @@ | |||
1485 | 120 | DRIZZLE_TYPE_VARCHAR, | 115 | DRIZZLE_TYPE_VARCHAR, |
1486 | 121 | 0, | 116 | 0, |
1487 | 122 | 0, | 117 | 0, |
1490 | 123 | "Default collation", | 118 | "Default collation"); |
1489 | 124 | SKIP_OPEN_TABLE); | ||
1491 | 125 | if (char_set_col == NULL) | 119 | if (char_set_col == NULL) |
1492 | 126 | { | 120 | { |
1493 | 127 | return true; | 121 | return true; |
1494 | @@ -132,8 +126,7 @@ | |||
1495 | 132 | DRIZZLE_TYPE_VARCHAR, | 126 | DRIZZLE_TYPE_VARCHAR, |
1496 | 133 | 0, | 127 | 0, |
1497 | 134 | 0, | 128 | 0, |
1500 | 135 | "Charset", | 129 | "Charset"); |
1499 | 136 | SKIP_OPEN_TABLE); | ||
1501 | 137 | if (descrip_col == NULL) | 130 | if (descrip_col == NULL) |
1502 | 138 | { | 131 | { |
1503 | 139 | return true; | 132 | return true; |
1504 | @@ -144,8 +137,7 @@ | |||
1505 | 144 | DRIZZLE_TYPE_LONGLONG, | 137 | DRIZZLE_TYPE_LONGLONG, |
1506 | 145 | 0, | 138 | 0, |
1507 | 146 | 0, | 139 | 0, |
1510 | 147 | "Id", | 140 | "Id"); |
1509 | 148 | SKIP_OPEN_TABLE); | ||
1511 | 149 | if (id_col == NULL) | 141 | if (id_col == NULL) |
1512 | 150 | { | 142 | { |
1513 | 151 | return true; | 143 | return true; |
1514 | @@ -156,8 +148,7 @@ | |||
1515 | 156 | DRIZZLE_TYPE_VARCHAR, | 148 | DRIZZLE_TYPE_VARCHAR, |
1516 | 157 | 0, | 149 | 0, |
1517 | 158 | 0, | 150 | 0, |
1520 | 159 | "Default", | 151 | "Default"); |
1519 | 160 | SKIP_OPEN_TABLE); | ||
1521 | 161 | if (default_col == NULL) | 152 | if (default_col == NULL) |
1522 | 162 | { | 153 | { |
1523 | 163 | return true; | 154 | return true; |
1524 | @@ -168,8 +159,7 @@ | |||
1525 | 168 | DRIZZLE_TYPE_VARCHAR, | 159 | DRIZZLE_TYPE_VARCHAR, |
1526 | 169 | 0, | 160 | 0, |
1527 | 170 | 0, | 161 | 0, |
1530 | 171 | "Compiled", | 162 | "Compiled"); |
1529 | 172 | SKIP_OPEN_TABLE); | ||
1531 | 173 | if (compiled_col == NULL) | 163 | if (compiled_col == NULL) |
1532 | 174 | { | 164 | { |
1533 | 175 | return true; | 165 | return true; |
1534 | @@ -180,8 +170,7 @@ | |||
1535 | 180 | DRIZZLE_TYPE_LONGLONG, | 170 | DRIZZLE_TYPE_LONGLONG, |
1536 | 181 | 0, | 171 | 0, |
1537 | 182 | 0, | 172 | 0, |
1540 | 183 | "Sortlen", | 173 | "Sortlen"); |
1539 | 184 | SKIP_OPEN_TABLE); | ||
1541 | 185 | if (sortlen_col == NULL) | 174 | if (sortlen_col == NULL) |
1542 | 186 | { | 175 | { |
1543 | 187 | return true; | 176 | return true; |
1544 | @@ -211,8 +200,7 @@ | |||
1545 | 211 | DRIZZLE_TYPE_VARCHAR, | 200 | DRIZZLE_TYPE_VARCHAR, |
1546 | 212 | 0, | 201 | 0, |
1547 | 213 | 0, | 202 | 0, |
1550 | 214 | "", | 203 | ""); |
1549 | 215 | SKIP_OPEN_TABLE); | ||
1551 | 216 | if (name_col == NULL) | 204 | if (name_col == NULL) |
1552 | 217 | { | 205 | { |
1553 | 218 | return true; | 206 | return true; |
1554 | @@ -223,8 +211,7 @@ | |||
1555 | 223 | DRIZZLE_TYPE_VARCHAR, | 211 | DRIZZLE_TYPE_VARCHAR, |
1556 | 224 | 0, | 212 | 0, |
1557 | 225 | 0, | 213 | 0, |
1560 | 226 | "", | 214 | ""); |
1559 | 227 | SKIP_OPEN_TABLE); | ||
1561 | 228 | if (char_set_col == NULL) | 215 | if (char_set_col == NULL) |
1562 | 229 | { | 216 | { |
1563 | 230 | return true; | 217 | return true; |
1564 | @@ -249,8 +236,7 @@ | |||
1565 | 249 | DRIZZLE_TYPE_VARCHAR, | 236 | DRIZZLE_TYPE_VARCHAR, |
1566 | 250 | 0, | 237 | 0, |
1567 | 251 | 1, | 238 | 1, |
1570 | 252 | "", | 239 | ""); |
1569 | 253 | OPEN_FRM_ONLY); | ||
1571 | 254 | if (tab_cat == NULL) | 240 | if (tab_cat == NULL) |
1572 | 255 | { | 241 | { |
1573 | 256 | return true; | 242 | return true; |
1574 | @@ -261,8 +247,7 @@ | |||
1575 | 261 | DRIZZLE_TYPE_VARCHAR, | 247 | DRIZZLE_TYPE_VARCHAR, |
1576 | 262 | 0, | 248 | 0, |
1577 | 263 | 0, | 249 | 0, |
1580 | 264 | "", | 250 | ""); |
1579 | 265 | OPEN_FRM_ONLY); | ||
1581 | 266 | if (tab_sch == NULL) | 251 | if (tab_sch == NULL) |
1582 | 267 | { | 252 | { |
1583 | 268 | return true; | 253 | return true; |
1584 | @@ -273,8 +258,7 @@ | |||
1585 | 273 | DRIZZLE_TYPE_VARCHAR, | 258 | DRIZZLE_TYPE_VARCHAR, |
1586 | 274 | 0, | 259 | 0, |
1587 | 275 | 0, | 260 | 0, |
1590 | 276 | "", | 261 | ""); |
1589 | 277 | OPEN_FRM_ONLY); | ||
1591 | 278 | if (tab_name == NULL) | 262 | if (tab_name == NULL) |
1592 | 279 | { | 263 | { |
1593 | 280 | return true; | 264 | return true; |
1594 | @@ -285,8 +269,7 @@ | |||
1595 | 285 | DRIZZLE_TYPE_VARCHAR, | 269 | DRIZZLE_TYPE_VARCHAR, |
1596 | 286 | 0, | 270 | 0, |
1597 | 287 | 0, | 271 | 0, |
1600 | 288 | "Field", | 272 | "Field"); |
1599 | 289 | OPEN_FRM_ONLY); | ||
1601 | 290 | if (col_name == NULL) | 273 | if (col_name == NULL) |
1602 | 291 | { | 274 | { |
1603 | 292 | return true; | 275 | return true; |
1604 | @@ -297,20 +280,19 @@ | |||
1605 | 297 | DRIZZLE_TYPE_LONGLONG, | 280 | DRIZZLE_TYPE_LONGLONG, |
1606 | 298 | 0, | 281 | 0, |
1607 | 299 | MY_I_S_UNSIGNED, | 282 | MY_I_S_UNSIGNED, |
1610 | 300 | "", | 283 | ""); |
1609 | 301 | OPEN_FRM_ONLY); | ||
1611 | 302 | if (ord_pos == NULL) | 284 | if (ord_pos == NULL) |
1612 | 303 | { | 285 | { |
1613 | 304 | return true; | 286 | return true; |
1614 | 305 | } | 287 | } |
1615 | 306 | 288 | ||
1616 | 307 | const drizzled::plugin::ColumnInfo *col_def= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_DEFAULT", | 289 | const drizzled::plugin::ColumnInfo *col_def= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_DEFAULT", |
1618 | 308 | MAX_FIELD_VARCHARLENGTH, | 290 | 64, |
1619 | 291 | //MAX_FIELD_VARCHARLENGTH, | ||
1620 | 309 | DRIZZLE_TYPE_VARCHAR, | 292 | DRIZZLE_TYPE_VARCHAR, |
1621 | 310 | 0, | 293 | 0, |
1622 | 311 | 1, | 294 | 1, |
1625 | 312 | "Default", | 295 | "Default"); |
1624 | 313 | OPEN_FRM_ONLY); | ||
1626 | 314 | if (col_def == NULL) | 296 | if (col_def == NULL) |
1627 | 315 | { | 297 | { |
1628 | 316 | return true; | 298 | return true; |
1629 | @@ -321,8 +303,7 @@ | |||
1630 | 321 | DRIZZLE_TYPE_VARCHAR, | 303 | DRIZZLE_TYPE_VARCHAR, |
1631 | 322 | 0, | 304 | 0, |
1632 | 323 | 0, | 305 | 0, |
1635 | 324 | "Null", | 306 | "Null"); |
1634 | 325 | OPEN_FRM_ONLY); | ||
1636 | 326 | if (is_nullable == NULL) | 307 | if (is_nullable == NULL) |
1637 | 327 | { | 308 | { |
1638 | 328 | return true; | 309 | return true; |
1639 | @@ -333,8 +314,7 @@ | |||
1640 | 333 | DRIZZLE_TYPE_VARCHAR, | 314 | DRIZZLE_TYPE_VARCHAR, |
1641 | 334 | 0, | 315 | 0, |
1642 | 335 | 0, | 316 | 0, |
1645 | 336 | "", | 317 | ""); |
1644 | 337 | OPEN_FRM_ONLY); | ||
1646 | 338 | if (data_type == NULL) | 318 | if (data_type == NULL) |
1647 | 339 | { | 319 | { |
1648 | 340 | return true; | 320 | return true; |
1649 | @@ -345,8 +325,7 @@ | |||
1650 | 345 | DRIZZLE_TYPE_LONGLONG, | 325 | DRIZZLE_TYPE_LONGLONG, |
1651 | 346 | 0, | 326 | 0, |
1652 | 347 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 327 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
1655 | 348 | "", | 328 | ""); |
1654 | 349 | OPEN_FRM_ONLY); | ||
1656 | 350 | if (max_len == NULL) | 329 | if (max_len == NULL) |
1657 | 351 | { | 330 | { |
1658 | 352 | return true; | 331 | return true; |
1659 | @@ -357,8 +336,7 @@ | |||
1660 | 357 | DRIZZLE_TYPE_LONGLONG, | 336 | DRIZZLE_TYPE_LONGLONG, |
1661 | 358 | 0, | 337 | 0, |
1662 | 359 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 338 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
1665 | 360 | "", | 339 | ""); |
1664 | 361 | OPEN_FRM_ONLY); | ||
1666 | 362 | if (octet_len == NULL) | 340 | if (octet_len == NULL) |
1667 | 363 | { | 341 | { |
1668 | 364 | return true; | 342 | return true; |
1669 | @@ -369,8 +347,7 @@ | |||
1670 | 369 | DRIZZLE_TYPE_LONGLONG, | 347 | DRIZZLE_TYPE_LONGLONG, |
1671 | 370 | 0, | 348 | 0, |
1672 | 371 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 349 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
1675 | 372 | "", | 350 | ""); |
1674 | 373 | OPEN_FRM_ONLY); | ||
1676 | 374 | if (num_prec == NULL) | 351 | if (num_prec == NULL) |
1677 | 375 | { | 352 | { |
1678 | 376 | return true; | 353 | return true; |
1679 | @@ -381,8 +358,7 @@ | |||
1680 | 381 | DRIZZLE_TYPE_LONGLONG, | 358 | DRIZZLE_TYPE_LONGLONG, |
1681 | 382 | 0, | 359 | 0, |
1682 | 383 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 360 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
1685 | 384 | "", | 361 | ""); |
1684 | 385 | OPEN_FRM_ONLY); | ||
1686 | 386 | if (num_scale == NULL) | 362 | if (num_scale == NULL) |
1687 | 387 | { | 363 | { |
1688 | 388 | return true; | 364 | return true; |
1689 | @@ -393,8 +369,7 @@ | |||
1690 | 393 | DRIZZLE_TYPE_VARCHAR, | 369 | DRIZZLE_TYPE_VARCHAR, |
1691 | 394 | 0, | 370 | 0, |
1692 | 395 | 1, | 371 | 1, |
1695 | 396 | "", | 372 | ""); |
1694 | 397 | OPEN_FRM_ONLY); | ||
1696 | 398 | if (char_set_name == NULL) | 373 | if (char_set_name == NULL) |
1697 | 399 | { | 374 | { |
1698 | 400 | return true; | 375 | return true; |
1699 | @@ -405,20 +380,19 @@ | |||
1700 | 405 | DRIZZLE_TYPE_VARCHAR, | 380 | DRIZZLE_TYPE_VARCHAR, |
1701 | 406 | 0, | 381 | 0, |
1702 | 407 | 1, | 382 | 1, |
1705 | 408 | "Collation", | 383 | "Collation"); |
1704 | 409 | OPEN_FRM_ONLY); | ||
1706 | 410 | if (coll_name == NULL) | 384 | if (coll_name == NULL) |
1707 | 411 | { | 385 | { |
1708 | 412 | return true; | 386 | return true; |
1709 | 413 | } | 387 | } |
1710 | 414 | 388 | ||
1711 | 415 | const drizzled::plugin::ColumnInfo *col_type= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_TYPE", | 389 | const drizzled::plugin::ColumnInfo *col_type= new(std::nothrow) drizzled::plugin::ColumnInfo("COLUMN_TYPE", |
1713 | 416 | 65535, | 390 | 64, |
1714 | 391 | //65535, | ||
1715 | 417 | DRIZZLE_TYPE_VARCHAR, | 392 | DRIZZLE_TYPE_VARCHAR, |
1716 | 418 | 0, | 393 | 0, |
1717 | 419 | 0, | 394 | 0, |
1720 | 420 | "Type", | 395 | "Type"); |
1719 | 421 | OPEN_FRM_ONLY); | ||
1721 | 422 | if (col_type == NULL) | 396 | if (col_type == NULL) |
1722 | 423 | { | 397 | { |
1723 | 424 | return true; | 398 | return true; |
1724 | @@ -429,8 +403,7 @@ | |||
1725 | 429 | DRIZZLE_TYPE_VARCHAR, | 403 | DRIZZLE_TYPE_VARCHAR, |
1726 | 430 | 0, | 404 | 0, |
1727 | 431 | 0, | 405 | 0, |
1730 | 432 | "Key", | 406 | "Key"); |
1729 | 433 | OPEN_FRM_ONLY); | ||
1731 | 434 | if (col_key == NULL) | 407 | if (col_key == NULL) |
1732 | 435 | { | 408 | { |
1733 | 436 | return true; | 409 | return true; |
1734 | @@ -441,8 +414,7 @@ | |||
1735 | 441 | DRIZZLE_TYPE_VARCHAR, | 414 | DRIZZLE_TYPE_VARCHAR, |
1736 | 442 | 0, | 415 | 0, |
1737 | 443 | 0, | 416 | 0, |
1740 | 444 | "Extra", | 417 | "Extra"); |
1739 | 445 | OPEN_FRM_ONLY); | ||
1741 | 446 | if (extra == NULL) | 418 | if (extra == NULL) |
1742 | 447 | { | 419 | { |
1743 | 448 | return true; | 420 | return true; |
1744 | @@ -453,8 +425,7 @@ | |||
1745 | 453 | DRIZZLE_TYPE_VARCHAR, | 425 | DRIZZLE_TYPE_VARCHAR, |
1746 | 454 | 0, | 426 | 0, |
1747 | 455 | 0, | 427 | 0, |
1750 | 456 | "Privileges", | 428 | "Privileges"); |
1749 | 457 | OPEN_FRM_ONLY); | ||
1751 | 458 | if (priv == NULL) | 429 | if (priv == NULL) |
1752 | 459 | { | 430 | { |
1753 | 460 | return true; | 431 | return true; |
1754 | @@ -465,8 +436,7 @@ | |||
1755 | 465 | DRIZZLE_TYPE_VARCHAR, | 436 | DRIZZLE_TYPE_VARCHAR, |
1756 | 466 | 0, | 437 | 0, |
1757 | 467 | 0, | 438 | 0, |
1760 | 468 | "Comment", | 439 | "Comment"); |
1759 | 469 | OPEN_FRM_ONLY); | ||
1761 | 470 | if (col_comment == NULL) | 440 | if (col_comment == NULL) |
1762 | 471 | { | 441 | { |
1763 | 472 | return true; | 442 | return true; |
1764 | @@ -477,8 +447,7 @@ | |||
1765 | 477 | DRIZZLE_TYPE_VARCHAR, | 447 | DRIZZLE_TYPE_VARCHAR, |
1766 | 478 | 0, | 448 | 0, |
1767 | 479 | 0, | 449 | 0, |
1770 | 480 | "Storage", | 450 | "Storage"); |
1769 | 481 | OPEN_FRM_ONLY); | ||
1771 | 482 | if (storage == NULL) | 451 | if (storage == NULL) |
1772 | 483 | { | 452 | { |
1773 | 484 | return true; | 453 | return true; |
1774 | @@ -489,8 +458,7 @@ | |||
1775 | 489 | DRIZZLE_TYPE_VARCHAR, | 458 | DRIZZLE_TYPE_VARCHAR, |
1776 | 490 | 0, | 459 | 0, |
1777 | 491 | 0, | 460 | 0, |
1780 | 492 | "Format", | 461 | "Format"); |
1779 | 493 | OPEN_FRM_ONLY); | ||
1781 | 494 | if (format == NULL) | 462 | if (format == NULL) |
1782 | 495 | { | 463 | { |
1783 | 496 | return true; | 464 | return true; |
1784 | @@ -531,8 +499,7 @@ | |||
1785 | 531 | DRIZZLE_TYPE_VARCHAR, | 499 | DRIZZLE_TYPE_VARCHAR, |
1786 | 532 | 0, | 500 | 0, |
1787 | 533 | 1, | 501 | 1, |
1790 | 534 | "", | 502 | ""); |
1789 | 535 | OPEN_FULL_TABLE); | ||
1791 | 536 | if (cat == NULL) | 503 | if (cat == NULL) |
1792 | 537 | { | 504 | { |
1793 | 538 | return true; | 505 | return true; |
1794 | @@ -543,8 +510,7 @@ | |||
1795 | 543 | DRIZZLE_TYPE_VARCHAR, | 510 | DRIZZLE_TYPE_VARCHAR, |
1796 | 544 | 0, | 511 | 0, |
1797 | 545 | 0, | 512 | 0, |
1800 | 546 | "", | 513 | ""); |
1799 | 547 | OPEN_FULL_TABLE); | ||
1801 | 548 | if (sch == NULL) | 514 | if (sch == NULL) |
1802 | 549 | { | 515 | { |
1803 | 550 | return true; | 516 | return true; |
1804 | @@ -555,8 +521,7 @@ | |||
1805 | 555 | DRIZZLE_TYPE_VARCHAR, | 521 | DRIZZLE_TYPE_VARCHAR, |
1806 | 556 | 0, | 522 | 0, |
1807 | 557 | 0, | 523 | 0, |
1810 | 558 | "", | 524 | ""); |
1809 | 559 | OPEN_FULL_TABLE); | ||
1811 | 560 | if (name == NULL) | 525 | if (name == NULL) |
1812 | 561 | { | 526 | { |
1813 | 562 | return true; | 527 | return true; |
1814 | @@ -567,8 +532,7 @@ | |||
1815 | 567 | DRIZZLE_TYPE_VARCHAR, | 532 | DRIZZLE_TYPE_VARCHAR, |
1816 | 568 | 0, | 533 | 0, |
1817 | 569 | 1, | 534 | 1, |
1820 | 570 | "", | 535 | ""); |
1819 | 571 | OPEN_FULL_TABLE); | ||
1821 | 572 | if (tab_cat == NULL) | 536 | if (tab_cat == NULL) |
1822 | 573 | { | 537 | { |
1823 | 574 | return true; | 538 | return true; |
1824 | @@ -579,8 +543,7 @@ | |||
1825 | 579 | DRIZZLE_TYPE_VARCHAR, | 543 | DRIZZLE_TYPE_VARCHAR, |
1826 | 580 | 0, | 544 | 0, |
1827 | 581 | 0, | 545 | 0, |
1830 | 582 | "", | 546 | ""); |
1829 | 583 | OPEN_FULL_TABLE); | ||
1831 | 584 | if (tab_sch == NULL) | 547 | if (tab_sch == NULL) |
1832 | 585 | { | 548 | { |
1833 | 586 | return true; | 549 | return true; |
1834 | @@ -591,8 +554,7 @@ | |||
1835 | 591 | DRIZZLE_TYPE_VARCHAR, | 554 | DRIZZLE_TYPE_VARCHAR, |
1836 | 592 | 0, | 555 | 0, |
1837 | 593 | 0, | 556 | 0, |
1840 | 594 | "", | 557 | ""); |
1839 | 595 | OPEN_FULL_TABLE); | ||
1841 | 596 | if (tab_name == NULL) | 558 | if (tab_name == NULL) |
1842 | 597 | { | 559 | { |
1843 | 598 | return true; | 560 | return true; |
1844 | @@ -603,8 +565,7 @@ | |||
1845 | 603 | DRIZZLE_TYPE_VARCHAR, | 565 | DRIZZLE_TYPE_VARCHAR, |
1846 | 604 | 0, | 566 | 0, |
1847 | 605 | 0, | 567 | 0, |
1850 | 606 | "", | 568 | ""); |
1849 | 607 | OPEN_FULL_TABLE); | ||
1851 | 608 | if (col_name == NULL) | 569 | if (col_name == NULL) |
1852 | 609 | { | 570 | { |
1853 | 610 | return true; | 571 | return true; |
1854 | @@ -614,8 +575,7 @@ | |||
1855 | 614 | DRIZZLE_TYPE_LONGLONG, | 575 | DRIZZLE_TYPE_LONGLONG, |
1856 | 615 | 0, | 576 | 0, |
1857 | 616 | 0, | 577 | 0, |
1860 | 617 | "", | 578 | ""); |
1859 | 618 | OPEN_FULL_TABLE); | ||
1861 | 619 | if (ord_pos == NULL) | 579 | if (ord_pos == NULL) |
1862 | 620 | { | 580 | { |
1863 | 621 | return true; | 581 | return true; |
1864 | @@ -626,8 +586,7 @@ | |||
1865 | 626 | DRIZZLE_TYPE_LONGLONG, | 586 | DRIZZLE_TYPE_LONGLONG, |
1866 | 627 | 0, | 587 | 0, |
1867 | 628 | 1, | 588 | 1, |
1870 | 629 | "", | 589 | ""); |
1869 | 630 | OPEN_FULL_TABLE); | ||
1871 | 631 | if (pos_in_uniq == NULL) | 590 | if (pos_in_uniq == NULL) |
1872 | 632 | { | 591 | { |
1873 | 633 | return true; | 592 | return true; |
1874 | @@ -638,8 +597,7 @@ | |||
1875 | 638 | DRIZZLE_TYPE_VARCHAR, | 597 | DRIZZLE_TYPE_VARCHAR, |
1876 | 639 | 0, | 598 | 0, |
1877 | 640 | 1, | 599 | 1, |
1880 | 641 | "", | 600 | ""); |
1879 | 642 | OPEN_FULL_TABLE); | ||
1881 | 643 | if (ref_tab_sch == NULL) | 601 | if (ref_tab_sch == NULL) |
1882 | 644 | { | 602 | { |
1883 | 645 | return true; | 603 | return true; |
1884 | @@ -650,8 +608,7 @@ | |||
1885 | 650 | DRIZZLE_TYPE_VARCHAR, | 608 | DRIZZLE_TYPE_VARCHAR, |
1886 | 651 | 0, | 609 | 0, |
1887 | 652 | 1, | 610 | 1, |
1890 | 653 | "", | 611 | ""); |
1889 | 654 | OPEN_FULL_TABLE); | ||
1891 | 655 | if (ref_tab_name == NULL) | 612 | if (ref_tab_name == NULL) |
1892 | 656 | { | 613 | { |
1893 | 657 | return true; | 614 | return true; |
1894 | @@ -662,8 +619,7 @@ | |||
1895 | 662 | DRIZZLE_TYPE_VARCHAR, | 619 | DRIZZLE_TYPE_VARCHAR, |
1896 | 663 | 0, | 620 | 0, |
1897 | 664 | 1, | 621 | 1, |
1900 | 665 | "", | 622 | ""); |
1899 | 666 | OPEN_FULL_TABLE); | ||
1901 | 667 | if (ref_col_name == NULL) | 623 | if (ref_col_name == NULL) |
1902 | 668 | { | 624 | { |
1903 | 669 | return true; | 625 | return true; |
1904 | @@ -692,8 +648,7 @@ | |||
1905 | 692 | DRIZZLE_TYPE_VARCHAR, | 648 | DRIZZLE_TYPE_VARCHAR, |
1906 | 693 | 0, | 649 | 0, |
1907 | 694 | 0, | 650 | 0, |
1910 | 695 | "Database", | 651 | "Database"); |
1909 | 696 | SKIP_OPEN_TABLE); | ||
1911 | 697 | if (db == NULL) | 652 | if (db == NULL) |
1912 | 698 | { | 653 | { |
1913 | 699 | return true; | 654 | return true; |
1914 | @@ -704,8 +659,7 @@ | |||
1915 | 704 | DRIZZLE_TYPE_VARCHAR, | 659 | DRIZZLE_TYPE_VARCHAR, |
1916 | 705 | 0, | 660 | 0, |
1917 | 706 | 0, | 661 | 0, |
1920 | 707 | "Table", | 662 | "Table"); |
1919 | 708 | SKIP_OPEN_TABLE); | ||
1921 | 709 | if (tab == NULL) | 663 | if (tab == NULL) |
1922 | 710 | { | 664 | { |
1923 | 711 | return true; | 665 | return true; |
1924 | @@ -716,8 +670,7 @@ | |||
1925 | 716 | DRIZZLE_TYPE_LONGLONG, | 670 | DRIZZLE_TYPE_LONGLONG, |
1926 | 717 | 0, | 671 | 0, |
1927 | 718 | 0, | 672 | 0, |
1930 | 719 | "In_use", | 673 | "In_use"); |
1929 | 720 | SKIP_OPEN_TABLE); | ||
1931 | 721 | if (in_use == NULL) | 674 | if (in_use == NULL) |
1932 | 722 | { | 675 | { |
1933 | 723 | return true; | 676 | return true; |
1934 | @@ -728,8 +681,7 @@ | |||
1935 | 728 | DRIZZLE_TYPE_LONGLONG, | 681 | DRIZZLE_TYPE_LONGLONG, |
1936 | 729 | 0, | 682 | 0, |
1937 | 730 | 0, | 683 | 0, |
1940 | 731 | "Name_locked", | 684 | "Name_locked"); |
1939 | 732 | SKIP_OPEN_TABLE); | ||
1941 | 733 | if (name_locked == NULL) | 685 | if (name_locked == NULL) |
1942 | 734 | { | 686 | { |
1943 | 735 | return true; | 687 | return true; |
1944 | @@ -750,8 +702,7 @@ | |||
1945 | 750 | DRIZZLE_TYPE_VARCHAR, | 702 | DRIZZLE_TYPE_VARCHAR, |
1946 | 751 | 0, | 703 | 0, |
1947 | 752 | 0, | 704 | 0, |
1950 | 753 | "Name", | 705 | "Name"); |
1949 | 754 | SKIP_OPEN_TABLE); | ||
1951 | 755 | if (name == NULL) | 706 | if (name == NULL) |
1952 | 756 | { | 707 | { |
1953 | 757 | return true; | 708 | return true; |
1954 | @@ -762,8 +713,7 @@ | |||
1955 | 762 | DRIZZLE_TYPE_VARCHAR, | 713 | DRIZZLE_TYPE_VARCHAR, |
1956 | 763 | 0, | 714 | 0, |
1957 | 764 | 0, | 715 | 0, |
1960 | 765 | "", | 716 | ""); |
1959 | 766 | SKIP_OPEN_TABLE); | ||
1961 | 767 | if (ver == NULL) | 717 | if (ver == NULL) |
1962 | 768 | { | 718 | { |
1963 | 769 | return true; | 719 | return true; |
1964 | @@ -774,8 +724,7 @@ | |||
1965 | 774 | DRIZZLE_TYPE_VARCHAR, | 724 | DRIZZLE_TYPE_VARCHAR, |
1966 | 775 | 0, | 725 | 0, |
1967 | 776 | 0, | 726 | 0, |
1970 | 777 | "Status", | 727 | "Status"); |
1969 | 778 | SKIP_OPEN_TABLE); | ||
1971 | 779 | if (stat == NULL) | 728 | if (stat == NULL) |
1972 | 780 | { | 729 | { |
1973 | 781 | return true; | 730 | return true; |
1974 | @@ -786,20 +735,19 @@ | |||
1975 | 786 | DRIZZLE_TYPE_VARCHAR, | 735 | DRIZZLE_TYPE_VARCHAR, |
1976 | 787 | 0, | 736 | 0, |
1977 | 788 | 1, | 737 | 1, |
1980 | 789 | "", | 738 | ""); |
1979 | 790 | SKIP_OPEN_TABLE); | ||
1981 | 791 | if (aut == NULL) | 739 | if (aut == NULL) |
1982 | 792 | { | 740 | { |
1983 | 793 | return true; | 741 | return true; |
1984 | 794 | } | 742 | } |
1985 | 795 | 743 | ||
1986 | 796 | const drizzled::plugin::ColumnInfo *descrip= new(std::nothrow) drizzled::plugin::ColumnInfo("PLUGIN_DESCRIPTION", | 744 | const drizzled::plugin::ColumnInfo *descrip= new(std::nothrow) drizzled::plugin::ColumnInfo("PLUGIN_DESCRIPTION", |
1988 | 797 | 65535, | 745 | 64, |
1989 | 746 | //65535, | ||
1990 | 798 | DRIZZLE_TYPE_VARCHAR, | 747 | DRIZZLE_TYPE_VARCHAR, |
1991 | 799 | 0, | 748 | 0, |
1992 | 800 | 1, | 749 | 1, |
1995 | 801 | "", | 750 | ""); |
1994 | 802 | SKIP_OPEN_TABLE); | ||
1996 | 803 | if (descrip == NULL) | 751 | if (descrip == NULL) |
1997 | 804 | { | 752 | { |
1998 | 805 | return true; | 753 | return true; |
1999 | @@ -810,8 +758,7 @@ | |||
2000 | 810 | DRIZZLE_TYPE_VARCHAR, | 758 | DRIZZLE_TYPE_VARCHAR, |
2001 | 811 | 0, | 759 | 0, |
2002 | 812 | 1, | 760 | 1, |
2005 | 813 | "License", | 761 | "License"); |
2004 | 814 | SKIP_OPEN_TABLE); | ||
2006 | 815 | if (lic == NULL) | 762 | if (lic == NULL) |
2007 | 816 | { | 763 | { |
2008 | 817 | return true; | 764 | return true; |
2009 | @@ -837,8 +784,7 @@ | |||
2010 | 837 | DRIZZLE_TYPE_LONGLONG, | 784 | DRIZZLE_TYPE_LONGLONG, |
2011 | 838 | 0, | 785 | 0, |
2012 | 839 | 0, | 786 | 0, |
2015 | 840 | "Id", | 787 | "Id"); |
2014 | 841 | SKIP_OPEN_TABLE); | ||
2016 | 842 | if (id_col == NULL) | 788 | if (id_col == NULL) |
2017 | 843 | { | 789 | { |
2018 | 844 | return true; | 790 | return true; |
2019 | @@ -849,8 +795,7 @@ | |||
2020 | 849 | DRIZZLE_TYPE_VARCHAR, | 795 | DRIZZLE_TYPE_VARCHAR, |
2021 | 850 | 0, | 796 | 0, |
2022 | 851 | 0, | 797 | 0, |
2025 | 852 | "User", | 798 | "User"); |
2024 | 853 | SKIP_OPEN_TABLE); | ||
2026 | 854 | if (user_col == NULL) | 799 | if (user_col == NULL) |
2027 | 855 | { | 800 | { |
2028 | 856 | return true; | 801 | return true; |
2029 | @@ -861,8 +806,7 @@ | |||
2030 | 861 | DRIZZLE_TYPE_VARCHAR, | 806 | DRIZZLE_TYPE_VARCHAR, |
2031 | 862 | 0, | 807 | 0, |
2032 | 863 | 0, | 808 | 0, |
2035 | 864 | "Host", | 809 | "Host"); |
2034 | 865 | SKIP_OPEN_TABLE); | ||
2036 | 866 | if (host_col == NULL) | 810 | if (host_col == NULL) |
2037 | 867 | { | 811 | { |
2038 | 868 | return true; | 812 | return true; |
2039 | @@ -873,8 +817,7 @@ | |||
2040 | 873 | DRIZZLE_TYPE_VARCHAR, | 817 | DRIZZLE_TYPE_VARCHAR, |
2041 | 874 | 0, | 818 | 0, |
2042 | 875 | 1, | 819 | 1, |
2045 | 876 | "Db", | 820 | "Db"); |
2044 | 877 | SKIP_OPEN_TABLE); | ||
2046 | 878 | if (db_col == NULL) | 821 | if (db_col == NULL) |
2047 | 879 | { | 822 | { |
2048 | 880 | return true; | 823 | return true; |
2049 | @@ -885,8 +828,7 @@ | |||
2050 | 885 | DRIZZLE_TYPE_VARCHAR, | 828 | DRIZZLE_TYPE_VARCHAR, |
2051 | 886 | 0, | 829 | 0, |
2052 | 887 | 0, | 830 | 0, |
2055 | 888 | "Command", | 831 | "Command"); |
2054 | 889 | SKIP_OPEN_TABLE); | ||
2056 | 890 | if (command_col == NULL) | 832 | if (command_col == NULL) |
2057 | 891 | { | 833 | { |
2058 | 892 | return true; | 834 | return true; |
2059 | @@ -897,8 +839,7 @@ | |||
2060 | 897 | DRIZZLE_TYPE_LONGLONG, | 839 | DRIZZLE_TYPE_LONGLONG, |
2061 | 898 | 0, | 840 | 0, |
2062 | 899 | 0, | 841 | 0, |
2065 | 900 | "Time", | 842 | "Time"); |
2064 | 901 | SKIP_OPEN_TABLE); | ||
2066 | 902 | if (time_col == NULL) | 843 | if (time_col == NULL) |
2067 | 903 | { | 844 | { |
2068 | 904 | return true; | 845 | return true; |
2069 | @@ -909,8 +850,7 @@ | |||
2070 | 909 | DRIZZLE_TYPE_VARCHAR, | 850 | DRIZZLE_TYPE_VARCHAR, |
2071 | 910 | 0, | 851 | 0, |
2072 | 911 | 1, | 852 | 1, |
2075 | 912 | "State", | 853 | "State"); |
2074 | 913 | SKIP_OPEN_TABLE); | ||
2076 | 914 | if (state_col == NULL) | 854 | if (state_col == NULL) |
2077 | 915 | { | 855 | { |
2078 | 916 | return true; | 856 | return true; |
2079 | @@ -921,8 +861,7 @@ | |||
2080 | 921 | DRIZZLE_TYPE_VARCHAR, | 861 | DRIZZLE_TYPE_VARCHAR, |
2081 | 922 | 0, | 862 | 0, |
2082 | 923 | 1, | 863 | 1, |
2085 | 924 | "Info", | 864 | "Info"); |
2084 | 925 | SKIP_OPEN_TABLE); | ||
2086 | 926 | if (info_col == NULL) | 865 | if (info_col == NULL) |
2087 | 927 | { | 866 | { |
2088 | 928 | return true; | 867 | return true; |
2089 | @@ -953,8 +892,7 @@ | |||
2090 | 953 | DRIZZLE_TYPE_VARCHAR, | 892 | DRIZZLE_TYPE_VARCHAR, |
2091 | 954 | 0, | 893 | 0, |
2092 | 955 | 1, | 894 | 1, |
2095 | 956 | "", | 895 | ""); |
2094 | 957 | OPEN_FULL_TABLE); | ||
2096 | 958 | 896 | ||
2097 | 959 | if (cat == NULL) | 897 | if (cat == NULL) |
2098 | 960 | { | 898 | { |
2099 | @@ -966,8 +904,7 @@ | |||
2100 | 966 | DRIZZLE_TYPE_VARCHAR, | 904 | DRIZZLE_TYPE_VARCHAR, |
2101 | 967 | 0, | 905 | 0, |
2102 | 968 | 0, | 906 | 0, |
2105 | 969 | "", | 907 | ""); |
2104 | 970 | OPEN_FULL_TABLE); | ||
2106 | 971 | if (sch == NULL) | 908 | if (sch == NULL) |
2107 | 972 | { | 909 | { |
2108 | 973 | return true; | 910 | return true; |
2109 | @@ -978,8 +915,7 @@ | |||
2110 | 978 | DRIZZLE_TYPE_VARCHAR, | 915 | DRIZZLE_TYPE_VARCHAR, |
2111 | 979 | 0, | 916 | 0, |
2112 | 980 | 0, | 917 | 0, |
2115 | 981 | "", | 918 | ""); |
2114 | 982 | OPEN_FULL_TABLE); | ||
2116 | 983 | if (name == NULL) | 919 | if (name == NULL) |
2117 | 984 | { | 920 | { |
2118 | 985 | return true; | 921 | return true; |
2119 | @@ -990,8 +926,7 @@ | |||
2120 | 990 | DRIZZLE_TYPE_VARCHAR, | 926 | DRIZZLE_TYPE_VARCHAR, |
2121 | 991 | 0, | 927 | 0, |
2122 | 992 | 1, | 928 | 1, |
2125 | 993 | "", | 929 | ""); |
2124 | 994 | OPEN_FULL_TABLE); | ||
2126 | 995 | if (uniq_cat == NULL) | 930 | if (uniq_cat == NULL) |
2127 | 996 | { | 931 | { |
2128 | 997 | return true; | 932 | return true; |
2129 | @@ -1002,8 +937,7 @@ | |||
2130 | 1002 | DRIZZLE_TYPE_VARCHAR, | 937 | DRIZZLE_TYPE_VARCHAR, |
2131 | 1003 | 0, | 938 | 0, |
2132 | 1004 | 0, | 939 | 0, |
2135 | 1005 | "", | 940 | ""); |
2134 | 1006 | OPEN_FULL_TABLE); | ||
2136 | 1007 | if (uniq_sch == NULL) | 941 | if (uniq_sch == NULL) |
2137 | 1008 | { | 942 | { |
2138 | 1009 | return true; | 943 | return true; |
2139 | @@ -1014,8 +948,7 @@ | |||
2140 | 1014 | DRIZZLE_TYPE_VARCHAR, | 948 | DRIZZLE_TYPE_VARCHAR, |
2141 | 1015 | 0, | 949 | 0, |
2142 | 1016 | MY_I_S_MAYBE_NULL, | 950 | MY_I_S_MAYBE_NULL, |
2145 | 1017 | "", | 951 | ""); |
2144 | 1018 | OPEN_FULL_TABLE); | ||
2146 | 1019 | if (uniq_name == NULL) | 952 | if (uniq_name == NULL) |
2147 | 1020 | { | 953 | { |
2148 | 1021 | return true; | 954 | return true; |
2149 | @@ -1026,8 +959,7 @@ | |||
2150 | 1026 | DRIZZLE_TYPE_VARCHAR, | 959 | DRIZZLE_TYPE_VARCHAR, |
2151 | 1027 | 0, | 960 | 0, |
2152 | 1028 | 0, | 961 | 0, |
2155 | 1029 | "", | 962 | ""); |
2154 | 1030 | OPEN_FULL_TABLE); | ||
2156 | 1031 | if (match == NULL) | 963 | if (match == NULL) |
2157 | 1032 | { | 964 | { |
2158 | 1033 | return true; | 965 | return true; |
2159 | @@ -1038,8 +970,7 @@ | |||
2160 | 1038 | DRIZZLE_TYPE_VARCHAR, | 970 | DRIZZLE_TYPE_VARCHAR, |
2161 | 1039 | 0, | 971 | 0, |
2162 | 1040 | 0, | 972 | 0, |
2165 | 1041 | "", | 973 | ""); |
2164 | 1042 | OPEN_FULL_TABLE); | ||
2166 | 1043 | if (update == NULL) | 974 | if (update == NULL) |
2167 | 1044 | { | 975 | { |
2168 | 1045 | return true; | 976 | return true; |
2169 | @@ -1050,8 +981,7 @@ | |||
2170 | 1050 | DRIZZLE_TYPE_VARCHAR, | 981 | DRIZZLE_TYPE_VARCHAR, |
2171 | 1051 | 0, | 982 | 0, |
2172 | 1052 | 0, | 983 | 0, |
2175 | 1053 | "", | 984 | ""); |
2174 | 1054 | OPEN_FULL_TABLE); | ||
2176 | 1055 | if (del_rule == NULL) | 985 | if (del_rule == NULL) |
2177 | 1056 | { | 986 | { |
2178 | 1057 | return true; | 987 | return true; |
2179 | @@ -1062,8 +992,7 @@ | |||
2180 | 1062 | DRIZZLE_TYPE_VARCHAR, | 992 | DRIZZLE_TYPE_VARCHAR, |
2181 | 1063 | 0, | 993 | 0, |
2182 | 1064 | 0, | 994 | 0, |
2185 | 1065 | "", | 995 | ""); |
2184 | 1066 | OPEN_FULL_TABLE); | ||
2186 | 1067 | if (tab_name == NULL) | 996 | if (tab_name == NULL) |
2187 | 1068 | { | 997 | { |
2188 | 1069 | return true; | 998 | return true; |
2189 | @@ -1074,8 +1003,7 @@ | |||
2190 | 1074 | DRIZZLE_TYPE_VARCHAR, | 1003 | DRIZZLE_TYPE_VARCHAR, |
2191 | 1075 | 0, | 1004 | 0, |
2192 | 1076 | 0, | 1005 | 0, |
2195 | 1077 | "", | 1006 | ""); |
2194 | 1078 | OPEN_FULL_TABLE); | ||
2196 | 1079 | if (ref_name == NULL) | 1007 | if (ref_name == NULL) |
2197 | 1080 | { | 1008 | { |
2198 | 1081 | return true; | 1009 | return true; |
2199 | @@ -1106,8 +1034,7 @@ | |||
2200 | 1106 | DRIZZLE_TYPE_VARCHAR, | 1034 | DRIZZLE_TYPE_VARCHAR, |
2201 | 1107 | 0, | 1035 | 0, |
2202 | 1108 | 1, | 1036 | 1, |
2205 | 1109 | "", | 1037 | ""); |
2204 | 1110 | SKIP_OPEN_TABLE); | ||
2206 | 1111 | if (cat_name == NULL) | 1038 | if (cat_name == NULL) |
2207 | 1112 | { | 1039 | { |
2208 | 1113 | return true; | 1040 | return true; |
2209 | @@ -1118,8 +1045,7 @@ | |||
2210 | 1118 | DRIZZLE_TYPE_VARCHAR, | 1045 | DRIZZLE_TYPE_VARCHAR, |
2211 | 1119 | 0, | 1046 | 0, |
2212 | 1120 | 0, | 1047 | 0, |
2215 | 1121 | "Database", | 1048 | "Database"); |
2214 | 1122 | SKIP_OPEN_TABLE); | ||
2216 | 1123 | if (sch_name == NULL) | 1049 | if (sch_name == NULL) |
2217 | 1124 | { | 1050 | { |
2218 | 1125 | return true; | 1051 | return true; |
2219 | @@ -1130,8 +1056,7 @@ | |||
2220 | 1130 | DRIZZLE_TYPE_VARCHAR, | 1056 | DRIZZLE_TYPE_VARCHAR, |
2221 | 1131 | 0, | 1057 | 0, |
2222 | 1132 | 0, | 1058 | 0, |
2225 | 1133 | "", | 1059 | ""); |
2224 | 1134 | SKIP_OPEN_TABLE); | ||
2226 | 1135 | if (cs_name == NULL) | 1060 | if (cs_name == NULL) |
2227 | 1136 | { | 1061 | { |
2228 | 1137 | return true; | 1062 | return true; |
2229 | @@ -1142,8 +1067,7 @@ | |||
2230 | 1142 | DRIZZLE_TYPE_VARCHAR, | 1067 | DRIZZLE_TYPE_VARCHAR, |
2231 | 1143 | 0, | 1068 | 0, |
2232 | 1144 | 0, | 1069 | 0, |
2235 | 1145 | "", | 1070 | ""); |
2234 | 1146 | SKIP_OPEN_TABLE); | ||
2236 | 1147 | if (coll_name == NULL) | 1071 | if (coll_name == NULL) |
2237 | 1148 | { | 1072 | { |
2238 | 1149 | return true; | 1073 | return true; |
2239 | @@ -1154,8 +1078,7 @@ | |||
2240 | 1154 | DRIZZLE_TYPE_VARCHAR, | 1078 | DRIZZLE_TYPE_VARCHAR, |
2241 | 1155 | 0, | 1079 | 0, |
2242 | 1156 | 1, | 1080 | 1, |
2245 | 1157 | "", | 1081 | ""); |
2244 | 1158 | SKIP_OPEN_TABLE); | ||
2246 | 1159 | if (sql_path == NULL) | 1082 | if (sql_path == NULL) |
2247 | 1160 | { | 1083 | { |
2248 | 1161 | return true; | 1084 | return true; |
2249 | @@ -1177,8 +1100,7 @@ | |||
2250 | 1177 | DRIZZLE_TYPE_VARCHAR, | 1100 | DRIZZLE_TYPE_VARCHAR, |
2251 | 1178 | 0, | 1101 | 0, |
2252 | 1179 | 1, | 1102 | 1, |
2255 | 1180 | "", | 1103 | ""); |
2254 | 1181 | OPEN_FRM_ONLY); | ||
2256 | 1182 | if (cat == NULL) | 1104 | if (cat == NULL) |
2257 | 1183 | { | 1105 | { |
2258 | 1184 | return true; | 1106 | return true; |
2259 | @@ -1189,8 +1111,7 @@ | |||
2260 | 1189 | DRIZZLE_TYPE_VARCHAR, | 1111 | DRIZZLE_TYPE_VARCHAR, |
2261 | 1190 | 0, | 1112 | 0, |
2262 | 1191 | 0, | 1113 | 0, |
2265 | 1192 | "", | 1114 | ""); |
2264 | 1193 | OPEN_FRM_ONLY); | ||
2266 | 1194 | if (sch == NULL) | 1115 | if (sch == NULL) |
2267 | 1195 | { | 1116 | { |
2268 | 1196 | return true; | 1117 | return true; |
2269 | @@ -1201,8 +1122,7 @@ | |||
2270 | 1201 | DRIZZLE_TYPE_VARCHAR, | 1122 | DRIZZLE_TYPE_VARCHAR, |
2271 | 1202 | 0, | 1123 | 0, |
2272 | 1203 | 0, | 1124 | 0, |
2275 | 1204 | "Table", | 1125 | "Table"); |
2274 | 1205 | OPEN_FRM_ONLY); | ||
2276 | 1206 | if (name == NULL) | 1126 | if (name == NULL) |
2277 | 1207 | { | 1127 | { |
2278 | 1208 | return true; | 1128 | return true; |
2279 | @@ -1213,8 +1133,7 @@ | |||
2280 | 1213 | DRIZZLE_TYPE_LONGLONG, | 1133 | DRIZZLE_TYPE_LONGLONG, |
2281 | 1214 | 0, | 1134 | 0, |
2282 | 1215 | 0, | 1135 | 0, |
2285 | 1216 | "Non_unique", | 1136 | "Non_unique"); |
2284 | 1217 | OPEN_FRM_ONLY); | ||
2286 | 1218 | if (uniq == NULL) | 1137 | if (uniq == NULL) |
2287 | 1219 | { | 1138 | { |
2288 | 1220 | return true; | 1139 | return true; |
2289 | @@ -1225,8 +1144,7 @@ | |||
2290 | 1225 | DRIZZLE_TYPE_VARCHAR, | 1144 | DRIZZLE_TYPE_VARCHAR, |
2291 | 1226 | 0, | 1145 | 0, |
2292 | 1227 | 0, | 1146 | 0, |
2295 | 1228 | "", | 1147 | ""); |
2294 | 1229 | OPEN_FRM_ONLY); | ||
2296 | 1230 | if (idx_sch == NULL) | 1148 | if (idx_sch == NULL) |
2297 | 1231 | { | 1149 | { |
2298 | 1232 | return true; | 1150 | return true; |
2299 | @@ -1237,8 +1155,7 @@ | |||
2300 | 1237 | DRIZZLE_TYPE_VARCHAR, | 1155 | DRIZZLE_TYPE_VARCHAR, |
2301 | 1238 | 0, | 1156 | 0, |
2302 | 1239 | 0, | 1157 | 0, |
2305 | 1240 | "Key_name", | 1158 | "Key_name"); |
2304 | 1241 | OPEN_FRM_ONLY); | ||
2306 | 1242 | if (idx_name == NULL) | 1159 | if (idx_name == NULL) |
2307 | 1243 | { | 1160 | { |
2308 | 1244 | return true; | 1161 | return true; |
2309 | @@ -1249,8 +1166,7 @@ | |||
2310 | 1249 | DRIZZLE_TYPE_LONGLONG, | 1166 | DRIZZLE_TYPE_LONGLONG, |
2311 | 1250 | 0, | 1167 | 0, |
2312 | 1251 | 0, | 1168 | 0, |
2315 | 1252 | "Seq_in_index", | 1169 | "Seq_in_index"); |
2314 | 1253 | OPEN_FRM_ONLY); | ||
2316 | 1254 | if (seq_in_idx == NULL) | 1170 | if (seq_in_idx == NULL) |
2317 | 1255 | { | 1171 | { |
2318 | 1256 | return true; | 1172 | return true; |
2319 | @@ -1261,8 +1177,7 @@ | |||
2320 | 1261 | DRIZZLE_TYPE_VARCHAR, | 1177 | DRIZZLE_TYPE_VARCHAR, |
2321 | 1262 | 0, | 1178 | 0, |
2322 | 1263 | 0, | 1179 | 0, |
2325 | 1264 | "Column_name", | 1180 | "Column_name"); |
2324 | 1265 | OPEN_FRM_ONLY); | ||
2326 | 1266 | if (col_name == NULL) | 1181 | if (col_name == NULL) |
2327 | 1267 | { | 1182 | { |
2328 | 1268 | return true; | 1183 | return true; |
2329 | @@ -1273,8 +1188,7 @@ | |||
2330 | 1273 | DRIZZLE_TYPE_VARCHAR, | 1188 | DRIZZLE_TYPE_VARCHAR, |
2331 | 1274 | 0, | 1189 | 0, |
2332 | 1275 | 1, | 1190 | 1, |
2335 | 1276 | "Collation", | 1191 | "Collation"); |
2334 | 1277 | OPEN_FRM_ONLY); | ||
2336 | 1278 | if (coll == NULL) | 1192 | if (coll == NULL) |
2337 | 1279 | { | 1193 | { |
2338 | 1280 | return true; | 1194 | return true; |
2339 | @@ -1285,8 +1199,7 @@ | |||
2340 | 1285 | DRIZZLE_TYPE_LONGLONG, | 1199 | DRIZZLE_TYPE_LONGLONG, |
2341 | 1286 | 0, | 1200 | 0, |
2342 | 1287 | 1, | 1201 | 1, |
2345 | 1288 | "Cardinality", | 1202 | "Cardinality"); |
2344 | 1289 | OPEN_FULL_TABLE); | ||
2346 | 1290 | if (card == NULL) | 1203 | if (card == NULL) |
2347 | 1291 | { | 1204 | { |
2348 | 1292 | return true; | 1205 | return true; |
2349 | @@ -1297,8 +1210,7 @@ | |||
2350 | 1297 | DRIZZLE_TYPE_LONGLONG, | 1210 | DRIZZLE_TYPE_LONGLONG, |
2351 | 1298 | 0, | 1211 | 0, |
2352 | 1299 | 1, | 1212 | 1, |
2355 | 1300 | "Sub_part", | 1213 | "Sub_part"); |
2354 | 1301 | OPEN_FRM_ONLY); | ||
2356 | 1302 | if (sub_part == NULL) | 1214 | if (sub_part == NULL) |
2357 | 1303 | { | 1215 | { |
2358 | 1304 | return true; | 1216 | return true; |
2359 | @@ -1309,8 +1221,7 @@ | |||
2360 | 1309 | DRIZZLE_TYPE_VARCHAR, | 1221 | DRIZZLE_TYPE_VARCHAR, |
2361 | 1310 | 0, | 1222 | 0, |
2362 | 1311 | 1, | 1223 | 1, |
2365 | 1312 | "Packed", | 1224 | "Packed"); |
2364 | 1313 | OPEN_FRM_ONLY); | ||
2366 | 1314 | if (packed == NULL) | 1225 | if (packed == NULL) |
2367 | 1315 | { | 1226 | { |
2368 | 1316 | return true; | 1227 | return true; |
2369 | @@ -1321,8 +1232,7 @@ | |||
2370 | 1321 | DRIZZLE_TYPE_VARCHAR, | 1232 | DRIZZLE_TYPE_VARCHAR, |
2371 | 1322 | 0, | 1233 | 0, |
2372 | 1323 | 0, | 1234 | 0, |
2375 | 1324 | "Null", | 1235 | "Null"); |
2374 | 1325 | OPEN_FRM_ONLY); | ||
2376 | 1326 | if (nullable == NULL) | 1236 | if (nullable == NULL) |
2377 | 1327 | { | 1237 | { |
2378 | 1328 | return true; | 1238 | return true; |
2379 | @@ -1333,8 +1243,7 @@ | |||
2380 | 1333 | DRIZZLE_TYPE_VARCHAR, | 1243 | DRIZZLE_TYPE_VARCHAR, |
2381 | 1334 | 0, | 1244 | 0, |
2382 | 1335 | 0, | 1245 | 0, |
2385 | 1336 | "Index_type", | 1246 | "Index_type"); |
2384 | 1337 | OPEN_FULL_TABLE); | ||
2386 | 1338 | if (idx_type == NULL) | 1247 | if (idx_type == NULL) |
2387 | 1339 | { | 1248 | { |
2388 | 1340 | return true; | 1249 | return true; |
2389 | @@ -1345,8 +1254,7 @@ | |||
2390 | 1345 | DRIZZLE_TYPE_VARCHAR, | 1254 | DRIZZLE_TYPE_VARCHAR, |
2391 | 1346 | 0, | 1255 | 0, |
2392 | 1347 | 1, | 1256 | 1, |
2395 | 1348 | "Comment", | 1257 | "Comment"); |
2394 | 1349 | OPEN_FRM_ONLY); | ||
2396 | 1350 | if (comment == NULL) | 1258 | if (comment == NULL) |
2397 | 1351 | { | 1259 | { |
2398 | 1352 | return true; | 1260 | return true; |
2399 | @@ -1357,8 +1265,7 @@ | |||
2400 | 1357 | DRIZZLE_TYPE_VARCHAR, | 1265 | DRIZZLE_TYPE_VARCHAR, |
2401 | 1358 | 0, | 1266 | 0, |
2402 | 1359 | 0, | 1267 | 0, |
2405 | 1360 | "Index_Comment", | 1268 | "Index_Comment"); |
2404 | 1361 | OPEN_FRM_ONLY); | ||
2406 | 1362 | if (idx_comment == NULL) | 1269 | if (idx_comment == NULL) |
2407 | 1363 | { | 1270 | { |
2408 | 1364 | return true; | 1271 | return true; |
2409 | @@ -1391,8 +1298,7 @@ | |||
2410 | 1391 | DRIZZLE_TYPE_VARCHAR, | 1298 | DRIZZLE_TYPE_VARCHAR, |
2411 | 1392 | 0, | 1299 | 0, |
2412 | 1393 | 0, | 1300 | 0, |
2415 | 1394 | "Variable_name", | 1301 | "Variable_name"); |
2414 | 1395 | SKIP_OPEN_TABLE); | ||
2416 | 1396 | if (name == NULL) | 1302 | if (name == NULL) |
2417 | 1397 | { | 1303 | { |
2418 | 1398 | return true; | 1304 | return true; |
2419 | @@ -1403,8 +1309,7 @@ | |||
2420 | 1403 | DRIZZLE_TYPE_VARCHAR, | 1309 | DRIZZLE_TYPE_VARCHAR, |
2421 | 1404 | 0, | 1310 | 0, |
2422 | 1405 | 1, | 1311 | 1, |
2425 | 1406 | "Value", | 1312 | "Value"); |
2424 | 1407 | SKIP_OPEN_TABLE); | ||
2426 | 1408 | if (value == NULL) | 1313 | if (value == NULL) |
2427 | 1409 | { | 1314 | { |
2428 | 1410 | return true; | 1315 | return true; |
2429 | @@ -1423,8 +1328,7 @@ | |||
2430 | 1423 | DRIZZLE_TYPE_VARCHAR, | 1328 | DRIZZLE_TYPE_VARCHAR, |
2431 | 1424 | 0, | 1329 | 0, |
2432 | 1425 | 1, | 1330 | 1, |
2435 | 1426 | "", | 1331 | ""); |
2434 | 1427 | OPEN_FULL_TABLE); | ||
2436 | 1428 | if (cat == NULL) | 1332 | if (cat == NULL) |
2437 | 1429 | { | 1333 | { |
2438 | 1430 | return true; | 1334 | return true; |
2439 | @@ -1435,8 +1339,7 @@ | |||
2440 | 1435 | DRIZZLE_TYPE_VARCHAR, | 1339 | DRIZZLE_TYPE_VARCHAR, |
2441 | 1436 | 0, | 1340 | 0, |
2442 | 1437 | 0, | 1341 | 0, |
2445 | 1438 | "", | 1342 | ""); |
2444 | 1439 | OPEN_FULL_TABLE); | ||
2446 | 1440 | if (sch == NULL) | 1343 | if (sch == NULL) |
2447 | 1441 | { | 1344 | { |
2448 | 1442 | return true; | 1345 | return true; |
2449 | @@ -1447,8 +1350,7 @@ | |||
2450 | 1447 | DRIZZLE_TYPE_VARCHAR, | 1350 | DRIZZLE_TYPE_VARCHAR, |
2451 | 1448 | 0, | 1351 | 0, |
2452 | 1449 | 0, | 1352 | 0, |
2455 | 1450 | "", | 1353 | ""); |
2454 | 1451 | OPEN_FULL_TABLE); | ||
2456 | 1452 | if (name == NULL) | 1354 | if (name == NULL) |
2457 | 1453 | { | 1355 | { |
2458 | 1454 | return true; | 1356 | return true; |
2459 | @@ -1459,8 +1361,7 @@ | |||
2460 | 1459 | DRIZZLE_TYPE_VARCHAR, | 1361 | DRIZZLE_TYPE_VARCHAR, |
2461 | 1460 | 0, | 1362 | 0, |
2462 | 1461 | 0, | 1363 | 0, |
2465 | 1462 | "", | 1364 | ""); |
2464 | 1463 | OPEN_FULL_TABLE); | ||
2466 | 1464 | if (tab_sch == NULL) | 1365 | if (tab_sch == NULL) |
2467 | 1465 | { | 1366 | { |
2468 | 1466 | return true; | 1367 | return true; |
2469 | @@ -1471,8 +1372,7 @@ | |||
2470 | 1471 | DRIZZLE_TYPE_VARCHAR, | 1372 | DRIZZLE_TYPE_VARCHAR, |
2471 | 1472 | 0, | 1373 | 0, |
2472 | 1473 | 0, | 1374 | 0, |
2475 | 1474 | "", | 1375 | ""); |
2474 | 1475 | OPEN_FULL_TABLE); | ||
2476 | 1476 | if (tab_name == NULL) | 1376 | if (tab_name == NULL) |
2477 | 1477 | { | 1377 | { |
2478 | 1478 | return true; | 1378 | return true; |
2479 | @@ -1483,8 +1383,7 @@ | |||
2480 | 1483 | DRIZZLE_TYPE_VARCHAR, | 1383 | DRIZZLE_TYPE_VARCHAR, |
2481 | 1484 | 0, | 1384 | 0, |
2482 | 1485 | 0, | 1385 | 0, |
2485 | 1486 | "", | 1386 | ""); |
2484 | 1487 | OPEN_FULL_TABLE); | ||
2486 | 1488 | if (type == NULL) | 1387 | if (type == NULL) |
2487 | 1489 | { | 1388 | { |
2488 | 1490 | return true; | 1389 | return true; |
2489 | @@ -1507,8 +1406,7 @@ | |||
2490 | 1507 | DRIZZLE_TYPE_VARCHAR, | 1406 | DRIZZLE_TYPE_VARCHAR, |
2491 | 1508 | 0, | 1407 | 0, |
2492 | 1509 | 1, | 1408 | 1, |
2495 | 1510 | "", | 1409 | ""); |
2494 | 1511 | SKIP_OPEN_TABLE); | ||
2496 | 1512 | if (cat == NULL) | 1410 | if (cat == NULL) |
2497 | 1513 | { | 1411 | { |
2498 | 1514 | return true; | 1412 | return true; |
2499 | @@ -1519,8 +1417,7 @@ | |||
2500 | 1519 | DRIZZLE_TYPE_VARCHAR, | 1417 | DRIZZLE_TYPE_VARCHAR, |
2501 | 1520 | 0, | 1418 | 0, |
2502 | 1521 | 0, | 1419 | 0, |
2505 | 1522 | "", | 1420 | ""); |
2504 | 1523 | SKIP_OPEN_TABLE); | ||
2506 | 1524 | if (sch == NULL) | 1421 | if (sch == NULL) |
2507 | 1525 | { | 1422 | { |
2508 | 1526 | return true; | 1423 | return true; |
2509 | @@ -1531,8 +1428,7 @@ | |||
2510 | 1531 | DRIZZLE_TYPE_VARCHAR, | 1428 | DRIZZLE_TYPE_VARCHAR, |
2511 | 1532 | 0, | 1429 | 0, |
2512 | 1533 | 0, | 1430 | 0, |
2515 | 1534 | "Name", | 1431 | "Name"); |
2514 | 1535 | SKIP_OPEN_TABLE); | ||
2516 | 1536 | if (name == NULL) | 1432 | if (name == NULL) |
2517 | 1537 | { | 1433 | { |
2518 | 1538 | return true; | 1434 | return true; |
2519 | @@ -1543,8 +1439,7 @@ | |||
2520 | 1543 | DRIZZLE_TYPE_VARCHAR, | 1439 | DRIZZLE_TYPE_VARCHAR, |
2521 | 1544 | 0, | 1440 | 0, |
2522 | 1545 | 0, | 1441 | 0, |
2525 | 1546 | "", | 1442 | ""); |
2524 | 1547 | OPEN_FRM_ONLY); | ||
2526 | 1548 | if (type == NULL) | 1443 | if (type == NULL) |
2527 | 1549 | { | 1444 | { |
2528 | 1550 | return true; | 1445 | return true; |
2529 | @@ -1555,8 +1450,7 @@ | |||
2530 | 1555 | DRIZZLE_TYPE_VARCHAR, | 1450 | DRIZZLE_TYPE_VARCHAR, |
2531 | 1556 | 0, | 1451 | 0, |
2532 | 1557 | 1, | 1452 | 1, |
2535 | 1558 | "Engine", | 1453 | "Engine"); |
2534 | 1559 | OPEN_FRM_ONLY); | ||
2536 | 1560 | if (engine == NULL) | 1454 | if (engine == NULL) |
2537 | 1561 | { | 1455 | { |
2538 | 1562 | return true; | 1456 | return true; |
2539 | @@ -1567,8 +1461,7 @@ | |||
2540 | 1567 | DRIZZLE_TYPE_LONGLONG, | 1461 | DRIZZLE_TYPE_LONGLONG, |
2541 | 1568 | 0, | 1462 | 0, |
2542 | 1569 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 1463 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
2545 | 1570 | "Version", | 1464 | "Version"); |
2544 | 1571 | OPEN_FRM_ONLY); | ||
2546 | 1572 | if (version == NULL) | 1465 | if (version == NULL) |
2547 | 1573 | { | 1466 | { |
2548 | 1574 | return true; | 1467 | return true; |
2549 | @@ -1579,8 +1472,7 @@ | |||
2550 | 1579 | DRIZZLE_TYPE_VARCHAR, | 1472 | DRIZZLE_TYPE_VARCHAR, |
2551 | 1580 | 0, | 1473 | 0, |
2552 | 1581 | 1, | 1474 | 1, |
2555 | 1582 | "Row_format", | 1475 | "Row_format"); |
2554 | 1583 | OPEN_FULL_TABLE); | ||
2556 | 1584 | if (row_format == NULL) | 1476 | if (row_format == NULL) |
2557 | 1585 | { | 1477 | { |
2558 | 1586 | return true; | 1478 | return true; |
2559 | @@ -1591,8 +1483,7 @@ | |||
2560 | 1591 | DRIZZLE_TYPE_LONGLONG, | 1483 | DRIZZLE_TYPE_LONGLONG, |
2561 | 1592 | 0, | 1484 | 0, |
2562 | 1593 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 1485 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
2565 | 1594 | "Rows", | 1486 | "Rows"); |
2564 | 1595 | OPEN_FULL_TABLE); | ||
2566 | 1596 | if (tab_rows == NULL) | 1487 | if (tab_rows == NULL) |
2567 | 1597 | { | 1488 | { |
2568 | 1598 | return true; | 1489 | return true; |
2569 | @@ -1603,8 +1494,7 @@ | |||
2570 | 1603 | DRIZZLE_TYPE_LONGLONG, | 1494 | DRIZZLE_TYPE_LONGLONG, |
2571 | 1604 | 0, | 1495 | 0, |
2572 | 1605 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 1496 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
2575 | 1606 | "Avg_row_length", | 1497 | "Avg_row_length"); |
2574 | 1607 | OPEN_FULL_TABLE); | ||
2576 | 1608 | if (avg_row_len == NULL) | 1498 | if (avg_row_len == NULL) |
2577 | 1609 | { | 1499 | { |
2578 | 1610 | return true; | 1500 | return true; |
2579 | @@ -1615,8 +1505,7 @@ | |||
2580 | 1615 | DRIZZLE_TYPE_LONGLONG, | 1505 | DRIZZLE_TYPE_LONGLONG, |
2581 | 1616 | 0, | 1506 | 0, |
2582 | 1617 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 1507 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
2585 | 1618 | "Data_length", | 1508 | "Data_length"); |
2584 | 1619 | OPEN_FULL_TABLE); | ||
2586 | 1620 | if (data_len == NULL) | 1509 | if (data_len == NULL) |
2587 | 1621 | { | 1510 | { |
2588 | 1622 | return true; | 1511 | return true; |
2589 | @@ -1627,8 +1516,7 @@ | |||
2590 | 1627 | DRIZZLE_TYPE_LONGLONG, | 1516 | DRIZZLE_TYPE_LONGLONG, |
2591 | 1628 | 0, | 1517 | 0, |
2592 | 1629 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 1518 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
2595 | 1630 | "Max_data_length", | 1519 | "Max_data_length"); |
2594 | 1631 | OPEN_FULL_TABLE); | ||
2596 | 1632 | if (max_data_len == NULL) | 1520 | if (max_data_len == NULL) |
2597 | 1633 | { | 1521 | { |
2598 | 1634 | return true; | 1522 | return true; |
2599 | @@ -1639,8 +1527,7 @@ | |||
2600 | 1639 | DRIZZLE_TYPE_LONGLONG, | 1527 | DRIZZLE_TYPE_LONGLONG, |
2601 | 1640 | 0, | 1528 | 0, |
2602 | 1641 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 1529 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
2605 | 1642 | "Index_length", | 1530 | "Index_length"); |
2604 | 1643 | OPEN_FULL_TABLE); | ||
2606 | 1644 | if (idx_len == NULL) | 1531 | if (idx_len == NULL) |
2607 | 1645 | { | 1532 | { |
2608 | 1646 | return true; | 1533 | return true; |
2609 | @@ -1651,8 +1538,7 @@ | |||
2610 | 1651 | DRIZZLE_TYPE_LONGLONG, | 1538 | DRIZZLE_TYPE_LONGLONG, |
2611 | 1652 | 0, | 1539 | 0, |
2612 | 1653 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 1540 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
2615 | 1654 | "Data_free", | 1541 | "Data_free"); |
2614 | 1655 | OPEN_FULL_TABLE); | ||
2616 | 1656 | if (data_free == NULL) | 1542 | if (data_free == NULL) |
2617 | 1657 | { | 1543 | { |
2618 | 1658 | return true; | 1544 | return true; |
2619 | @@ -1663,8 +1549,7 @@ | |||
2620 | 1663 | DRIZZLE_TYPE_LONGLONG, | 1549 | DRIZZLE_TYPE_LONGLONG, |
2621 | 1664 | 0, | 1550 | 0, |
2622 | 1665 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 1551 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
2625 | 1666 | "Auto_increment", | 1552 | "Auto_increment"); |
2624 | 1667 | OPEN_FULL_TABLE); | ||
2626 | 1668 | if (auto_inc == NULL) | 1553 | if (auto_inc == NULL) |
2627 | 1669 | { | 1554 | { |
2628 | 1670 | return true; | 1555 | return true; |
2629 | @@ -1675,8 +1560,7 @@ | |||
2630 | 1675 | DRIZZLE_TYPE_DATETIME, | 1560 | DRIZZLE_TYPE_DATETIME, |
2631 | 1676 | 0, | 1561 | 0, |
2632 | 1677 | 1, | 1562 | 1, |
2635 | 1678 | "Create_time", | 1563 | "Create_time"); |
2634 | 1679 | OPEN_FULL_TABLE); | ||
2636 | 1680 | if (create_time == NULL) | 1564 | if (create_time == NULL) |
2637 | 1681 | { | 1565 | { |
2638 | 1682 | return true; | 1566 | return true; |
2639 | @@ -1687,8 +1571,7 @@ | |||
2640 | 1687 | DRIZZLE_TYPE_DATETIME, | 1571 | DRIZZLE_TYPE_DATETIME, |
2641 | 1688 | 0, | 1572 | 0, |
2642 | 1689 | 1, | 1573 | 1, |
2645 | 1690 | "Update_time", | 1574 | "Update_time"); |
2644 | 1691 | OPEN_FULL_TABLE); | ||
2646 | 1692 | if (update_time == NULL) | 1575 | if (update_time == NULL) |
2647 | 1693 | { | 1576 | { |
2648 | 1694 | return true; | 1577 | return true; |
2649 | @@ -1699,8 +1582,7 @@ | |||
2650 | 1699 | DRIZZLE_TYPE_DATETIME, | 1582 | DRIZZLE_TYPE_DATETIME, |
2651 | 1700 | 0, | 1583 | 0, |
2652 | 1701 | 1, | 1584 | 1, |
2655 | 1702 | "Check_time", | 1585 | "Check_time"); |
2654 | 1703 | OPEN_FULL_TABLE); | ||
2656 | 1704 | if (check_time == NULL) | 1586 | if (check_time == NULL) |
2657 | 1705 | { | 1587 | { |
2658 | 1706 | return true; | 1588 | return true; |
2659 | @@ -1711,8 +1593,7 @@ | |||
2660 | 1711 | DRIZZLE_TYPE_VARCHAR, | 1593 | DRIZZLE_TYPE_VARCHAR, |
2661 | 1712 | 0, | 1594 | 0, |
2662 | 1713 | 1, | 1595 | 1, |
2665 | 1714 | "Collation", | 1596 | "Collation"); |
2664 | 1715 | OPEN_FRM_ONLY); | ||
2666 | 1716 | if (table_coll == NULL) | 1597 | if (table_coll == NULL) |
2667 | 1717 | { | 1598 | { |
2668 | 1718 | return true; | 1599 | return true; |
2669 | @@ -1723,8 +1604,7 @@ | |||
2670 | 1723 | DRIZZLE_TYPE_LONGLONG, | 1604 | DRIZZLE_TYPE_LONGLONG, |
2671 | 1724 | 0, | 1605 | 0, |
2672 | 1725 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), | 1606 | (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), |
2675 | 1726 | "Checksum", | 1607 | "Checksum"); |
2674 | 1727 | OPEN_FULL_TABLE); | ||
2676 | 1728 | if (checksum == NULL) | 1608 | if (checksum == NULL) |
2677 | 1729 | { | 1609 | { |
2678 | 1730 | return true; | 1610 | return true; |
2679 | @@ -1735,8 +1615,7 @@ | |||
2680 | 1735 | DRIZZLE_TYPE_VARCHAR, | 1615 | DRIZZLE_TYPE_VARCHAR, |
2681 | 1736 | 0, | 1616 | 0, |
2682 | 1737 | 1, | 1617 | 1, |
2685 | 1738 | "Create_options", | 1618 | "Create_options"); |
2684 | 1739 | OPEN_FRM_ONLY); | ||
2686 | 1740 | if (create_opt == NULL) | 1619 | if (create_opt == NULL) |
2687 | 1741 | { | 1620 | { |
2688 | 1742 | return true; | 1621 | return true; |
2689 | @@ -1747,8 +1626,7 @@ | |||
2690 | 1747 | DRIZZLE_TYPE_VARCHAR, | 1626 | DRIZZLE_TYPE_VARCHAR, |
2691 | 1748 | 0, | 1627 | 0, |
2692 | 1749 | 0, | 1628 | 0, |
2695 | 1750 | "Comment", | 1629 | "Comment"); |
2694 | 1751 | OPEN_FRM_ONLY); | ||
2696 | 1752 | if (tab_comment == NULL) | 1630 | if (tab_comment == NULL) |
2697 | 1753 | { | 1631 | { |
2698 | 1754 | return true; | 1632 | return true; |
2699 | @@ -1787,8 +1665,7 @@ | |||
2700 | 1787 | DRIZZLE_TYPE_VARCHAR, | 1665 | DRIZZLE_TYPE_VARCHAR, |
2701 | 1788 | 0, | 1666 | 0, |
2702 | 1789 | 1, | 1667 | 1, |
2705 | 1790 | "", | 1668 | ""); |
2704 | 1791 | SKIP_OPEN_TABLE); | ||
2706 | 1792 | if (cat == NULL) | 1669 | if (cat == NULL) |
2707 | 1793 | { | 1670 | { |
2708 | 1794 | return true; | 1671 | return true; |
2709 | @@ -1799,8 +1676,7 @@ | |||
2710 | 1799 | DRIZZLE_TYPE_VARCHAR, | 1676 | DRIZZLE_TYPE_VARCHAR, |
2711 | 1800 | 0, | 1677 | 0, |
2712 | 1801 | 0, | 1678 | 0, |
2715 | 1802 | "", | 1679 | ""); |
2714 | 1803 | SKIP_OPEN_TABLE); | ||
2716 | 1804 | if (sch == NULL) | 1680 | if (sch == NULL) |
2717 | 1805 | { | 1681 | { |
2718 | 1806 | return true; | 1682 | return true; |
2719 | @@ -1811,8 +1687,7 @@ | |||
2720 | 1811 | DRIZZLE_TYPE_VARCHAR, | 1687 | DRIZZLE_TYPE_VARCHAR, |
2721 | 1812 | 0, | 1688 | 0, |
2722 | 1813 | 0, | 1689 | 0, |
2725 | 1814 | "Tables_in_", | 1690 | "Tables_in_"); |
2724 | 1815 | SKIP_OPEN_TABLE); | ||
2726 | 1816 | if (name == NULL) | 1691 | if (name == NULL) |
2727 | 1817 | { | 1692 | { |
2728 | 1818 | return true; | 1693 | return true; |
2729 | @@ -1823,8 +1698,7 @@ | |||
2730 | 1823 | DRIZZLE_TYPE_VARCHAR, | 1698 | DRIZZLE_TYPE_VARCHAR, |
2731 | 1824 | 0, | 1699 | 0, |
2732 | 1825 | 0, | 1700 | 0, |
2735 | 1826 | "Table_type", | 1701 | "Table_type"); |
2734 | 1827 | OPEN_FRM_ONLY); | ||
2736 | 1828 | if (type == NULL) | 1702 | if (type == NULL) |
2737 | 1829 | { | 1703 | { |
2738 | 1830 | return true; | 1704 | return true; |
2739 | 1831 | 1705 | ||
2740 | === modified file 'plugin/info_schema/info_schema_methods.cc' | |||
2741 | --- plugin/info_schema/info_schema_methods.cc 2009-10-16 00:38:56 +0000 | |||
2742 | +++ plugin/info_schema/info_schema_methods.cc 2009-10-29 23:56:14 +0000 | |||
2743 | @@ -29,6 +29,7 @@ | |||
2744 | 29 | #include <drizzled/tztime.h> | 29 | #include <drizzled/tztime.h> |
2745 | 30 | #include <drizzled/sql_base.h> | 30 | #include <drizzled/sql_base.h> |
2746 | 31 | #include <drizzled/plugin/client.h> | 31 | #include <drizzled/plugin/client.h> |
2747 | 32 | #include <drizzled/join_table.h> | ||
2748 | 32 | 33 | ||
2749 | 33 | #include "info_schema_methods.h" | 34 | #include "info_schema_methods.h" |
2750 | 34 | 35 | ||
2751 | @@ -36,6 +37,7 @@ | |||
2752 | 36 | #include <string> | 37 | #include <string> |
2753 | 37 | 38 | ||
2754 | 38 | using namespace std; | 39 | using namespace std; |
2755 | 40 | using namespace drizzled; | ||
2756 | 39 | 41 | ||
2757 | 40 | static inline void make_upper(char *buf) | 42 | static inline void make_upper(char *buf) |
2758 | 41 | { | 43 | { |
2759 | @@ -186,6 +188,9 @@ | |||
2760 | 186 | break; | 188 | break; |
2761 | 187 | } | 189 | } |
2762 | 188 | table->restoreRecordAsDefault(); | 190 | table->restoreRecordAsDefault(); |
2763 | 191 | table->setWriteSet(0); | ||
2764 | 192 | table->setWriteSet(1); | ||
2765 | 193 | table->setWriteSet(2); | ||
2766 | 189 | table->field[0]->store(name_buffer, strlen(name_buffer), | 194 | table->field[0]->store(name_buffer, strlen(name_buffer), |
2767 | 190 | system_charset_info); | 195 | system_charset_info); |
2768 | 191 | table->field[1]->store(pos, (uint32_t) (end - pos), system_charset_info); | 196 | table->field[1]->store(pos, (uint32_t) (end - pos), system_charset_info); |
2769 | @@ -193,8 +198,8 @@ | |||
2770 | 193 | 198 | ||
2771 | 194 | pthread_mutex_unlock(&LOCK_global_system_variables); | 199 | pthread_mutex_unlock(&LOCK_global_system_variables); |
2772 | 195 | 200 | ||
2775 | 196 | if (schema_table_store_record(session, table)) | 201 | TableList *tmp_list= table->pos_in_table_list; |
2776 | 197 | return true; | 202 | tmp_list->schema_table->addRow(table->record[0], table->s->reclength); |
2777 | 198 | } | 203 | } |
2778 | 199 | } | 204 | } |
2779 | 200 | } | 205 | } |
2780 | @@ -202,7 +207,7 @@ | |||
2781 | 202 | return false; | 207 | return false; |
2782 | 203 | } | 208 | } |
2783 | 204 | 209 | ||
2785 | 205 | int CharSetISMethods::fillTable(Session *session, TableList *tables, COND *) | 210 | int CharSetISMethods::fillTable(Session *session, TableList *tables) |
2786 | 206 | { | 211 | { |
2787 | 207 | CHARSET_INFO **cs; | 212 | CHARSET_INFO **cs; |
2788 | 208 | const char *wild= session->lex->wild ? session->lex->wild->ptr() : NULL; | 213 | const char *wild= session->lex->wild ? session->lex->wild->ptr() : NULL; |
2789 | @@ -220,13 +225,17 @@ | |||
2790 | 220 | { | 225 | { |
2791 | 221 | const char *comment; | 226 | const char *comment; |
2792 | 222 | table->restoreRecordAsDefault(); | 227 | table->restoreRecordAsDefault(); |
2793 | 228 | /* set the appropriate bits in the write bitset */ | ||
2794 | 229 | table->setWriteSet(0); | ||
2795 | 230 | table->setWriteSet(1); | ||
2796 | 231 | table->setWriteSet(2); | ||
2797 | 232 | table->setWriteSet(3); | ||
2798 | 223 | table->field[0]->store(tmp_cs->csname, strlen(tmp_cs->csname), scs); | 233 | table->field[0]->store(tmp_cs->csname, strlen(tmp_cs->csname), scs); |
2799 | 224 | table->field[1]->store(tmp_cs->name, strlen(tmp_cs->name), scs); | 234 | table->field[1]->store(tmp_cs->name, strlen(tmp_cs->name), scs); |
2800 | 225 | comment= tmp_cs->comment ? tmp_cs->comment : ""; | 235 | comment= tmp_cs->comment ? tmp_cs->comment : ""; |
2801 | 226 | table->field[2]->store(comment, strlen(comment), scs); | 236 | table->field[2]->store(comment, strlen(comment), scs); |
2802 | 227 | table->field[3]->store((int64_t) tmp_cs->mbmaxlen, true); | 237 | table->field[3]->store((int64_t) tmp_cs->mbmaxlen, true); |
2805 | 228 | if (schema_table_store_record(session, table)) | 238 | tables->schema_table->addRow(table->record[0], table->s->reclength); |
2804 | 229 | return 1; | ||
2806 | 230 | } | 239 | } |
2807 | 231 | } | 240 | } |
2808 | 232 | return 0; | 241 | return 0; |
2809 | @@ -258,7 +267,7 @@ | |||
2810 | 258 | return 0; | 267 | return 0; |
2811 | 259 | } | 268 | } |
2812 | 260 | 269 | ||
2814 | 261 | int CollationISMethods::fillTable(Session *session, TableList *tables, COND *) | 270 | int CollationISMethods::fillTable(Session *session, TableList *tables) |
2815 | 262 | { | 271 | { |
2816 | 263 | CHARSET_INFO **cs; | 272 | CHARSET_INFO **cs; |
2817 | 264 | const char *wild= session->lex->wild ? session->lex->wild->ptr() : NULL; | 273 | const char *wild= session->lex->wild ? session->lex->wild->ptr() : NULL; |
2818 | @@ -283,6 +292,13 @@ | |||
2819 | 283 | { | 292 | { |
2820 | 284 | const char *tmp_buff; | 293 | const char *tmp_buff; |
2821 | 285 | table->restoreRecordAsDefault(); | 294 | table->restoreRecordAsDefault(); |
2822 | 295 | /* set the appropriate bits in the write bitset */ | ||
2823 | 296 | table->setWriteSet(0); | ||
2824 | 297 | table->setWriteSet(1); | ||
2825 | 298 | table->setWriteSet(2); | ||
2826 | 299 | table->setWriteSet(3); | ||
2827 | 300 | table->setWriteSet(4); | ||
2828 | 301 | table->setWriteSet(5); | ||
2829 | 286 | table->field[0]->store(tmp_cl->name, strlen(tmp_cl->name), scs); | 302 | table->field[0]->store(tmp_cl->name, strlen(tmp_cl->name), scs); |
2830 | 287 | table->field[1]->store(tmp_cl->csname , strlen(tmp_cl->csname), scs); | 303 | table->field[1]->store(tmp_cl->csname , strlen(tmp_cl->csname), scs); |
2831 | 288 | table->field[2]->store((int64_t) tmp_cl->number, true); | 304 | table->field[2]->store((int64_t) tmp_cl->number, true); |
2832 | @@ -291,15 +307,14 @@ | |||
2833 | 291 | tmp_buff= (tmp_cl->state & MY_CS_COMPILED)? "Yes" : ""; | 307 | tmp_buff= (tmp_cl->state & MY_CS_COMPILED)? "Yes" : ""; |
2834 | 292 | table->field[4]->store(tmp_buff, strlen(tmp_buff), scs); | 308 | table->field[4]->store(tmp_buff, strlen(tmp_buff), scs); |
2835 | 293 | table->field[5]->store((int64_t) tmp_cl->strxfrm_multiply, true); | 309 | table->field[5]->store((int64_t) tmp_cl->strxfrm_multiply, true); |
2838 | 294 | if (schema_table_store_record(session, table)) | 310 | tables->schema_table->addRow(table->record[0], table->s->reclength); |
2837 | 295 | return 1; | ||
2839 | 296 | } | 311 | } |
2840 | 297 | } | 312 | } |
2841 | 298 | } | 313 | } |
2842 | 299 | return 0; | 314 | return 0; |
2843 | 300 | } | 315 | } |
2844 | 301 | 316 | ||
2846 | 302 | int CollCharISMethods::fillTable(Session *session, TableList *tables, COND *) | 317 | int CollCharISMethods::fillTable(Session *, TableList *tables) |
2847 | 303 | { | 318 | { |
2848 | 304 | CHARSET_INFO **cs; | 319 | CHARSET_INFO **cs; |
2849 | 305 | Table *table= tables->table; | 320 | Table *table= tables->table; |
2850 | @@ -318,10 +333,11 @@ | |||
2851 | 318 | ! my_charset_same(tmp_cs,tmp_cl)) | 333 | ! my_charset_same(tmp_cs,tmp_cl)) |
2852 | 319 | continue; | 334 | continue; |
2853 | 320 | table->restoreRecordAsDefault(); | 335 | table->restoreRecordAsDefault(); |
2854 | 336 | table->setWriteSet(0); | ||
2855 | 337 | table->setWriteSet(1); | ||
2856 | 321 | table->field[0]->store(tmp_cl->name, strlen(tmp_cl->name), scs); | 338 | table->field[0]->store(tmp_cl->name, strlen(tmp_cl->name), scs); |
2857 | 322 | table->field[1]->store(tmp_cl->csname , strlen(tmp_cl->csname), scs); | 339 | table->field[1]->store(tmp_cl->csname , strlen(tmp_cl->csname), scs); |
2860 | 323 | if (schema_table_store_record(session, table)) | 340 | tables->schema_table->addRow(table->record[0], table->s->reclength); |
2859 | 324 | return 1; | ||
2861 | 325 | } | 341 | } |
2862 | 326 | } | 342 | } |
2863 | 327 | return 0; | 343 | return 0; |
2864 | @@ -367,6 +383,13 @@ | |||
2865 | 367 | int64_t idx) | 383 | int64_t idx) |
2866 | 368 | { | 384 | { |
2867 | 369 | const CHARSET_INFO * const cs= system_charset_info; | 385 | const CHARSET_INFO * const cs= system_charset_info; |
2868 | 386 | /* set the appropriate bits in the write bitset */ | ||
2869 | 387 | table->setWriteSet(1); | ||
2870 | 388 | table->setWriteSet(2); | ||
2871 | 389 | table->setWriteSet(4); | ||
2872 | 390 | table->setWriteSet(5); | ||
2873 | 391 | table->setWriteSet(6); | ||
2874 | 392 | table->setWriteSet(7); | ||
2875 | 370 | table->field[1]->store(db_name->str, db_name->length, cs); | 393 | table->field[1]->store(db_name->str, db_name->length, cs); |
2876 | 371 | table->field[2]->store(key_name, key_len, cs); | 394 | table->field[2]->store(key_name, key_len, cs); |
2877 | 372 | table->field[4]->store(db_name->str, db_name->length, cs); | 395 | table->field[4]->store(db_name->str, db_name->length, cs); |
2878 | @@ -375,11 +398,12 @@ | |||
2879 | 375 | table->field[7]->store((int64_t) idx, true); | 398 | table->field[7]->store((int64_t) idx, true); |
2880 | 376 | } | 399 | } |
2881 | 377 | 400 | ||
2887 | 378 | int KeyColUsageISMethods::processTable(Session *session, | 401 | int KeyColUsageISMethods::processTable(plugin::InfoSchemaTable *, |
2888 | 379 | TableList *tables, | 402 | Session *session, |
2889 | 380 | Table *table, bool res, | 403 | TableList *tables, |
2890 | 381 | LEX_STRING *db_name, | 404 | Table *table, bool res, |
2891 | 382 | LEX_STRING *table_name) const | 405 | LEX_STRING *db_name, |
2892 | 406 | LEX_STRING *table_name) | ||
2893 | 383 | { | 407 | { |
2894 | 384 | if (res) | 408 | if (res) |
2895 | 385 | { | 409 | { |
2896 | @@ -418,10 +442,8 @@ | |||
2897 | 418 | key_part->field->field_name, | 442 | key_part->field->field_name, |
2898 | 419 | strlen(key_part->field->field_name), | 443 | strlen(key_part->field->field_name), |
2899 | 420 | (int64_t) f_idx); | 444 | (int64_t) f_idx); |
2904 | 421 | if (schema_table_store_record(session, table)) | 445 | tables->schema_table->addRow(table->record[0], |
2905 | 422 | { | 446 | table->s->reclength); |
2902 | 423 | return (1); | ||
2903 | 424 | } | ||
2906 | 425 | } | 447 | } |
2907 | 426 | } | 448 | } |
2908 | 427 | } | 449 | } |
2909 | @@ -446,6 +468,10 @@ | |||
2910 | 446 | f_key_info->forein_id->length, | 468 | f_key_info->forein_id->length, |
2911 | 447 | f_info->str, f_info->length, | 469 | f_info->str, f_info->length, |
2912 | 448 | (int64_t) f_idx); | 470 | (int64_t) f_idx); |
2913 | 471 | table->setWriteSet(8); | ||
2914 | 472 | table->setWriteSet(9); | ||
2915 | 473 | table->setWriteSet(10); | ||
2916 | 474 | table->setWriteSet(11); | ||
2917 | 449 | table->field[8]->store((int64_t) f_idx, true); | 475 | table->field[8]->store((int64_t) f_idx, true); |
2918 | 450 | table->field[8]->set_notnull(); | 476 | table->field[8]->set_notnull(); |
2919 | 451 | table->field[9]->store(f_key_info->referenced_db->str, | 477 | table->field[9]->store(f_key_info->referenced_db->str, |
2920 | @@ -459,10 +485,8 @@ | |||
2921 | 459 | table->field[11]->store(r_info->str, r_info->length, | 485 | table->field[11]->store(r_info->str, r_info->length, |
2922 | 460 | system_charset_info); | 486 | system_charset_info); |
2923 | 461 | table->field[11]->set_notnull(); | 487 | table->field[11]->set_notnull(); |
2928 | 462 | if (schema_table_store_record(session, table)) | 488 | tables->schema_table->addRow(table->record[0], |
2929 | 463 | { | 489 | table->s->reclength); |
2926 | 464 | return (1); | ||
2927 | 465 | } | ||
2930 | 466 | } | 490 | } |
2931 | 467 | } | 491 | } |
2932 | 468 | } | 492 | } |
2933 | @@ -473,17 +497,21 @@ | |||
2934 | 473 | inline bool open_list_store(Table *table, open_table_list_st& open_list) | 497 | inline bool open_list_store(Table *table, open_table_list_st& open_list) |
2935 | 474 | { | 498 | { |
2936 | 475 | table->restoreRecordAsDefault(); | 499 | table->restoreRecordAsDefault(); |
2937 | 500 | table->setWriteSet(0); | ||
2938 | 501 | table->setWriteSet(1); | ||
2939 | 502 | table->setWriteSet(2); | ||
2940 | 503 | table->setWriteSet(3); | ||
2941 | 476 | table->field[0]->store(open_list.db.c_str(), open_list.db.length(), system_charset_info); | 504 | table->field[0]->store(open_list.db.c_str(), open_list.db.length(), system_charset_info); |
2942 | 477 | table->field[1]->store(open_list.table.c_str(), open_list.table.length(), system_charset_info); | 505 | table->field[1]->store(open_list.table.c_str(), open_list.table.length(), system_charset_info); |
2943 | 478 | table->field[2]->store((int64_t) open_list.in_use, true); | 506 | table->field[2]->store((int64_t) open_list.in_use, true); |
2944 | 479 | table->field[3]->store((int64_t) open_list.locked, true); | 507 | table->field[3]->store((int64_t) open_list.locked, true); |
2947 | 480 | if (schema_table_store_record(table->in_use, table)) | 508 | TableList *tmp= table->pos_in_table_list; |
2948 | 481 | return true; | 509 | tmp->schema_table->addRow(table->record[0], table->s->reclength); |
2949 | 482 | 510 | ||
2950 | 483 | return false; | 511 | return false; |
2951 | 484 | } | 512 | } |
2952 | 485 | 513 | ||
2954 | 486 | int OpenTablesISMethods::fillTable(Session *session, TableList *tables, COND *) | 514 | int OpenTablesISMethods::fillTable(Session *session, TableList *tables) |
2955 | 487 | { | 515 | { |
2956 | 488 | const char *wild= session->lex->wild ? session->lex->wild->ptr() : NULL; | 516 | const char *wild= session->lex->wild ? session->lex->wild->ptr() : NULL; |
2957 | 489 | 517 | ||
2958 | @@ -497,9 +525,16 @@ | |||
2959 | 497 | { | 525 | { |
2960 | 498 | Session *session; | 526 | Session *session; |
2961 | 499 | Table *table; | 527 | Table *table; |
2962 | 528 | plugin::InfoSchemaTable *is_table; | ||
2963 | 500 | public: | 529 | public: |
2966 | 501 | ShowPlugins(Session *session_arg, Table *table_arg) | 530 | ShowPlugins(Session *session_arg, |
2967 | 502 | : session(session_arg), table(table_arg) {} | 531 | Table *table_arg, |
2968 | 532 | plugin::InfoSchemaTable *is_table_arg) | ||
2969 | 533 | : | ||
2970 | 534 | session(session_arg), | ||
2971 | 535 | table(table_arg), | ||
2972 | 536 | is_table(is_table_arg) | ||
2973 | 537 | {} | ||
2974 | 503 | 538 | ||
2975 | 504 | result_type operator() (argument_type plugin) | 539 | result_type operator() (argument_type plugin) |
2976 | 505 | { | 540 | { |
2977 | @@ -508,6 +543,14 @@ | |||
2978 | 508 | 543 | ||
2979 | 509 | table->restoreRecordAsDefault(); | 544 | table->restoreRecordAsDefault(); |
2980 | 510 | 545 | ||
2981 | 546 | /* mark fields that will be written to in the write bitset */ | ||
2982 | 547 | table->setWriteSet(0); | ||
2983 | 548 | table->setWriteSet(1); | ||
2984 | 549 | table->setWriteSet(2); | ||
2985 | 550 | table->setWriteSet(3); | ||
2986 | 551 | table->setWriteSet(4); | ||
2987 | 552 | table->setWriteSet(5); | ||
2988 | 553 | |||
2989 | 511 | table->field[0]->store(plugin->getName().c_str(), | 554 | table->field[0]->store(plugin->getName().c_str(), |
2990 | 512 | plugin->getName().size(), cs); | 555 | plugin->getName().size(), cs); |
2991 | 513 | 556 | ||
2992 | @@ -569,18 +612,21 @@ | |||
2993 | 569 | } | 612 | } |
2994 | 570 | table->field[5]->set_notnull(); | 613 | table->field[5]->set_notnull(); |
2995 | 571 | 614 | ||
2997 | 572 | return schema_table_store_record(session, table); | 615 | is_table->addRow(table->record[0], table->s->reclength); |
2998 | 616 | return false; | ||
2999 | 573 | } | 617 | } |
3000 | 574 | }; | 618 | }; |
3001 | 575 | 619 | ||
3003 | 576 | int PluginsISMethods::fillTable(Session *session, TableList *tables, COND *) | 620 | int PluginsISMethods::fillTable(Session *session, TableList *tables) |
3004 | 577 | { | 621 | { |
3005 | 578 | Table *table= tables->table; | 622 | Table *table= tables->table; |
3006 | 579 | 623 | ||
3007 | 580 | drizzled::plugin::Registry ®istry= drizzled::plugin::Registry::singleton(); | 624 | drizzled::plugin::Registry ®istry= drizzled::plugin::Registry::singleton(); |
3008 | 581 | vector<drizzled::plugin::Handle *> plugins= registry.getList(true); | 625 | vector<drizzled::plugin::Handle *> plugins= registry.getList(true); |
3009 | 582 | vector<drizzled::plugin::Handle *>::iterator iter= | 626 | vector<drizzled::plugin::Handle *>::iterator iter= |
3011 | 583 | find_if(plugins.begin(), plugins.end(), ShowPlugins(session, table)); | 627 | find_if(plugins.begin(), |
3012 | 628 | plugins.end(), | ||
3013 | 629 | ShowPlugins(session, table, tables->schema_table)); | ||
3014 | 584 | if (iter != plugins.end()) | 630 | if (iter != plugins.end()) |
3015 | 585 | { | 631 | { |
3016 | 586 | return 1; | 632 | return 1; |
3017 | @@ -588,7 +634,7 @@ | |||
3018 | 588 | return (0); | 634 | return (0); |
3019 | 589 | } | 635 | } |
3020 | 590 | 636 | ||
3022 | 591 | int ProcessListISMethods::fillTable(Session* session, TableList* tables, COND*) | 637 | int ProcessListISMethods::fillTable(Session* session, TableList* tables) |
3023 | 592 | { | 638 | { |
3024 | 593 | Table *table= tables->table; | 639 | Table *table= tables->table; |
3025 | 594 | const CHARSET_INFO * const cs= system_charset_info; | 640 | const CHARSET_INFO * const cs= system_charset_info; |
3026 | @@ -615,6 +661,14 @@ | |||
3027 | 615 | continue; | 661 | continue; |
3028 | 616 | 662 | ||
3029 | 617 | table->restoreRecordAsDefault(); | 663 | table->restoreRecordAsDefault(); |
3030 | 664 | table->setWriteSet(0); | ||
3031 | 665 | table->setWriteSet(1); | ||
3032 | 666 | table->setWriteSet(2); | ||
3033 | 667 | table->setWriteSet(3); | ||
3034 | 668 | table->setWriteSet(4); | ||
3035 | 669 | table->setWriteSet(5); | ||
3036 | 670 | table->setWriteSet(6); | ||
3037 | 671 | table->setWriteSet(7); | ||
3038 | 618 | /* ID */ | 672 | /* ID */ |
3039 | 619 | table->field[0]->store((int64_t) tmp->thread_id, true); | 673 | table->field[0]->store((int64_t) tmp->thread_id, true); |
3040 | 620 | /* USER */ | 674 | /* USER */ |
3041 | @@ -667,11 +721,7 @@ | |||
3042 | 667 | table->field[7]->set_notnull(); | 721 | table->field[7]->set_notnull(); |
3043 | 668 | } | 722 | } |
3044 | 669 | 723 | ||
3050 | 670 | if (schema_table_store_record(session, table)) | 724 | tables->schema_table->addRow(table->record[0], table->s->reclength); |
3046 | 671 | { | ||
3047 | 672 | pthread_mutex_unlock(&LOCK_thread_count); | ||
3048 | 673 | return(1); | ||
3049 | 674 | } | ||
3051 | 675 | } | 725 | } |
3052 | 676 | } | 726 | } |
3053 | 677 | 727 | ||
3054 | @@ -680,10 +730,10 @@ | |||
3055 | 680 | } | 730 | } |
3056 | 681 | 731 | ||
3057 | 682 | int | 732 | int |
3059 | 683 | RefConstraintsISMethods::processTable(Session *session, TableList *tables, | 733 | RefConstraintsISMethods::processTable(plugin::InfoSchemaTable *, |
3060 | 734 | Session *session, TableList *tables, | ||
3061 | 684 | Table *table, bool res, | 735 | Table *table, bool res, |
3062 | 685 | LEX_STRING *db_name, LEX_STRING *table_name) | 736 | LEX_STRING *db_name, LEX_STRING *table_name) |
3063 | 686 | const | ||
3064 | 687 | { | 737 | { |
3065 | 688 | const CHARSET_INFO * const cs= system_charset_info; | 738 | const CHARSET_INFO * const cs= system_charset_info; |
3066 | 689 | 739 | ||
3067 | @@ -709,6 +759,15 @@ | |||
3068 | 709 | while ((f_key_info= it++)) | 759 | while ((f_key_info= it++)) |
3069 | 710 | { | 760 | { |
3070 | 711 | table->restoreRecordAsDefault(); | 761 | table->restoreRecordAsDefault(); |
3071 | 762 | table->setWriteSet(1); | ||
3072 | 763 | table->setWriteSet(2); | ||
3073 | 764 | table->setWriteSet(4); | ||
3074 | 765 | table->setWriteSet(5); | ||
3075 | 766 | table->setWriteSet(6); | ||
3076 | 767 | table->setWriteSet(7); | ||
3077 | 768 | table->setWriteSet(8); | ||
3078 | 769 | table->setWriteSet(9); | ||
3079 | 770 | table->setWriteSet(10); | ||
3080 | 712 | table->field[1]->store(db_name->str, db_name->length, cs); | 771 | table->field[1]->store(db_name->str, db_name->length, cs); |
3081 | 713 | table->field[9]->store(table_name->str, table_name->length, cs); | 772 | table->field[9]->store(table_name->str, table_name->length, cs); |
3082 | 714 | table->field[2]->store(f_key_info->forein_id->str, | 773 | table->field[2]->store(f_key_info->forein_id->str, |
3083 | @@ -732,26 +791,29 @@ | |||
3084 | 732 | f_key_info->update_method->length, cs); | 791 | f_key_info->update_method->length, cs); |
3085 | 733 | table->field[8]->store(f_key_info->delete_method->str, | 792 | table->field[8]->store(f_key_info->delete_method->str, |
3086 | 734 | f_key_info->delete_method->length, cs); | 793 | f_key_info->delete_method->length, cs); |
3091 | 735 | if (schema_table_store_record(session, table)) | 794 | tables->schema_table->addRow(table->record[0], |
3092 | 736 | { | 795 | table->s->reclength); |
3089 | 737 | return (1); | ||
3090 | 738 | } | ||
3093 | 739 | } | 796 | } |
3094 | 740 | } | 797 | } |
3095 | 741 | return (0); | 798 | return (0); |
3096 | 742 | } | 799 | } |
3097 | 743 | 800 | ||
3099 | 744 | static bool store_schema_schemata(Session* session, Table *table, LEX_STRING *db_name, | 801 | static bool store_schema_schemata(Session *, Table *table, LEX_STRING *db_name, |
3100 | 745 | const CHARSET_INFO * const cs) | 802 | const CHARSET_INFO * const cs) |
3101 | 746 | { | 803 | { |
3102 | 747 | table->restoreRecordAsDefault(); | 804 | table->restoreRecordAsDefault(); |
3103 | 805 | table->setWriteSet(1); | ||
3104 | 806 | table->setWriteSet(2); | ||
3105 | 807 | table->setWriteSet(3); | ||
3106 | 748 | table->field[1]->store(db_name->str, db_name->length, system_charset_info); | 808 | table->field[1]->store(db_name->str, db_name->length, system_charset_info); |
3107 | 749 | table->field[2]->store(cs->csname, strlen(cs->csname), system_charset_info); | 809 | table->field[2]->store(cs->csname, strlen(cs->csname), system_charset_info); |
3108 | 750 | table->field[3]->store(cs->name, strlen(cs->name), system_charset_info); | 810 | table->field[3]->store(cs->name, strlen(cs->name), system_charset_info); |
3110 | 751 | return schema_table_store_record(session, table); | 811 | TableList *tmp= table->pos_in_table_list; |
3111 | 812 | tmp->schema_table->addRow(table->record[0], table->s->reclength); | ||
3112 | 813 | return 0; | ||
3113 | 752 | } | 814 | } |
3114 | 753 | 815 | ||
3116 | 754 | int SchemataISMethods::fillTable(Session *session, TableList *tables, COND *cond) | 816 | int SchemataISMethods::fillTable(Session *session, TableList *tables) |
3117 | 755 | { | 817 | { |
3118 | 756 | /* | 818 | /* |
3119 | 757 | TODO: fill_schema_shemata() is called when new client is connected. | 819 | TODO: fill_schema_shemata() is called when new client is connected. |
3120 | @@ -762,6 +824,8 @@ | |||
3121 | 762 | vector<LEX_STRING*> db_names; | 824 | vector<LEX_STRING*> db_names; |
3122 | 763 | bool with_i_schema; | 825 | bool with_i_schema; |
3123 | 764 | Table *table= tables->table; | 826 | Table *table= tables->table; |
3124 | 827 | /* the WHERE clause */ | ||
3125 | 828 | COND *cond= table->reginfo.join_tab->select_cond; | ||
3126 | 765 | 829 | ||
3127 | 766 | if (get_lookup_field_values(session, cond, tables, &lookup_field_vals)) | 830 | if (get_lookup_field_values(session, cond, tables, &lookup_field_vals)) |
3128 | 767 | return(0); | 831 | return(0); |
3129 | @@ -810,7 +874,7 @@ | |||
3130 | 810 | return(0); | 874 | return(0); |
3131 | 811 | } | 875 | } |
3132 | 812 | 876 | ||
3134 | 813 | int SchemataISMethods::oldFormat(Session *session, drizzled::plugin::InfoSchemaTable *schema_table) | 877 | int SchemataISMethods::oldFormat(Session *session, plugin::InfoSchemaTable *schema_table) |
3135 | 814 | const | 878 | const |
3136 | 815 | { | 879 | { |
3137 | 816 | char tmp[128]; | 880 | char tmp[128]; |
3138 | @@ -840,10 +904,11 @@ | |||
3139 | 840 | return 0; | 904 | return 0; |
3140 | 841 | } | 905 | } |
3141 | 842 | 906 | ||
3146 | 843 | int StatsISMethods::processTable(Session *session, TableList *tables, | 907 | int StatsISMethods::processTable(plugin::InfoSchemaTable *store_table, |
3147 | 844 | Table *table, bool res, | 908 | Session *session, TableList *tables, |
3148 | 845 | LEX_STRING *db_name, | 909 | Table *table, bool res, |
3149 | 846 | LEX_STRING *table_name) const | 910 | LEX_STRING *db_name, |
3150 | 911 | LEX_STRING *table_name) | ||
3151 | 847 | { | 912 | { |
3152 | 848 | const CHARSET_INFO * const cs= system_charset_info; | 913 | const CHARSET_INFO * const cs= system_charset_info; |
3153 | 849 | if (res) | 914 | if (res) |
3154 | @@ -881,6 +946,19 @@ | |||
3155 | 881 | for (uint32_t j=0 ; j < key_info->key_parts ; j++,key_part++) | 946 | for (uint32_t j=0 ; j < key_info->key_parts ; j++,key_part++) |
3156 | 882 | { | 947 | { |
3157 | 883 | table->restoreRecordAsDefault(); | 948 | table->restoreRecordAsDefault(); |
3158 | 949 | table->setWriteSet(1); | ||
3159 | 950 | table->setWriteSet(2); | ||
3160 | 951 | table->setWriteSet(3); | ||
3161 | 952 | table->setWriteSet(4); | ||
3162 | 953 | table->setWriteSet(5); | ||
3163 | 954 | table->setWriteSet(6); | ||
3164 | 955 | table->setWriteSet(8); | ||
3165 | 956 | table->setWriteSet(9); | ||
3166 | 957 | table->setWriteSet(10); | ||
3167 | 958 | table->setWriteSet(12); | ||
3168 | 959 | table->setWriteSet(13); | ||
3169 | 960 | table->setWriteSet(14); | ||
3170 | 961 | table->setWriteSet(15); | ||
3171 | 884 | table->field[1]->store(db_name->str, db_name->length, cs); | 962 | table->field[1]->store(db_name->str, db_name->length, cs); |
3172 | 885 | table->field[2]->store(table_name->str, table_name->length, cs); | 963 | table->field[2]->store(table_name->str, table_name->length, cs); |
3173 | 886 | table->field[3]->store((int64_t) ((key_info->flags & | 964 | table->field[3]->store((int64_t) ((key_info->flags & |
3174 | @@ -938,17 +1016,15 @@ | |||
3175 | 938 | table->field[15]->store(key_info->comment.str, | 1016 | table->field[15]->store(key_info->comment.str, |
3176 | 939 | key_info->comment.length, cs); | 1017 | key_info->comment.length, cs); |
3177 | 940 | } | 1018 | } |
3182 | 941 | if (schema_table_store_record(session, table)) | 1019 | store_table->addRow(table->record[0], |
3183 | 942 | { | 1020 | table->s->reclength); |
3180 | 943 | return (1); | ||
3181 | 944 | } | ||
3184 | 945 | } | 1021 | } |
3185 | 946 | } | 1022 | } |
3186 | 947 | } | 1023 | } |
3188 | 948 | return(res); | 1024 | return res; |
3189 | 949 | } | 1025 | } |
3190 | 950 | 1026 | ||
3192 | 951 | int StatusISMethods::fillTable(Session *session, TableList *tables, COND *) | 1027 | int StatusISMethods::fillTable(Session *session, TableList *tables) |
3193 | 952 | { | 1028 | { |
3194 | 953 | LEX *lex= session->lex; | 1029 | LEX *lex= session->lex; |
3195 | 954 | const char *wild= lex->wild ? lex->wild->ptr() : NULL; | 1030 | const char *wild= lex->wild ? lex->wild->ptr() : NULL; |
3196 | @@ -988,24 +1064,32 @@ | |||
3197 | 988 | return(res); | 1064 | return(res); |
3198 | 989 | } | 1065 | } |
3199 | 990 | 1066 | ||
3201 | 991 | static bool store_constraints(Session *session, Table *table, LEX_STRING *db_name, | 1067 | static bool store_constraints(Session *, Table *table, LEX_STRING *db_name, |
3202 | 992 | LEX_STRING *table_name, const char *key_name, | 1068 | LEX_STRING *table_name, const char *key_name, |
3203 | 993 | uint32_t key_len, const char *con_type, uint32_t con_len) | 1069 | uint32_t key_len, const char *con_type, uint32_t con_len) |
3204 | 994 | { | 1070 | { |
3205 | 995 | const CHARSET_INFO * const cs= system_charset_info; | 1071 | const CHARSET_INFO * const cs= system_charset_info; |
3206 | 996 | table->restoreRecordAsDefault(); | 1072 | table->restoreRecordAsDefault(); |
3207 | 1073 | table->setWriteSet(1); | ||
3208 | 1074 | table->setWriteSet(2); | ||
3209 | 1075 | table->setWriteSet(3); | ||
3210 | 1076 | table->setWriteSet(4); | ||
3211 | 1077 | table->setWriteSet(5); | ||
3212 | 997 | table->field[1]->store(db_name->str, db_name->length, cs); | 1078 | table->field[1]->store(db_name->str, db_name->length, cs); |
3213 | 998 | table->field[2]->store(key_name, key_len, cs); | 1079 | table->field[2]->store(key_name, key_len, cs); |
3214 | 999 | table->field[3]->store(db_name->str, db_name->length, cs); | 1080 | table->field[3]->store(db_name->str, db_name->length, cs); |
3215 | 1000 | table->field[4]->store(table_name->str, table_name->length, cs); | 1081 | table->field[4]->store(table_name->str, table_name->length, cs); |
3216 | 1001 | table->field[5]->store(con_type, con_len, cs); | 1082 | table->field[5]->store(con_type, con_len, cs); |
3218 | 1002 | return schema_table_store_record(session, table); | 1083 | TableList *tmp= table->pos_in_table_list; |
3219 | 1084 | tmp->schema_table->addRow(table->record[0], table->s->reclength); | ||
3220 | 1085 | return false; | ||
3221 | 1003 | } | 1086 | } |
3222 | 1004 | 1087 | ||
3224 | 1005 | int TabConstraintsISMethods::processTable(Session *session, TableList *tables, | 1088 | int TabConstraintsISMethods::processTable(plugin::InfoSchemaTable *, |
3225 | 1089 | Session *session, TableList *tables, | ||
3226 | 1006 | Table *table, bool res, | 1090 | Table *table, bool res, |
3227 | 1007 | LEX_STRING *db_name, | 1091 | LEX_STRING *db_name, |
3229 | 1008 | LEX_STRING *table_name) const | 1092 | LEX_STRING *table_name) |
3230 | 1009 | { | 1093 | { |
3231 | 1010 | if (res) | 1094 | if (res) |
3232 | 1011 | { | 1095 | { |
3233 | @@ -1070,16 +1154,36 @@ | |||
3234 | 1070 | return (res); | 1154 | return (res); |
3235 | 1071 | } | 1155 | } |
3236 | 1072 | 1156 | ||
3241 | 1073 | int TablesISMethods::processTable(Session *session, TableList *tables, | 1157 | int TablesISMethods::processTable(plugin::InfoSchemaTable *store_table, |
3242 | 1074 | Table *table, bool res, | 1158 | Session *session, TableList *tables, |
3243 | 1075 | LEX_STRING *db_name, | 1159 | Table *table, bool res, |
3244 | 1076 | LEX_STRING *table_name) const | 1160 | LEX_STRING *db_name, |
3245 | 1161 | LEX_STRING *table_name) | ||
3246 | 1077 | { | 1162 | { |
3247 | 1078 | const char *tmp_buff; | 1163 | const char *tmp_buff; |
3248 | 1079 | DRIZZLE_TIME time; | 1164 | DRIZZLE_TIME time; |
3249 | 1080 | const CHARSET_INFO * const cs= system_charset_info; | 1165 | const CHARSET_INFO * const cs= system_charset_info; |
3250 | 1081 | 1166 | ||
3251 | 1082 | table->restoreRecordAsDefault(); | 1167 | table->restoreRecordAsDefault(); |
3252 | 1168 | table->setWriteSet(1); | ||
3253 | 1169 | table->setWriteSet(2); | ||
3254 | 1170 | table->setWriteSet(3); | ||
3255 | 1171 | table->setWriteSet(4); | ||
3256 | 1172 | table->setWriteSet(5); | ||
3257 | 1173 | table->setWriteSet(6); | ||
3258 | 1174 | table->setWriteSet(7); | ||
3259 | 1175 | table->setWriteSet(8); | ||
3260 | 1176 | table->setWriteSet(9); | ||
3261 | 1177 | table->setWriteSet(11); | ||
3262 | 1178 | table->setWriteSet(12); | ||
3263 | 1179 | table->setWriteSet(13); | ||
3264 | 1180 | table->setWriteSet(14); | ||
3265 | 1181 | table->setWriteSet(15); | ||
3266 | 1182 | table->setWriteSet(16); | ||
3267 | 1183 | table->setWriteSet(17); | ||
3268 | 1184 | table->setWriteSet(18); | ||
3269 | 1185 | table->setWriteSet(19); | ||
3270 | 1186 | table->setWriteSet(20); | ||
3271 | 1083 | table->field[1]->store(db_name->str, db_name->length, cs); | 1187 | table->field[1]->store(db_name->str, db_name->length, cs); |
3272 | 1084 | table->field[2]->store(table_name->str, table_name->length, cs); | 1188 | table->field[2]->store(table_name->str, table_name->length, cs); |
3273 | 1085 | if (res) | 1189 | if (res) |
3274 | @@ -1245,7 +1349,8 @@ | |||
3275 | 1245 | } | 1349 | } |
3276 | 1246 | } | 1350 | } |
3277 | 1247 | } | 1351 | } |
3279 | 1248 | return (schema_table_store_record(session, table)); | 1352 | store_table->addRow(table->record[0], table->s->reclength); |
3280 | 1353 | return false; | ||
3281 | 1249 | } | 1354 | } |
3282 | 1250 | 1355 | ||
3283 | 1251 | 1356 | ||
3284 | @@ -1291,7 +1396,7 @@ | |||
3285 | 1291 | return 0; | 1396 | return 0; |
3286 | 1292 | } | 1397 | } |
3287 | 1293 | 1398 | ||
3289 | 1294 | int VariablesISMethods::fillTable(Session *session, TableList *tables, COND *) | 1399 | int VariablesISMethods::fillTable(Session *session, TableList *tables) |
3290 | 1295 | { | 1400 | { |
3291 | 1296 | int res= 0; | 1401 | int res= 0; |
3292 | 1297 | LEX *lex= session->lex; | 1402 | LEX *lex= session->lex; |
3293 | 1298 | 1403 | ||
3294 | === modified file 'plugin/info_schema/info_schema_methods.h' | |||
3295 | --- plugin/info_schema/info_schema_methods.h 2009-09-25 20:13:37 +0000 | |||
3296 | +++ plugin/info_schema/info_schema_methods.h 2009-10-29 23:56:14 +0000 | |||
3297 | @@ -34,8 +34,7 @@ | |||
3298 | 34 | { | 34 | { |
3299 | 35 | public: | 35 | public: |
3300 | 36 | virtual int fillTable(Session *session, | 36 | virtual int fillTable(Session *session, |
3303 | 37 | TableList *tables, | 37 | TableList *tables); |
3302 | 38 | COND *cond); | ||
3304 | 39 | virtual int oldFormat(Session *session, | 38 | virtual int oldFormat(Session *session, |
3305 | 40 | drizzled::plugin::InfoSchemaTable *schema_table) const; | 39 | drizzled::plugin::InfoSchemaTable *schema_table) const; |
3306 | 41 | }; | 40 | }; |
3307 | @@ -50,8 +49,7 @@ | |||
3308 | 50 | { | 49 | { |
3309 | 51 | public: | 50 | public: |
3310 | 52 | virtual int fillTable(Session *session, | 51 | virtual int fillTable(Session *session, |
3313 | 53 | TableList *tables, | 52 | TableList *tables); |
3312 | 54 | COND *cond); | ||
3314 | 55 | }; | 53 | }; |
3315 | 56 | 54 | ||
3316 | 57 | /** | 55 | /** |
3317 | @@ -64,8 +62,7 @@ | |||
3318 | 64 | { | 62 | { |
3319 | 65 | public: | 63 | public: |
3320 | 66 | virtual int fillTable(Session *session, | 64 | virtual int fillTable(Session *session, |
3323 | 67 | TableList *tables, | 65 | TableList *tables); |
3322 | 68 | COND *cond); | ||
3324 | 69 | }; | 66 | }; |
3325 | 70 | 67 | ||
3326 | 71 | /** | 68 | /** |
3327 | @@ -90,9 +87,11 @@ | |||
3328 | 90 | class KeyColUsageISMethods : public drizzled::plugin::InfoSchemaMethods | 87 | class KeyColUsageISMethods : public drizzled::plugin::InfoSchemaMethods |
3329 | 91 | { | 88 | { |
3330 | 92 | public: | 89 | public: |
3332 | 93 | virtual int processTable(Session *session, TableList *tables, | 90 | virtual int processTable(drizzled::plugin::InfoSchemaTable *store_table, |
3333 | 91 | Session *session, | ||
3334 | 92 | TableList *tables, | ||
3335 | 94 | Table *table, bool res, LEX_STRING *db_name, | 93 | Table *table, bool res, LEX_STRING *db_name, |
3337 | 95 | LEX_STRING *table_name) const; | 94 | LEX_STRING *table_name); |
3338 | 96 | }; | 95 | }; |
3339 | 97 | 96 | ||
3340 | 98 | /** | 97 | /** |
3341 | @@ -105,8 +104,7 @@ | |||
3342 | 105 | { | 104 | { |
3343 | 106 | public: | 105 | public: |
3344 | 107 | virtual int fillTable(Session *session, | 106 | virtual int fillTable(Session *session, |
3347 | 108 | TableList *tables, | 107 | TableList *tables); |
3346 | 109 | COND *cond); | ||
3348 | 110 | }; | 108 | }; |
3349 | 111 | 109 | ||
3350 | 112 | /** | 110 | /** |
3351 | @@ -119,8 +117,7 @@ | |||
3352 | 119 | { | 117 | { |
3353 | 120 | public: | 118 | public: |
3354 | 121 | virtual int fillTable(Session *session, | 119 | virtual int fillTable(Session *session, |
3357 | 122 | TableList *tables, | 120 | TableList *tables); |
3356 | 123 | COND *cond); | ||
3358 | 124 | }; | 121 | }; |
3359 | 125 | 122 | ||
3360 | 126 | /** | 123 | /** |
3361 | @@ -133,8 +130,7 @@ | |||
3362 | 133 | { | 130 | { |
3363 | 134 | public: | 131 | public: |
3364 | 135 | virtual int fillTable(Session *session, | 132 | virtual int fillTable(Session *session, |
3367 | 136 | TableList *tables, | 133 | TableList *tables); |
3366 | 137 | COND *cond); | ||
3368 | 138 | }; | 134 | }; |
3369 | 139 | 135 | ||
3370 | 140 | /** | 136 | /** |
3371 | @@ -159,9 +155,10 @@ | |||
3372 | 159 | * | 155 | * |
3373 | 160 | * @return 0 on success; 1 on failure | 156 | * @return 0 on success; 1 on failure |
3374 | 161 | */ | 157 | */ |
3376 | 162 | virtual int processTable(Session *session, TableList *tables, | 158 | virtual int processTable(drizzled::plugin::InfoSchemaTable *store_table, |
3377 | 159 | Session *session, TableList *tables, | ||
3378 | 163 | Table *table, bool res, LEX_STRING *db_name, | 160 | Table *table, bool res, LEX_STRING *db_name, |
3380 | 164 | LEX_STRING *table_name) const; | 161 | LEX_STRING *table_name); |
3381 | 165 | }; | 162 | }; |
3382 | 166 | 163 | ||
3383 | 167 | /** | 164 | /** |
3384 | @@ -174,8 +171,7 @@ | |||
3385 | 174 | { | 171 | { |
3386 | 175 | public: | 172 | public: |
3387 | 176 | virtual int fillTable(Session *session, | 173 | virtual int fillTable(Session *session, |
3390 | 177 | TableList *tables, | 174 | TableList *tables); |
3389 | 178 | COND *cond); | ||
3391 | 179 | virtual int oldFormat(Session *session, | 175 | virtual int oldFormat(Session *session, |
3392 | 180 | drizzled::plugin::InfoSchemaTable *schema_table) const; | 176 | drizzled::plugin::InfoSchemaTable *schema_table) const; |
3393 | 181 | }; | 177 | }; |
3394 | @@ -189,9 +185,11 @@ | |||
3395 | 189 | class StatsISMethods : public drizzled::plugin::InfoSchemaMethods | 185 | class StatsISMethods : public drizzled::plugin::InfoSchemaMethods |
3396 | 190 | { | 186 | { |
3397 | 191 | public: | 187 | public: |
3399 | 192 | virtual int processTable(Session *session, TableList *tables, | 188 | virtual int processTable(drizzled::plugin::InfoSchemaTable *store_table, |
3400 | 189 | Session *session, | ||
3401 | 190 | TableList *tables, | ||
3402 | 193 | Table *table, bool res, LEX_STRING *db_name, | 191 | Table *table, bool res, LEX_STRING *db_name, |
3404 | 194 | LEX_STRING *table_name) const; | 192 | LEX_STRING *table_name); |
3405 | 195 | }; | 193 | }; |
3406 | 196 | 194 | ||
3407 | 197 | /** | 195 | /** |
3408 | @@ -204,8 +202,7 @@ | |||
3409 | 204 | { | 202 | { |
3410 | 205 | public: | 203 | public: |
3411 | 206 | virtual int fillTable(Session *session, | 204 | virtual int fillTable(Session *session, |
3414 | 207 | TableList *tables, | 205 | TableList *tables); |
3413 | 208 | COND *cond); | ||
3415 | 209 | }; | 206 | }; |
3416 | 210 | 207 | ||
3417 | 211 | /** | 208 | /** |
3418 | @@ -217,9 +214,10 @@ | |||
3419 | 217 | class TabConstraintsISMethods : public drizzled::plugin::InfoSchemaMethods | 214 | class TabConstraintsISMethods : public drizzled::plugin::InfoSchemaMethods |
3420 | 218 | { | 215 | { |
3421 | 219 | public: | 216 | public: |
3423 | 220 | virtual int processTable(Session *session, TableList *tables, | 217 | virtual int processTable(drizzled::plugin::InfoSchemaTable *store_table, |
3424 | 218 | Session *session, TableList *tables, | ||
3425 | 221 | Table *table, bool res, LEX_STRING *db_name, | 219 | Table *table, bool res, LEX_STRING *db_name, |
3427 | 222 | LEX_STRING *table_name) const; | 220 | LEX_STRING *table_name); |
3428 | 223 | }; | 221 | }; |
3429 | 224 | 222 | ||
3430 | 225 | /** | 223 | /** |
3431 | @@ -231,9 +229,10 @@ | |||
3432 | 231 | class TablesISMethods : public drizzled::plugin::InfoSchemaMethods | 229 | class TablesISMethods : public drizzled::plugin::InfoSchemaMethods |
3433 | 232 | { | 230 | { |
3434 | 233 | public: | 231 | public: |
3436 | 234 | virtual int processTable(Session *session, TableList *tables, | 232 | virtual int processTable(drizzled::plugin::InfoSchemaTable *store_table, |
3437 | 233 | Session *session, TableList *tables, | ||
3438 | 235 | Table *table, bool res, LEX_STRING *db_name, | 234 | Table *table, bool res, LEX_STRING *db_name, |
3440 | 236 | LEX_STRING *table_name) const; | 235 | LEX_STRING *table_name); |
3441 | 237 | }; | 236 | }; |
3442 | 238 | 237 | ||
3443 | 239 | /** | 238 | /** |
3444 | @@ -259,8 +258,7 @@ | |||
3445 | 259 | { | 258 | { |
3446 | 260 | public: | 259 | public: |
3447 | 261 | virtual int fillTable(Session *session, | 260 | virtual int fillTable(Session *session, |
3450 | 262 | TableList *tables, | 261 | TableList *tables); |
3449 | 263 | COND *cond); | ||
3451 | 264 | }; | 262 | }; |
3452 | 265 | 263 | ||
3453 | 266 | #endif /* PLUGIN_INFO_SCHEMA_INFO_SCHEMA_METHODS_H */ | 264 | #endif /* PLUGIN_INFO_SCHEMA_INFO_SCHEMA_METHODS_H */ |
3454 | 267 | 265 | ||
3455 | === added directory 'plugin/info_schema_engine' | |||
3456 | === added file 'plugin/info_schema_engine/info_schema_cursor.cc' | |||
3457 | --- plugin/info_schema_engine/info_schema_cursor.cc 1970-01-01 00:00:00 +0000 | |||
3458 | +++ plugin/info_schema_engine/info_schema_cursor.cc 2009-10-29 23:56:14 +0000 | |||
3459 | @@ -0,0 +1,144 @@ | |||
3460 | 1 | /* | ||
3461 | 2 | * Copyright (C) 2009 Sun Microsystems | ||
3462 | 3 | * | ||
3463 | 4 | * This program is free software; you can redistribute it and/or modify | ||
3464 | 5 | * it under the terms of the GNU General Public License as published by | ||
3465 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
3466 | 7 | * (at your option) any later version. | ||
3467 | 8 | * | ||
3468 | 9 | * This program is distributed in the hope that it will be useful, | ||
3469 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3470 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3471 | 12 | * GNU General Public License for more details. | ||
3472 | 13 | * | ||
3473 | 14 | * You should have received a copy of the GNU General Public License | ||
3474 | 15 | * along with this program; if not, write to the Free Software | ||
3475 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
3476 | 17 | */ | ||
3477 | 18 | |||
3478 | 19 | #include "drizzled/server_includes.h" | ||
3479 | 20 | #include "drizzled/join_table.h" | ||
3480 | 21 | #include "drizzled/session.h" | ||
3481 | 22 | #include "info_schema_cursor.h" | ||
3482 | 23 | #include "open_tables.h" | ||
3483 | 24 | |||
3484 | 25 | #include <string> | ||
3485 | 26 | #include <map> | ||
3486 | 27 | |||
3487 | 28 | using namespace std; | ||
3488 | 29 | using namespace drizzled; | ||
3489 | 30 | |||
3490 | 31 | int InfoSchemaCursor::open(const char *name, int, uint32_t) | ||
3491 | 32 | { | ||
3492 | 33 | string table_name(name); | ||
3493 | 34 | string i_s_prefix("./information_schema/"); | ||
3494 | 35 | table_name.erase(0, i_s_prefix.length()); | ||
3495 | 36 | |||
3496 | 37 | OpenTables &open_tables= OpenTables::singleton(); | ||
3497 | 38 | if (! (share= open_tables.getShare(table_name))) | ||
3498 | 39 | { | ||
3499 | 40 | return HA_ERR_OUT_OF_MEM; | ||
3500 | 41 | } | ||
3501 | 42 | |||
3502 | 43 | assert(share); | ||
3503 | 44 | |||
3504 | 45 | thr_lock_data_init(share->getThreadLock(), &data_lock, NULL); | ||
3505 | 46 | |||
3506 | 47 | return 0; | ||
3507 | 48 | } | ||
3508 | 49 | |||
3509 | 50 | int InfoSchemaCursor::close() | ||
3510 | 51 | { | ||
3511 | 52 | OpenTables &open_tables= OpenTables::singleton(); | ||
3512 | 53 | open_tables.freeShare(); | ||
3513 | 54 | return 0; | ||
3514 | 55 | } | ||
3515 | 56 | |||
3516 | 57 | int InfoSchemaCursor::info(uint32_t flags) | ||
3517 | 58 | { | ||
3518 | 59 | /* | ||
3519 | 60 | * If this flag is set, then we know that the time of the last | ||
3520 | 61 | * modification needs to be modified. | ||
3521 | 62 | */ | ||
3522 | 63 | if (flags & HA_STATUS_TIME) | ||
3523 | 64 | { | ||
3524 | 65 | } | ||
3525 | 66 | |||
3526 | 67 | if (flags & HA_STATUS_VARIABLE) | ||
3527 | 68 | { | ||
3528 | 69 | stats.records= 1; | ||
3529 | 70 | } | ||
3530 | 71 | |||
3531 | 72 | /* | ||
3532 | 73 | * If this flag is set, then we know that the auto_increment value needs | ||
3533 | 74 | * to be updated. | ||
3534 | 75 | */ | ||
3535 | 76 | if (flags & HA_STATUS_AUTO) | ||
3536 | 77 | { | ||
3537 | 78 | stats.auto_increment_value= 1; | ||
3538 | 79 | } | ||
3539 | 80 | |||
3540 | 81 | return 0; | ||
3541 | 82 | } | ||
3542 | 83 | |||
3543 | 84 | int InfoSchemaCursor::rnd_init(bool) | ||
3544 | 85 | { | ||
3545 | 86 | TableList *tmp= table->pos_in_table_list; | ||
3546 | 87 | plugin::InfoSchemaTable *sch_table= share->getInfoSchemaTable(); | ||
3547 | 88 | if (sch_table) | ||
3548 | 89 | { | ||
3549 | 90 | sch_table->fillTable(ha_session(), | ||
3550 | 91 | tmp); | ||
3551 | 92 | iter= sch_table->getRows().begin(); | ||
3552 | 93 | } | ||
3553 | 94 | return 0; | ||
3554 | 95 | } | ||
3555 | 96 | |||
3556 | 97 | int InfoSchemaCursor::rnd_next(unsigned char *buf) | ||
3557 | 98 | { | ||
3558 | 99 | ha_statistic_increment(&SSV::ha_read_rnd_next_count); | ||
3559 | 100 | plugin::InfoSchemaTable *sch_table= share->getInfoSchemaTable(); | ||
3560 | 101 | if (iter != sch_table->getRows().end() && | ||
3561 | 102 | ! sch_table->getRows().empty()) | ||
3562 | 103 | { | ||
3563 | 104 | (*iter)->copyRecordInto(buf); | ||
3564 | 105 | ++iter; | ||
3565 | 106 | return 0; | ||
3566 | 107 | } | ||
3567 | 108 | sch_table->clearRows(); | ||
3568 | 109 | return HA_ERR_END_OF_FILE; | ||
3569 | 110 | } | ||
3570 | 111 | |||
3571 | 112 | int InfoSchemaCursor::rnd_pos(unsigned char *, unsigned char *) | ||
3572 | 113 | { | ||
3573 | 114 | ha_statistic_increment(&SSV::ha_read_rnd_count); | ||
3574 | 115 | return HA_ERR_WRONG_COMMAND; | ||
3575 | 116 | } | ||
3576 | 117 | |||
3577 | 118 | void InfoSchemaCursor::position(const unsigned char *) | ||
3578 | 119 | { | ||
3579 | 120 | return; | ||
3580 | 121 | } | ||
3581 | 122 | |||
3582 | 123 | THR_LOCK_DATA **InfoSchemaCursor::store_lock(Session *session, | ||
3583 | 124 | THR_LOCK_DATA **to, | ||
3584 | 125 | enum thr_lock_type lock_type) | ||
3585 | 126 | { | ||
3586 | 127 | /* borrowed from archive and BDB engines. TODO: understand this! */ | ||
3587 | 128 | if (lock_type != TL_IGNORE && data_lock.type == TL_UNLOCK) | ||
3588 | 129 | { | ||
3589 | 130 | if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE) && | ||
3590 | 131 | ! session_tablespace_op(session)) | ||
3591 | 132 | { | ||
3592 | 133 | lock_type= TL_WRITE_ALLOW_WRITE; | ||
3593 | 134 | } | ||
3594 | 135 | if (lock_type == TL_READ_NO_INSERT) | ||
3595 | 136 | { | ||
3596 | 137 | lock_type= TL_READ; | ||
3597 | 138 | } | ||
3598 | 139 | data_lock.type= lock_type; | ||
3599 | 140 | } | ||
3600 | 141 | *to++= &data_lock; | ||
3601 | 142 | return to; | ||
3602 | 143 | } | ||
3603 | 144 | |||
3604 | 0 | 145 | ||
3605 | === added file 'plugin/info_schema_engine/info_schema_cursor.h' | |||
3606 | --- plugin/info_schema_engine/info_schema_cursor.h 1970-01-01 00:00:00 +0000 | |||
3607 | +++ plugin/info_schema_engine/info_schema_cursor.h 2009-10-29 23:56:14 +0000 | |||
3608 | @@ -0,0 +1,175 @@ | |||
3609 | 1 | /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*- | ||
3610 | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | ||
3611 | 3 | * | ||
3612 | 4 | * Copyright (C) 2009 Sun Microsystems | ||
3613 | 5 | * | ||
3614 | 6 | * This program is free software; you can redistribute it and/or modify | ||
3615 | 7 | * it under the terms of the GNU General Public License as published by | ||
3616 | 8 | * the Free Software Foundation; either version 2 of the License, or | ||
3617 | 9 | * (at your option) any later version. | ||
3618 | 10 | * | ||
3619 | 11 | * This program is distributed in the hope that it will be useful, | ||
3620 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3621 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3622 | 14 | * GNU General Public License for more details. | ||
3623 | 15 | * | ||
3624 | 16 | * You should have received a copy of the GNU General Public License | ||
3625 | 17 | * along with this program; if not, write to the Free Software | ||
3626 | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
3627 | 19 | */ | ||
3628 | 20 | |||
3629 | 21 | #ifndef DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_CURSOR_H | ||
3630 | 22 | #define DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_CURSOR_H | ||
3631 | 23 | |||
3632 | 24 | #include <drizzled/cursor.h> | ||
3633 | 25 | #include <drizzled/show.h> | ||
3634 | 26 | #include <drizzled/plugin/info_schema_table.h> | ||
3635 | 27 | #include <mysys/thr_lock.h> | ||
3636 | 28 | |||
3637 | 29 | /* | ||
3638 | 30 | * Shared structure for correct LOCK operation | ||
3639 | 31 | */ | ||
3640 | 32 | class InfoSchemaShare | ||
3641 | 33 | { | ||
3642 | 34 | public: | ||
3643 | 35 | InfoSchemaShare() | ||
3644 | 36 | : | ||
3645 | 37 | use_count(0), | ||
3646 | 38 | lock(), | ||
3647 | 39 | i_s_table(NULL) | ||
3648 | 40 | {} | ||
3649 | 41 | |||
3650 | 42 | ~InfoSchemaShare() | ||
3651 | 43 | { | ||
3652 | 44 | thr_lock_delete(&lock); | ||
3653 | 45 | } | ||
3654 | 46 | |||
3655 | 47 | uint32_t getUseCount() const | ||
3656 | 48 | { | ||
3657 | 49 | return use_count; | ||
3658 | 50 | } | ||
3659 | 51 | |||
3660 | 52 | void incUseCount() | ||
3661 | 53 | { | ||
3662 | 54 | use_count++; | ||
3663 | 55 | } | ||
3664 | 56 | |||
3665 | 57 | void decUseCount() | ||
3666 | 58 | { | ||
3667 | 59 | use_count--; | ||
3668 | 60 | } | ||
3669 | 61 | |||
3670 | 62 | const std::string &getName() const | ||
3671 | 63 | { | ||
3672 | 64 | return i_s_table->getTableName(); | ||
3673 | 65 | } | ||
3674 | 66 | |||
3675 | 67 | void initThreadLock() | ||
3676 | 68 | { | ||
3677 | 69 | thr_lock_init(&lock); | ||
3678 | 70 | } | ||
3679 | 71 | |||
3680 | 72 | THR_LOCK *getThreadLock() | ||
3681 | 73 | { | ||
3682 | 74 | return &lock; | ||
3683 | 75 | } | ||
3684 | 76 | |||
3685 | 77 | void setInfoSchemaTable(const std::string &name) | ||
3686 | 78 | { | ||
3687 | 79 | i_s_table= drizzled::plugin::InfoSchemaTable::getTable(name.c_str()); | ||
3688 | 80 | } | ||
3689 | 81 | |||
3690 | 82 | drizzled::plugin::InfoSchemaTable *getInfoSchemaTable() | ||
3691 | 83 | { | ||
3692 | 84 | return i_s_table; | ||
3693 | 85 | } | ||
3694 | 86 | |||
3695 | 87 | |||
3696 | 88 | private: | ||
3697 | 89 | |||
3698 | 90 | uint32_t use_count; | ||
3699 | 91 | THR_LOCK lock; | ||
3700 | 92 | drizzled::plugin::InfoSchemaTable *i_s_table; | ||
3701 | 93 | }; | ||
3702 | 94 | |||
3703 | 95 | class InfoSchemaCursor : public Cursor | ||
3704 | 96 | { | ||
3705 | 97 | public: | ||
3706 | 98 | |||
3707 | 99 | InfoSchemaCursor(drizzled::plugin::StorageEngine *engine_arg, TableShare *table_arg) | ||
3708 | 100 | : | ||
3709 | 101 | Cursor(engine_arg, table_arg) | ||
3710 | 102 | {} | ||
3711 | 103 | |||
3712 | 104 | ~InfoSchemaCursor() {} | ||
3713 | 105 | |||
3714 | 106 | const char *table_type() const | ||
3715 | 107 | { | ||
3716 | 108 | return "INFORMATION_SCHEMA"; | ||
3717 | 109 | } | ||
3718 | 110 | |||
3719 | 111 | /* | ||
3720 | 112 | The name of the index type that will be used for display | ||
3721 | 113 | don't implement this method unless you really have indexes | ||
3722 | 114 | */ | ||
3723 | 115 | const char *index_type(uint32_t) | ||
3724 | 116 | { | ||
3725 | 117 | return NULL; | ||
3726 | 118 | } | ||
3727 | 119 | |||
3728 | 120 | uint64_t table_flags() const | ||
3729 | 121 | { | ||
3730 | 122 | return (HA_NULL_IN_KEY | | ||
3731 | 123 | HA_CAN_INDEX_BLOBS | | ||
3732 | 124 | HA_AUTO_PART_KEY); | ||
3733 | 125 | } | ||
3734 | 126 | |||
3735 | 127 | uint32_t index_flags(uint32_t, uint32_t, bool) const | ||
3736 | 128 | { | ||
3737 | 129 | return 0; | ||
3738 | 130 | } | ||
3739 | 131 | |||
3740 | 132 | /* open a table */ | ||
3741 | 133 | int open(const char *name, int mode, uint32_t test_if_locked); | ||
3742 | 134 | |||
3743 | 135 | /* close a table */ | ||
3744 | 136 | int close(void); | ||
3745 | 137 | |||
3746 | 138 | /* provide info to the optimizer */ | ||
3747 | 139 | int info(uint32_t flag); | ||
3748 | 140 | |||
3749 | 141 | /* preparation for table scan (is this true?) */ | ||
3750 | 142 | int rnd_init(bool scan); | ||
3751 | 143 | |||
3752 | 144 | /* get the next row and copy it into buf */ | ||
3753 | 145 | int rnd_next(unsigned char *buf); | ||
3754 | 146 | |||
3755 | 147 | /* locate row pointed to by pos, copy it into buf */ | ||
3756 | 148 | int rnd_pos(unsigned char *buf, unsigned char *pos); | ||
3757 | 149 | |||
3758 | 150 | /* record position of a record for reordering */ | ||
3759 | 151 | void position(const unsigned char *record); | ||
3760 | 152 | |||
3761 | 153 | /* | ||
3762 | 154 | * @todo: return actual upper bound of number of records in the table. | ||
3763 | 155 | * (e.g. save number of records seen on full table scan and/or use file size | ||
3764 | 156 | * as upper bound) | ||
3765 | 157 | */ | ||
3766 | 158 | ha_rows estimate_rows_upper_bound() | ||
3767 | 159 | { | ||
3768 | 160 | return HA_POS_ERROR; | ||
3769 | 161 | } | ||
3770 | 162 | |||
3771 | 163 | THR_LOCK_DATA **store_lock(Session *session, | ||
3772 | 164 | THR_LOCK_DATA **to, | ||
3773 | 165 | enum thr_lock_type lock_type); | ||
3774 | 166 | |||
3775 | 167 | private: | ||
3776 | 168 | |||
3777 | 169 | THR_LOCK_DATA data_lock; | ||
3778 | 170 | InfoSchemaShare *share; | ||
3779 | 171 | drizzled::plugin::InfoSchemaTable::Rows::iterator iter; | ||
3780 | 172 | |||
3781 | 173 | }; | ||
3782 | 174 | |||
3783 | 175 | #endif /* DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_CURSOR_H */ | ||
3784 | 0 | 176 | ||
3785 | === added file 'plugin/info_schema_engine/info_schema_engine.cc' | |||
3786 | --- plugin/info_schema_engine/info_schema_engine.cc 1970-01-01 00:00:00 +0000 | |||
3787 | +++ plugin/info_schema_engine/info_schema_engine.cc 2009-10-29 23:56:14 +0000 | |||
3788 | @@ -0,0 +1,195 @@ | |||
3789 | 1 | /* | ||
3790 | 2 | * Copyright (C) 2009 Sun Microsystems | ||
3791 | 3 | * | ||
3792 | 4 | * This program is free software; you can redistribute it and/or modify | ||
3793 | 5 | * it under the terms of the GNU General Public License as published by | ||
3794 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
3795 | 7 | * (at your option) any later version. | ||
3796 | 8 | * | ||
3797 | 9 | * This program is distributed in the hope that it will be useful, | ||
3798 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3799 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3800 | 12 | * GNU General Public License for more details. | ||
3801 | 13 | * | ||
3802 | 14 | * You should have received a copy of the GNU General Public License | ||
3803 | 15 | * along with this program; if not, write to the Free Software | ||
3804 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
3805 | 17 | */ | ||
3806 | 18 | |||
3807 | 19 | #include <drizzled/server_includes.h> | ||
3808 | 20 | #include <drizzled/show.h> | ||
3809 | 21 | #include "info_schema_engine.h" | ||
3810 | 22 | #include "info_schema_cursor.h" | ||
3811 | 23 | #include "open_tables.h" | ||
3812 | 24 | |||
3813 | 25 | #include <string> | ||
3814 | 26 | #include <map> | ||
3815 | 27 | |||
3816 | 28 | using namespace std; | ||
3817 | 29 | using namespace drizzled; | ||
3818 | 30 | |||
3819 | 31 | static const string engine_name("INFORMATION_SCHEMA"); | ||
3820 | 32 | |||
3821 | 33 | int InfoSchemaEngine::getTableProtoImplementation(const char *path, | ||
3822 | 34 | message::Table *table_proto) | ||
3823 | 35 | { | ||
3824 | 36 | string table_name(path); | ||
3825 | 37 | string i_s_prefix("./information_schema/"); | ||
3826 | 38 | |||
3827 | 39 | if (table_name.compare(0, i_s_prefix.length(), i_s_prefix) != 0) | ||
3828 | 40 | { | ||
3829 | 41 | return ENOENT; | ||
3830 | 42 | } | ||
3831 | 43 | |||
3832 | 44 | if (! table_proto) | ||
3833 | 45 | { | ||
3834 | 46 | return EEXIST; | ||
3835 | 47 | } | ||
3836 | 48 | |||
3837 | 49 | table_name.erase(0, i_s_prefix.length()); | ||
3838 | 50 | plugin::InfoSchemaTable *schema_table= plugin::InfoSchemaTable::getTable(table_name.c_str()); | ||
3839 | 51 | |||
3840 | 52 | if (! schema_table) | ||
3841 | 53 | { | ||
3842 | 54 | return ENOENT; | ||
3843 | 55 | } | ||
3844 | 56 | |||
3845 | 57 | table_proto->set_name(table_name); | ||
3846 | 58 | table_proto->set_type(message::Table::STANDARD); | ||
3847 | 59 | |||
3848 | 60 | message::Table::StorageEngine *protoengine= table_proto->mutable_engine(); | ||
3849 | 61 | protoengine->set_name(engine_name); | ||
3850 | 62 | |||
3851 | 63 | message::Table::TableOptions *table_options= table_proto->mutable_options(); | ||
3852 | 64 | table_options->set_collation_id(default_charset_info->number); | ||
3853 | 65 | table_options->set_collation(default_charset_info->name); | ||
3854 | 66 | |||
3855 | 67 | const plugin::InfoSchemaTable::Columns &columns= schema_table->getColumns(); | ||
3856 | 68 | plugin::InfoSchemaTable::Columns::const_iterator iter= columns.begin(); | ||
3857 | 69 | |||
3858 | 70 | while (iter != columns.end()) | ||
3859 | 71 | { | ||
3860 | 72 | const plugin::ColumnInfo *column= *iter; | ||
3861 | 73 | /* get the various proto variables we need */ | ||
3862 | 74 | message::Table::Field *proto_field= table_proto->add_field(); | ||
3863 | 75 | message::Table::Field::FieldOptions *field_options= | ||
3864 | 76 | proto_field->mutable_options(); | ||
3865 | 77 | message::Table::Field::FieldConstraints *field_constraints= | ||
3866 | 78 | proto_field->mutable_constraints(); | ||
3867 | 79 | |||
3868 | 80 | proto_field->set_name(column->getName()); | ||
3869 | 81 | field_options->set_default_value("0"); | ||
3870 | 82 | |||
3871 | 83 | if (column->getFlags() & MY_I_S_MAYBE_NULL) | ||
3872 | 84 | { | ||
3873 | 85 | field_options->set_default_null(true); | ||
3874 | 86 | field_constraints->set_is_nullable(true); | ||
3875 | 87 | } | ||
3876 | 88 | |||
3877 | 89 | if (column->getFlags() & MY_I_S_UNSIGNED) | ||
3878 | 90 | { | ||
3879 | 91 | field_constraints->set_is_unsigned(true); | ||
3880 | 92 | } | ||
3881 | 93 | |||
3882 | 94 | switch(column->getType()) | ||
3883 | 95 | { | ||
3884 | 96 | case DRIZZLE_TYPE_TINY: | ||
3885 | 97 | case DRIZZLE_TYPE_LONG: | ||
3886 | 98 | proto_field->set_type(message::Table::Field::INTEGER); | ||
3887 | 99 | field_options->set_length(MAX_INT_WIDTH); | ||
3888 | 100 | break; | ||
3889 | 101 | case DRIZZLE_TYPE_DOUBLE: | ||
3890 | 102 | proto_field->set_type(message::Table::Field::DOUBLE); | ||
3891 | 103 | break; | ||
3892 | 104 | case DRIZZLE_TYPE_NULL: | ||
3893 | 105 | assert(true); | ||
3894 | 106 | break; | ||
3895 | 107 | case DRIZZLE_TYPE_TIMESTAMP: | ||
3896 | 108 | proto_field->set_type(message::Table::Field::TIMESTAMP); | ||
3897 | 109 | field_options->set_default_value("NOW()"); | ||
3898 | 110 | break; | ||
3899 | 111 | case DRIZZLE_TYPE_LONGLONG: | ||
3900 | 112 | proto_field->set_type(message::Table::Field::BIGINT); | ||
3901 | 113 | field_options->set_length(MAX_BIGINT_WIDTH); | ||
3902 | 114 | break; | ||
3903 | 115 | case DRIZZLE_TYPE_DATETIME: | ||
3904 | 116 | proto_field->set_type(message::Table::Field::DATETIME); | ||
3905 | 117 | field_options->set_default_value("NOW()"); | ||
3906 | 118 | break; | ||
3907 | 119 | case DRIZZLE_TYPE_DATE: | ||
3908 | 120 | proto_field->set_type(message::Table::Field::DATE); | ||
3909 | 121 | field_options->set_default_value("NOW()"); | ||
3910 | 122 | break; | ||
3911 | 123 | case DRIZZLE_TYPE_VARCHAR: | ||
3912 | 124 | { | ||
3913 | 125 | message::Table::Field::StringFieldOptions *str_field_options= | ||
3914 | 126 | proto_field->mutable_string_options(); | ||
3915 | 127 | proto_field->set_type(message::Table::Field::VARCHAR); | ||
3916 | 128 | str_field_options->set_length(column->getLength()); | ||
3917 | 129 | field_options->set_length(column->getLength() * 4); | ||
3918 | 130 | field_options->set_default_value(""); | ||
3919 | 131 | str_field_options->set_collation_id(default_charset_info->number); | ||
3920 | 132 | str_field_options->set_collation(default_charset_info->name); | ||
3921 | 133 | break; | ||
3922 | 134 | } | ||
3923 | 135 | case DRIZZLE_TYPE_NEWDECIMAL: | ||
3924 | 136 | { | ||
3925 | 137 | message::Table::Field::NumericFieldOptions *num_field_options= | ||
3926 | 138 | proto_field->mutable_numeric_options(); | ||
3927 | 139 | proto_field->set_type(message::Table::Field::DECIMAL); | ||
3928 | 140 | num_field_options->set_precision(column->getLength()); | ||
3929 | 141 | num_field_options->set_scale(column->getLength() % 10); | ||
3930 | 142 | break; | ||
3931 | 143 | } | ||
3932 | 144 | default: | ||
3933 | 145 | assert(true); | ||
3934 | 146 | break; | ||
3935 | 147 | } | ||
3936 | 148 | |||
3937 | 149 | ++iter; | ||
3938 | 150 | } | ||
3939 | 151 | |||
3940 | 152 | return EEXIST; | ||
3941 | 153 | } | ||
3942 | 154 | |||
3943 | 155 | static plugin::StorageEngine *info_schema_engine= NULL; | ||
3944 | 156 | |||
3945 | 157 | static int init(plugin::Registry ®istry) | ||
3946 | 158 | { | ||
3947 | 159 | info_schema_engine= new(std::nothrow) InfoSchemaEngine(engine_name); | ||
3948 | 160 | if (! info_schema_engine) | ||
3949 | 161 | { | ||
3950 | 162 | return true; | ||
3951 | 163 | } | ||
3952 | 164 | |||
3953 | 165 | /* we are good to go */ | ||
3954 | 166 | registry.add(info_schema_engine); | ||
3955 | 167 | |||
3956 | 168 | return false; | ||
3957 | 169 | } | ||
3958 | 170 | |||
3959 | 171 | static int deinit(plugin::Registry ®istry) | ||
3960 | 172 | { | ||
3961 | 173 | if (info_schema_engine) | ||
3962 | 174 | { | ||
3963 | 175 | registry.remove(info_schema_engine); | ||
3964 | 176 | delete info_schema_engine; | ||
3965 | 177 | } | ||
3966 | 178 | return false; | ||
3967 | 179 | } | ||
3968 | 180 | |||
3969 | 181 | drizzle_declare_plugin(info_schema_engine) | ||
3970 | 182 | { | ||
3971 | 183 | "info_schema_engine", | ||
3972 | 184 | "0.2", | ||
3973 | 185 | "Padraig O'Sullivan", | ||
3974 | 186 | "INFORMATION_SCHEMA Storage Engine", | ||
3975 | 187 | PLUGIN_LICENSE_GPL, | ||
3976 | 188 | init, /* Plugin Init */ | ||
3977 | 189 | deinit, /* Plugin Deinit */ | ||
3978 | 190 | NULL, /* status variables */ | ||
3979 | 191 | NULL, /* system variables */ | ||
3980 | 192 | NULL /* config options */ | ||
3981 | 193 | } | ||
3982 | 194 | drizzle_declare_plugin_end; | ||
3983 | 195 | |||
3984 | 0 | 196 | ||
3985 | === added file 'plugin/info_schema_engine/info_schema_engine.h' | |||
3986 | --- plugin/info_schema_engine/info_schema_engine.h 1970-01-01 00:00:00 +0000 | |||
3987 | +++ plugin/info_schema_engine/info_schema_engine.h 2009-10-29 23:56:14 +0000 | |||
3988 | @@ -0,0 +1,91 @@ | |||
3989 | 1 | /* | ||
3990 | 2 | * Copyright (C) 2009 Sun Microsystems | ||
3991 | 3 | * | ||
3992 | 4 | * This program is free software; you can redistribute it and/or modify | ||
3993 | 5 | * it under the terms of the GNU General Public License as published by | ||
3994 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
3995 | 7 | * (at your option) any later version. | ||
3996 | 8 | * | ||
3997 | 9 | * This program is distributed in the hope that it will be useful, | ||
3998 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3999 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4000 | 12 | * GNU General Public License for more details. | ||
4001 | 13 | * | ||
4002 | 14 | * You should have received a copy of the GNU General Public License | ||
4003 | 15 | * along with this program; if not, write to the Free Software | ||
4004 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
4005 | 17 | */ | ||
4006 | 18 | |||
4007 | 19 | #ifndef DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_H | ||
4008 | 20 | #define DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_H | ||
4009 | 21 | |||
4010 | 22 | #include <drizzled/error.h> | ||
4011 | 23 | #include "info_schema_cursor.h" | ||
4012 | 24 | #include "table_name_iterator.h" | ||
4013 | 25 | |||
4014 | 26 | #include <string> | ||
4015 | 27 | |||
4016 | 28 | class InfoSchemaEngine : public drizzled::plugin::StorageEngine | ||
4017 | 29 | { | ||
4018 | 30 | public: | ||
4019 | 31 | |||
4020 | 32 | InfoSchemaEngine(const std::string &in_name) | ||
4021 | 33 | : | ||
4022 | 34 | drizzled::plugin::StorageEngine(in_name, | ||
4023 | 35 | HTON_CREATE_NOT_SUPPORTED) | ||
4024 | 36 | {} | ||
4025 | 37 | |||
4026 | 38 | ~InfoSchemaEngine() {} | ||
4027 | 39 | |||
4028 | 40 | virtual Cursor *create(TableShare *table, | ||
4029 | 41 | MEM_ROOT *mem_root) | ||
4030 | 42 | { | ||
4031 | 43 | return new(mem_root) InfoSchemaCursor(this, table); | ||
4032 | 44 | } | ||
4033 | 45 | |||
4034 | 46 | const char **bas_ext() const | ||
4035 | 47 | { | ||
4036 | 48 | return NULL; | ||
4037 | 49 | } | ||
4038 | 50 | |||
4039 | 51 | int createTableImplementation(Session *, | ||
4040 | 52 | const char *, | ||
4041 | 53 | Table *, | ||
4042 | 54 | HA_CREATE_INFO *, | ||
4043 | 55 | drizzled::message::Table *) | ||
4044 | 56 | { | ||
4045 | 57 | my_error(ER_ILLEGAL_HA_CREATE_OPTION, | ||
4046 | 58 | MYF(0), | ||
4047 | 59 | drizzled::plugin::StorageEngine::resolveName(this).c_str(), | ||
4048 | 60 | "CREATE TABLE"); | ||
4049 | 61 | return -1; | ||
4050 | 62 | } | ||
4051 | 63 | |||
4052 | 64 | int deleteTableImplementation(Session *, | ||
4053 | 65 | const std::string &table_path) | ||
4054 | 66 | { | ||
4055 | 67 | std::string i_s_prefix("./information_schema/"); | ||
4056 | 68 | if (table_path.compare(0, i_s_prefix.length(), i_s_prefix) == 0) | ||
4057 | 69 | { | ||
4058 | 70 | my_error(ER_DBACCESS_DENIED_ERROR, | ||
4059 | 71 | MYF(0), | ||
4060 | 72 | "", | ||
4061 | 73 | "", | ||
4062 | 74 | INFORMATION_SCHEMA_NAME.c_str()); | ||
4063 | 75 | return ER_DBACCESS_DENIED_ERROR; | ||
4064 | 76 | } | ||
4065 | 77 | return ENOENT; | ||
4066 | 78 | } | ||
4067 | 79 | |||
4068 | 80 | int getTableProtoImplementation(const char *path, | ||
4069 | 81 | drizzled::message::Table *table_proto); | ||
4070 | 82 | |||
4071 | 83 | drizzled::plugin::TableNameIteratorImplementation *tableNameIterator(const std::string &database) | ||
4072 | 84 | { | ||
4073 | 85 | return new InfoSchemaTableNameIterator(database); | ||
4074 | 86 | } | ||
4075 | 87 | |||
4076 | 88 | |||
4077 | 89 | }; | ||
4078 | 90 | |||
4079 | 91 | #endif /* DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_H */ | ||
4080 | 0 | 92 | ||
4081 | === added file 'plugin/info_schema_engine/open_tables.cc' | |||
4082 | --- plugin/info_schema_engine/open_tables.cc 1970-01-01 00:00:00 +0000 | |||
4083 | +++ plugin/info_schema_engine/open_tables.cc 2009-10-29 23:56:14 +0000 | |||
4084 | @@ -0,0 +1,72 @@ | |||
4085 | 1 | /* | ||
4086 | 2 | * Copyright (C) 2009 Sun Microsystems | ||
4087 | 3 | * | ||
4088 | 4 | * This program is free software; you can redistribute it and/or modify | ||
4089 | 5 | * it under the terms of the GNU General Public License as published by | ||
4090 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
4091 | 7 | * (at your option) any later version. | ||
4092 | 8 | * | ||
4093 | 9 | * This program is distributed in the hope that it will be useful, | ||
4094 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4095 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4096 | 12 | * GNU General Public License for more details. | ||
4097 | 13 | * | ||
4098 | 14 | * You should have received a copy of the GNU General Public License | ||
4099 | 15 | * along with this program; if not, write to the Free Software | ||
4100 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
4101 | 17 | */ | ||
4102 | 18 | |||
4103 | 19 | #include <drizzled/server_includes.h> | ||
4104 | 20 | #include "info_schema_cursor.h" | ||
4105 | 21 | #include "open_tables.h" | ||
4106 | 22 | |||
4107 | 23 | #include <string> | ||
4108 | 24 | #include <map> | ||
4109 | 25 | |||
4110 | 26 | using namespace std; | ||
4111 | 27 | using namespace drizzled; | ||
4112 | 28 | |||
4113 | 29 | InfoSchemaShare *OpenTables::getShare(const string &name) | ||
4114 | 30 | { | ||
4115 | 31 | map<const string, InfoSchemaShare *>::iterator it; | ||
4116 | 32 | pthread_mutex_lock(&mutex); | ||
4117 | 33 | |||
4118 | 34 | it= open_tables.find(name); | ||
4119 | 35 | if (it != open_tables.end()) | ||
4120 | 36 | { | ||
4121 | 37 | share= (*it).second; | ||
4122 | 38 | } | ||
4123 | 39 | else | ||
4124 | 40 | { | ||
4125 | 41 | share= NULL; | ||
4126 | 42 | } | ||
4127 | 43 | |||
4128 | 44 | if (! share) | ||
4129 | 45 | { | ||
4130 | 46 | share= new(std::nothrow) InfoSchemaShare(); | ||
4131 | 47 | if (! share) | ||
4132 | 48 | { | ||
4133 | 49 | pthread_mutex_unlock(&mutex); | ||
4134 | 50 | return NULL; | ||
4135 | 51 | } | ||
4136 | 52 | /* get the I_S table */ | ||
4137 | 53 | share->setInfoSchemaTable(name); | ||
4138 | 54 | open_tables[name]= share; | ||
4139 | 55 | share->initThreadLock(); | ||
4140 | 56 | } | ||
4141 | 57 | share->incUseCount(); | ||
4142 | 58 | pthread_mutex_unlock(&mutex); | ||
4143 | 59 | |||
4144 | 60 | return share; | ||
4145 | 61 | } | ||
4146 | 62 | |||
4147 | 63 | void OpenTables::freeShare() | ||
4148 | 64 | { | ||
4149 | 65 | pthread_mutex_lock(&mutex); | ||
4150 | 66 | share->decUseCount(); | ||
4151 | 67 | if (share->getUseCount() == 0) | ||
4152 | 68 | { | ||
4153 | 69 | open_tables.erase(share->getName()); | ||
4154 | 70 | } | ||
4155 | 71 | pthread_mutex_unlock(&mutex); | ||
4156 | 72 | } | ||
4157 | 0 | 73 | ||
4158 | === added file 'plugin/info_schema_engine/open_tables.h' | |||
4159 | --- plugin/info_schema_engine/open_tables.h 1970-01-01 00:00:00 +0000 | |||
4160 | +++ plugin/info_schema_engine/open_tables.h 2009-10-29 23:56:14 +0000 | |||
4161 | @@ -0,0 +1,77 @@ | |||
4162 | 1 | /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- | ||
4163 | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | ||
4164 | 3 | * | ||
4165 | 4 | * Copyright (C) 2009 Sun Microsystems | ||
4166 | 5 | * | ||
4167 | 6 | * This program is free software; you can redistribute it and/or modify | ||
4168 | 7 | * it under the terms of the GNU General Public License as published by | ||
4169 | 8 | * the Free Software Foundation; version 2 of the License. | ||
4170 | 9 | * | ||
4171 | 10 | * This program is distributed in the hope that it will be useful, | ||
4172 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4173 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4174 | 13 | * GNU General Public License for more details. | ||
4175 | 14 | * | ||
4176 | 15 | * You should have received a copy of the GNU General Public License | ||
4177 | 16 | * along with this program; if not, write to the Free Software | ||
4178 | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
4179 | 18 | */ | ||
4180 | 19 | |||
4181 | 20 | #ifndef DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_OPEN_TABLES_H | ||
4182 | 21 | #define DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_OPEN_TABLES_H | ||
4183 | 22 | |||
4184 | 23 | #include "info_schema_cursor.h" | ||
4185 | 24 | |||
4186 | 25 | #include <string> | ||
4187 | 26 | #include <vector> | ||
4188 | 27 | #include <map> | ||
4189 | 28 | |||
4190 | 29 | /** | ||
4191 | 30 | * @class OpenTables | ||
4192 | 31 | * | ||
4193 | 32 | * Class which tracks all the open tables for the I_S storage engine. | ||
4194 | 33 | * Encapsulating this functionality in a class will make it easier for us to | ||
4195 | 34 | * change things such as whether a std::map or HASH is used to lookup the | ||
4196 | 35 | * open tables. | ||
4197 | 36 | */ | ||
4198 | 37 | class OpenTables | ||
4199 | 38 | { | ||
4200 | 39 | public: | ||
4201 | 40 | |||
4202 | 41 | static OpenTables &singleton() | ||
4203 | 42 | { | ||
4204 | 43 | static OpenTables open_tabs; | ||
4205 | 44 | return open_tabs; | ||
4206 | 45 | } | ||
4207 | 46 | |||
4208 | 47 | InfoSchemaShare *getShare(const std::string &name); | ||
4209 | 48 | |||
4210 | 49 | void freeShare(); | ||
4211 | 50 | |||
4212 | 51 | private: | ||
4213 | 52 | |||
4214 | 53 | pthread_mutex_t mutex; | ||
4215 | 54 | |||
4216 | 55 | std::map<const std::string, InfoSchemaShare *> | ||
4217 | 56 | open_tables; | ||
4218 | 57 | |||
4219 | 58 | InfoSchemaShare *share; | ||
4220 | 59 | |||
4221 | 60 | OpenTables() | ||
4222 | 61 | : | ||
4223 | 62 | mutex(), | ||
4224 | 63 | open_tables(), | ||
4225 | 64 | share(NULL) | ||
4226 | 65 | { | ||
4227 | 66 | pthread_mutex_init(&mutex, MY_MUTEX_INIT_FAST); | ||
4228 | 67 | } | ||
4229 | 68 | |||
4230 | 69 | ~OpenTables() | ||
4231 | 70 | { | ||
4232 | 71 | pthread_mutex_destroy(&mutex); | ||
4233 | 72 | } | ||
4234 | 73 | |||
4235 | 74 | OpenTables(const OpenTables&); | ||
4236 | 75 | }; | ||
4237 | 76 | |||
4238 | 77 | #endif /* DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_OPEN_TABLES_H */ | ||
4239 | 0 | 78 | ||
4240 | === added file 'plugin/info_schema_engine/plugin.ini' | |||
4241 | --- plugin/info_schema_engine/plugin.ini 1970-01-01 00:00:00 +0000 | |||
4242 | +++ plugin/info_schema_engine/plugin.ini 2009-10-29 23:56:17 +0000 | |||
4243 | @@ -0,0 +1,9 @@ | |||
4244 | 1 | [plugin] | ||
4245 | 2 | name=info_schema_engine | ||
4246 | 3 | title=INFORMATION_SCHEMA Storage Engine | ||
4247 | 4 | description=Engine for INFORMATION_SCHEMA tables | ||
4248 | 5 | sources=info_schema_engine.cc info_schema_cursor.cc open_tables.cc | ||
4249 | 6 | table_name_iterator.cc | ||
4250 | 7 | headers=info_schema_engine.h info_schema_cursor.h open_tables.h | ||
4251 | 8 | table_name_iterator.h | ||
4252 | 9 | load_by_default= yes | ||
4253 | 0 | 10 | ||
4254 | === added file 'plugin/info_schema_engine/table_name_iterator.cc' | |||
4255 | --- plugin/info_schema_engine/table_name_iterator.cc 1970-01-01 00:00:00 +0000 | |||
4256 | +++ plugin/info_schema_engine/table_name_iterator.cc 2009-10-29 23:56:17 +0000 | |||
4257 | @@ -0,0 +1,53 @@ | |||
4258 | 1 | /* | ||
4259 | 2 | * Copyright (C) 2009 Sun Microsystems | ||
4260 | 3 | * | ||
4261 | 4 | * This program is free software; you can redistribute it and/or modify | ||
4262 | 5 | * it under the terms of the GNU General Public License as published by | ||
4263 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
4264 | 7 | * (at your option) any later version. | ||
4265 | 8 | * | ||
4266 | 9 | * This program is distributed in the hope that it will be useful, | ||
4267 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4268 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4269 | 12 | * GNU General Public License for more details. | ||
4270 | 13 | * | ||
4271 | 14 | * You should have received a copy of the GNU General Public License | ||
4272 | 15 | * along with this program; if not, write to the Free Software | ||
4273 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
4274 | 17 | */ | ||
4275 | 18 | |||
4276 | 19 | #include <drizzled/server_includes.h> | ||
4277 | 20 | #include <drizzled/plugin/info_schema_table.h> | ||
4278 | 21 | #include <drizzled/plugin/storage_engine.h> | ||
4279 | 22 | #include "table_name_iterator.h" | ||
4280 | 23 | |||
4281 | 24 | #include <string> | ||
4282 | 25 | |||
4283 | 26 | using namespace std; | ||
4284 | 27 | using namespace drizzled; | ||
4285 | 28 | |||
4286 | 29 | int InfoSchemaTableNameIterator::next(string *name) | ||
4287 | 30 | { | ||
4288 | 31 | start: | ||
4289 | 32 | if (iter == all_schema_tables.end()) | ||
4290 | 33 | { | ||
4291 | 34 | return -1; | ||
4292 | 35 | } | ||
4293 | 36 | |||
4294 | 37 | plugin::InfoSchemaTable *table= *iter; | ||
4295 | 38 | |||
4296 | 39 | if (table->isHidden()) | ||
4297 | 40 | { | ||
4298 | 41 | ++iter; | ||
4299 | 42 | goto start; | ||
4300 | 43 | } | ||
4301 | 44 | |||
4302 | 45 | if (name) | ||
4303 | 46 | { | ||
4304 | 47 | name->assign(table->getTableName()); | ||
4305 | 48 | } | ||
4306 | 49 | |||
4307 | 50 | ++iter; | ||
4308 | 51 | |||
4309 | 52 | return 0; | ||
4310 | 53 | } | ||
4311 | 0 | 54 | ||
4312 | === added file 'plugin/info_schema_engine/table_name_iterator.h' | |||
4313 | --- plugin/info_schema_engine/table_name_iterator.h 1970-01-01 00:00:00 +0000 | |||
4314 | +++ plugin/info_schema_engine/table_name_iterator.h 2009-10-29 23:56:17 +0000 | |||
4315 | @@ -0,0 +1,61 @@ | |||
4316 | 1 | /* | ||
4317 | 2 | * Copyright (C) 2009 Sun Microsystems | ||
4318 | 3 | * | ||
4319 | 4 | * This program is free software; you can redistribute it and/or modify | ||
4320 | 5 | * it under the terms of the GNU General Public License as published by | ||
4321 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
4322 | 7 | * (at your option) any later version. | ||
4323 | 8 | * | ||
4324 | 9 | * This program is distributed in the hope that it will be useful, | ||
4325 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4326 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4327 | 12 | * GNU General Public License for more details. | ||
4328 | 13 | * | ||
4329 | 14 | * You should have received a copy of the GNU General Public License | ||
4330 | 15 | * along with this program; if not, write to the Free Software | ||
4331 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
4332 | 17 | */ | ||
4333 | 18 | |||
4334 | 19 | #ifndef DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_TABLE_NAME_ITERATOR_H | ||
4335 | 20 | #define DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_TABLE_NAME_ITERATOR_H | ||
4336 | 21 | |||
4337 | 22 | #include <drizzled/plugin/info_schema_table.h> | ||
4338 | 23 | #include <drizzled/plugin/storage_engine.h> | ||
4339 | 24 | |||
4340 | 25 | #include <vector> | ||
4341 | 26 | #include <string> | ||
4342 | 27 | |||
4343 | 28 | class InfoSchemaTableNameIterator : public drizzled::plugin::TableNameIteratorImplementation | ||
4344 | 29 | { | ||
4345 | 30 | public: | ||
4346 | 31 | |||
4347 | 32 | InfoSchemaTableNameIterator(const std::string &database) | ||
4348 | 33 | : | ||
4349 | 34 | drizzled::plugin::TableNameIteratorImplementation(database) | ||
4350 | 35 | { | ||
4351 | 36 | /* | ||
4352 | 37 | * If the database passed to the constructor is not the I_S database | ||
4353 | 38 | * then we set the iterator to the end of the vector of schema tables to | ||
4354 | 39 | * ensure that the next() method will not return any tables. | ||
4355 | 40 | */ | ||
4356 | 41 | if (database.compare(INFORMATION_SCHEMA_NAME) == 0) | ||
4357 | 42 | { | ||
4358 | 43 | iter= drizzled::all_schema_tables.begin(); | ||
4359 | 44 | } | ||
4360 | 45 | else | ||
4361 | 46 | { | ||
4362 | 47 | iter= drizzled::all_schema_tables.end(); | ||
4363 | 48 | } | ||
4364 | 49 | } | ||
4365 | 50 | |||
4366 | 51 | ~InfoSchemaTableNameIterator() {} | ||
4367 | 52 | |||
4368 | 53 | int next(std::string *name); | ||
4369 | 54 | |||
4370 | 55 | private: | ||
4371 | 56 | |||
4372 | 57 | std::vector<drizzled::plugin::InfoSchemaTable *>::iterator iter; | ||
4373 | 58 | |||
4374 | 59 | }; | ||
4375 | 60 | |||
4376 | 61 | #endif /* DRIZZLE_PLUGIN_INFO_SCHEMA_ENGINE_TABLE_NAME_ITERATOR_H */ | ||
4377 | 0 | 62 | ||
4378 | === modified file 'plugin/innobase/handler/ha_innodb.cc' | |||
4379 | --- plugin/innobase/handler/ha_innodb.cc 2009-10-16 10:27:33 +0000 | |||
4380 | +++ plugin/innobase/handler/ha_innodb.cc 2009-10-29 23:56:17 +0000 | |||
4381 | @@ -376,7 +376,7 @@ | |||
4382 | 376 | UNIV_INTERN int renameTableImplementation(Session* session, | 376 | UNIV_INTERN int renameTableImplementation(Session* session, |
4383 | 377 | const char* from, | 377 | const char* from, |
4384 | 378 | const char* to); | 378 | const char* to); |
4386 | 379 | UNIV_INTERN int deleteTableImplementation(Session* session, const string table_path); | 379 | UNIV_INTERN int deleteTableImplementation(Session* session, const string &table_path); |
4387 | 380 | }; | 380 | }; |
4388 | 381 | 381 | ||
4389 | 382 | /** @brief Initialize the default value of innodb_commit_concurrency. | 382 | /** @brief Initialize the default value of innodb_commit_concurrency. |
4390 | @@ -5959,7 +5959,7 @@ | |||
4391 | 5959 | InnobaseEngine::deleteTableImplementation( | 5959 | InnobaseEngine::deleteTableImplementation( |
4392 | 5960 | /*======================*/ | 5960 | /*======================*/ |
4393 | 5961 | Session *session, | 5961 | Session *session, |
4395 | 5962 | const string table_path) /* in: table name */ | 5962 | const string &table_path) /* in: table name */ |
4396 | 5963 | { | 5963 | { |
4397 | 5964 | int error; | 5964 | int error; |
4398 | 5965 | trx_t* parent_trx; | 5965 | trx_t* parent_trx; |
4399 | 5966 | 5966 | ||
4400 | === modified file 'plugin/innobase/handler/i_s.cc' | |||
4401 | --- plugin/innobase/handler/i_s.cc 2009-10-13 16:18:59 +0000 | |||
4402 | +++ plugin/innobase/handler/i_s.cc 2009-10-29 23:56:17 +0000 | |||
4403 | @@ -112,7 +112,6 @@ | |||
4404 | 112 | */ | 112 | */ |
4405 | 113 | 113 | ||
4406 | 114 | /* XXX these are defined in mysql_priv.h inside #ifdef DRIZZLE_SERVER */ | 114 | /* XXX these are defined in mysql_priv.h inside #ifdef DRIZZLE_SERVER */ |
4407 | 115 | bool schema_table_store_record(Session *session, Table *table); | ||
4408 | 116 | void localtime_to_TIME(DRIZZLE_TIME *to, struct tm *from); | 115 | void localtime_to_TIME(DRIZZLE_TIME *to, struct tm *from); |
4409 | 117 | 116 | ||
4410 | 118 | /*******************************************************************//** | 117 | /*******************************************************************//** |
4411 | @@ -205,8 +204,7 @@ | |||
4412 | 205 | DRIZZLE_TYPE_VARCHAR, | 204 | DRIZZLE_TYPE_VARCHAR, |
4413 | 206 | 0, | 205 | 0, |
4414 | 207 | 0, | 206 | 0, |
4417 | 208 | "", | 207 | ""), |
4416 | 209 | SKIP_OPEN_TABLE), | ||
4418 | 210 | 208 | ||
4419 | 211 | #define IDX_TRX_STATE 1 | 209 | #define IDX_TRX_STATE 1 |
4420 | 212 | drizzled::plugin::ColumnInfo("trx_state", | 210 | drizzled::plugin::ColumnInfo("trx_state", |
4421 | @@ -214,8 +212,7 @@ | |||
4422 | 214 | DRIZZLE_TYPE_VARCHAR, | 212 | DRIZZLE_TYPE_VARCHAR, |
4423 | 215 | 0, | 213 | 0, |
4424 | 216 | 0, | 214 | 0, |
4427 | 217 | "", | 215 | ""), |
4426 | 218 | SKIP_OPEN_TABLE), | ||
4428 | 219 | 216 | ||
4429 | 220 | #define IDX_TRX_STARTED 2 | 217 | #define IDX_TRX_STARTED 2 |
4430 | 221 | drizzled::plugin::ColumnInfo("trx_started", | 218 | drizzled::plugin::ColumnInfo("trx_started", |
4431 | @@ -223,8 +220,7 @@ | |||
4432 | 223 | DRIZZLE_TYPE_DATETIME, | 220 | DRIZZLE_TYPE_DATETIME, |
4433 | 224 | 0, | 221 | 0, |
4434 | 225 | 0, | 222 | 0, |
4437 | 226 | "", | 223 | ""), |
4436 | 227 | SKIP_OPEN_TABLE), | ||
4438 | 228 | 224 | ||
4439 | 229 | #define IDX_TRX_REQUESTED_LOCK_ID 3 | 225 | #define IDX_TRX_REQUESTED_LOCK_ID 3 |
4440 | 230 | drizzled::plugin::ColumnInfo("trx_requested_lock_id", | 226 | drizzled::plugin::ColumnInfo("trx_requested_lock_id", |
4441 | @@ -232,8 +228,7 @@ | |||
4442 | 232 | DRIZZLE_TYPE_VARCHAR, | 228 | DRIZZLE_TYPE_VARCHAR, |
4443 | 233 | 0, | 229 | 0, |
4444 | 234 | MY_I_S_MAYBE_NULL, | 230 | MY_I_S_MAYBE_NULL, |
4447 | 235 | "", | 231 | ""), |
4446 | 236 | SKIP_OPEN_TABLE), | ||
4448 | 237 | 232 | ||
4449 | 238 | #define IDX_TRX_WAIT_STARTED 4 | 233 | #define IDX_TRX_WAIT_STARTED 4 |
4450 | 239 | drizzled::plugin::ColumnInfo("trx_wait_started", | 234 | drizzled::plugin::ColumnInfo("trx_wait_started", |
4451 | @@ -241,8 +236,7 @@ | |||
4452 | 241 | DRIZZLE_TYPE_DATETIME, | 236 | DRIZZLE_TYPE_DATETIME, |
4453 | 242 | 0, | 237 | 0, |
4454 | 243 | MY_I_S_MAYBE_NULL, | 238 | MY_I_S_MAYBE_NULL, |
4457 | 244 | "", | 239 | ""), |
4456 | 245 | SKIP_OPEN_TABLE), | ||
4458 | 246 | 240 | ||
4459 | 247 | #define IDX_TRX_WEIGHT 5 | 241 | #define IDX_TRX_WEIGHT 5 |
4460 | 248 | drizzled::plugin::ColumnInfo("trx_weight", | 242 | drizzled::plugin::ColumnInfo("trx_weight", |
4461 | @@ -250,8 +244,7 @@ | |||
4462 | 250 | DRIZZLE_TYPE_LONGLONG, | 244 | DRIZZLE_TYPE_LONGLONG, |
4463 | 251 | 0, | 245 | 0, |
4464 | 252 | MY_I_S_UNSIGNED, | 246 | MY_I_S_UNSIGNED, |
4467 | 253 | "", | 247 | ""), |
4466 | 254 | SKIP_OPEN_TABLE), | ||
4468 | 255 | 248 | ||
4469 | 256 | #define IDX_TRX_DRIZZLE_THREAD_ID 6 | 249 | #define IDX_TRX_DRIZZLE_THREAD_ID 6 |
4470 | 257 | drizzled::plugin::ColumnInfo("trx_mysql_thread_id", | 250 | drizzled::plugin::ColumnInfo("trx_mysql_thread_id", |
4471 | @@ -259,8 +252,7 @@ | |||
4472 | 259 | DRIZZLE_TYPE_LONGLONG, | 252 | DRIZZLE_TYPE_LONGLONG, |
4473 | 260 | 0, | 253 | 0, |
4474 | 261 | MY_I_S_UNSIGNED, | 254 | MY_I_S_UNSIGNED, |
4477 | 262 | "", | 255 | ""), |
4476 | 263 | SKIP_OPEN_TABLE), | ||
4478 | 264 | 256 | ||
4479 | 265 | #define IDX_TRX_QUERY 7 | 257 | #define IDX_TRX_QUERY 7 |
4480 | 266 | drizzled::plugin::ColumnInfo("trx_query", | 258 | drizzled::plugin::ColumnInfo("trx_query", |
4481 | @@ -268,8 +260,7 @@ | |||
4482 | 268 | DRIZZLE_TYPE_VARCHAR, | 260 | DRIZZLE_TYPE_VARCHAR, |
4483 | 269 | 0, | 261 | 0, |
4484 | 270 | MY_I_S_MAYBE_NULL, | 262 | MY_I_S_MAYBE_NULL, |
4487 | 271 | "", | 263 | ""), |
4486 | 272 | SKIP_OPEN_TABLE), | ||
4488 | 273 | 264 | ||
4489 | 274 | drizzled::plugin::ColumnInfo() | 265 | drizzled::plugin::ColumnInfo() |
4490 | 275 | }; | 266 | }; |
4491 | @@ -283,8 +274,6 @@ | |||
4492 | 283 | fill_innodb_trx_from_cache( | 274 | fill_innodb_trx_from_cache( |
4493 | 284 | /*=======================*/ | 275 | /*=======================*/ |
4494 | 285 | trx_i_s_cache_t* cache, /*!< in: cache to read from */ | 276 | trx_i_s_cache_t* cache, /*!< in: cache to read from */ |
4495 | 286 | Session* session,/*!< in: used to call | ||
4496 | 287 | schema_table_store_record() */ | ||
4497 | 288 | Table* table) /*!< in/out: fill this table */ | 277 | Table* table) /*!< in/out: fill this table */ |
4498 | 289 | { | 278 | { |
4499 | 290 | Field** fields; | 279 | Field** fields; |
4500 | @@ -351,7 +340,9 @@ | |||
4501 | 351 | OK(field_store_string(fields[IDX_TRX_QUERY], | 340 | OK(field_store_string(fields[IDX_TRX_QUERY], |
4502 | 352 | row->trx_query)); | 341 | row->trx_query)); |
4503 | 353 | 342 | ||
4505 | 354 | OK(schema_table_store_record(session, table)); | 343 | TableList *tmp_list= table->pos_in_table_list; |
4506 | 344 | tmp_list->schema_table->addRow(table->record[0], | ||
4507 | 345 | table->s->reclength); | ||
4508 | 355 | } | 346 | } |
4509 | 356 | 347 | ||
4510 | 357 | return(0); | 348 | return(0); |
4511 | @@ -383,8 +374,7 @@ | |||
4512 | 383 | DRIZZLE_TYPE_VARCHAR, | 374 | DRIZZLE_TYPE_VARCHAR, |
4513 | 384 | 0, | 375 | 0, |
4514 | 385 | 0, | 376 | 0, |
4517 | 386 | "", | 377 | ""), |
4516 | 387 | SKIP_OPEN_TABLE), | ||
4518 | 388 | 378 | ||
4519 | 389 | #define IDX_LOCK_TRX_ID 1 | 379 | #define IDX_LOCK_TRX_ID 1 |
4520 | 390 | drizzled::plugin::ColumnInfo("lock_trx_id", | 380 | drizzled::plugin::ColumnInfo("lock_trx_id", |
4521 | @@ -392,8 +382,7 @@ | |||
4522 | 392 | DRIZZLE_TYPE_VARCHAR, | 382 | DRIZZLE_TYPE_VARCHAR, |
4523 | 393 | 0, | 383 | 0, |
4524 | 394 | 0, | 384 | 0, |
4527 | 395 | "", | 385 | ""), |
4526 | 396 | SKIP_OPEN_TABLE), | ||
4528 | 397 | 386 | ||
4529 | 398 | #define IDX_LOCK_MODE 2 | 387 | #define IDX_LOCK_MODE 2 |
4530 | 399 | drizzled::plugin::ColumnInfo("lock_mode", | 388 | drizzled::plugin::ColumnInfo("lock_mode", |
4531 | @@ -402,8 +391,7 @@ | |||
4532 | 402 | DRIZZLE_TYPE_VARCHAR, | 391 | DRIZZLE_TYPE_VARCHAR, |
4533 | 403 | 0, | 392 | 0, |
4534 | 404 | 0, | 393 | 0, |
4537 | 405 | "", | 394 | ""), |
4536 | 406 | SKIP_OPEN_TABLE), | ||
4538 | 407 | 395 | ||
4539 | 408 | #define IDX_LOCK_TYPE 3 | 396 | #define IDX_LOCK_TYPE 3 |
4540 | 409 | drizzled::plugin::ColumnInfo("lock_type", | 397 | drizzled::plugin::ColumnInfo("lock_type", |
4541 | @@ -411,8 +399,7 @@ | |||
4542 | 411 | DRIZZLE_TYPE_VARCHAR, | 399 | DRIZZLE_TYPE_VARCHAR, |
4543 | 412 | 0, | 400 | 0, |
4544 | 413 | 0, | 401 | 0, |
4547 | 414 | "", | 402 | ""), |
4546 | 415 | SKIP_OPEN_TABLE), | ||
4548 | 416 | 403 | ||
4549 | 417 | #define IDX_LOCK_TABLE 4 | 404 | #define IDX_LOCK_TABLE 4 |
4550 | 418 | drizzled::plugin::ColumnInfo("lock_table", | 405 | drizzled::plugin::ColumnInfo("lock_table", |
4551 | @@ -420,8 +407,7 @@ | |||
4552 | 420 | DRIZZLE_TYPE_VARCHAR, | 407 | DRIZZLE_TYPE_VARCHAR, |
4553 | 421 | 0, | 408 | 0, |
4554 | 422 | 0, | 409 | 0, |
4557 | 423 | "", | 410 | ""), |
4556 | 424 | SKIP_OPEN_TABLE), | ||
4558 | 425 | 411 | ||
4559 | 426 | #define IDX_LOCK_INDEX 5 | 412 | #define IDX_LOCK_INDEX 5 |
4560 | 427 | drizzled::plugin::ColumnInfo("lock_index", | 413 | drizzled::plugin::ColumnInfo("lock_index", |
4561 | @@ -429,8 +415,7 @@ | |||
4562 | 429 | DRIZZLE_TYPE_VARCHAR, | 415 | DRIZZLE_TYPE_VARCHAR, |
4563 | 430 | 0, | 416 | 0, |
4564 | 431 | MY_I_S_MAYBE_NULL, | 417 | MY_I_S_MAYBE_NULL, |
4567 | 432 | "", | 418 | ""), |
4566 | 433 | SKIP_OPEN_TABLE), | ||
4568 | 434 | 419 | ||
4569 | 435 | #define IDX_LOCK_SPACE 6 | 420 | #define IDX_LOCK_SPACE 6 |
4570 | 436 | drizzled::plugin::ColumnInfo("lock_space", | 421 | drizzled::plugin::ColumnInfo("lock_space", |
4571 | @@ -438,8 +423,7 @@ | |||
4572 | 438 | DRIZZLE_TYPE_LONGLONG, | 423 | DRIZZLE_TYPE_LONGLONG, |
4573 | 439 | 0, | 424 | 0, |
4574 | 440 | MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, | 425 | MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, |
4577 | 441 | "", | 426 | ""), |
4576 | 442 | SKIP_OPEN_TABLE), | ||
4578 | 443 | 427 | ||
4579 | 444 | #define IDX_LOCK_PAGE 7 | 428 | #define IDX_LOCK_PAGE 7 |
4580 | 445 | drizzled::plugin::ColumnInfo("lock_page", | 429 | drizzled::plugin::ColumnInfo("lock_page", |
4581 | @@ -447,8 +431,7 @@ | |||
4582 | 447 | DRIZZLE_TYPE_LONGLONG, | 431 | DRIZZLE_TYPE_LONGLONG, |
4583 | 448 | 0, | 432 | 0, |
4584 | 449 | MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, | 433 | MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, |
4587 | 450 | "", | 434 | ""), |
4586 | 451 | SKIP_OPEN_TABLE), | ||
4588 | 452 | 435 | ||
4589 | 453 | #define IDX_LOCK_REC 8 | 436 | #define IDX_LOCK_REC 8 |
4590 | 454 | drizzled::plugin::ColumnInfo("lock_rec", | 437 | drizzled::plugin::ColumnInfo("lock_rec", |
4591 | @@ -456,8 +439,7 @@ | |||
4592 | 456 | DRIZZLE_TYPE_LONGLONG, | 439 | DRIZZLE_TYPE_LONGLONG, |
4593 | 457 | 0, | 440 | 0, |
4594 | 458 | MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, | 441 | MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, |
4597 | 459 | "", | 442 | ""), |
4596 | 460 | SKIP_OPEN_TABLE), | ||
4598 | 461 | 443 | ||
4599 | 462 | #define IDX_LOCK_DATA 9 | 444 | #define IDX_LOCK_DATA 9 |
4600 | 463 | drizzled::plugin::ColumnInfo("lock_data", | 445 | drizzled::plugin::ColumnInfo("lock_data", |
4601 | @@ -465,8 +447,7 @@ | |||
4602 | 465 | DRIZZLE_TYPE_VARCHAR, | 447 | DRIZZLE_TYPE_VARCHAR, |
4603 | 466 | 0, | 448 | 0, |
4604 | 467 | MY_I_S_MAYBE_NULL, | 449 | MY_I_S_MAYBE_NULL, |
4607 | 468 | "", | 450 | ""), |
4606 | 469 | SKIP_OPEN_TABLE), | ||
4608 | 470 | 451 | ||
4609 | 471 | drizzled::plugin::ColumnInfo() | 452 | drizzled::plugin::ColumnInfo() |
4610 | 472 | }; | 453 | }; |
4611 | @@ -571,7 +552,9 @@ | |||
4612 | 571 | OK(field_store_string(fields[IDX_LOCK_DATA], | 552 | OK(field_store_string(fields[IDX_LOCK_DATA], |
4613 | 572 | row->lock_data)); | 553 | row->lock_data)); |
4614 | 573 | 554 | ||
4616 | 574 | OK(schema_table_store_record(session, table)); | 555 | TableList *tmp_list= table->pos_in_table_list; |
4617 | 556 | tmp_list->schema_table->addRow(table->record[0], | ||
4618 | 557 | table->s->reclength); | ||
4619 | 575 | } | 558 | } |
4620 | 576 | 559 | ||
4621 | 577 | return(0); | 560 | return(0); |
4622 | @@ -603,8 +586,7 @@ | |||
4623 | 603 | DRIZZLE_TYPE_VARCHAR, | 586 | DRIZZLE_TYPE_VARCHAR, |
4624 | 604 | 0, | 587 | 0, |
4625 | 605 | 0, | 588 | 0, |
4628 | 606 | "", | 589 | ""), |
4627 | 607 | SKIP_OPEN_TABLE), | ||
4629 | 608 | 590 | ||
4630 | 609 | #define IDX_REQUESTED_LOCK_ID 1 | 591 | #define IDX_REQUESTED_LOCK_ID 1 |
4631 | 610 | drizzled::plugin::ColumnInfo("requested_lock_id", | 592 | drizzled::plugin::ColumnInfo("requested_lock_id", |
4632 | @@ -612,8 +594,7 @@ | |||
4633 | 612 | DRIZZLE_TYPE_VARCHAR, | 594 | DRIZZLE_TYPE_VARCHAR, |
4634 | 613 | 0, | 595 | 0, |
4635 | 614 | 0, | 596 | 0, |
4638 | 615 | "", | 597 | ""), |
4637 | 616 | SKIP_OPEN_TABLE), | ||
4639 | 617 | 598 | ||
4640 | 618 | #define IDX_BLOCKING_TRX_ID 2 | 599 | #define IDX_BLOCKING_TRX_ID 2 |
4641 | 619 | drizzled::plugin::ColumnInfo("blocking_trx_id", | 600 | drizzled::plugin::ColumnInfo("blocking_trx_id", |
4642 | @@ -621,8 +602,7 @@ | |||
4643 | 621 | DRIZZLE_TYPE_VARCHAR, | 602 | DRIZZLE_TYPE_VARCHAR, |
4644 | 622 | 0, | 603 | 0, |
4645 | 623 | 0, | 604 | 0, |
4648 | 624 | "", | 605 | ""), |
4647 | 625 | SKIP_OPEN_TABLE), | ||
4649 | 626 | 606 | ||
4650 | 627 | #define IDX_BLOCKING_LOCK_ID 3 | 607 | #define IDX_BLOCKING_LOCK_ID 3 |
4651 | 628 | drizzled::plugin::ColumnInfo("blocking_lock_id", | 608 | drizzled::plugin::ColumnInfo("blocking_lock_id", |
4652 | @@ -630,8 +610,7 @@ | |||
4653 | 630 | DRIZZLE_TYPE_VARCHAR, | 610 | DRIZZLE_TYPE_VARCHAR, |
4654 | 631 | 0, | 611 | 0, |
4655 | 632 | 0, | 612 | 0, |
4658 | 633 | "", | 613 | ""), |
4657 | 634 | SKIP_OPEN_TABLE), | ||
4659 | 635 | 614 | ||
4660 | 636 | drizzled::plugin::ColumnInfo() | 615 | drizzled::plugin::ColumnInfo() |
4661 | 637 | }; | 616 | }; |
4662 | @@ -645,8 +624,6 @@ | |||
4663 | 645 | fill_innodb_lock_waits_from_cache( | 624 | fill_innodb_lock_waits_from_cache( |
4664 | 646 | /*==============================*/ | 625 | /*==============================*/ |
4665 | 647 | trx_i_s_cache_t* cache, /*!< in: cache to read from */ | 626 | trx_i_s_cache_t* cache, /*!< in: cache to read from */ |
4666 | 648 | Session* session,/*!< in: used to call | ||
4667 | 649 | schema_table_store_record() */ | ||
4668 | 650 | Table* table) /*!< in/out: fill this table */ | 627 | Table* table) /*!< in/out: fill this table */ |
4669 | 651 | { | 628 | { |
4670 | 652 | Field** fields; | 629 | Field** fields; |
4671 | @@ -699,7 +676,9 @@ | |||
4672 | 699 | blocking_lock_id, | 676 | blocking_lock_id, |
4673 | 700 | sizeof(blocking_lock_id)))); | 677 | sizeof(blocking_lock_id)))); |
4674 | 701 | 678 | ||
4676 | 702 | OK(schema_table_store_record(session, table)); | 679 | TableList *tmp_list= table->pos_in_table_list; |
4677 | 680 | tmp_list->schema_table->addRow(table->record[0], | ||
4678 | 681 | table->s->reclength); | ||
4679 | 703 | } | 682 | } |
4680 | 704 | 683 | ||
4681 | 705 | return(0); | 684 | return(0); |
4682 | @@ -734,8 +713,7 @@ | |||
4683 | 734 | TrxISMethods::fillTable( | 713 | TrxISMethods::fillTable( |
4684 | 735 | /*======================*/ | 714 | /*======================*/ |
4685 | 736 | Session* session,/*!< in: thread */ | 715 | Session* session,/*!< in: thread */ |
4688 | 737 | TableList* tables, /*!< in/out: tables to fill */ | 716 | TableList* tables) /*!< in/out: tables to fill */ |
4687 | 738 | COND* ) /*!< in: condition (not used) */ | ||
4689 | 739 | { | 717 | { |
4690 | 740 | const char* table_name; | 718 | const char* table_name; |
4691 | 741 | int ret; | 719 | int ret; |
4692 | @@ -771,7 +749,7 @@ | |||
4693 | 771 | if (innobase_strcasecmp(table_name, "innodb_trx") == 0) { | 749 | if (innobase_strcasecmp(table_name, "innodb_trx") == 0) { |
4694 | 772 | 750 | ||
4695 | 773 | if (fill_innodb_trx_from_cache( | 751 | if (fill_innodb_trx_from_cache( |
4697 | 774 | cache, session, tables->table) != 0) { | 752 | cache, tables->table) != 0) { |
4698 | 775 | 753 | ||
4699 | 776 | ret = 1; | 754 | ret = 1; |
4700 | 777 | } | 755 | } |
4701 | @@ -787,7 +765,7 @@ | |||
4702 | 787 | } else if (innobase_strcasecmp(table_name, "innodb_lock_waits") == 0) { | 765 | } else if (innobase_strcasecmp(table_name, "innodb_lock_waits") == 0) { |
4703 | 788 | 766 | ||
4704 | 789 | if (fill_innodb_lock_waits_from_cache( | 767 | if (fill_innodb_lock_waits_from_cache( |
4706 | 790 | cache, session, tables->table) != 0) { | 768 | cache, tables->table) != 0) { |
4707 | 791 | 769 | ||
4708 | 792 | ret = 1; | 770 | ret = 1; |
4709 | 793 | } | 771 | } |
4710 | @@ -826,48 +804,42 @@ | |||
4711 | 826 | DRIZZLE_TYPE_LONG, | 804 | DRIZZLE_TYPE_LONG, |
4712 | 827 | 0, | 805 | 0, |
4713 | 828 | 0, | 806 | 0, |
4716 | 829 | "Compressed Page Size", | 807 | "Compressed Page Size"), |
4715 | 830 | SKIP_OPEN_TABLE), | ||
4717 | 831 | 808 | ||
4718 | 832 | drizzled::plugin::ColumnInfo("compress_ops", | 809 | drizzled::plugin::ColumnInfo("compress_ops", |
4719 | 833 | MY_INT32_NUM_DECIMAL_DIGITS, | 810 | MY_INT32_NUM_DECIMAL_DIGITS, |
4720 | 834 | DRIZZLE_TYPE_LONG, | 811 | DRIZZLE_TYPE_LONG, |
4721 | 835 | 0, | 812 | 0, |
4722 | 836 | 0, | 813 | 0, |
4725 | 837 | "Total Number of Compressions", | 814 | "Total Number of Compressions"), |
4724 | 838 | SKIP_OPEN_TABLE), | ||
4726 | 839 | 815 | ||
4727 | 840 | drizzled::plugin::ColumnInfo("compress_ops_ok", | 816 | drizzled::plugin::ColumnInfo("compress_ops_ok", |
4728 | 841 | MY_INT32_NUM_DECIMAL_DIGITS, | 817 | MY_INT32_NUM_DECIMAL_DIGITS, |
4729 | 842 | DRIZZLE_TYPE_LONG, | 818 | DRIZZLE_TYPE_LONG, |
4730 | 843 | 0, | 819 | 0, |
4731 | 844 | 0, | 820 | 0, |
4734 | 845 | "Total Number of Successful Compressions", | 821 | "Total Number of Successful Compressions"), |
4733 | 846 | SKIP_OPEN_TABLE), | ||
4735 | 847 | 822 | ||
4736 | 848 | drizzled::plugin::ColumnInfo("compress_time", | 823 | drizzled::plugin::ColumnInfo("compress_time", |
4737 | 849 | MY_INT32_NUM_DECIMAL_DIGITS, | 824 | MY_INT32_NUM_DECIMAL_DIGITS, |
4738 | 850 | DRIZZLE_TYPE_LONG, | 825 | DRIZZLE_TYPE_LONG, |
4739 | 851 | 0, | 826 | 0, |
4740 | 852 | 0, | 827 | 0, |
4743 | 853 | "Total Duration of Compressions in Seconds", | 828 | "Total Duration of Compressions in Seconds"), |
4742 | 854 | SKIP_OPEN_TABLE), | ||
4744 | 855 | 829 | ||
4745 | 856 | drizzled::plugin::ColumnInfo("uncompress_ops", | 830 | drizzled::plugin::ColumnInfo("uncompress_ops", |
4746 | 857 | MY_INT32_NUM_DECIMAL_DIGITS, | 831 | MY_INT32_NUM_DECIMAL_DIGITS, |
4747 | 858 | DRIZZLE_TYPE_LONG, | 832 | DRIZZLE_TYPE_LONG, |
4748 | 859 | 0, | 833 | 0, |
4749 | 860 | 0, | 834 | 0, |
4752 | 861 | "Total Number of Decompressions", | 835 | "Total Number of Decompressions"), |
4751 | 862 | SKIP_OPEN_TABLE), | ||
4753 | 863 | 836 | ||
4754 | 864 | drizzled::plugin::ColumnInfo("uncompress_time", | 837 | drizzled::plugin::ColumnInfo("uncompress_time", |
4755 | 865 | MY_INT32_NUM_DECIMAL_DIGITS, | 838 | MY_INT32_NUM_DECIMAL_DIGITS, |
4756 | 866 | DRIZZLE_TYPE_LONG, | 839 | DRIZZLE_TYPE_LONG, |
4757 | 867 | 0, | 840 | 0, |
4758 | 868 | 0, | 841 | 0, |
4761 | 869 | "Total Duration of Decompressions in Seconds", | 842 | "Total Duration of Decompressions in Seconds"), |
4760 | 870 | SKIP_OPEN_TABLE), | ||
4762 | 871 | 843 | ||
4763 | 872 | drizzled::plugin::ColumnInfo() | 844 | drizzled::plugin::ColumnInfo() |
4764 | 873 | }; | 845 | }; |
4765 | @@ -883,7 +855,6 @@ | |||
4766 | 883 | /*=============*/ | 855 | /*=============*/ |
4767 | 884 | Session* session,/*!< in: thread */ | 856 | Session* session,/*!< in: thread */ |
4768 | 885 | TableList* tables, /*!< in/out: tables to fill */ | 857 | TableList* tables, /*!< in/out: tables to fill */ |
4769 | 886 | COND* , /*!< in: condition (ignored) */ | ||
4770 | 887 | ibool reset) /*!< in: TRUE=reset cumulated counts */ | 858 | ibool reset) /*!< in: TRUE=reset cumulated counts */ |
4771 | 888 | { | 859 | { |
4772 | 889 | Table* table = (Table *) tables->table; | 860 | Table* table = (Table *) tables->table; |
4773 | @@ -915,10 +886,9 @@ | |||
4774 | 915 | memset(zip_stat, 0, sizeof *zip_stat); | 886 | memset(zip_stat, 0, sizeof *zip_stat); |
4775 | 916 | } | 887 | } |
4776 | 917 | 888 | ||
4781 | 918 | if (schema_table_store_record(session, table)) { | 889 | TableList *tmp_list= table->pos_in_table_list; |
4782 | 919 | status = 1; | 890 | tmp_list->schema_table->addRow(table->record[0], |
4783 | 920 | break; | 891 | table->s->reclength); |
4780 | 921 | } | ||
4784 | 922 | } | 892 | } |
4785 | 923 | 893 | ||
4786 | 924 | return(status); | 894 | return(status); |
4787 | @@ -931,10 +901,9 @@ | |||
4788 | 931 | CmpISMethods::fillTable( | 901 | CmpISMethods::fillTable( |
4789 | 932 | /*=========*/ | 902 | /*=========*/ |
4790 | 933 | Session* session,/*!< in: thread */ | 903 | Session* session,/*!< in: thread */ |
4793 | 934 | TableList* tables, /*!< in/out: tables to fill */ | 904 | TableList* tables) /*!< in/out: tables to fill */ |
4792 | 935 | COND* cond) /*!< in: condition (ignored) */ | ||
4794 | 936 | { | 905 | { |
4796 | 937 | return(i_s_cmp_fill_low(session, tables, cond, FALSE)); | 906 | return(i_s_cmp_fill_low(session, tables, FALSE)); |
4797 | 938 | } | 907 | } |
4798 | 939 | 908 | ||
4799 | 940 | /*******************************************************************//** | 909 | /*******************************************************************//** |
4800 | @@ -944,10 +913,9 @@ | |||
4801 | 944 | CmpResetISMethods::fillTable( | 913 | CmpResetISMethods::fillTable( |
4802 | 945 | /*===============*/ | 914 | /*===============*/ |
4803 | 946 | Session* session,/*!< in: thread */ | 915 | Session* session,/*!< in: thread */ |
4806 | 947 | TableList* tables, /*!< in/out: tables to fill */ | 916 | TableList* tables) /*!< in/out: tables to fill */ |
4805 | 948 | COND* cond) /*!< in: condition (ignored) */ | ||
4807 | 949 | { | 917 | { |
4809 | 950 | return(i_s_cmp_fill_low(session, tables, cond, TRUE)); | 918 | return(i_s_cmp_fill_low(session, tables, TRUE)); |
4810 | 951 | } | 919 | } |
4811 | 952 | 920 | ||
4812 | 953 | /*******************************************************************//** | 921 | /*******************************************************************//** |
4813 | @@ -994,40 +962,35 @@ | |||
4814 | 994 | DRIZZLE_TYPE_LONG, | 962 | DRIZZLE_TYPE_LONG, |
4815 | 995 | 0, | 963 | 0, |
4816 | 996 | 0, | 964 | 0, |
4819 | 997 | "Buddy Block Size", | 965 | "Buddy Block Size"), |
4818 | 998 | SKIP_OPEN_TABLE), | ||
4820 | 999 | 966 | ||
4821 | 1000 | drizzled::plugin::ColumnInfo("pages_used", | 967 | drizzled::plugin::ColumnInfo("pages_used", |
4822 | 1001 | MY_INT32_NUM_DECIMAL_DIGITS, | 968 | MY_INT32_NUM_DECIMAL_DIGITS, |
4823 | 1002 | DRIZZLE_TYPE_LONG, | 969 | DRIZZLE_TYPE_LONG, |
4824 | 1003 | 0, | 970 | 0, |
4825 | 1004 | 0, | 971 | 0, |
4828 | 1005 | "Currently in Use", | 972 | "Currently in Use"), |
4827 | 1006 | SKIP_OPEN_TABLE), | ||
4829 | 1007 | 973 | ||
4830 | 1008 | drizzled::plugin::ColumnInfo("pages_free", | 974 | drizzled::plugin::ColumnInfo("pages_free", |
4831 | 1009 | MY_INT32_NUM_DECIMAL_DIGITS, | 975 | MY_INT32_NUM_DECIMAL_DIGITS, |
4832 | 1010 | DRIZZLE_TYPE_LONG, | 976 | DRIZZLE_TYPE_LONG, |
4833 | 1011 | 0, | 977 | 0, |
4834 | 1012 | 0, | 978 | 0, |
4837 | 1013 | "Currently Available", | 979 | "Currently Available"), |
4836 | 1014 | SKIP_OPEN_TABLE), | ||
4838 | 1015 | 980 | ||
4839 | 1016 | drizzled::plugin::ColumnInfo("relocation_ops", | 981 | drizzled::plugin::ColumnInfo("relocation_ops", |
4840 | 1017 | MY_INT64_NUM_DECIMAL_DIGITS, | 982 | MY_INT64_NUM_DECIMAL_DIGITS, |
4841 | 1018 | DRIZZLE_TYPE_LONGLONG, | 983 | DRIZZLE_TYPE_LONGLONG, |
4842 | 1019 | 0, | 984 | 0, |
4843 | 1020 | 0, | 985 | 0, |
4846 | 1021 | "Total Number of Relocations", | 986 | "Total Number of Relocations"), |
4845 | 1022 | SKIP_OPEN_TABLE), | ||
4847 | 1023 | 987 | ||
4848 | 1024 | drizzled::plugin::ColumnInfo("relocation_time", | 988 | drizzled::plugin::ColumnInfo("relocation_time", |
4849 | 1025 | MY_INT32_NUM_DECIMAL_DIGITS, | 989 | MY_INT32_NUM_DECIMAL_DIGITS, |
4850 | 1026 | DRIZZLE_TYPE_LONG, | 990 | DRIZZLE_TYPE_LONG, |
4851 | 1027 | 0, | 991 | 0, |
4852 | 1028 | 0, | 992 | 0, |
4855 | 1029 | "Total Duration of Relocations, in Seconds", | 993 | "Total Duration of Relocations, in Seconds"), |
4854 | 1030 | SKIP_OPEN_TABLE), | ||
4856 | 1031 | 994 | ||
4857 | 1032 | drizzled::plugin::ColumnInfo() | 995 | drizzled::plugin::ColumnInfo() |
4858 | 1033 | }; | 996 | }; |
4859 | @@ -1042,7 +1005,6 @@ | |||
4860 | 1042 | /*================*/ | 1005 | /*================*/ |
4861 | 1043 | Session* session,/*!< in: thread */ | 1006 | Session* session,/*!< in: thread */ |
4862 | 1044 | TableList* tables, /*!< in/out: tables to fill */ | 1007 | TableList* tables, /*!< in/out: tables to fill */ |
4863 | 1045 | COND* , /*!< in: condition (ignored) */ | ||
4864 | 1046 | ibool reset) /*!< in: TRUE=reset cumulated counts */ | 1008 | ibool reset) /*!< in: TRUE=reset cumulated counts */ |
4865 | 1047 | { | 1009 | { |
4866 | 1048 | Table* table = (Table *) tables->table; | 1010 | Table* table = (Table *) tables->table; |
4867 | @@ -1070,10 +1032,9 @@ | |||
4868 | 1070 | buddy_stat->relocated_usec = 0; | 1032 | buddy_stat->relocated_usec = 0; |
4869 | 1071 | } | 1033 | } |
4870 | 1072 | 1034 | ||
4875 | 1073 | if (schema_table_store_record(session, table)) { | 1035 | TableList *tmp_list= table->pos_in_table_list; |
4876 | 1074 | status = 1; | 1036 | tmp_list->schema_table->addRow(table->record[0], |
4877 | 1075 | break; | 1037 | table->s->reclength); |
4874 | 1076 | } | ||
4878 | 1077 | } | 1038 | } |
4879 | 1078 | 1039 | ||
4880 | 1079 | buf_pool_mutex_exit(); | 1040 | buf_pool_mutex_exit(); |
4881 | @@ -1087,10 +1048,9 @@ | |||
4882 | 1087 | CmpmemISMethods::fillTable( | 1048 | CmpmemISMethods::fillTable( |
4883 | 1088 | /*============*/ | 1049 | /*============*/ |
4884 | 1089 | Session* session,/*!< in: thread */ | 1050 | Session* session,/*!< in: thread */ |
4887 | 1090 | TableList* tables, /*!< in/out: tables to fill */ | 1051 | TableList* tables) /*!< in/out: tables to fill */ |
4886 | 1091 | COND* cond) /*!< in: condition (ignored) */ | ||
4888 | 1092 | { | 1052 | { |
4890 | 1093 | return(i_s_cmpmem_fill_low(session, tables, cond, FALSE)); | 1053 | return(i_s_cmpmem_fill_low(session, tables, FALSE)); |
4891 | 1094 | } | 1054 | } |
4892 | 1095 | 1055 | ||
4893 | 1096 | /*******************************************************************//** | 1056 | /*******************************************************************//** |
4894 | @@ -1100,10 +1060,9 @@ | |||
4895 | 1100 | CmpmemResetISMethods::fillTable( | 1060 | CmpmemResetISMethods::fillTable( |
4896 | 1101 | /*==================*/ | 1061 | /*==================*/ |
4897 | 1102 | Session* session,/*!< in: thread */ | 1062 | Session* session,/*!< in: thread */ |
4900 | 1103 | TableList* tables, /*!< in/out: tables to fill */ | 1063 | TableList* tables) /*!< in/out: tables to fill */ |
4899 | 1104 | COND* cond) /*!< in: condition (ignored) */ | ||
4901 | 1105 | { | 1064 | { |
4903 | 1106 | return(i_s_cmpmem_fill_low(session, tables, cond, TRUE)); | 1065 | return(i_s_cmpmem_fill_low(session, tables, TRUE)); |
4904 | 1107 | } | 1066 | } |
4905 | 1108 | 1067 | ||
4906 | 1109 | /*******************************************************************//** | 1068 | /*******************************************************************//** |
4907 | 1110 | 1069 | ||
4908 | === modified file 'plugin/innobase/handler/i_s.h' | |||
4909 | --- plugin/innobase/handler/i_s.h 2009-10-13 06:36:19 +0000 | |||
4910 | +++ plugin/innobase/handler/i_s.h 2009-10-29 23:56:17 +0000 | |||
4911 | @@ -30,48 +30,42 @@ | |||
4912 | 30 | { | 30 | { |
4913 | 31 | public: | 31 | public: |
4914 | 32 | virtual int fillTable(Session *session, | 32 | virtual int fillTable(Session *session, |
4917 | 33 | TableList *tables, | 33 | TableList *tables); |
4916 | 34 | COND *cond); | ||
4918 | 35 | }; | 34 | }; |
4919 | 36 | 35 | ||
4920 | 37 | class LocksISMethods : public drizzled::plugin::InfoSchemaMethods | 36 | class LocksISMethods : public drizzled::plugin::InfoSchemaMethods |
4921 | 38 | { | 37 | { |
4922 | 39 | public: | 38 | public: |
4923 | 40 | virtual int fillTable(Session *session, | 39 | virtual int fillTable(Session *session, |
4926 | 41 | TableList *tables, | 40 | TableList *tables); |
4925 | 42 | COND *cond); | ||
4927 | 43 | }; | 41 | }; |
4928 | 44 | 42 | ||
4929 | 45 | class CmpISMethods : public drizzled::plugin::InfoSchemaMethods | 43 | class CmpISMethods : public drizzled::plugin::InfoSchemaMethods |
4930 | 46 | { | 44 | { |
4931 | 47 | public: | 45 | public: |
4932 | 48 | virtual int fillTable(Session *session, | 46 | virtual int fillTable(Session *session, |
4935 | 49 | TableList *tables, | 47 | TableList *tables); |
4934 | 50 | COND *cond); | ||
4936 | 51 | }; | 48 | }; |
4937 | 52 | 49 | ||
4938 | 53 | class CmpResetISMethods : public drizzled::plugin::InfoSchemaMethods | 50 | class CmpResetISMethods : public drizzled::plugin::InfoSchemaMethods |
4939 | 54 | { | 51 | { |
4940 | 55 | public: | 52 | public: |
4941 | 56 | virtual int fillTable(Session *session, | 53 | virtual int fillTable(Session *session, |
4944 | 57 | TableList *tables, | 54 | TableList *tables); |
4943 | 58 | COND *cond); | ||
4945 | 59 | }; | 55 | }; |
4946 | 60 | 56 | ||
4947 | 61 | class CmpmemISMethods : public drizzled::plugin::InfoSchemaMethods | 57 | class CmpmemISMethods : public drizzled::plugin::InfoSchemaMethods |
4948 | 62 | { | 58 | { |
4949 | 63 | public: | 59 | public: |
4950 | 64 | virtual int fillTable(Session *session, | 60 | virtual int fillTable(Session *session, |
4953 | 65 | TableList *tables, | 61 | TableList *tables); |
4952 | 66 | COND *cond); | ||
4954 | 67 | }; | 62 | }; |
4955 | 68 | 63 | ||
4956 | 69 | class CmpmemResetISMethods : public drizzled::plugin::InfoSchemaMethods | 64 | class CmpmemResetISMethods : public drizzled::plugin::InfoSchemaMethods |
4957 | 70 | { | 65 | { |
4958 | 71 | public: | 66 | public: |
4959 | 72 | virtual int fillTable(Session *session, | 67 | virtual int fillTable(Session *session, |
4962 | 73 | TableList *tables, | 68 | TableList *tables); |
4961 | 74 | COND *cond); | ||
4963 | 75 | }; | 69 | }; |
4964 | 76 | 70 | ||
4965 | 77 | int i_s_common_deinit(drizzled::plugin::Registry ®istry); | 71 | int i_s_common_deinit(drizzled::plugin::Registry ®istry); |
4966 | 78 | 72 | ||
4967 | === modified file 'plugin/memcached_stats/analysis_table.cc' | |||
4968 | --- plugin/memcached_stats/analysis_table.cc 2009-10-03 17:20:06 +0000 | |||
4969 | +++ plugin/memcached_stats/analysis_table.cc 2009-10-29 23:56:17 +0000 | |||
4970 | @@ -42,9 +42,8 @@ | |||
4971 | 42 | using namespace std; | 42 | using namespace std; |
4972 | 43 | using namespace drizzled; | 43 | using namespace drizzled; |
4973 | 44 | 44 | ||
4977 | 45 | int MemcachedAnalysisISMethods::fillTable(Session *session, | 45 | int MemcachedAnalysisISMethods::fillTable(Session *, |
4978 | 46 | TableList *tables, | 46 | TableList *tables) |
4976 | 47 | COND *) | ||
4979 | 48 | { | 47 | { |
4980 | 49 | const CHARSET_INFO * const scs= system_charset_info; | 48 | const CHARSET_INFO * const scs= system_charset_info; |
4981 | 50 | Table *table= tables->table; | 49 | Table *table= tables->table; |
4982 | @@ -88,10 +87,8 @@ | |||
4983 | 88 | table->field[8]->store(report->pool_hit_ratio); | 87 | table->field[8]->store(report->pool_hit_ratio); |
4984 | 89 | 88 | ||
4985 | 90 | /* store the actual record now */ | 89 | /* store the actual record now */ |
4990 | 91 | if (schema_table_store_record(session, table)) | 90 | TableList *tmp_list= table->pos_in_table_list; |
4991 | 92 | { | 91 | tmp_list->schema_table->addRow(table->record[0], table->s->reclength); |
4988 | 93 | return 1; | ||
4989 | 94 | } | ||
4992 | 95 | free(report); | 92 | free(report); |
4993 | 96 | } | 93 | } |
4994 | 97 | 94 | ||
4995 | @@ -110,8 +107,7 @@ | |||
4996 | 110 | DRIZZLE_TYPE_LONGLONG, | 107 | DRIZZLE_TYPE_LONGLONG, |
4997 | 111 | 0, | 108 | 0, |
4998 | 112 | 0, | 109 | 0, |
4999 | 113 | "Num of Servers Analyzed", | ||
5000 | 114 | SKIP_OPEN_TABLE); |
I'm looking to get some help with my I_S engine if anyone has some time. I'm proposing it for merging so that its easier for people to see the changes I have made. I'm still trying to keep looking at this when I get some spare time so I'm still working on it, just not as much as I would like to be.
I'm pretty close (I believe) to having a working I_S engine. The main issue I'm having right now is with the COLUMN_DEFAULT column in the COLUMNS table. It is throwing warnings whenever I do a select on the COLUMNS table.
But besides that, it would be nice to get some input on what I have done so far. I feel like it would be good to get some input on this engine as its a large patch and it would be nice to know whether people think I am going in the right direction or not. I want to make sure I am not going off on a tangent or anything!
-Padraig