Foros del Web » Administración de Sistemas » Unix / Linux »

tamaño de *MYSQL Mensaje Previo

Estas en el tema de tamaño de *MYSQL Mensaje Previo en el foro de Unix / Linux en Foros del Web. Holas... antes que nada decir que he estado buscando en google y no encuentro mucha info para esclarecer el asunto Mr. Green Mr. Green Mr. ...
  #1 (permalink)  
Antiguo 13/01/2005, 11:07
Avatar de kapachov  
Fecha de Ingreso: diciembre-2002
Ubicación: Loeches
Mensajes: 464
Antigüedad: 21 años, 4 meses
Puntos: 0
tamaño de *MYSQL Mensaje Previo

Holas...

antes que nada decir que he estado buscando en google y no encuentro mucha info para esclarecer el asunto Mr. Green Mr. Green Mr. Green Necesito saber cuanto espacio se reserva cuando crep variables de este tipo *MYSQL.

Si alguien sabe de alguna forma en C para darme cuenta [ de cuanto espacio se reserva ] y/o a visto que alguien a preguntado lo mismo que _YO_ [ y le han respondido ] le rogaria me enviara el link

Me imagino que ya hubo alguien que se puso en la tarea de sumar cada tipo de variable en la struc de :

typedef struct st_mysql {
NET net; /* Communication parameters */
gptr connector_fd; /* ConnectorFd for SSL */
char *host,*user,*passwd,*unix_socket,*server_version,* host_info,
*info,*db;
struct charset_info_st *charset;
MYSQL_FIELD *fields;
MEM_ROOT field_alloc;
my_ulonglong affected_rows;
my_ulonglong insert_id; /* id if insert on table with NEXTNR */
my_ulonglong extra_info; /* Used by mysqlshow */
unsigned long thread_id; /* Id for connection in server */
unsigned long packet_length;
unsigned int port,client_flag,server_capabilities;
unsigned int protocol_version;
unsigned int field_count;
unsigned int server_status;
unsigned int server_language;
struct st_mysql_options options;
enum mysql_status status;
my_bool free_me; /* If free in mysql_close */
my_bool reconnect; /* set to 1 if automatic reconnect */
char scramble_buff[9];

/*
Set if this is the original connection, not a master or a slave we have
added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave()
*/
my_bool rpl_pivot;
/*
Pointers to the master, and the next slave connections, points to
itself if lone connection.
*/
struct st_mysql* master, *next_slave;

struct st_mysql* last_used_slave; /* needed for round-robin slave pick */
/* needed for send/read/store/use result to work correctly with replication */
struct st_mysql* last_used_con;
} MYSQL;

O la gente de MySQL previendo que alguien como _YO_ [ que formula preguntas a veces sin sentido ] quisiera saberlo, lo han puesto ya en su pagina pero no lo _VEO_

puede ser esto :

---
mysql: Out of memory at line 42, 'malloc.c'
mysql: needed 8136 byte (8k), memory in use: 12481367 bytes (12189k)
ERROR 2008: MySQL client ran out of memory
---
__________________
Siempre hago lo que quiero...
Aunque no quiera...
  #2 (permalink)  
Antiguo 13/01/2005, 11:43
Avatar de kapachov  
Fecha de Ingreso: diciembre-2002
Ubicación: Loeches
Mensajes: 464
Antigüedad: 21 años, 4 meses
Puntos: 0
Holas...

Me constesto:

/************************************************** **************************
*
* Purpose: Find out the size of the different data types
* Author: M J Leslie
* Date: 27-feb-94
*
************************************************** **************************/

#include <stdio.h>
main()
{
/*
* int/char are 'type specifiers'
* short/long are 'type qualifiers'
*/
int i;

printf(" short int is %2d bytes \n", sizeof(short int));
printf(" int is %2d bytes \n", sizeof(int));
printf(" int * is %2d bytes \n", sizeof(int *));
printf(" long int is %2d bytes \n", sizeof(long int));
printf(" long int * is %2d bytes \n", sizeof(long int *));
printf(" signed int is %2d bytes \n", sizeof(signed int));
printf(" unsigned int is %2d bytes \n", sizeof(unsigned int));
printf("\n");
printf(" float is %2d bytes \n", sizeof(float));
printf(" float * is %2d bytes \n", sizeof(float *));
printf(" double is %2d bytes \n", sizeof(double));
printf(" double * is %2d bytes \n", sizeof(double *));
printf(" long double is %2d bytes \n", sizeof(long double));
printf("\n");
printf(" signed char is %2d bytes \n", sizeof(signed char));
printf(" char is %2d bytes \n", sizeof(char));
printf(" char * is %2d bytes \n", sizeof(char *));
printf("unsigned char is %2d bytes \n", sizeof(unsigned char));
}


/************************************************** ***********
*
* The O/P from this program is
*
* short int is 2 bytes
* int is 4 bytes
* int * is 4 bytes
* long int is 4 bytes
* long int * is 4 bytes
* signed int is 4 bytes
* unsigned int is 4 bytes
*
* float is 4 bytes
* float * is 4 bytes
* double is 8 bytes
* double * is 4 bytes
* long double is 12 bytes
*
* signed char is 1 bytes
* char is 1 bytes
* char * is 4 bytes
* unsigned char is 1 bytes
*
*
************************************************** ************/

Esto estaba en mi Pc :

/usr/share/doc/HTML/en/kdevelop/reference/C/EXAMPLES/sizeof.c

La ayuda del sizeof me vino de mi jefe.
__________________
Siempre hago lo que quiero...
Aunque no quiera...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:01.