summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-08-21 21:14:02 +0200
committerunknown <serg@serg.mylan>2003-08-21 21:14:02 +0200
commitb8de463ea17289747fe940ba048707498336f951 (patch)
tree5cd64e9c7d6eedceacee72ad2dda9353492e6cec
parent8b2bc4362c048511a6538996f3d7cea4638cc3a0 (diff)
downloadmariadb-git-b8de463ea17289747fe940ba048707498336f951.tar.gz
Bug #1064: SHOW CREATE TABLE: avoid allocations for simple tables, old client compatibility
sql/item.h: fixups sql/sql_show.cc: avoid allocations for simple tables old client compatibility
-rw-r--r--sql/item.h1
-rw-r--r--sql/sql_show.cc6
2 files changed, 5 insertions, 2 deletions
diff --git a/sql/item.h b/sql/item.h
index 3cf5a17805c..d9d125b8bd4 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -275,6 +275,7 @@ class Item_empty_string :public Item_string
public:
Item_empty_string(const char *header,uint length) :Item_string("",0)
{ name=(char*) header; max_length=length;}
+ void make_field(Send_field *field);
};
class Item_varbinary :public Item
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 6acdb1cc72b..f2d6dd8e058 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -564,7 +564,8 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN(1);
}
- String packet;
+ char buff[1024];
+ String packet(buff,sizeof(buff));
packet.length(0);
net_store_data(&packet, table->table_name);
/*
@@ -597,7 +598,8 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
List<Item> field_list;
field_list.push_back(new Item_empty_string("Table",NAME_LEN));
- field_list.push_back(new Item_empty_string("Create Table",packet.length()));
+ field_list.push_back(new Item_empty_string("Create Table",
+ max(packet.length(),1024))); // 1024 is for not to confuse old clients
if (send_fields(thd,field_list,1))
DBUG_RETURN(1);