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

More fixes

This commit is contained in:
Michael Widenius
2012-08-17 16:46:34 +03:00
parent 60589aeee0
commit f1159b18d9
19 changed files with 59 additions and 36 deletions

2
TODO
View File

@ -1,4 +1,4 @@
State of MERGE between MariaDB 5.5 and MySQL 5.6.5
State of MERGE between MariaDB 5.5 and MySQL 5.6.5-m8
Featured copied/merged
- storage/innodb/*

View File

@ -50,7 +50,7 @@ static char *default_dbug_option= (char*) "d:t:O,/tmp/comp_err.trace";
#endif
/* Header for errmsg.sys files */
uchar file_head[]= { 254, 254, 2, 1 };
uchar file_head[]= { 254, 254, 2, 2 };
/* Store positions to each error message row to store in errmsg.sys header */
uint file_pos[MAX_ROWS];
@ -371,8 +371,8 @@ static int create_sys_files(struct languages *lang_head,
bzero((uchar*) head, HEADER_LENGTH);
bmove((uchar *) head, (uchar *) file_head, 4);
head[4]= 1;
int2store(head + 6, length);
int2store(head + 8, row_count);
int4store(head + 6, length);
int2store(head + 10, row_count);
head[30]= csnum;
my_fseek(to, 0l, MY_SEEK_SET, MYF(0));

View File

@ -87,8 +87,6 @@ struct my_option
typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
ATTRIBUTE_FORMAT_FPTR(printf, 2, 3);
/**
Used to retrieve a reference to the object (variable) that holds the value

View File

@ -1015,9 +1015,9 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define closesocket(A) close(A)
#define SOCKET_EINTR EINTR
#define SOCKET_EAGAIN EAGAIN
#define SOCKET_ETIMEDOUT SOCKET_EINTR
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
#define SOCKET_EADDRINUSE EADDRINUSE
#define SOCKET_ETIMEDOUT ETIMEDOUT
#define SOCKET_ECONNRESET ECONNRESET
#define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE

View File

@ -39,7 +39,7 @@
#ifndef DBUG_OFF
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B) ; bfill(A, trash_tmp, C); MEM_UNDEFINED(A, trash_tmp); } while (0)
#else
#define TRASH_FILL(A,B,C) do{ const size_t trash_tmp= (B) ; MEM_CHECK_ADDRESSABLE(A,trash_tmp);MEM_UNDEFINED(A,trash_tmp);} while (0)
#define TRASH_FILL(A,B,C) do{ const size_t trash_tmp __attribute((unused)) = (B) ; MEM_CHECK_ADDRESSABLE(A,trash_tmp);MEM_UNDEFINED(A,trash_tmp);} while (0)
#endif
#define TRASH_ALLOC(A,B) TRASH_FILL(A,B,0xA5)
#define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F)

View File

@ -88,7 +88,6 @@ int vio_keepalive(Vio *vio, my_bool onoff);
my_bool vio_should_retry(Vio *vio);
/* Check that operation was timed out */
my_bool vio_was_timeout(Vio *vio);
my_bool vio_was_interrupted(Vio *vio);
/* Short text description of the socket for those, who are curious.. */
const char* vio_description(Vio *vio);
/* Return the type of the connection */
@ -192,12 +191,10 @@ void vio_end(void);
#define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive)
#define vio_should_retry(vio) (vio)->should_retry(vio)
#define vio_was_timeout(vio) (vio)->was_timeout(vio)
#define vio_was_interrupted(vio) (vio)->was_interrupted(vio)
#define vio_close(vio) ((vio)->vioclose)(vio)
#define vio_shutdown(vio,how) ((vio)->shutdown)(vio,how)
#define vio_peer_addr(vio, buf, prt, buflen) (vio)->peer_addr(vio, buf, prt, buflen)
#define vio_io_wait(vio, event, timeout) (vio)->io_wait(vio, event, timeout)
#define vio_timeout(vio, which, seconds) (vio)->timeout(vio, which, seconds)
#define vio_is_connected(vio) (vio)->is_connected(vio)
#endif /* !defined(DONT_MAP_VIO) */
@ -260,7 +257,6 @@ struct st_vio
void (*in_addr)(Vio*, struct sockaddr_storage*);
my_bool (*should_retry)(Vio*);
my_bool (*was_timeout)(Vio*);
my_bool (*was_interrupted)(Vio*);
int (*vioclose)(Vio*);
my_bool (*is_connected)(Vio*);
int (*shutdown)(Vio *, int);

View File

@ -5,11 +5,12 @@ innodb
innodb-cmpmem
innodb-trx
innodb-sys-index
xtradb-admin-command
loose-xtradb-admin-command
[xtradb]
innodb
innodb-cmpmem
innodb-trx
innodb-sys-index
xtradb-admin-command
loose-xtradb-admin-command

View File

@ -61,6 +61,7 @@ DROP TABLE t1;
# SELECT is not detected
#
SET @old_innodb_thread_concurrency:= @@innodb_thread_concurrency;
SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay;
SET GLOBAL innodb_thread_concurrency = 1;
CREATE TABLE t1
(user_num BIGINT,
@ -91,6 +92,7 @@ COMMIT;
# con1, reaping ALTER.
# Disconnecting con1 and switching to default. Cleaning up.
SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
DROP TABLE t1;
#
# Bug#50418: DROP PARTITION does not interact with transactions

View File

@ -72,6 +72,7 @@ DROP TABLE t1;
--echo #
SET @old_innodb_thread_concurrency:= @@innodb_thread_concurrency;
SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay;
SET GLOBAL innodb_thread_concurrency = 1;
CREATE TABLE t1
@ -120,6 +121,7 @@ COMMIT;
--connection default
SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
DROP TABLE t1;

View File

@ -775,7 +775,7 @@ restart:
DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %lu",
vio_description(net->vio),len));
#ifdef MYSQL_SERVER
if (net->vio && vio_was_interrupted(net->vio))
if (net->vio && (net->last_errno == ER_NET_READ_INTERRUPTED))
return (packet_error);
#endif /*MYSQL_SERVER*/
end_server(mysql);

