1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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
This commit is contained in:
unknown
2000-10-04 23:20:16 +03:00
parent 63b7b45ff7
commit fc78fef796
17 changed files with 261 additions and 66 deletions

View File

@ -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
{
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);
}
// 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);
}