118
118
return (*str != '\0');
122
bool drizzled_show_create(Session *session, TableList *table_list, bool is_if_not_exists)
125
String buffer(buff, sizeof(buff), system_charset_info);
127
/* Only one table for now, but VIEW can involve several tables */
128
if (session->openTables(table_list))
130
if (session->is_error())
134
Clear all messages with 'error' level status and
135
issue a warning with 'warning' level status in
136
case of invalid view and last error is ER_VIEW_INVALID
138
drizzle_reset_errors(session, true);
139
session->clear_error();
144
if (store_create_info(table_list, &buffer, is_if_not_exists))
147
List<Item> field_list;
149
field_list.push_back(new Item_empty_string("Table",NAME_CHAR_LEN));
150
// 1024 is for not to confuse old clients
151
field_list.push_back(new Item_empty_string("Create Table",
152
max(buffer.length(),(size_t)1024)));
155
if (session->client->sendFields(&field_list))
158
session->client->store(table_list->table->getAlias());
161
session->client->store(buffer.ptr(), buffer.length());
163
if (session->client->flush())
171
122
Get a CREATE statement for a given database.