View File

@ -186,12 +186,12 @@ bool read_texts(const char *file_name, const char *language,
goto err;
funktpos=2;
if (head[0] != (uchar) 254 || head[1] != (uchar) 254 ||
head[2] != 2 || head[3] != 1)
head[2] != 2 || head[3] != 2)
goto err; /* purecov: inspected */
textcount=head[4];
error_message_charset_info= system_charset_info;
length=uint2korr(head+6); count=uint2korr(head+8);
length=uint4korr(head+6); count=uint2korr(head+10);
if (count < error_messages)
{
@ -203,7 +203,7 @@ Error message file '%s' had only %d error messages, but it should contain at lea
}
if (!(*point= (const char**)
my_malloc((size_t) (length+count*sizeof(char*)),MYF(0))))
my_malloc((size_t) (max(length,count*2)+count*sizeof(char*)),MYF(0))))
{
funktpos=3; /* purecov: inspected */
goto err; /* purecov: inspected */

View File

@ -295,7 +295,7 @@ void net_clear(NET *net, my_bool clear_buffer __attribute__((unused)))
{
size_t count;
int ready;
while ((ready= net_data_is_ready(net->vio->sd)) > 0)
while ((ready= net_data_is_ready(vio_fd(net->vio))) > 0)
{
/* The socket is ready */
if ((long) (count= vio_read(net->vio, net->buff,
@ -895,7 +895,7 @@ my_real_read(NET *net, size_t *complen)
remain, vio_errno(net->vio), (long) length));
len= packet_error;
net->error= 2; /* Close socket */
net->last_errno= (vio_was_interrupted(net->vio) ?
net->last_errno= (vio_was_timeout(net->vio) ?
ER_NET_READ_INTERRUPTED :
ER_NET_READ_ERROR);
MYSQL_SERVER_my_error(net->last_errno, MYF(0));
@ -1160,13 +1160,12 @@ void my_net_set_read_timeout(NET *net, uint timeout)
{
DBUG_ENTER("my_net_set_read_timeout");
DBUG_PRINT("enter", ("timeout: %d", timeout));
if (net->read_timeout == timeout)
DBUG_VOID_RETURN;
net->read_timeout= timeout;
#ifdef NO_ALARM
if (net->vio)
vio_timeout(net->vio, 0, timeout);
#endif
if (net->read_timeout != timeout)
{
net->read_timeout= timeout;
if (net->vio)
vio_timeout(net->vio, 0, timeout);
}
DBUG_VOID_RETURN;
}
@ -1175,12 +1174,11 @@ void my_net_set_write_timeout(NET *net, uint timeout)
{
DBUG_ENTER("my_net_set_write_timeout");
DBUG_PRINT("enter", ("timeout: %d", timeout));
if (net->write_timeout == timeout)
DBUG_VOID_RETURN;
net->write_timeout= timeout;
#ifdef NO_ALARM
if (net->vio)
vio_timeout(net->vio, 1, timeout);
#endif
if (net->write_timeout != timeout)
{
net->write_timeout= timeout;
if (net->vio)
vio_timeout(net->vio, 1, timeout);
}
DBUG_VOID_RETURN;
}

Binary file not shown.

View File

@ -119,6 +119,10 @@ void cleanup_account(void)
account_array= NULL;
pfs_free(account_instr_class_waits_array);
account_instr_class_waits_array= NULL;
pfs_free(account_instr_class_stages_array);
account_instr_class_stages_array= 0;
pfs_free(account_instr_class_statements_array);
account_instr_class_statements_array=0;
account_max= 0;
}

View File

@ -467,6 +467,10 @@ void cleanup_instruments(void)
global_instr_class_stages_array= NULL;
pfs_free(global_instr_class_statements_array);
global_instr_class_statements_array= NULL;
pfs_free(thread_instr_class_statements_array);
thread_instr_class_statements_array= NULL;
pfs_free(thread_instr_class_stages_array);
thread_instr_class_stages_array= NULL;
DBUG_VOID_RETURN;
}

View File

@ -157,7 +157,6 @@ static void destroy_pfs_thread(void *key)
static void cleanup_performance_schema(void)
{
cleanup_instrument_config();
/* Disabled: Bug#5666
cleanup_instruments();
cleanup_sync_class();
cleanup_thread_class();
@ -182,8 +181,8 @@ static void cleanup_performance_schema(void)
cleanup_account();
cleanup_account_hash();
cleanup_digest();
cleanup_digest_hash();
PFS_atomic::cleanup();
*/
}
void shutdown_performance_schema(void)

View File

@ -106,6 +106,8 @@ static void vio_init(Vio *vio, enum enum_vio_type type,
vio->was_timeout =vio_was_timeout;
vio->vioclose =vio_close_pipe;
vio->peer_addr =vio_peer_addr;
vio->vioblocking =vio_blocking;
vio->is_blocking =vio_is_blocking;
vio->io_wait =no_io_wait;
vio->is_connected =vio_is_connected_pipe;
vio->has_data =has_no_data;
@ -126,6 +128,8 @@ static void vio_init(Vio *vio, enum enum_vio_type type,
vio->was_timeout =vio_was_timeout;
vio->vioclose =vio_close_shared_memory;
vio->peer_addr =vio_peer_addr;
vio->vioblocking =vio_blocking;
vio->is_blocking =vio_is_blocking;
vio->io_wait =no_io_wait;
vio->is_connected =vio_is_connected_shared_memory;
vio->has_data =vio_shared_memory_has_data;
@ -146,6 +150,8 @@ static void vio_init(Vio *vio, enum enum_vio_type type,
vio->was_timeout =vio_was_timeout;
vio->vioclose =vio_ssl_close;
vio->peer_addr =vio_peer_addr;
vio->vioblocking =vio_ssl_blocking;
vio->is_blocking =vio_is_blocking;
vio->io_wait =vio_io_wait;
vio->is_connected =vio_is_connected;
vio->has_data =vio_ssl_has_data;
@ -164,6 +170,8 @@ static void vio_init(Vio *vio, enum enum_vio_type type,
vio->was_timeout =vio_was_timeout;
vio->vioclose =vio_close;
vio->peer_addr =vio_peer_addr;
vio->vioblocking =vio_blocking;
vio->is_blocking =vio_is_blocking;
vio->io_wait =vio_io_wait;
vio->is_connected =vio_is_connected;
vio->shutdown =vio_socket_shutdown;

View File

@ -58,6 +58,7 @@ size_t vio_ssl_write(Vio *vio,const uchar* buf, size_t size);
/* When the workday is over... */
int vio_ssl_close(Vio *vio);
void vio_ssl_delete(Vio *vio);
int vio_ssl_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode);
my_bool vio_ssl_has_data(Vio *vio);
#endif /* HAVE_OPENSSL */

View File

@ -451,6 +451,16 @@ int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout, unsigned long *e
}
int vio_ssl_blocking(Vio *vio __attribute__((unused)),
my_bool set_blocking_mode,
my_bool *old_mode)
{
/* Mode is always blocking */
*old_mode= 1;
/* Return error if we try to change to non_blocking mode */
return (set_blocking_mode ? 0 : 1);
}
my_bool vio_ssl_has_data(Vio *vio)
{
return SSL_pending(vio->ssl_arg) > 0 ? TRUE : FALSE;