summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-10-04 23:20:16 +0300
committerunknown <monty@donna.mysql.com>2000-10-04 23:20:16 +0300
commitfc78fef7968a652d2bf96ac5ee6d5f35faf7fcd9 (patch)
treef355b0229e2ae229e8311da676b61658f1b0a052 /sql/sql_show.cc
parent63b7b45ff7f79a08a673e8b759a69f5ee7e67902 (diff)
downloadmariadb-git-fc78fef7968a652d2bf96ac5ee6d5f35faf7fcd9.tar.gz
Portability fixes
Docs/manual.texi: Updates in the links sections config.guess: Added fixes for Darwin config.sub: Added fixes for Darwin configure.in: Added fixes for Darwin extra/my_print_defaults.c: Fixed typo include/my_pthread.h: Added fixes for Darwin ltconfig: Portability fix myisam/mi_check.c: Make myisamchk more silent mysys/Makefile.am: Added mf_tempfile.c mysys/mf_cache.c: Remove not used parts mysys/mf_tempfile.c: Fix for Solaris sql/log.cc: Fix for Windows sql/sql_cache.cc: Fix for Darwin sql/sql_show.cc: Fix for temporary tables strings/strtol.c: Fix for Darwin support-files/mysql.spec.sh: Fix for documentation files that are installed compressed BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc55
1 files changed, 27 insertions, 28 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index ea6e09f6cb5..83a53467426 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -476,6 +476,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
table_list->real_name));
+ /* Only one table for now */
if (!(table = open_ltable(thd, table_list, TL_UNLOCK)))
{
send_error(&thd->net);
@@ -490,34 +491,32 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN(1);
String *packet = &thd->packet;
- for(;table; table = table->next)
- {
- packet->length(0);
- net_store_data(packet, table->table_name);
- // a hack - we need to reserve some space for the length before
- // we know what it is - let's assume that the length of create table
- // statement will fit into 3 bytes ( 16 MB max :-) )
- ulong store_len_offset = packet->length();
- packet->length(store_len_offset + 4);
- if(store_create_info(thd, table, packet))
- DBUG_RETURN(-1);
- ulong create_len = packet->length() - store_len_offset - 4;
- if(create_len > 0x00ffffff) // better readable in HEX ...
- DBUG_RETURN(1); // just in case somebody manages to create a table
- // with *that* much stuff in the definition
-
- // now we have to store the length in three bytes, even if it would fit
- // into fewer, so we cannot use net_store_data() anymore,
- // and do it ourselves
- char* p = (char*)packet->ptr() + store_len_offset;
- *p++ = (char) 253; // The client the length is stored using 3-bytes
- int3store(p, create_len);
-
- // now we are in business :-)
- if(my_net_write(&thd->net, (char*)packet->ptr(), packet->length()))
- DBUG_RETURN(1);
- }
-
+ {
+ packet->length(0);
+ net_store_data(packet, table->table_name);
+ // a hack - we need to reserve some space for the length before
+ // we know what it is - let's assume that the length of create table
+ // statement will fit into 3 bytes ( 16 MB max :-) )
+ ulong store_len_offset = packet->length();
+ packet->length(store_len_offset + 4);
+ if (store_create_info(thd, table, packet))
+ DBUG_RETURN(-1);
+ ulong create_len = packet->length() - store_len_offset - 4;
+ if (create_len > 0x00ffffff) // better readable in HEX ...
+ DBUG_RETURN(1); // just in case somebody manages to create a table
+ // with *that* much stuff in the definition
+
+ // now we have to store the length in three bytes, even if it would fit
+ // into fewer, so we cannot use net_store_data() anymore,
+ // and do it ourselves
+ char* p = (char*)packet->ptr() + store_len_offset;
+ *p++ = (char) 253; // The client the length is stored using 3-bytes
+ int3store(p, create_len);
+
+ // now we are in business :-)
+ if (my_net_write(&thd->net, (char*)packet->ptr(), packet->length()))
+ DBUG_RETURN(1);
+ }
send_eof(&thd->net);
DBUG_RETURN(0);
}