mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
474fe6d9d9
and small collateral changes mysql-test/lib/My/Test.pm: somehow with "print" we get truncated writes sometimes mysql-test/suite/perfschema/r/digest_table_full.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/dml_handler.result: host table is not ported over yet mysql-test/suite/perfschema/r/information_schema.result: host table is not ported over yet mysql-test/suite/perfschema/r/nesting.result: this differs, because we don't rewrite general log queries, and multi-statement packets are logged as a one entry. this result file is identical to what mysql-5.6.5 produces with the --log-raw option. mysql-test/suite/perfschema/r/relaylog.result: MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB. mysql-test/suite/perfschema/r/server_init.result: MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup. mysql-test/suite/perfschema/r/stage_mdl_global.result: this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not do that, and this causes useless mutex locks and waits. mysql-test/suite/perfschema/r/statement_digest.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/statement_digest_consumers.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/statement_digest_long_query.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result: will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result: will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
117 lines
4.1 KiB
C
117 lines
4.1 KiB
C
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
|
|
#include <my_global.h>
|
|
#include <my_sys.h>
|
|
|
|
#ifdef USE_SYSTEM_WRAPPERS
|
|
#include "system_wrappers.h"
|
|
#endif
|
|
|
|
#ifdef HAVE_GETRUSAGE
|
|
#include <sys/resource.h>
|
|
#endif
|
|
|
|
#include <my_pthread.h>
|
|
|
|
#ifdef HAVE_PSI_INTERFACE
|
|
|
|
#if !defined(HAVE_PREAD) && !defined(_WIN32)
|
|
extern PSI_mutex_key key_my_file_info_mutex;
|
|
#endif /* !defined(HAVE_PREAD) && !defined(_WIN32) */
|
|
|
|
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
|
|
extern PSI_mutex_key key_LOCK_localtime_r;
|
|
#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */
|
|
|
|
extern PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock,
|
|
key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm,
|
|
key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap,
|
|
key_THR_LOCK_lock, key_THR_LOCK_malloc,
|
|
key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net,
|
|
key_THR_LOCK_open, key_THR_LOCK_threads, key_LOCK_uuid_generator,
|
|
key_TMPDIR_mutex, key_THR_LOCK_myisam_mmap;
|
|
|
|
extern PSI_cond_key key_COND_alarm, key_IO_CACHE_SHARE_cond,
|
|
key_IO_CACHE_SHARE_cond_writer, key_my_thread_var_suspend,
|
|
key_THR_COND_threads;
|
|
|
|
#ifdef USE_ALARM_THREAD
|
|
extern PSI_thread_key key_thread_alarm;
|
|
#endif /* USE_ALARM_THREAD */
|
|
|
|
extern PSI_rwlock_key key_SAFEHASH_mutex;
|
|
|
|
#endif /* HAVE_PSI_INTERFACE */
|
|
|
|
extern PSI_stage_info stage_waiting_for_table_level_lock;
|
|
|
|
extern mysql_mutex_t THR_LOCK_malloc, THR_LOCK_open, THR_LOCK_keycache;
|
|
extern mysql_mutex_t THR_LOCK_lock, THR_LOCK_net;
|
|
extern mysql_mutex_t THR_LOCK_charset;
|
|
|
|
#include <mysql/psi/mysql_file.h>
|
|
|
|
#ifdef HAVE_PSI_INTERFACE
|
|
#ifdef HUGETLB_USE_PROC_MEMINFO
|
|
extern PSI_file_key key_file_proc_meminfo;
|
|
#endif /* HUGETLB_USE_PROC_MEMINFO */
|
|
extern PSI_file_key key_file_charset, key_file_cnf;
|
|
#endif /* HAVE_PSI_INTERFACE */
|
|
|
|
#ifdef SAFEMALLOC
|
|
void *sf_malloc(size_t size);
|
|
void *sf_realloc(void *ptr, size_t size);
|
|
void sf_free(void *ptr);
|
|
#else
|
|
#define sf_malloc(X) malloc(X)
|
|
#define sf_realloc(X,Y) realloc(X,Y)
|
|
#define sf_free(X) free(X)
|
|
#endif
|
|
|
|
/*
|
|
EDQUOT is used only in 3 C files only in mysys/. If it does not exist on
|
|
system, we set it to some value which can never happen.
|
|
*/
|
|
#ifndef EDQUOT
|
|
#define EDQUOT (-1)
|
|
#endif
|
|
|
|
void my_error_unregister_all(void);
|
|
|
|
#ifdef _WIN32
|
|
#include <sys/stat.h>
|
|
/* my_winfile.c exports, should not be used outside mysys */
|
|
extern File my_win_open(const char *path, int oflag);
|
|
extern int my_win_close(File fd);
|
|
extern size_t my_win_read(File fd, uchar *buffer, size_t count);
|
|
extern size_t my_win_write(File fd, const uchar *buffer, size_t count);
|
|
extern size_t my_win_pread(File fd, uchar *buffer, size_t count,
|
|
my_off_t offset);
|
|
extern size_t my_win_pwrite(File fd, const uchar *buffer, size_t count,
|
|
my_off_t offset);
|
|
extern my_off_t my_win_lseek(File fd, my_off_t pos, int whence);
|
|
extern int my_win_chsize(File fd, my_off_t newlength);
|
|
extern FILE* my_win_fopen(const char *filename, const char *type);
|
|
extern File my_win_fclose(FILE *file);
|
|
extern File my_win_fileno(FILE *file);
|
|
extern FILE* my_win_fdopen(File Filedes, const char *type);
|
|
extern int my_win_stat(const char *path, struct _stati64 *buf);
|
|
extern int my_win_fstat(File fd, struct _stati64 *buf);
|
|
extern int my_win_fsync(File fd);
|
|
extern File my_win_dup(File fd);
|
|
extern File my_win_sopen(const char *path, int oflag, int shflag, int perm);
|
|
extern File my_open_osfhandle(HANDLE handle, int oflag);
|
|
#endif
|