The world's most popular open source database
#include <m_ctype.h>#include <stdarg.h>#include <typelib.h>#include <my_alloc.h>Include dependency graph for my_sys.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Classes | |
| struct | wild_file_pack |
| struct | st_record_cache |
| struct | st_my_file_info |
| struct | st_my_tmpdir |
| struct | st_dynamic_array |
| struct | st_dynamic_string |
| struct | st_io_cache |
Defines | |
| #define | MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; } |
| #define | MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;} |
| #define | MY_INIT(name) ; { my_progname= name; my_init(); } |
| #define | ERRMSGSIZE (SC_MAXWIDTH) |
| #define | NRERRBUFFS (2) |
| #define | MY_FILE_ERROR ((uint) ~0) |
| #define | MY_FFNF 1 |
| #define | MY_FNABP 2 |
| #define | MY_NABP 4 |
| #define | MY_FAE 8 |
| #define | MY_WME 16 |
| #define | MY_WAIT_IF_FULL 32 |
| #define | MY_IGNORE_BADFD 32 |
| #define | MY_RAID 64 |
| #define | MY_FULL_IO 512 |
| #define | MY_DONT_CHECK_FILESIZE 128 |
| #define | MY_LINK_WARNING 32 |
| #define | MY_COPYTIME 64 |
| #define | MY_DELETE_OLD 256 |
| #define | MY_RESOLVE_LINK 128 |
| #define | MY_HOLD_ORIGINAL_MODES 128 |
| #define | MY_REDEL_MAKE_BACKUP 256 |
| #define | MY_SEEK_NOT_DONE 32 |
| #define | MY_DONT_WAIT 64 |
| #define | MY_ZEROFILL 32 |
| #define | MY_ALLOW_ZERO_PTR 64 |
| #define | MY_FREE_ON_ERROR 128 |
| #define | MY_HOLD_ON_ERROR 256 |
| #define | MY_THREADSAFE 128 |
| #define | MY_DONT_OVERWRITE_FILE 1024 |
| #define | MY_CHECK_ERROR 1 |
| #define | MY_GIVE_INFO 2 |
| #define | MY_DONT_FREE_DBUG 4 |
| #define | MY_REMOVE_NONE 0 |
| #define | MY_REMOVE_OPTION 1 |
| #define | MY_REMOVE_SECTION 2 |
| #define | ME_HIGHBYTE 8 |
| #define | ME_NOCUR 1 |
| #define | ME_OLDWIN 2 |
| #define | ME_BELL 4 |
| #define | ME_HOLDTANG 8 |
| #define | ME_WAITTOT 16 |
| #define | ME_WAITTANG 32 |
| #define | ME_NOREFRESH 64 |
| #define | ME_NOINPUT 128 |
| #define | ME_COLOUR1 ((1 << ME_HIGHBYTE)) |
| #define | ME_COLOUR2 ((2 << ME_HIGHBYTE)) |
| #define | ME_COLOUR3 ((3 << ME_HIGHBYTE)) |
| #define | MY_REPLACE_DIR 1 |
| #define | MY_REPLACE_EXT 2 |
| #define | MY_UNPACK_FILENAME 4 |
| #define | MY_PACK_FILENAME 8 |
| #define | MY_RESOLVE_SYMLINKS 16 |
| #define | MY_RETURN_REAL_PATH 32 |
| #define | MY_SAFE_PATH 64 |
| #define | MY_RELATIVE_PATH 128 |
| #define | MY_APPEND_EXT 256 |
| #define | MY_SEEK_SET 0 |
| #define | MY_SEEK_CUR 1 |
| #define | MY_SEEK_END 2 |
| #define | MY_WAIT_FOR_USER_TO_FIX_PANIC 60 |
| #define | MY_WAIT_GIVE_USER_A_MESSAGE 10 |
| #define | MIN_COMPRESS_LENGTH 50 |
| #define | DFLT_INIT_HITS 3 |
| #define | MY_KEEP_PREALLOC 1 |
| #define | MY_MARK_BLOCKS_FREE 2 |
| #define | MY_ERRNO_EDOM 33 |
| #define | MY_ERRNO_ERANGE 34 |
| #define | GETDATE_DATE_TIME 1 |
| #define | GETDATE_SHORT_DATE 2 |
| #define | GETDATE_HHMMSSTIME 4 |
| #define | GETDATE_GMT 8 |
| #define | GETDATE_FIXEDLENGTH 16 |
| #define | my_checkmalloc() |
| #define | TERMINATE(A) {} |
| #define | QUICK_SAFEMALLOC |
| #define | NORMAL_SAFEMALLOC |
| #define | my_malloc_ci(SZ, FLAG) my_malloc( SZ, FLAG ) |
| #define | my_free(PTR, FG) ((void)FG,my_no_flags_free(PTR)) |
| #define | CALLER_INFO_PROTO |
| #define | CALLER_INFO |
| #define | ORIG_CALLER_INFO |
| #define | TRASH(A, B) |
| #define | my_get_large_page_size() (0) |
| #define | my_large_malloc(A, B) my_malloc_lock((A),(B)) |
| #define | my_large_free(A, B) my_free_lock((A),(B)) |
| #define | my_alloca(SZ) my_malloc(SZ,MYF(0)) |
| #define | my_afree(PTR) my_free(PTR,MYF(MY_WME)) |
| #define | my_b_clear(info) (info)->buffer=0 |
| #define | my_b_inited(info) (info)->buffer |
| #define | my_b_EOF INT_MIN |
| #define | my_b_read(info, Buffer, Count) |
| #define | my_b_write(info, Buffer, Count) |
| #define | my_b_get(info) |
| #define | my_b_write_byte(info, chr) |
| #define | my_b_fill_cache(info) (((info)->read_end=(info)->read_pos),(*(info)->read_function)(info,0,0)) |
| #define | my_b_tell(info) |
| #define | my_b_bytes_in_cache(info) |
| #define | my_access access |
| #define | my_delete_allow_opened(fname, flags) my_delete((fname),(flags)) |
| #define | my_print_open_files() |
| #define | base_name(A) (A+dirname_length(A)) |
| #define | flush_io_cache(info) my_b_flush_io_cache((info),1) |
| #define | my_init_dynamic_array(A, B, C, D) init_dynamic_array(A,B,C,D CALLER_INFO) |
| #define | my_init_dynamic_array_ci(A, B, C, D) init_dynamic_array(A,B,C,D ORIG_CALLER_INFO) |
| #define | dynamic_array_ptr(array, array_index) ((array)->buffer+(array_index)*(array)->size_of_element) |
| #define | dynamic_element(array, array_index, type) ((type)((array)->buffer) +(array_index)) |
| #define | push_dynamic(A, B) insert_dynamic((A),(B)) |
| #define | reset_dynamic(array) ((array)->elements= 0) |
| #define | sort_dynamic(A, cmp) qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp)) |
| #define | my_malloc_lock(A, B) my_malloc((A),(B)) |
| #define | my_free_lock(A, B) my_free((A),(B)) |
| #define | alloc_root_inited(A) ((A)->min_malloc != 0) |
| #define | ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) |
| #define | clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0) |
| #define | PROT_READ 1 |
| #define | PROT_WRITE 2 |
| #define | MAP_NORESERVE 0 |
| #define | MAP_SHARED 0x0001 |
| #define | MAP_PRIVATE 0x0002 |
| #define | MAP_NOSYNC 0x0800 |
| #define | MAP_FAILED ((void *)-1) |
| #define | MS_SYNC 0x0000 |
| #define | HAVE_MMAP |
Typedefs | |
| typedef wild_file_pack | WF_PACK |
| typedef st_record_cache | RECORD_CACHE |
| typedef st_my_tmpdir | MY_TMPDIR |
| typedef st_dynamic_array | DYNAMIC_ARRAY |
| typedef st_dynamic_string | DYNAMIC_STRING |
| typedef int(*) | IO_CACHE_CALLBACK (struct st_io_cache *) |
| typedef st_io_cache | IO_CACHE |
| typedef int(*) | qsort2_cmp (const void *, const void *, const void *) |
| typedef uint32 | ha_checksum |
| typedef int(*) | Process_option_func (void *ctx, const char *group_name, const char *option) |
Enumerations | |
| enum | loglevel { ERROR_LEVEL, WARNING_LEVEL, INFORMATION_LEVEL } |
| enum | cache_type { TYPE_NOT_SET = 0, READ_CACHE, WRITE_CACHE, SEQ_READ_APPEND, READ_FIFO, READ_NET, WRITE_NET } |
| enum | flush_type { FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE } |
| enum | file_type { UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN, FILE_BY_MKSTEMP, FILE_BY_DUP } |
Functions | |
| gptr | my_malloc (uint Size, myf MyFlags) |
| gptr | my_realloc (gptr oldpoint, uint Size, myf MyFlags) |
| void | my_no_flags_free (gptr ptr) |
| gptr | my_memdup (const byte *from, uint length, myf MyFlags) |
| char * | my_strdup (const char *from, myf MyFlags) |
| char * | my_strndup (const char *from, uint length, myf MyFlags) |
| void(*)(*) | my_sigtstp_restart (void) |
| my_off_t | my_b_append_tell (IO_CACHE *info) |
| my_off_t | my_b_safe_tell (IO_CACHE *info) |
| int | my_copy (const char *from, const char *to, myf MyFlags) |
| int | my_append (const char *from, const char *to, myf MyFlags) |
| int | my_delete (const char *name, myf MyFlags) |
| int | my_getwd (my_string buf, uint size, myf MyFlags) |
| int | my_setwd (const char *dir, myf MyFlags) |
| int | my_lock (File fd, int op, my_off_t start, my_off_t length, myf MyFlags) |
| gptr | my_once_alloc (uint Size, myf MyFlags) |
| void | my_once_free (void) |
| char * | my_once_strdup (const char *src, myf myflags) |
| char * | my_once_memdup (const char *src, uint len, myf myflags) |
| File | my_open (const char *FileName, int Flags, myf MyFlags) |
| File | my_register_filename (File fd, const char *FileName, enum file_type type_of_file, uint error_message_number, myf MyFlags) |
| File | my_create (const char *FileName, int CreateFlags, int AccessFlags, myf MyFlags) |
| int | my_close (File Filedes, myf MyFlags) |
| File | my_dup (File file, myf MyFlags) |
| int | my_mkdir (const char *dir, int Flags, myf MyFlags) |
| int | my_readlink (char *to, const char *filename, myf MyFlags) |
| int | my_realpath (char *to, const char *filename, myf MyFlags) |
| File | my_create_with_symlink (const char *linkname, const char *filename, int createflags, int access_flags, myf MyFlags) |
| int | my_delete_with_symlink (const char *name, myf MyFlags) |
| int | my_rename_with_symlink (const char *from, const char *to, myf MyFlags) |
| int | my_symlink (const char *content, const char *linkname, myf MyFlags) |
| uint | my_read (File Filedes, byte *Buffer, uint Count, myf MyFlags) |
| uint | my_pread (File Filedes, byte *Buffer, uint Count, my_off_t offset, myf MyFlags) |
| int | my_rename (const char *from, const char *to, myf MyFlags) |
| my_off_t | my_seek (File fd, my_off_t pos, int whence, myf MyFlags) |
| my_off_t | my_tell (File fd, myf MyFlags) |
| uint | my_write (File Filedes, const byte *Buffer, uint Count, myf MyFlags) |
| uint | my_pwrite (File Filedes, const byte *Buffer, uint Count, my_off_t offset, myf MyFlags) |
| uint | my_fread (FILE *stream, byte *Buffer, uint Count, myf MyFlags) |
| uint | my_fwrite (FILE *stream, const byte *Buffer, uint Count, myf MyFlags) |
| my_off_t | my_fseek (FILE *stream, my_off_t pos, int whence, myf MyFlags) |
| my_off_t | my_ftell (FILE *stream, myf MyFlags) |
| gptr | _mymalloc (uint uSize, const char *sFile, uint uLine, myf MyFlag) |
| gptr | _myrealloc (gptr pPtr, uint uSize, const char *sFile, uint uLine, myf MyFlag) |
| gptr my_multi_malloc | _VARARGS ((myf MyFlags,...)) |
| void | _myfree (gptr pPtr, const char *sFile, uint uLine, myf MyFlag) |
| int | _sanity (const char *sFile, unsigned int uLine) |
| gptr | _my_memdup (const byte *from, uint length, const char *sFile, uint uLine, myf MyFlag) |
| my_string | _my_strdup (const char *from, const char *sFile, uint uLine, myf MyFlag) |
| char * | _my_strndup (const char *from, uint length, const char *sFile, uint uLine, myf MyFlag) |
| void * | my_memmem (const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) |
| int | check_if_legal_filename (const char *path) |
| int | check_if_legal_tablename (const char *path) |
| void | init_glob_errs (void) |
| FILE * | my_fopen (const char *FileName, int Flags, myf MyFlags) |
| FILE * | my_fdopen (File Filedes, const char *name, int Flags, myf MyFlags) |
| int | my_fclose (FILE *fd, myf MyFlags) |
| int | my_chsize (File fd, my_off_t newlength, int filler, myf MyFlags) |
| int | my_sync (File fd, myf my_flags) |
| int my_error | _VARARGS ((int nr, myf MyFlags,...)) |
| int my_printf_error | _VARARGS ((uint my_err, const char *format, myf MyFlags,...) __attribute__((format(printf, 2, 4)))) |
| int | my_error_register (const char **errmsgs, int first, int last) |
| const char ** | my_error_unregister (int first, int last) |
| int | my_message (uint my_err, const char *str, myf MyFlags) |
| int | my_message_no_curses (uint my_err, const char *str, myf MyFlags) |
| int | my_message_curses (uint my_err, const char *str, myf MyFlags) |
| my_bool | my_init (void) |
| void | my_end (int infoflag) |
| int | my_redel (const char *from, const char *to, int MyFlags) |
| int | my_copystat (const char *from, const char *to, int MyFlags) |
| my_string | my_filename (File fd) |
| void | dont_break (void) |
| void | allow_break (void) |
| my_bool | init_tmpdir (MY_TMPDIR *tmpdir, const char *pathlist) |
| char * | my_tmpdir (MY_TMPDIR *tmpdir) |
| void | free_tmpdir (MY_TMPDIR *tmpdir) |
| void | my_remember_signal (int signal_number, sig_handler(*func)(int)) |
| uint | dirname_part (my_string to, const char *name) |
| uint | dirname_length (const char *name) |
| int | test_if_hard_path (const char *dir_name) |
| my_bool | has_path (const char *name) |
| char * | convert_dirname (char *to, const char *from, const char *from_end) |
| void | to_unix_path (my_string name) |
| my_string | fn_ext (const char *name) |
| my_string | fn_same (my_string toname, const char *name, int flag) |
| my_string | fn_format (my_string to, const char *name, const char *dir, const char *form, uint flag) |
| size_s | strlength (const char *str) |
| void | pack_dirname (my_string to, const char *from) |
| uint | unpack_dirname (my_string to, const char *from) |
| uint | cleanup_dirname (my_string to, const char *from) |
| uint | system_filename (my_string to, const char *from) |
| uint | unpack_filename (my_string to, const char *from) |
| my_string | intern_filename (my_string to, const char *from) |
| my_string | directory_file_name (my_string dst, const char *src) |
| int | pack_filename (my_string to, const char *name, size_s max_length) |
| my_string | my_path (my_string to, const char *progname, const char *own_pathname_part) |
| my_string | my_load_path (my_string to, const char *path, const char *own_path_prefix) |
| int | wild_compare (const char *str, const char *wildstr, pbool str_is_pattern) |
| WF_PACK * | wf_comp (my_string str) |
| int | wf_test (struct wild_file_pack *wf_pack, const char *name) |
| void | wf_end (struct wild_file_pack *buffer) |
| size_s | strip_sp (my_string str) |
| void | get_date (my_string to, int timeflag, time_t use_time) |
| void | soundex (CHARSET_INFO *, my_string out_pntr, my_string in_pntr, pbool remove_garbage) |
| int | init_record_cache (RECORD_CACHE *info, uint cachesize, File file, uint reclength, enum cache_type type, pbool use_async_io) |
| int | read_cache_record (RECORD_CACHE *info, byte *to) |
| int | end_record_cache (RECORD_CACHE *info) |
| int | write_cache_record (RECORD_CACHE *info, my_off_t filepos, const byte *record, uint length) |
| int | flush_write_cache (RECORD_CACHE *info) |
| long | my_clock (void) |
| sig_handler | sigtstp_handler (int signal_number) |
| void | handle_recived_signals (void) |
| sig_handler | my_set_alarm_variable (int signo) |
| void | my_string_ptr_sort (void *base, uint items, size_s size) |
| void | radixsort_for_str_ptr (uchar *base[], uint number_of_elements, size_s size_of_element, uchar *buffer[]) |
| qsort_t | qsort2 (void *base_ptr, size_t total_elems, size_t size, qsort2_cmp cmp, void *cmp_argument) |
| qsort2_cmp | get_ptr_compare (uint) |
| void | my_store_ptr (byte *buff, uint pack_length, my_off_t pos) |
| my_off_t | my_get_ptr (byte *ptr, uint pack_length) |
| int | init_io_cache (IO_CACHE *info, File file, uint cachesize, enum cache_type type, my_off_t seek_offset, pbool use_async_io, myf cache_myflags) |
| my_bool | reinit_io_cache (IO_CACHE *info, enum cache_type type, my_off_t seek_offset, pbool use_async_io, pbool clear_cache) |
| void | setup_io_cache (IO_CACHE *info) |
| int | _my_b_read (IO_CACHE *info, byte *Buffer, uint Count) |
| int | _my_b_seq_read (IO_CACHE *info, byte *Buffer, uint Count) |
| int | _my_b_net_read (IO_CACHE *info, byte *Buffer, uint Count) |
| int | _my_b_get (IO_CACHE *info) |
| int | _my_b_async_read (IO_CACHE *info, byte *Buffer, uint Count) |
| int | _my_b_write (IO_CACHE *info, const byte *Buffer, uint Count) |
| int | my_b_append (IO_CACHE *info, const byte *Buffer, uint Count) |
| int | my_b_safe_write (IO_CACHE *info, const byte *Buffer, uint Count) |
| int | my_block_write (IO_CACHE *info, const byte *Buffer, uint Count, my_off_t pos) |
| int | my_b_flush_io_cache (IO_CACHE *info, int need_append_buffer_lock) |
| int | end_io_cache (IO_CACHE *info) |
| uint | my_b_fill (IO_CACHE *info) |
| void | my_b_seek (IO_CACHE *info, my_off_t pos) |
| uint | my_b_gets (IO_CACHE *info, char *to, uint max_length) |
| my_off_t | my_b_filelength (IO_CACHE *info) |
| uint | my_b_printf (IO_CACHE *info, const char *fmt,...) |
| uint | my_b_vprintf (IO_CACHE *info, const char *fmt, va_list ap) |
| my_bool | open_cached_file (IO_CACHE *cache, const char *dir, const char *prefix, uint cache_size, myf cache_myflags) |
| my_bool | real_open_cached_file (IO_CACHE *cache) |
| void | close_cached_file (IO_CACHE *cache) |
| File | create_temp_file (char *to, const char *dir, const char *pfx, int mode, myf MyFlags) |
| my_bool | init_dynamic_array (DYNAMIC_ARRAY *array, uint element_size, uint init_alloc, uint alloc_increment CALLER_INFO_PROTO) |
| my_bool | insert_dynamic (DYNAMIC_ARRAY *array, gptr element) |
| byte * | alloc_dynamic (DYNAMIC_ARRAY *array) |
| byte * | pop_dynamic (DYNAMIC_ARRAY *) |
| my_bool | set_dynamic (DYNAMIC_ARRAY *array, gptr element, uint array_index) |
| void | get_dynamic (DYNAMIC_ARRAY *array, gptr element, uint array_index) |
| void | delete_dynamic (DYNAMIC_ARRAY *array) |
| void | delete_dynamic_element (DYNAMIC_ARRAY *array, uint array_index) |
| void | freeze_size (DYNAMIC_ARRAY *array) |
| int | get_index_dynamic (DYNAMIC_ARRAY *array, gptr element) |
| my_bool | init_dynamic_string (DYNAMIC_STRING *str, const char *init_str, uint init_alloc, uint alloc_increment) |
| my_bool | dynstr_append (DYNAMIC_STRING *str, const char *append) |
| my_bool | dynstr_append_mem (DYNAMIC_STRING *str, const char *append, uint length) |
| my_bool | dynstr_set (DYNAMIC_STRING *str, const char *init_str) |
| my_bool | dynstr_realloc (DYNAMIC_STRING *str, ulong additional_size) |
| void | dynstr_free (DYNAMIC_STRING *str) |
| void | init_alloc_root (MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size) |
| gptr | alloc_root (MEM_ROOT *mem_root, unsigned int Size) |
| gptr | multi_alloc_root (MEM_ROOT *mem_root,...) |
| void | free_root (MEM_ROOT *root, myf MyFLAGS) |
| void | set_prealloc_root (MEM_ROOT *root, char *ptr) |
| void | reset_root_defaults (MEM_ROOT *mem_root, uint block_size, uint prealloc_size) |
| char * | strdup_root (MEM_ROOT *root, const char *str) |
| char * | strmake_root (MEM_ROOT *root, const char *str, uint len) |
| char * | memdup_root (MEM_ROOT *root, const char *str, uint len) |
| int | get_defaults_options (int argc, char **argv, char **defaults, char **extra_defaults, char **group_suffix) |
| int | load_defaults (const char *conf_file, const char **groups, int *argc, char ***argv) |
| int | modify_defaults_file (const char *file_location, const char *option, const char *option_value, const char *section_name, int remove_option) |
| int | my_search_option_files (const char *conf_file, int *argc, char ***argv, uint *args_used, Process_option_func func, void *func_ctx) |
| void | free_defaults (char **argv) |
| void | my_print_default_files (const char *conf_file) |
| void | print_defaults (const char *conf_file, const char **groups) |
| my_bool | my_compress (byte *, ulong *, ulong *) |
| my_bool | my_uncompress (byte *, ulong *, ulong *) |
| byte * | my_compress_alloc (const byte *packet, ulong *len, ulong *complen) |
| int | packfrm (const void *, uint, const void **, uint *) |
| int | unpackfrm (const void **, uint *, const void *) |
| ha_checksum | my_checksum (ha_checksum crc, const byte *mem, uint count) |
| uint | my_bit_log2 (ulong value) |
| uint32 | my_round_up_to_next_power (uint32 v) |
| uint | my_count_bits (ulonglong v) |
| uint | my_count_bits_ushort (ushort v) |
| void | my_sleep (ulong m_seconds) |
| ulong | crc32 (ulong crc, const uchar *buf, uint len) |
| uint | my_set_max_open_files (uint files) |
| void | my_free_open_file_info (void) |
| ulonglong | my_getsystime (void) |
| my_bool | my_gethwaddr (uchar *to) |
| int | my_getncpus () |
| int | my_getpagesize (void) |
| void * | my_mmap (void *, size_t, int, int, int, my_off_t) |
| int | my_munmap (void *, size_t) |
| int | my_msync (int, void *, size_t, int) |
| uint | get_charset_number (const char *cs_name, uint cs_flags) |
| uint | get_collation_number (const char *name) |
| const char * | get_charset_name (uint cs_number) |
| CHARSET_INFO * | get_charset (uint cs_number, myf flags) |
| CHARSET_INFO * | get_charset_by_name (const char *cs_name, myf flags) |
| CHARSET_INFO * | get_charset_by_csname (const char *cs_name, uint cs_flags, myf my_flags) |
| void | free_charsets (void) |
| char * | get_charsets_dir (char *buf) |
| my_bool | my_charset_same (CHARSET_INFO *cs1, CHARSET_INFO *cs2) |
| my_bool | init_compiled_charsets (myf flags) |
| void | add_compiled_collation (CHARSET_INFO *cs) |
| ulong | escape_string_for_mysql (CHARSET_INFO *charset_info, char *to, ulong to_length, const char *from, ulong length) |
| ulong | escape_quotes_for_mysql (CHARSET_INFO *charset_info, char *to, ulong to_length, const char *from, ulong length) |
| void | thd_increment_bytes_sent (ulong length) |
| void | thd_increment_bytes_received (ulong length) |
| void | thd_increment_net_big_packet_count (ulong length) |
Variables | |
| C_MODE_START int NEAR | my_errno |
| int | errno |
| char NEAR | errbuff [NRERRBUFFS][ERRMSGSIZE] |
| char * | home_dir |
| const char * | my_progname |
| char NEAR | curr_dir [] |
| int(*) | error_handler_hook (uint my_err, const char *str, myf MyFlags) |
| int(*) | fatal_error_handler_hook (uint my_err, const char *str, myf MyFlags) |
| uint | my_file_limit |
| CHARSET_INFO * | default_charset_info |
| CHARSET_INFO * | all_charsets [256] |
| CHARSET_INFO | compiled_charsets [] |
| ulong | my_file_opened |
| ulong | my_stream_opened |
| ulong | my_tmp_file_created |
| uint | mysys_usage_id |
| my_bool | my_init_done |
| void(* | my_sigtstp_cleanup )(void) |
| void(*)(*)(*) | my_abort_hook (int) |
| int NEAR | my_umask |
| int NEAR NEAR | my_umask_dir |
| int NEAR NEAR NEAR | my_recived_signals |
| int NEAR NEAR NEAR NEAR | my_safe_to_handle_signal |
| int NEAR NEAR NEAR NEAR NEAR | my_dont_interrupt |
| my_bool NEAR | mysys_uses_curses |
| my_bool NEAR | my_use_symdir |
| ulong | sf_malloc_cur_memory |
| ulong | sf_malloc_max_memory |
| ulong | my_default_record_cache_size |
| my_bool NEAR | my_disable_locking |
| my_bool NEAR NEAR | my_disable_async_io |
| my_bool NEAR NEAR NEAR | my_disable_flush_key_blocks |
| my_bool NEAR NEAR NEAR NEAR | my_disable_symlinks |
| char | wild_many |
| char | wild_one |
| char | wild_prefix |
| const char * | charsets_dir |
| char * | defaults_extra_file |
| const char * | defaults_group_suffix |
| const char * | defaults_file |
| my_bool | timed_mutexes |
| st_my_file_info * | my_file_info |
Definition at line 789 of file my_sys.h.
Referenced by alloc_root(), handler::ha_open(), and reset_root_defaults().
| #define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) |
Definition at line 790 of file my_sys.h.
Referenced by init_alloc_root(), reset_root_defaults(), Sensitive_cursor::Sensitive_cursor(), and trie_init().
Definition at line 660 of file my_sys.h.
Referenced by get_all_tables(), get_system_var(), sys_var_key_cache_long::update(), and sys_var_key_buffer_size::update().
| #define CALLER_INFO |
Definition at line 171 of file my_sys.h.
Referenced by add_init_command(), and Load_log_processor::init().
| #define DFLT_INIT_HITS 3 |
Definition at line 118 of file my_sys.h.
Referenced by _mi_balance_page(), _mi_ck_real_delete(), _mi_enlarge_root(), _mi_ft_convert_to_ft2(), _mi_search(), _mi_search_first(), _mi_search_last(), _mi_search_next(), _mi_search_pos(), _mi_split_page(), check_k_link(), chk_index_down(), chk_key(), d_search(), del(), flush_pending_blocks(), mi_preload(), movepoint(), sort_insert_key(), sort_one_index(), underflow(), and w_search().
| #define dynamic_array_ptr | ( | array, | |||
| array_index | ) | ((array)->buffer+(array_index)*(array)->size_of_element) |
Definition at line 768 of file my_sys.h.
Referenced by _mi_ft_convert_to_ft2(), main(), and QUICK_RANGE_SELECT::row_in_ranges().
| #define dynamic_element | ( | array, | |||
| array_index, | |||||
| type | ) | ((type)((array)->buffer) +(array_index)) |
Definition at line 769 of file my_sys.h.
Referenced by _create_index_by_sort(), acl_check_host(), acl_get(), acl_getroot(), acl_getroot_no_password(), acl_insert_db(), acl_insert_user(), acl_load(), acl_update_db(), acl_update_user(), check_acl_user(), clean_up(), display_table_locks(), fill_schema_schema_privileges(), fill_schema_user_privileges(), find_acl_user(), find_message(), free_used_memory(), Load_log_processor::grab_event(), Load_log_processor::grab_fname(), handle_grant_struct(), hash_check(), hash_delete(), hash_element(), hash_first(), hash_free_elements(), hash_next(), hash_replace(), hash_update(), init_check_host(), my_hash_insert(), mysql_revoke_all(), mysql_show_grants(), optimize_keyuse(), plugin_call_deinitializer(), plugin_call_initializer(), plugin_dl_del(), plugin_dl_find(), plugin_dl_insert_or_reuse(), plugin_foreach(), plugin_free(), plugin_init(), plugin_insert_or_reuse(), plugin_register_builtin(), Load_log_processor::process(), remove_status_vars(), shrink_var_array(), and Event_scheduler::stop_all_running_events().
| #define ERRMSGSIZE (SC_MAXWIDTH) |
Definition at line 46 of file my_sys.h.
Referenced by my_error(), my_printf_error(), mysql_admin_table(), ha_myisam::preload_keys(), and push_warning_printf().
Definition at line 738 of file my_sys.h.
Referenced by _create_index_by_sort(), _mi_check_index(), _mi_cmp_dynamic_record(), _mi_cmp_static_record(), _mi_read_dynamic_record(), _mi_read_rnd_dynamic_record(), _mi_read_rnd_static_record(), _mi_read_static_record(), filesort(), MYSQL_BIN_LOG::flush_and_sync(), merge_many_buff(), mi_extra(), mi_panic(), mi_rrnd(), mi_scan_init(), mi_sort_records(), my_b_seek(), MYSQL_BIN_LOG::open(), MYSQL_LOG::open(), sort_delete_record(), and MYSQL_QUERY_LOG::write().
| #define GETDATE_DATE_TIME 1 |
Definition at line 129 of file my_sys.h.
Referenced by get_date(), write_footer(), and write_parameter().
| #define GETDATE_FIXEDLENGTH 16 |
| #define GETDATE_GMT 8 |
| #define GETDATE_HHMMSSTIME 4 |
| #define GETDATE_SHORT_DATE 2 |
| #define MAP_FAILED ((void *)-1) |
Definition at line 868 of file my_sys.h.
Referenced by history_do_write(), and read_history_range().
| #define MAP_NORESERVE 0 |
| #define MAP_PRIVATE 0x0002 |
Definition at line 866 of file my_sys.h.
Referenced by mapSegment(), mmaptest(), NDB_MAIN(), and unmaptest().
| #define MAP_SHARED 0x0001 |
| #define ME_BELL 4 |
Definition at line 87 of file my_sys.h.
Referenced by _mymalloc(), drop_db(), execute_commands(), find_files(), get_charset(), get_charset_by_csname(), get_charset_by_name(), get_pidfile(), get_replace_strings(), ha_create_table(), init_replace(), my_chsize(), my_close(), my_copystat(), my_delete(), my_dir(), my_end(), my_fclose(), my_fdopen(), my_fopen(), my_fread(), my_fwrite(), my_getwd(), my_lock(), my_lread(), my_lwrite(), my_malloc(), my_message_no_curses(), my_mkdir(), my_once_alloc(), my_pread(), my_pwrite(), my_read(), my_realloc(), my_register_filename(), my_rename(), my_setwd(), my_stat(), my_sync(), my_write(), print_lock_error(), sql_connect(), static_get_options(), and write_huff_tree().
| #define ME_NOINPUT 128 |
Definition at line 92 of file my_sys.h.
Referenced by cache_remove_open_tmp(), close_cached_file(), create_temp_file(), and my_delete().
| #define ME_NOREFRESH 64 |
Definition at line 91 of file my_sys.h.
Referenced by mi_report_error(), my_fwrite(), my_message_sql(), my_pwrite(), and my_write().
| #define ME_OLDWIN 2 |
| #define ME_WAITTANG 32 |
Definition at line 90 of file my_sys.h.
Referenced by _mymalloc(), filesort(), find_all_keys(), find_files(), ha_create_table(), my_chsize(), my_close(), my_copystat(), my_delete(), my_dir(), my_fclose(), my_fdopen(), my_fopen(), my_fread(), my_fwrite(), my_getwd(), my_lock(), my_lread(), my_lwrite(), my_malloc(), my_mkdir(), my_once_alloc(), my_pread(), my_pwrite(), my_read(), my_realloc(), my_register_filename(), my_rename(), my_setwd(), my_stat(), my_sync(), my_write(), MYSQL_LOG::open(), open_table_error(), and print_lock_error().
| #define my_access access |
Definition at line 603 of file my_sys.h.
Referenced by check_db_dir_existence(), create_instance_in_file(), User_map::load(), mysql_rename_db(), and sys_check_log_path().
| #define my_afree | ( | PTR | ) | my_free(PTR,MYF(MY_WME)) |
Definition at line 201 of file my_sys.h.
Referenced by _mi_ck_real_delete(), _mi_cmp_dynamic_record(), _mi_cmp_dynamic_unique(), _mi_update_blob_record(), _mi_write_blob_record(), bin2decimal(), chk_index(), d_search(), del(), do_div_mod(), print_table_data(), qsort(), recreate_table(), reopen_tables(), sort_one_index(), sort_record_index(), w_search(), and write_huff_tree().
| #define my_alloca | ( | SZ | ) | my_malloc(SZ,MYF(0)) |
Definition at line 200 of file my_sys.h.
Referenced by _mi_ck_real_delete(), _mi_cmp_dynamic_record(), _mi_cmp_dynamic_unique(), _mi_update_blob_record(), _mi_write_blob_record(), bin2decimal(), chk_index(), compress_isam_file(), d_search(), del(), do_div_mod(), get_statistic(), mi_open(), mi_sort_records(), QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range(), QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range(), print_table_data(), qsort(), recreate_table(), reopen_tables(), sort_one_index(), sort_record_index(), w_search(), and write_huff_tree().
| #define MY_ALLOW_ZERO_PTR 64 |
Definition at line 70 of file my_sys.h.
Referenced by _mi_cmp_dynamic_unique(), _myfree(), _myrealloc(), add_init_command(), alloc_dynamic(), batch_readline_end(), clean_up(), cleanup(), CLI_MYSQL_REAL_CONNECT(), close_cached_file(), close_cons(), close_files(), closefrm(), com_connect(), com_prompt(), com_use(), dump_all_tables_in_db(), dump_routines_for_db(), dump_selected_tables(), dump_table(), filesort_free_buffers(), free_delayed_insert_blobs(), free_plugin_mem(), free_replace_regex(), Named_value::free_str(), free_used_memory(), get_current_db(), get_one_option(), get_options(), get_replace_column(), get_table_structure(), init_line_buffer_from_string(), init_server_components(), init_username(), main(), mi_alloc_rec_buff(), mi_close(), mi_preload(), my_fclose(), my_realloc(), my_yyoverflow(), mysql_change_user(), mysql_close_free(), mysql_close_free_options(), mysql_end(), mysql_manager_close(), mysql_options(), mysql_read_default_options(), mysql_select_db(), mysql_write_frm(), ndb_mgm_destroy_handle(), ndb_mgm_destroy_logevent_handle(), ndb_mgm_set_name(), net_end(), open_cached_file(), open_table_from_share(), ilink::operator delete(), Log_event::operator delete(), read_line(), Log_event::read_log_event(), set_dynamic(), Gis_read_stream::set_error_msg(), sort_write_record(), sys_var_thd_date_time_format::update2(), update_hash(), update_sys_var_str(), update_sys_var_str_path(), var_set(), vio_delete(), vio_reset(), Create_file_log_event::~Create_file_log_event(), Gis_read_stream::~Gis_read_stream(), QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT(), Rotate_log_event::~Rotate_log_event(), and Transparent_file::~Transparent_file().
| #define MY_APPEND_EXT 256 |
Definition at line 106 of file my_sys.h.
Referenced by handler::delete_table(), fn_format(), fn_format_relative_to_data_home(), ha_myisam::info(), make_default_log_name(), mi_delete_table(), mi_open(), mi_rename(), myrg_create(), myrg_open(), mysql_table_grant(), ha_myisammrg::open(), readfrm(), and writefrm().
| #define my_b_bytes_in_cache | ( | info | ) |
Value:
(uint) (*(info)->current_end - \ *(info)->current_pos)
Definition at line 523 of file my_sys.h.
Referenced by my_b_gets(), and MYSQL_BIN_LOG::write().
Definition at line 486 of file my_sys.h.
Referenced by _create_index_by_sort(), filesort(), and SQL_SELECT::SQL_SELECT().
| #define my_b_EOF INT_MIN |
Definition at line 488 of file my_sys.h.
Referenced by _my_b_get(), READ_INFO::find_start_of_fields(), READ_INFO::next_line(), READ_INFO::read_field(), and READ_INFO::read_fixed_length().
| #define my_b_get | ( | info | ) |
Definition at line 487 of file my_sys.h.
Referenced by _create_index_by_sort(), MYSQL_BIN_LOG::close(), close_cached_file(), end_send(), filesort(), find_all_keys(), init_read_record(), MYSQL_BIN_LOG::open(), MYSQL_BIN_LOG::open_index_file(), write_key(), write_keys(), and write_keys_varlen().
Value:
((info)->read_pos + (Count) <= (info)->read_end ?\ (memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \ ((info)->read_pos+=(Count)),0) :\ (*(info)->read_function)((info),Buffer,Count))
Definition at line 490 of file my_sys.h.
Referenced by _create_index_by_sort(), _mi_read_rnd_static_record(), String::append(), check_binlog_magic(), check_header(), dump_local_log_entries(), examine_log(), find_all_keys(), read_buffpek_from_file(), Log_event::read_log_event(), read_string(), rr_from_tempfile(), rr_unpack_from_tempfile(), and sort_get_next_record().
| #define my_b_tell | ( | info | ) |
Value:
Definition at line 516 of file my_sys.h.
Referenced by _mi_read_rnd_static_record(), binlog_savepoint_rollback(), binlog_savepoint_set(), check_binlog_magic(), check_header(), dump_local_log_entries(), binlog_trx_data::empty(), examine_log(), filesort(), find_all_keys(), MYSQL_BIN_LOG::find_log_pos(), MYSQL_BIN_LOG::find_next_log(), MYSQL_BIN_LOG::get_current_log(), merge_buffers(), my_b_filelength(), my_b_safe_tell(), Log_event::read_log_event(), reinit_io_cache(), MYSQL_BIN_LOG::rotate_and_purge(), MYSQL_BIN_LOG::write(), write_keys(), and write_keys_varlen().
Value:
((info)->write_pos + (Count) <=(info)->write_end ?\ (memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\ ((info)->write_pos+=(Count)),0) : \ (*(info)->write_function)((info),(Buffer),(Count)))
Definition at line 496 of file my_sys.h.
Referenced by _mi_write_part_record(), _mi_write_static_record(), merge_buffers(), my_b_safe_write(), my_b_vprintf(), my_var_write(), MYSQL_BIN_LOG::open(), MYSQL_LOG::open(), sort_write_record(), unique_write_to_file(), MYSQL_BIN_LOG::write(), MYSQL_QUERY_LOG::write(), write_data_suffix(), write_key(), write_keys(), and write_merge_key().
| #define my_b_write_byte | ( | info, | |||
| chr | ) |
Value:
(((info)->write_pos < (info)->write_end) ?\ ((*(info)->write_pos++)=(chr)) :\ (_my_b_write(info,0,0) , ((*(info)->write_pos++)=(chr))))
| #define MY_CHECK_ERROR 1 |
Definition at line 76 of file my_sys.h.
Referenced by abort_not_supported_test(), die(), main(), my_end(), mysql_end(), run_test(), and unireg_abort().
| #define my_checkmalloc | ( | ) |
| #define MY_COPYTIME 64 |
| #define MY_DELETE_OLD 256 |
| #define MY_DONT_CHECK_FILESIZE 128 |
Definition at line 60 of file my_sys.h.
Referenced by dump_local_log_entries(), init_io_cache(), and open_binlog().
| #define MY_DONT_FREE_DBUG 4 |
| #define MY_DONT_OVERWRITE_FILE 1024 |
Definition at line 74 of file my_sys.h.
Referenced by ha_myisam::backup(), my_copy(), and mysql_create_like_table().
| #define MY_DONT_WAIT 64 |
Definition at line 68 of file my_sys.h.
Referenced by lock_file(), mi_extra(), mi_open(), and my_lock().
| #define MY_ERRNO_EDOM 33 |
| #define MY_ERRNO_ERANGE 34 |
| #define MY_FAE 8 |
Definition at line 54 of file my_sys.h.
Referenced by _mymalloc(), append_stmt_result(), clean_up(), copy_data_between_tables(), create_check_file(), create_defaults_file(), do_test(), fill_buffer(), fix_paths(), get_one_option(), get_replace(), get_replace_column(), get_tty_password(), get_word(), ha_known_exts(), init_line_buffer(), init_line_buffer_from_string(), init_replace_regex(), list_cons(), make_empty_rec(), mi_preload(), my_chsize(), my_close(), my_copystat(), my_delete(), my_dir(), my_fclose(), my_fdopen(), my_fopen(), my_fread(), my_fwrite(), my_lread(), my_lwrite(), my_malloc(), my_mkdir(), my_once_alloc(), my_pread(), my_pwrite(), my_read(), my_realloc(), my_register_filename(), my_rename(), my_stat(), my_str_free_mysqld(), my_str_malloc_mysqld(), my_write(), mysql_delete(), open_file(), open_isam_files(), ilink::operator new(), Log_event::operator new(), parse_delimiter(), parse_message_string(), reg_replace(), setval(), and update_sys_var_str_path().
| #define MY_FFNF 1 |
Definition at line 51 of file my_sys.h.
Referenced by my_fopen(), my_mkdir(), my_register_filename(), and str_to_file().
| #define MY_FILE_ERROR ((uint) ~0) |
Definition at line 48 of file my_sys.h.
Referenced by _mi_read_dynamic_record(), _mi_read_rnd_dynamic_record(), _mi_rec_unpack(), create_defaults_file(), Transparent_file::get_value(), mi_state_info_read_dsk(), my_lread(), my_pread(), my_pwrite(), my_read(), my_write(), Transparent_file::read_next(), and sql_parse_prepare().
| #define MY_FNABP 2 |
Definition at line 52 of file my_sys.h.
Referenced by create_check_file(), create_defaults_file(), init_io_cache(), mi_preload(), my_copy(), my_fread(), my_fwrite(), my_lread(), my_lwrite(), my_pread(), my_pwrite(), my_quick_read(), my_read(), my_write(), and str_to_file().
| #define my_free | ( | PTR, | |||
| FG | ) | ((void)FG,my_no_flags_free(PTR)) |
Definition at line 169 of file my_sys.h.
Referenced by _create_index_by_sort(), _mi_ck_write_btree(), _mi_cmp_dynamic_unique(), _mi_read_pack_info(), ac_trie_prepare(), add_init_command(), append_stmt_result(), batch_readline_command(), batch_readline_end(), batch_readline_init(), binlog_close_connection(), bitmap_free(), ha_tina::check(), ha_archive::check(), sys_var_thd_date_time_format::check(), clean_up(), cleanup(), st_relay_log_info::clear_tables_to_lock(), CLI_MYSQL_REAL_CONNECT(), cli_stmt_execute(), cli_use_result(), close_cached_file(), close_cons(), close_files(), close_temporary(), closefrm(), com_connect(), com_prompt(), com_use(), completion_hash_free(), compress(), create_key_cache(), default_local_infile_end(), delete_dynamic(), delete_queue(), delete_tree_element(), Load_log_processor::destroy(), do_connect(), drop_locked_tables(), dump_all_tables_in_db(), dump_routines_for_db(), dump_selected_tables(), dump_table(), dyn_string_cmp(), dynstr_free(), end_file_buffer(), end_io_cache(), end_key_cache(), examine_log(), fakebigcodes(), file_info_free(), filecopy(), filesort_free_buffers(), flush_ft_buf(), String::free(), free_buffer(), free_cache_entry(), free_counts_and_tree_and_queue(), free_dbopt(), free_delayed_insert_blobs(), free_io_cache(), free_key_cache(), free_plugin_mem(), free_pointer_array(), free_record(), free_replace(), free_replace_column(), free_replace_regex(), free_root(), free_rows(), free_sets(), free_share(), ha_archive::free_share(), Named_value::free_str(), Rpl_filter::free_string_array(), free_table_ent(), Log_event::free_temp_buf(), free_tmpdir(), free_used_memory(), free_user(), free_user_var(), ft_boolean_close_search(), ft_free_stopwords(), ft_init_boolean_search(), ft_init_stopwords(), ft_nlq_close_search(), FT_STOPWORD_free(), get_current_db(), get_form_pos(), get_one_option(), get_options(), get_or_create_user_conn(), get_replace(), get_replace_column(), get_schema_tables_record(), get_share(), get_table_structure(), get_variable(), ha_create_table_from_engine(), ha_finish_errors(), ha_recover(), handle_local_infile(), handle_manager(), handle_request_for_tables(), heap_rename(), hp_close(), hp_free(), init_key_cache(), init_replace(), init_replace_regex(), init_server_components(), init_sets(), init_username(), insert_pointer_name(), ip_to_hostname(), join_init_cache(), join_same_trees(), lex_end(), list_free(), lock_db_free_element(), lock_db_insert(), lock_table_name(), log(), main(), make_empty_rec(), make_huff_trees(), make_select(), mi_close(), mi_end_bulk_insert(), mi_preload(), modify_defaults_file(), mrg_close(), my_close(), my_dir(), my_dirend(), my_error_register(), my_error_unregister(), my_fclose(), my_free_open_file_info(), my_read_charset_file(), my_realloc(), my_stat(), my_str_free_mysqld(), my_string_ptr_sort(), myrg_close(), myrg_open(), mysql_change_db(), mysql_change_user(), mysql_client_binlog_statement(), mysql_close(), mysql_close_free(), mysql_close_free_options(), mysql_create_frm(), mysql_end(), mysql_free_result(), mysql_ha_hash_free(), mysql_ha_open(), mysql_lock_abort(), mysql_lock_abort_for_thread(), mysql_lock_downgrade_write(), mysql_lock_merge(), mysql_lock_tables(), mysql_manager_close(), mysql_options(), mysql_read_default_options(), mysql_select_db(), mysql_stmt_close(), mysql_store_result(), mysql_truncate(), mysql_unlock_tables(), mysql_write_frm(), ndb_mgm_destroy_handle(), ndb_mgm_destroy_logevent_handle(), ndb_mgm_set_name(), net_end(), net_real_write(), MYSQL_BIN_LOG::new_file_impl(), open_binary_frm(), open_cached_file(), open_isam_files(), open_table(), open_table_from_share(), open_temporary_table(), open_unireg_entry(), ilink::operator delete(), Event_timed::operator delete(), Log_event::operator delete(), ha_archive::optimize(), parse_error_offset(), process_all_tables_in_db(), process_event(), process_selected_tables(), put_dbopt(), read_buffpek_from_file(), READ_INFO::READ_INFO(), read_line(), Log_event::read_log_event(), read_string(), release_ddl_log(), remove_dup_with_hash_index(), MYSQL_QUERY_LOG::reopen_file(), ha_tina::repair(), My_auto_ptr< T >::reset(), QUICK_RANGE_SELECT::reset(), MYSQL_BIN_LOG::reset_logs(), reset_root_defaults(), safe_hash_entry_free(), safe_hash_set(), setval(), sql_element_free(), statement_cleanup(), store_create_info(), BackupRestore::translate_frm(), unescape(), sys_var_thd_date_time_format::update2(), update_auto_increment_key(), update_hash(), update_sys_var_str(), update_sys_var_str_path(), User_level_lock::User_level_lock(), var_free(), var_set(), vio_delete(), vio_reset(), wf_end(), write_delayed(), ha_archive::write_row(), xid_free_hash(), Buffer::~Buffer(), Create_file_log_event::~Create_file_log_event(), Format_description_log_event::~Format_description_log_event(), Gis_read_stream::~Gis_read_stream(), ha_tina::~ha_tina(), mapped_files::~mapped_files(), My_auto_ptr< T >::~My_auto_ptr(), NAMED_LIST::~NAMED_LIST(), Query_log_event::~Query_log_event(), QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT(), READ_INFO::~READ_INFO(), Rotate_log_event::~Rotate_log_event(), Transparent_file::~Transparent_file(), and User_level_lock::~User_level_lock().
| #define MY_FREE_ON_ERROR 128 |
Definition at line 71 of file my_sys.h.
Referenced by _myrealloc(), modify_defaults_file(), my_realloc(), my_yyoverflow(), and sort_write_record().
| #define my_get_large_page_size | ( | ) | (0) |
| #define MY_GIVE_INFO 2 |
Definition at line 77 of file my_sys.h.
Referenced by do_test(), main(), my_end(), mysql_end(), and unireg_abort().
| #define MY_HOLD_ON_ERROR 256 |
Definition at line 72 of file my_sys.h.
Referenced by _mi_read_pack_info(), _myrealloc(), and my_realloc().
| #define MY_HOLD_ORIGINAL_MODES 128 |
Definition at line 65 of file my_sys.h.
Referenced by ha_myisam::backup(), compress(), and my_copy().
| #define MY_INIT | ( | name | ) | ; { my_progname= name; my_init(); } |
Definition at line 754 of file my_sys.h.
Referenced by _create_index_by_sort(), _mi_insert(), acl_load(), add_status_vars(), display_table_locks(), Dynamic_array< Elem >::Dynamic_array(), sp_head::init(), QUICK_GROUP_MIN_MAX_SELECT::init(), Named_value_arr::init(), init_check_host(), init_replace_regex(), init_sym_table(), Rpl_filter::init_table_rule_array(), init_tmpdir(), load_defaults(), main(), my_dir(), parse_error_string(), plugin_init(), QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(), sp_pcontext::sp_pcontext(), Event_scheduler::stop_all_running_events(), and update_ref_and_keys().
| #define MY_KEEP_PREALLOC 1 |
Definition at line 121 of file my_sys.h.
Referenced by dispatch_command(), free_root(), handle_bootstrap(), mysql_stmt_prepare(), mysql_stmt_store_result(), reset_stmt_handle(), and stmt_read_row_from_cursor().
| #define MY_LINK_WARNING 32 |
Definition at line 61 of file my_sys.h.
Referenced by change_to_newfile(), convert_file(), and my_copystat().
| #define my_malloc_ci | ( | SZ, | |||
| FLAG | ) | my_malloc( SZ, FLAG ) |
| #define MY_MARK_BLOCKS_FREE 2 |
Definition at line 122 of file my_sys.h.
Referenced by _mi_ft_add(), _mi_ft_del(), _mi_ft_update(), free_root(), reset_tree(), and sort_ft_key_read().
| #define MY_NABP 4 |
Definition at line 53 of file my_sys.h.
Referenced by _mi_cmp_buffer(), _mi_cmp_static_record(), _mi_cmp_static_unique(), _mi_decrement_open_count(), _mi_delete_static_record(), _mi_mark_file_changed(), _mi_pack_get_block_info(), _mi_read_cache(), _mi_read_dynamic_record(), _mi_read_pack_info(), _mi_read_pack_record(), _mi_read_rnd_dynamic_record(), _mi_read_rnd_pack_record(), _mi_read_static_record(), _mi_update_static_record(), _mi_write_static_record(), _my_b_write(), chk_del(), compress(), convert_pipe(), copy_up_file_and_fill(), create_frm(), create_instance_in_file(), create_pid_file(), delete_dynamic_record(), dump_local_log_entries(), dyn_string_cmp(), examine_log(), filecopy(), find_key_block(), flush_buffer(), flush_cached_blocks(), get_form_pos(), init_io_cache(), key_cache_read(), key_cache_write(), Load_log_processor::load_old_format_file(), make_new_entry(), mi_base_info_write(), mi_keydef_write(), mi_keyseg_write(), mi_open(), mi_recinfo_write(), mi_sort_records(), mi_state_info_read_dsk(), mi_state_info_write(), mi_uniquedef_write(), modify_defaults_file(), my_append(), my_b_append(), my_b_flush_io_cache(), my_block_write(), my_chsize(), my_copy(), my_fread(), my_fwrite(), my_lread(), my_lwrite(), my_pread(), my_pwrite(), my_quick_read(), my_read(), my_write(), myisamchk_init(), myrg_create(), myrg_open(), mysql_create_frm(), mysql_frm_type(), MYSQL_LOG::open(), open_binary_frm(), open_cached_file(), open_table_def(), Load_log_processor::process(), Load_log_processor::process_first_event(), read_string(), read_texts(), sort_one_index(), sort_record_index(), unlink_deleted_block(), update_backward_delete_link(), update_dynamic_record(), ha_tina::update_row(), Item_load_file::val_str(), write_db_opt(), write_header(), ha_tina::write_row(), and writefrm().
| #define MY_PACK_FILENAME 8 |
| #define MY_RAID 64 |
| #define MY_REDEL_MAKE_BACKUP 256 |
| #define MY_RELATIVE_PATH 128 |
Definition at line 105 of file my_sys.h.
Referenced by fn_format(), mysql_load(), and Item_load_file::val_str().
| #define MY_REMOVE_OPTION 1 |
| #define MY_REMOVE_SECTION 2 |
Definition at line 82 of file my_sys.h.
Referenced by Drop_instance::execute_impl(), and modify_defaults_file().
| #define MY_REPLACE_DIR 1 |
Definition at line 98 of file my_sys.h.
Referenced by check_result(), create_file(), fn_format(), and test_if_case_insensitive().
| #define MY_REPLACE_EXT 2 |
Definition at line 99 of file my_sys.h.
Referenced by check_result(), ha_tina::create(), create_tmp_table(), dump_progress(), dump_result_to_log_file(), dump_result_to_reject_file(), dyn_string_cmp(), fn_format(), get_share(), ha_archive::get_share(), init_server_components(), mysql_create_like_table(), MYSQL_BIN_LOG::open_index_file(), ha_tina::open_update_temp_file_if_needed(), ha_archive::optimize(), ha_tina::repair(), ha_tina::rnd_end(), and test_if_case_insensitive().
| #define MY_RESOLVE_LINK 128 |
| #define MY_RESOLVE_SYMLINKS 16 |
Definition at line 102 of file my_sys.h.
Referenced by fn_format(), mi_open(), and mysql_table_grant().
| #define MY_RETURN_REAL_PATH 32 |
| #define MY_SAFE_PATH 64 |
Definition at line 104 of file my_sys.h.
Referenced by Instance_options::fill_log_options(), fn_format(), fn_format_relative_to_data_home(), init_server_components(), and search_default_file_with_ext().
| #define MY_SEEK_CUR 1 |
| #define MY_SEEK_END 2 |
Definition at line 112 of file my_sys.h.
Referenced by chk_index_down(), chk_size(), ft_init_stopwords(), init_io_cache(), make_new_entry(), mi_repair(), mi_repair_by_sort(), mi_repair_parallel(), my_b_append_tell(), my_b_filelength(), my_chsize(), MYSQL_BIN_LOG::open_index_file(), recreate_table(), and test_if_almost_full().
| #define MY_SEEK_NOT_DONE 32 |
Definition at line 67 of file my_sys.h.
Referenced by _mi_read_rnd_dynamic_record(), _mi_read_rnd_static_record(), _mi_readinfo(), _mi_writeinfo(), _myisam_log(), _myisam_log_command(), _myisam_log_record(), lock_file(), mi_lock_database(), and my_lock().
| #define MY_SEEK_SET 0 |
Definition at line 110 of file my_sys.h.
Referenced by _mi_get_block_info(), _mi_pack_get_block_info(), _my_b_read(), _my_b_seq_read(), _my_b_write(), azrewind(), azseek(), compress(), copy_up_file_and_fill(), filecopy(), ft_init_stopwords(), get_form_pos(), Transparent_file::get_value(), Transparent_file::init_buff(), make_new_entry(), mi_open(), modify_defaults_file(), my_b_append_tell(), my_b_fill(), my_b_flush_io_cache(), my_chsize(), my_fwrite(), my_lock(), my_pread(), my_pwrite(), mysql_create_frm(), open_binary_frm(), read_meta_file(), ha_archive::read_meta_file(), Show_instance_log::write_data(), write_header(), write_meta_file(), and ha_archive::write_meta_file().
| #define MY_THREADSAFE 128 |
| #define MY_UNPACK_FILENAME 4 |
Definition at line 100 of file my_sys.h.
Referenced by ha_tina::create(), create_file(), create_tmp_table(), default_local_infile_init(), handler::delete_table(), dyn_string_cmp(), Instance_options::fill_log_options(), fn_format(), fn_format_relative_to_data_home(), get_one_option(), get_share(), ha_archive::get_share(), init_server_components(), make_default_log_name(), mi_delete_table(), mi_open(), mi_rename(), myrg_create(), myrg_open(), mysql_load(), mysql_register_view(), mysql_table_grant(), ha_myisammrg::open(), open_file(), MYSQL_BIN_LOG::open_index_file(), ha_tina::open_update_temp_file_if_needed(), ha_archive::optimize(), read_server_arguments(), readfrm(), ha_tina::repair(), ha_tina::rnd_end(), search_default_file_with_ext(), sql_create_definition_file(), str_to_file(), test_if_case_insensitive(), Item_load_file::val_str(), and writefrm().
| #define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 |
| #define MY_WAIT_GIVE_USER_A_MESSAGE 10 |
| #define MY_WAIT_IF_FULL 32 |
Definition at line 56 of file my_sys.h.
Referenced by compress(), ha_myisam::enable_indexes(), examine_log(), find_key_block(), flush_buffer(), flush_cached_blocks(), key_cache_write(), mi_extra(), mi_repair(), mi_repair_by_sort(), mi_repair_parallel(), mi_sort_records(), my_fwrite(), my_pwrite(), my_write(), myisamchk_init(), MYSQL_LOG::open(), MYSQL_BIN_LOG::open_index_file(), sort_one_index(), and write_header().
| #define MY_WME 16 |
Definition at line 55 of file my_sys.h.
Referenced by _mi_insert(), _mi_read_pack_info(), _mi_writeinfo(), _mymalloc(), add_collation(), add_init_command(), Rpl_filter::add_table_rule(), Rpl_filter::add_wild_table_rule(), alloc_dynamic(), alloc_query_str(), alloc_root(), append_stmt_result(), ha_myisam::backup(), batch_readline_command(), batch_readline_init(), bitmap_init(), build_insert_string(), build_query_string(), build_table_string(), cache_remove_open_tmp(), ha_tina::chain_append(), change_to_newfile(), ha_tina::check(), ha_archive::check(), ha_myisam::check(), clean_up(), st_relay_log_info::clear_tables_to_lock(), CLI_MYSQL_REAL_CONNECT(), cli_read_rows(), cli_stmt_execute(), cli_use_result(), MYSQL_LOG::close(), close_cached_file(), com_charset(), com_connect(), com_edit(), com_prompt(), com_use(), Event_timed::compile(), completion_hash_init(), compress(), convert_file(), convert_pipe(), copy_up_file_and_fill(), ha_tina::create(), ha_heap::create(), create_check_file(), create_defaults_file(), create_file(), Create_file_log_event::Create_file_log_event(), create_frm(), create_header_files(), create_key_cache(), create_pid_file(), create_sort_index(), create_sys_files(), create_temp_file(), Table_triggers_list::create_trigger(), cs_alloc(), cs_copy_data(), date_time_format_copy(), default_local_infile_end(), delayed_get_table(), ha_tina::delete_all_rows(), delete_dynamic(), Load_log_processor::destroy(), do_connect(), dump_local_log_entries(), dump_remote_log_entries(), dump_triggers_for_table(), dyn_string_cmp(), dynstr_append_mem(), dynstr_free(), dynstr_realloc(), dynstr_set(), end_io_cache(), eval_expr(), examine_log(), execute_ddl_log_action(), CommandInterpreter::execute_impl(), CommandInterpreter::executeClusterLog(), CommandInterpreter::executeDumpState(), CommandInterpreter::executeError(), CommandInterpreter::executeLog(), CommandInterpreter::executeSet(), filesort(), fill_buffer(), fill_buffer_retaining(), MYSQL_BIN_LOG::flush_and_sync(), flush_buffer(), free_buffer(), Rpl_filter::free_string_array(), free_used_memory(), freeze_size(), ft_init_boolean_search(), ft_init_stopwords(), get_addon_fields(), get_charset(), get_charset_by_csname(), get_charset_by_name(), get_current_db(), get_form_pos(), get_free_ddl_log_entry(), get_one_option(), get_options(), get_or_create_user_conn(), get_replace(), get_replace_column(), get_share(), ha_archive::get_share(), get_table_structure(), get_variable(), get_view_structure(), get_word(), ha_init_errors(), ha_known_exts(), handle_bootstrap(), handle_request_for_tables(), heap_rename(), ha_archive::info(), Load_log_processor::init_by_cur_dir(), init_common_variables(), init_ddl_log(), init_dynamic_array(), init_dynamic_string(), init_file_buffer(), init_huff_count(), init_io_cache(), init_key_cache(), init_line_buffer(), init_queue(), init_replace(), init_replace_regex(), init_server_components(), init_sets(), init_state_maps(), init_tee(), init_tmpdir(), init_username(), initialize_buffer(), insert_pointer_name(), Load_log_processor::load_old_format_file(), lock_db_insert(), lock_table_name(), main(), make_empty_rec(), make_huff_decode_table(), make_huff_trees(), make_new_entry(), make_new_set(), mapped_files::mapped_files(), merge_many_buff(), mi_check_print_msg(), mi_create(), mi_delete_all_rows(), mi_delete_table(), mi_lock_database(), mi_open(), mi_open_datafile(), mi_open_keyfile(), mi_panic(), mi_preload(), mi_rename(), mi_repair(), mi_repair_by_sort(), mi_repair_parallel(), mi_sort_index(), mi_sort_records(), modify_defaults_file(), my_chsize(), my_close(), my_copystat(), my_delete(), my_dir(), my_error_register(), my_fclose(), my_fdopen(), my_fopen(), my_fread(), my_fwrite(), my_getwd(), my_lock(), my_lread(), my_lwrite(), my_malloc(), my_mkdir(), my_net_init(), my_once_alloc(), my_pread(), my_pwrite(), my_read(), my_readlink(), my_realloc(), my_realpath(), my_register_filename(), my_rename(), my_set_max_open_files(), my_setwd(), my_stat(), my_symlink(), my_sync(), my_write(), myisamchk(), myisamchk_init(), myrg_create(), myrg_open(), mysql_change_db(), mysql_change_user(), mysql_client_binlog_statement(), mysql_close_free_options(), mysql_create_frm(), mysql_drop_view(), mysql_end(), mysql_frm_type(), mysql_ha_open(), mysql_init(), mysql_init_character_set(), mysql_list_fields(), mysql_load(), mysql_lock_merge(), mysql_manager_init(), mysql_manager_submit(), mysql_options(), mysql_read_default_options(), mysql_rename_db(), mysql_rm_arc_files(), mysql_rm_known_files(), mysql_rm_table_part2(), mysql_rm_tmp_tables(), mysql_select_db(), mysql_stmt_close(), mysql_stmt_init(), mysql_stmt_result_metadata(), mysql_store_result(), mysql_write_frm(), mysqld_dump_create_info(), NAMED_LIST::NAMED_LIST(), ndb_mgm_create_handle(), ndb_mgm_create_logevent_handle(), ndb_mgm_set_name(), net_real_write(), net_realloc(), MYSQL_BIN_LOG::open(), MYSQL_LOG::open(), open_binary_frm(), open_binlog(), open_cached_file(), open_files(), MYSQL_BIN_LOG::open_index_file(), open_sql_file_for_table(), open_table(), open_table_def(), open_table_from_share(), open_temporary_table(), open_unireg_entry(), ha_tina::open_update_temp_file_if_needed(), ilink::operator delete(), Log_event::operator delete(), ilink::operator new(), Log_event::operator new(), ha_archive::optimize(), pack_screens(), parse_charset_string(), parse_error_string(), parse_input_file(), parse_message_string(), CommandInterpreter::parseBlockSpecification(), plugin_dl_add(), prepare_for_repair(), prepare_for_restore(), primary_key_fields(), Load_log_processor::process(), process_all_tables_in_db(), process_event(), Load_log_processor::process_first_event(), process_selected_tables(), put_blob_in_record(), put_dbopt(), Query_log_event::Query_log_event(), QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(), read_buffpek_from_file(), read_ddl_log_file_entry(), read_ddl_log_header(), READ_INFO::read_field(), READ_INFO::READ_INFO(), read_init_file(), Log_event::read_log_event(), read_meta_file(), ha_archive::read_meta_file(), read_query(), read_server_arguments(), read_string(), read_texts(), readfrm(), String::real_alloc(), real_open_cached_file(), String::realloc(), reg_replace(), release_ddl_log(), remove_dup_with_hash_index(), rename_file_ext(), rename_in_schema_file(), ha_tina::repair(), replace_strings(), QUICK_RANGE_SELECT::reset(), MYSQL_BIN_LOG::reset_logs(), resize_queue(), ha_myisam::restore(), rm_dir_w_symlink(), rm_trigger_file(), rm_trigname_file(), ha_tina::rnd_end(), Rotate_log_event::Rotate_log_event(), safe_hash_set(), save_index(), search_default_file_with_ext(), set_charset(), set_dynamic(), setval(), sort_ft_key_write(), sort_record_index(), sql_alloc(), sql_create_definition_file(), sql_parse_prepare(), str_to_file(), test_frm_bug(), test_if_case_insensitive(), Transparent_file::Transparent_file(), unescape(), update_frm_version(), ha_tina::update_row(), update_sys_var_str_path(), usage(), var_copy(), var_free(), var_init(), var_set(), vio_init(), vio_new(), wf_comp(), Show_instance_log::write_data(), write_db_opt(), write_ddl_log_file_entry(), write_delayed(), write_header(), write_keys(), write_meta_file(), ha_archive::write_meta_file(), ha_tina::write_row(), ha_archive::write_row(), writefrm(), and xid_cache_insert().
| #define MY_ZEROFILL 32 |
Definition at line 69 of file my_sys.h.
Referenced by _mi_read_pack_info(), _mymalloc(), append_stmt_result(), batch_readline_command(), batch_readline_init(), build_insert_string(), build_query_string(), build_table_string(), cli_read_rows(), cli_use_result(), completion_hash_init(), copy_data_between_tables(), create_key_cache(), create_sort_index(), Format_description_log_event::Format_description_log_event(), get_share(), ha_archive::get_share(), ha_init_errors(), heap_open(), init_huff_count(), lock_db_insert(), lock_table_name(), main(), make_empty_rec(), make_huff_decode_table(), make_huff_trees(), mi_create(), mi_repair_parallel(), my_malloc(), my_once_alloc(), myrg_open(), mysql_delete(), mysql_init(), mysql_list_fields(), mysql_manager_init(), mysql_stmt_init(), mysql_stmt_result_metadata(), mysql_store_result(), parse_comma(), parse_delimiter(), plugin_dl_add(), and put_dbopt().
| #define MYSYS_PROGRAM_DONT_USE_CURSES | ( | ) | { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;} |
| #define MYSYS_PROGRAM_USES_CURSES | ( | ) | { error_handler_hook = my_message_curses; mysys_uses_curses=1; } |
| #define NORMAL_SAFEMALLOC |
| #define PROT_READ 1 |
Definition at line 862 of file my_sys.h.
Referenced by history_do_write(), mapped_files::mapped_files(), mapSegment(), mmaptest(), NDB_MAIN(), read_history_range(), and unmaptest().
| #define PROT_WRITE 2 |
Definition at line 863 of file my_sys.h.
Referenced by history_do_write(), mapSegment(), mmaptest(), NDB_MAIN(), read_history_range(), and unmaptest().
Definition at line 770 of file my_sys.h.
Referenced by acl_insert_db(), acl_insert_user(), acl_load(), init_check_host(), my_dir(), push_locks_into_array(), and Event_scheduler::stop_all_running_events().
| #define QUICK_SAFEMALLOC |
| #define reset_dynamic | ( | array | ) | ((array)->elements= 0) |
Definition at line 771 of file my_sys.h.
Referenced by sp_head::execute(), sp_head::execute_function(), my_hash_reset(), and mysql_reset_thd_for_next_command().
| #define TERMINATE | ( | A | ) | {} |
| #define TRASH | ( | A, | |||
| B | ) |
Definition at line 173 of file my_sys.h.
Referenced by thread_info::operator delete(), COND_CMP::operator delete(), Sql_alloc::operator delete(), Server_side_cursor::operator delete(), TABLE_READ_PLAN::operator delete(), Item::operator delete(), Field::operator delete(), Event_timed::operator delete(), String::operator delete(), and Sql_alloc::operator delete[]().
| typedef struct st_dynamic_array DYNAMIC_ARRAY |
| typedef struct st_dynamic_string DYNAMIC_STRING |
| typedef uint32 ha_checksum |
| typedef struct st_io_cache IO_CACHE |
| typedef int(*) IO_CACHE_CALLBACK(struct st_io_cache *) |
| typedef struct st_my_tmpdir MY_TMPDIR |
| typedef int(*) Process_option_func(void *ctx, const char *group_name, const char *option) |
| typedef int(*) qsort2_cmp(const void *, const void *, const void *) |
| typedef struct st_record_cache RECORD_CACHE |
| typedef struct wild_file_pack WF_PACK |
| enum cache_type |
Definition at line 273 of file my_sys.h.
00274 { 00275 TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE, 00276 SEQ_READ_APPEND /* sequential read or append */, 00277 READ_FIFO, READ_NET,WRITE_NET};
| enum file_type |
| UNOPEN | |
| FILE_BY_OPEN | |
| FILE_BY_CREATE | |
| STREAM_BY_FOPEN | |
| STREAM_BY_FDOPEN | |
| FILE_BY_MKSTEMP | |
| FILE_BY_DUP |
Definition at line 298 of file my_sys.h.
00299 { 00300 UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN, 00301 FILE_BY_MKSTEMP, FILE_BY_DUP 00302 };
| enum flush_type |
Definition at line 279 of file my_sys.h.
00280 { 00281 FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE 00282 };
| enum loglevel |
Definition at line 267 of file my_sys.h.
00267 { 00268 ERROR_LEVEL, 00269 WARNING_LEVEL, 00270 INFORMATION_LEVEL 00271 };
| int _my_b_get | ( | IO_CACHE * | info | ) |
Definition at line 991 of file mf_iocache.c.
References my_b_EOF, and st_io_cache::pre_read.
00992 { 00993 byte buff; 00994 IO_CACHE_CALLBACK pre_read,post_read; 00995 if ((pre_read = info->pre_read)) 00996 (*pre_read)(info); 00997 if ((*(info)->read_function)(info,&buff,1)) 00998 return my_b_EOF; 00999 if ((post_read = info->post_read)) 01000 (*post_read)(info); 01001 return (int) (uchar) buff; 01002 }
Definition at line 507 of file safemalloc.c.
References _mymalloc(), and memcpy.
00509 { 00510 gptr ptr; 00511 if ((ptr=_mymalloc(length,filename,lineno,MyFlags)) != 0) 00512 memcpy((byte*) ptr, (byte*) from,(size_t) length); 00513 return(ptr); 00514 } /*_my_memdup */
Here is the call graph for this function:

Definition at line 517 of file safemalloc.c.
References _mymalloc(), memcpy, and strlen().
00519 { 00520 gptr ptr; 00521 uint length=(uint) strlen(from)+1; 00522 if ((ptr=_mymalloc(length,filename,lineno,MyFlags)) != 0) 00523 memcpy((byte*) ptr, (byte*) from,(size_t) length); 00524 return((char*) ptr); 00525 } /* _my_strdup */
Here is the call graph for this function:

Definition at line 528 of file safemalloc.c.
References _mymalloc(), and memcpy.
00531 { 00532 gptr ptr; 00533 if ((ptr=_mymalloc(length+1,filename,lineno,MyFlags)) != 0) 00534 { 00535 memcpy((byte*) ptr, (byte*) from,(size_t) length); 00536 ptr[length]=0; 00537 } 00538 return((char *) ptr); 00539 }
Here is the call graph for this function:

Definition at line 258 of file safemalloc.c.
References _sanity(), ALIGN_SIZE, bfill, check_ptr(), st_irem::datasize, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, free, FREE_VAL, MAGICKEY, MY_ALLOW_ZERO_PTR, st_irem::next, pchar, st_irem::prev, pthread_mutex_lock, pthread_mutex_unlock, sf_malloc_count, sf_malloc_cur_memory, sf_malloc_prehunc, sf_malloc_quick, and sf_malloc_root.
Referenced by _myrealloc().
00259 { 00260 struct st_irem *irem; 00261 DBUG_ENTER("_myfree"); 00262 DBUG_PRINT("enter",("ptr: 0x%lx", ptr)); 00263 00264 if (!sf_malloc_quick) 00265 (void) _sanity (filename, lineno); 00266 00267 if ((!ptr && (myflags & MY_ALLOW_ZERO_PTR)) || 00268 check_ptr("Freeing",(byte*) ptr,filename,lineno)) 00269 DBUG_VOID_RETURN; 00270 00271 /* Calculate the address of the remember structure */ 00272 irem= (struct st_irem *) ((char*) ptr- ALIGN_SIZE(sizeof(struct st_irem))- 00273 sf_malloc_prehunc); 00274 00275 /* 00276 Check to make sure that we have a real remember structure. 00277 Note: this test could fail for four reasons: 00278 (1) The memory was already free'ed 00279 (2) The memory was never new'ed 00280 (3) There was an underrun 00281 (4) A stray pointer hit this location 00282 */ 00283 00284 if (*((uint32*) ((char*) ptr- sizeof(uint32))) != MAGICKEY) 00285 { 00286 fprintf(stderr, "Error: Freeing unallocated data at line %d, '%s'\n", 00287 lineno, filename); 00288 DBUG_PRINT("safe",("Unallocated data at line %d, '%s'",lineno,filename)); 00289 (void) fflush(stderr); 00290 DBUG_VOID_RETURN; 00291 } 00292 00293 /* Remove this structure from the linked list */ 00294 pthread_mutex_lock(&THR_LOCK_malloc); 00295 if (irem->prev) 00296 irem->prev->next= irem->next; 00297 else 00298 sf_malloc_root= irem->next; 00299 00300 if (irem->next) 00301 irem->next->prev= irem->prev; 00302 /* Handle the statistics */ 00303 sf_malloc_cur_memory-= irem->datasize; 00304 sf_malloc_count--; 00305 pthread_mutex_unlock(&THR_LOCK_malloc); 00306 00307 #ifndef HAVE_purify 00308 /* Mark this data as free'ed */ 00309 if (!sf_malloc_quick) 00310 bfill(ptr, irem->datasize, (pchar) FREE_VAL); 00311 #endif 00312 *((uint32*) ((char*) ptr- sizeof(uint32)))= ~MAGICKEY; 00313 /* Actually free the memory */ 00314 free((char*) irem); 00315 DBUG_VOID_RETURN; 00316 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 123 of file safemalloc.c.
References _sanity(), ALIGN_SIZE, ALLOC_VAL, bfill, data, st_irem::datasize, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, EE_OUTOFMEMORY, errno, error_handler_hook, exit, fatal_error_handler_hook, st_irem::filename, st_irem::linenum, MAGICEND0, MAGICEND1, MAGICEND2, MAGICEND3, MAGICKEY, malloc, ME_BELL, ME_WAITTANG, my_errno, MY_FAE, my_message(), MY_WME, MY_ZEROFILL, MYF, st_irem::next, NULL, st_irem::prev, pthread_mutex_lock, pthread_mutex_unlock, SC_MAXWIDTH, sf_malloc_count, sf_malloc_cur_memory, sf_malloc_endhunc, sf_malloc_max_memory, sf_malloc_mem_limit, sf_malloc_prehunc, sf_malloc_quick, sf_malloc_root, sf_max_adress, and sf_min_adress.
Referenced by _my_memdup(), _my_strdup(), _my_strndup(), and _myrealloc().
00124 { 00125 struct st_irem *irem; 00126 char *data; 00127 DBUG_ENTER("_mymalloc"); 00128 DBUG_PRINT("enter",("Size: %u",size)); 00129 00130 if (!sf_malloc_quick) 00131 (void) _sanity (filename, lineno); 00132 00133 if (size + sf_malloc_cur_memory > sf_malloc_mem_limit) 00134 irem= 0; 00135 else 00136 { 00137 /* Allocate the physical memory */ 00138 irem= (struct st_irem *) malloc (ALIGN_SIZE(sizeof(struct st_irem)) + 00139 sf_malloc_prehunc + 00140 size + /* size requested */ 00141 4 + /* overrun mark */ 00142 sf_malloc_endhunc); 00143 } 00144 /* Check if there isn't anymore memory avaiable */ 00145 if (!irem) 00146 { 00147 if (MyFlags & MY_FAE) 00148 error_handler_hook=fatal_error_handler_hook; 00149 if (MyFlags & (MY_FAE+MY_WME)) 00150 { 00151 char buff[SC_MAXWIDTH]; 00152 my_errno=errno; 00153 sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename); 00154 my_message(EE_OUTOFMEMORY,buff,MYF(ME_BELL+ME_WAITTANG)); 00155 sprintf(buff,"needed %d byte (%ldk), memory in use: %ld bytes (%ldk)", 00156 size, (size + 1023L) / 1024L, 00157 sf_malloc_max_memory, (sf_malloc_max_memory + 1023L) / 1024L); 00158 my_message(EE_OUTOFMEMORY,buff,MYF(ME_BELL+ME_WAITTANG)); 00159 } 00160 DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'", 00161 sf_malloc_max_memory,lineno, filename)); 00162 if (MyFlags & MY_FAE) 00163 exit(1); 00164 DBUG_RETURN ((gptr) 0); 00165 } 00166 00167 /* Fill up the structure */ 00168 data= (((char*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) + 00169 sf_malloc_prehunc); 00170 *((uint32*) (data-sizeof(uint32)))= MAGICKEY; 00171 data[size + 0]= MAGICEND0; 00172 data[size + 1]= MAGICEND1; 00173 data[size + 2]= MAGICEND2; 00174 data[size + 3]= MAGICEND3; 00175 irem->filename= (my_string) filename; 00176 irem->linenum= lineno; 00177 irem->datasize= size; 00178 irem->prev= NULL; 00179 00180 /* Add this remember structure to the linked list */ 00181 pthread_mutex_lock(&THR_LOCK_malloc); 00182 if ((irem->next= sf_malloc_root)) 00183 sf_malloc_root->prev= irem; 00184 sf_malloc_root= irem; 00185 00186 /* Keep the statistics */ 00187 sf_malloc_cur_memory+= size; 00188 if (sf_malloc_cur_memory > sf_malloc_max_memory) 00189 sf_malloc_max_memory= sf_malloc_cur_memory; 00190 sf_malloc_count++; 00191 pthread_mutex_unlock(&THR_LOCK_malloc); 00192 00193 /* Set the memory to the aribtrary wierd value */ 00194 if ((MyFlags & MY_ZEROFILL) || !sf_malloc_quick) 00195 bfill(data, size, (char) (MyFlags & MY_ZEROFILL ? 0 : ALLOC_VAL)); 00196 /* Return a pointer to the real data */ 00197 DBUG_PRINT("exit",("ptr: 0x%lx", data)); 00198 if (sf_min_adress > data) 00199 sf_min_adress= data; 00200 if (sf_max_adress < data) 00201 sf_max_adress= data; 00202 DBUG_RETURN ((gptr) data); 00203 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int _sanity | ( | const char * | sFile, | |
| unsigned int | uLine | |||
| ) |
Definition at line 477 of file safemalloc.c.
Referenced by _db_enter_(), _db_return_(), _myfree(), _mymalloc(), _myrealloc(), and sort_record_index().
00478 { 00479 reg1 struct st_irem *irem; 00480 reg2 int flag=0; 00481 uint count=0; 00482 00483 pthread_mutex_lock(&THR_LOCK_malloc); 00484 #ifndef PEDANTIC_SAFEMALLOC 00485 if (sf_malloc_tampered && (int) sf_malloc_count < 0) 00486 sf_malloc_count=0; 00487 #endif 00488 count=sf_malloc_count; 00489 for (irem= sf_malloc_root; irem != NULL && count-- ; irem= irem->next) 00490 flag+= _checkchunk (irem, filename, lineno); 00491 pthread_mutex_unlock(&THR_LOCK_malloc); 00492 if (count || irem) 00493 { 00494 const char *format="Error: Safemalloc link list destroyed, discovered at '%s:%d'"; 00495 fprintf(stderr, format, filename, lineno); fputc('\n',stderr); 00496 fprintf(stderr, "root=%p,count=%d,irem=%p\n", sf_malloc_root,count,irem); 00497 (void) fflush(stderr); 00498 DBUG_PRINT("safe",(format, filename, lineno)); 00499 flag=1; 00500 } 00501 return flag; 00502 } /* _sanity */
Here is the caller graph for this function:

| int my_printf_error _VARARGS | ( | (uint my_err, const char *format, myf MyFlags,...) __attribute__((format(printf, 2, 4))) | ) |
| int my_error _VARARGS | ( | (int nr, myf MyFlags,...) | ) |
| void add_compiled_collation | ( | CHARSET_INFO * | cs | ) |
Definition at line 371 of file charset.c.
References all_charsets, MY_CS_AVAILABLE, charset_info_st::number, and charset_info_st::state.
Referenced by init_compiled_charsets().
00372 { 00373 all_charsets[cs->number]= cs; 00374 cs->state|= MY_CS_AVAILABLE; 00375 }
Here is the caller graph for this function:

| byte* alloc_dynamic | ( | DYNAMIC_ARRAY * | array | ) |
Definition at line 120 of file array.c.
References st_dynamic_array::alloc_increment, st_dynamic_array::buffer, st_dynamic_array::elements, st_dynamic_array::max_element, MY_ALLOW_ZERO_PTR, my_realloc(), MY_WME, MYF, and st_dynamic_array::size_of_element.
Referenced by find_all_keys(), insert_dynamic(), and my_hash_insert().
00121 { 00122 if (array->elements == array->max_element) 00123 { 00124 char *new_ptr; 00125 if (!(new_ptr=(char*) my_realloc(array->buffer,(array->max_element+ 00126 array->alloc_increment)* 00127 array->size_of_element, 00128 MYF(MY_WME | MY_ALLOW_ZERO_PTR)))) 00129 return 0; 00130 array->buffer=new_ptr; 00131 array->max_element+=array->alloc_increment; 00132 } 00133 return array->buffer+(array->elements++ * array->size_of_element); 00134 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 144 of file my_alloc.c.
References ALIGN_SIZE, ALLOC_MAX_BLOCK_TO_DROP, ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP, alloc_root_inited, st_mem_root::block_num, st_mem_root::block_size, DBUG_ASSERT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, st_mem_root::error_handler, st_mem_root::first_block_usage, st_mem_root::free, st_used_mem::left, max, st_mem_root::min_malloc, my_malloc(), MY_WME, MYF, st_used_mem::next, NULL, reg1, reg2, st_used_mem::size, and st_mem_root::used.
Referenced by alloc_stmt_fields(), build_completion_hash(), Table_triggers_list::check_n_load(), cli_read_binary_rows(), cli_read_rows(), Instance_options::complete_initialization(), completion_hash_update(), create_myisam_tmp_table(), create_tmp_table(), Table_triggers_list::create_trigger(), create_typelib(), dump_selected_tables(), events_table_index_read_for_db(), fill_used_fields_bitmap(), ft_add_word(), ft_init_boolean_search(), ft_linearize(), ftb_query_add_word(), Item_func_sp::func_name(), get_best_covering_ror_intersect(), get_best_disjunct_quick(), get_best_ror_intersect(), get_dynamic_sql_string(), get_field(), get_file_options_ulllist(), get_mm_leaf(), get_quick_select_for_ref(), get_var_with_binlog(), GRANT_NAME::GRANT_NAME(), Guardian_thread::guard(), handler::ha_open(), handle_default_option(), QUICK_GROUP_MIN_MAX_SELECT::init(), QUICK_ROR_UNION_SELECT::init(), Event_timed::init_definer(), init_param_array(), load_defaults(), make_ror_scan(), memdup_root(), multi_alloc_root(), my_dir(), my_search_option_files(), my_tz_init(), mysql_execute_command(), mysql_stmt_prepare(), open_binary_frm(), open_table_from_share(), Sql_alloc::operator new(), sp_head::operator new(), TABLE_READ_PLAN::operator new(), Item::operator new(), Event_timed::operator new(), String::operator new(), Sql_alloc::operator new[](), SEL_IMERGE::or_sel_tree(), File_parser::parse(), parse_escaped_string(), parse_quoted_escaped_string(), parse_string(), Table_triggers_list::prepare_record1_accessors(), QUICK_ROR_INTERSECT_SELECT::QUICK_ROR_INTERSECT_SELECT(), rename_temporary_table(), ror_intersect_init(), send_variant_2_list(), st_table_list::set_insert_values(), sql_alloc(), sql_parse_prepare(), strmake_root(), SQL_SELECT::test_quick_select(), trie_init(), trie_insert(), typelib(), tz_load_from_open_tables(), and unpack_fields().
00145 { 00146 #if defined(HAVE_purify) && defined(EXTRA_DEBUG) 00147 reg1 USED_MEM *next; 00148 DBUG_ENTER("alloc_root"); 00149 DBUG_PRINT("enter",("root: 0x%lx", mem_root)); 00150 00151 DBUG_ASSERT(alloc_root_inited(mem_root)); 00152 00153 Size+=ALIGN_SIZE(sizeof(USED_MEM)); 00154 if (!(next = (USED_MEM*) my_malloc(Size,MYF(MY_WME)))) 00155 { 00156 if (mem_root->error_handler) 00157 (*mem_root->error_handler)(); 00158 DBUG_RETURN((gptr) 0); /* purecov: inspected */ 00159 } 00160 next->next= mem_root->used; 00161 next->size= Size; 00162 mem_root->used= next; 00163 DBUG_PRINT("exit",("ptr: 0x%lx", (((char*) next)+ 00164 ALIGN_SIZE(sizeof(USED_MEM))))); 00165 DBUG_RETURN((gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM)))); 00166 #else 00167 uint get_size, block_size; 00168 gptr point; 00169 reg1 USED_MEM *next= 0; 00170 reg2 USED_MEM **prev; 00171 DBUG_ENTER("alloc_root"); 00172 DBUG_PRINT("enter",("root: 0x%lx", mem_root)); 00173 DBUG_ASSERT(alloc_root_inited(mem_root)); 00174 00175 Size= ALIGN_SIZE(Size); 00176 if ((*(prev= &mem_root->free)) != NULL) 00177 { 00178 if ((*prev)->left < Size && 00179 mem_root->first_block_usage++ >= ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP && 00180 (*prev)->left < ALLOC_MAX_BLOCK_TO_DROP) 00181 { 00182 next= *prev; 00183 *prev= next->next; /* Remove block from list */ 00184 next->next= mem_root->used; 00185 mem_root->used= next; 00186 mem_root->first_block_usage= 0; 00187 } 00188 for (next= *prev ; next && next->left < Size ; next= next->next) 00189 prev= &next->next; 00190 } 00191 if (! next) 00192 { /* Time to alloc new block */ 00193 block_size= mem_root->block_size * (mem_root->block_num >> 2); 00194 get_size= Size+ALIGN_SIZE(sizeof(USED_MEM)); 00195 get_size= max(get_size, block_size); 00196 00197 if (!(next = (USED_MEM*) my_malloc(get_size,MYF(MY_WME)))) 00198 { 00199 if (mem_root->error_handler) 00200 (*mem_root->error_handler)(); 00201 return((gptr) 0); /* purecov: inspected */ 00202 } 00203 mem_root->block_num++; 00204 next->next= *prev; 00205 next->size= get_size; 00206 next->left= get_size-ALIGN_SIZE(sizeof(USED_MEM)); 00207 *prev=next; 00208 } 00209 00210 point= (gptr) ((char*) next+ (next->size-next->left)); 00211 /*TODO: next part may be unneded due to mem_root->first_block_usage counter*/ 00212 if ((next->left-= Size) < mem_root->min_malloc) 00213 { /* Full block */ 00214 *prev= next->next; /* Remove block from list */ 00215 next->next= mem_root->used; 00216 mem_root->used= next; 00217 mem_root->first_block_usage= 0; 00218 } 00219 DBUG_PRINT("exit",("ptr: 0x%lx", (ulong) point)); 00220 DBUG_RETURN(point); 00221 #endif 00222 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void allow_break | ( | void | ) |
Definition at line 33 of file mf_brkhant.c.
References _my_sig_remember, _my_signals, func, st_remember::func, index(), MAX_SIGNALS, my_dont_interrupt, and reg1.
Referenced by hp_get_new_block(), and mi_delete_all_rows().
00034 { 00035 { 00036 reg1 int index; 00037 00038 my_dont_interrupt=0; 00039 if (_my_signals) 00040 { 00041 if (_my_signals > MAX_SIGNALS) 00042 _my_signals=MAX_SIGNALS; 00043 for (index=0 ; index < _my_signals ; index++) 00044 { 00045 if (_my_sig_remember[index].func) /* Safequard */ 00046 { 00047 (*_my_sig_remember[index].func)(_my_sig_remember[index].number); 00048 _my_sig_remember[index].func=0; 00049 } 00050 } 00051 _my_signals=0; 00052 } 00053 } 00054 } /* dont_break */
Here is the call graph for this function:

Here is the caller graph for this function:

| int check_if_legal_filename | ( | const char * | path | ) |
| int check_if_legal_tablename | ( | const char * | path | ) |
Definition at line 149 of file my_access.c.
References DBUG_ENTER, DBUG_RETURN, and str_list_find().
Referenced by tablename_to_filename().
00150 { 00151 DBUG_ENTER("check_if_legal_tablename"); 00152 DBUG_RETURN((reserved_map[(uchar) name[0]] & 1) && 00153 (reserved_map[(uchar) name[1]] & 2) && 00154 (reserved_map[(uchar) name[2]] & 4) && 00155 str_list_find(&reserved_names[1], name)); 00156 }
Here is the call graph for this function:

Here is the caller graph for this function:

Referenced by init_tmpdir(), myrg_open(), mysql_init_variables(), pack_dirname(), and unpack_dirname().
Here is the caller graph for this function:

| void close_cached_file | ( | IO_CACHE * | cache | ) |
Definition at line 99 of file mf_cache.c.
References DBUG_ENTER, DBUG_VOID_RETURN, st_io_cache::dir, end_io_cache(), st_io_cache::file, st_io_cache::file_name, ME_NOINPUT, MY_ALLOW_ZERO_PTR, my_b_inited, my_close(), my_delete(), my_free, MY_WME, MYF, and st_io_cache::prefix.
Referenced by _create_index_by_sort(), binlog_close_connection(), SQL_SELECT::cleanup(), filesort(), free_io_cache(), and merge_many_buff().
00100 { 00101 DBUG_ENTER("close_cached_file"); 00102 if (my_b_inited(cache)) 00103 { 00104 File file=cache->file; 00105 cache->file= -1; /* Don't flush data */ 00106 (void) end_io_cache(cache); 00107 if (file >= 0) 00108 { 00109 (void) my_close(file,MYF(0)); 00110 #ifdef CANT_DELETE_OPEN_FILES 00111 if (cache->file_name) 00112 { 00113 (void) my_delete(cache->file_name,MYF(MY_WME | ME_NOINPUT)); 00114 my_free(cache->file_name,MYF(0)); 00115 } 00116 #endif 00117 } 00118 my_free(cache->dir,MYF(MY_ALLOW_ZERO_PTR)); 00119 my_free(cache->prefix,MYF(MY_ALLOW_ZERO_PTR)); 00120 } 00121 DBUG_VOID_RETURN; 00122 }
Here is the call graph for this function:

Here is the caller graph for this function:

| char* convert_dirname | ( | char * | to, | |
| const char * | from, | |||
| const char * | from_end | |||
| ) |
Definition at line 100 of file mf_dirname.c.
References DBUG_ENTER, DBUG_RETURN, FN_DEVCHAR, FN_LIBCHAR, FN_REFLEN, memmove, my_ismbchar, strmake(), and use_mb.
Referenced by append_file_to_dir(), Instance_options::complete_initialization(), create_temp_file(), dirname_part(), dump_table(), examine_log(), fix_paths(), fn_format(), get_charsets_dir(), Load_log_processor::init_by_dir_name(), intern_filename(), my_print_default_files(), open_sql_file_for_table(), and search_default_file_with_ext().
00101 { 00102 char *to_org=to; 00103 #ifdef BACKSLASH_MBTAIL 00104 CHARSET_INFO *fs= fs_character_set(); 00105 #endif 00106 DBUG_ENTER("convert_dirname"); 00107 00108 /* We use -2 here, becasue we need place for the last FN_LIBCHAR */ 00109 if (!from_end || (from_end - from) > FN_REFLEN-2) 00110 from_end=from+FN_REFLEN -2; 00111 00112 #if FN_LIBCHAR != '/' || defined(FN_C_BEFORE_DIR_2) 00113 { 00114 for (; from != from_end && *from ; from++) 00115 { 00116 if (*from == '/') 00117 *to++= FN_LIBCHAR; 00118 #ifdef FN_C_BEFORE_DIR_2 00119 else if (*from == FN_C_BEFORE_DIR_2) 00120 *to++= FN_C_BEFORE_DIR; 00121 else if (*from == FN_C_AFTER_DIR_2) 00122 *to++= FN_C_AFTER_DIR; 00123 #endif 00124 else 00125 { 00126 #ifdef BACKSLASH_MBTAIL 00127 uint l; 00128 if (use_mb(fs) && (l= my_ismbchar(fs, from, from + 3))) 00129 { 00130 memmove(to, from, l); 00131 to+= l; 00132 from+= l - 1; 00133 to_org= to; /* Don't look inside mbchar */ 00134 } 00135 else 00136 #endif 00137 { 00138 *to++= *from; 00139 } 00140 } 00141 } 00142 *to=0; 00143 } 00144 #else 00145 /* This is ok even if to == from, becasue we need to cut the string */ 00146 to= strmake(to, from, (uint) (from_end-from)); 00147 #endif 00148 00149 /* Add FN_LIBCHAR to the end of directory path */ 00150 if (to != to_org && (to[-1] != FN_LIBCHAR && to[-1] != FN_DEVCHAR)) 00151 { 00152 *to++=FN_LIBCHAR; 00153 *to=0; 00154 } 00155 DBUG_RETURN(to); /* Pointer to end of dir */ 00156 } /* convert_dirname */
Here is the call graph for this function:

Here is the caller graph for this function:

Referenced by az_open(), azread(), azrewind(), azwrite(), deflate(), deflateReset(), gz_open(), gzread(), gzrewind(), gzwrite(), my_checksum(), read_buf(), and Item_func_crc32::val_int().
Here is the caller graph for this function:

Referenced by com_edit(), convert_file(), and real_open_cached_file().
Here is the caller graph for this function:

| void delete_dynamic | ( | DYNAMIC_ARRAY * | array | ) |
Definition at line 232 of file array.c.
References st_dynamic_array::buffer, st_dynamic_array::elements, st_dynamic_array::max_element, my_free, MY_WME, and MYF.
Referenced by _create_index_by_sort(), _mi_ck_write_btree(), acl_free(), acl_reload(), clean_up(), JOIN::destroy(), sp_pcontext::destroy(), sp_head::destroy(), display_table_locks(), free_status_vars(), Rpl_filter::free_string_array(), free_used_memory(), hash_free(), init_tmpdir(), load_defaults(), main(), my_dirend(), mysql_close_free_options(), plugin_free(), rebuild_check_host(), shrink_var_array(), Event_scheduler::stop_all_running_events(), Dynamic_array< Elem >::~Dynamic_array(), Load_log_processor::~Load_log_processor(), Named_value_arr::~Named_value_arr(), QUICK_GROUP_MIN_MAX_SELECT::~QUICK_GROUP_MIN_MAX_SELECT(), and QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT().
00233 { 00234 if (array->buffer) 00235 { 00236 my_free(array->buffer,MYF(MY_WME)); 00237 array->buffer=0; 00238 array->elements=array->max_element=0; 00239 } 00240 }
Here is the caller graph for this function:

| void delete_dynamic_element | ( | DYNAMIC_ARRAY * | array, | |
| uint | array_index | |||
| ) |
Definition at line 251 of file array.c.
References st_dynamic_array::buffer, st_dynamic_array::elements, memmove, and st_dynamic_array::size_of_element.
Referenced by acl_update_db(), handle_grant_struct(), and Named_value_arr::remove_element().
00252 { 00253 char *ptr=array->buffer+array->size_of_element*idx; 00254 array->elements--; 00255 memmove(ptr,ptr+array->size_of_element, 00256 (array->elements-idx)*array->size_of_element); 00257 }
Here is the caller graph for this function:

Definition at line 212 of file my_lib.c.
References directory_file_name(), FN_DEVCHAR, FN_LIBCHAR, getenv(), strchr(), strcmp(), strlen(), strmake(), strmov(), strrchr(), and VOID.
Referenced by directory_file_name(), and my_dir().
00213 { 00214 #ifndef VMS 00215 00216 /* Process as Unix format: just remove test the final slash. */ 00217 00218 my_string end; 00219 00220 if (src[0] == 0) 00221 src= (char*) "."; /* Use empty as current */ 00222 end=strmov(dst, src); 00223 if (end[-1] != FN_LIBCHAR) 00224 { 00225 end[0]=FN_LIBCHAR; /* Add last '/' */ 00226 end[1]='\0'; 00227 } 00228 return dst; 00229 00230 #else /* VMS */ 00231 00232 long slen; 00233 long rlen; 00234 my_string ptr, rptr; 00235 char bracket; 00236 struct FAB fab = cc$rms_fab; 00237 struct NAM nam = cc$rms_nam; 00238 char esa[NAM$C_MAXRSS]; 00239 00240 if (! src[0]) 00241 src="[.]"; /* Empty is == current dir */ 00242 00243 slen = strlen (src) - 1; 00244 if (src[slen] == FN_C_AFTER_DIR || src[slen] == FN_C_AFTER_DIR_2 || 00245 src[slen] == FN_DEVCHAR) 00246 { 00247 /* VMS style - convert [x.y.z] to [x.y]z, [x] to [000000]x */ 00248 fab.fab$l_fna = src; 00249 fab.fab$b_fns = slen + 1; 00250 fab.fab$l_nam = &nam; 00251 fab.fab$l_fop = FAB$M_NAM; 00252 00253 nam.nam$l_esa = esa; 00254 nam.nam$b_ess = sizeof esa; 00255 nam.nam$b_nop |= NAM$M_SYNCHK; 00256 00257 /* We call SYS$PARSE to handle such things as [--] for us. */ 00258 if (SYS$PARSE(&fab, 0, 0) == RMS$_NORMAL) 00259 { 00260 slen = nam.nam$b_esl - 1; 00261 if (esa[slen] == ';' && esa[slen - 1] == '.') 00262 slen -= 2; 00263 esa[slen + 1] = '\0'; 00264 src = esa; 00265 } 00266 if (src[slen] != FN_C_AFTER_DIR && src[slen] != FN_C_AFTER_DIR_2) 00267 { 00268 /* what about when we have logical_name:???? */ 00269 if (src[slen] == FN_DEVCHAR) 00270 { /* Xlate logical name and see what we get */ 00271 VOID(strmov(dst,src)); 00272 dst[slen] = 0; /* remove colon */ 00273 if (!(src = getenv (dst))) 00274 return dst; /* Can't translate */ 00275 00276 /* should we jump to the beginning of this procedure? 00277 Good points: allows us to use logical names that xlate 00278 to Unix names, 00279 Bad points: can be a problem if we just translated to a device 00280 name... 00281 For now, I'll punt and always expect VMS names, and hope for 00282 the best! */ 00283 00284 slen = strlen (src) - 1; 00285 if (src[slen] != FN_C_AFTER_DIR && src[slen] != FN_C_AFTER_DIR_2) 00286 { /* no recursion here! */ 00287 VOID(strmov(dst, src)); 00288 return(dst); 00289 } 00290 } 00291 else 00292 { /* not a directory spec */ 00293 VOID(strmov(dst, src)); 00294 return(dst); 00295 } 00296 } 00297 00298 bracket = src[slen]; /* End char */ 00299 if (!(ptr = strchr (src, bracket - 2))) 00300 { /* no opening bracket */ 00301 VOID(strmov (dst, src)); 00302 return dst; 00303 } 00304 if (!(rptr = strrchr (src, '.'))) 00305 rptr = ptr; 00306 slen = rptr - src; 00307 VOID(strmake (dst, src, slen)); 00308 00309 if (*rptr == '.') 00310 { /* Put bracket and add */ 00311 dst[slen++] = bracket; /* (rptr+1) after this */ 00312 } 00313 else 00314 { 00315 /* If we have the top-level of a rooted directory (i.e. xx:[000000]), 00316 then translate the device and recurse. */ 00317 00318 if (dst[slen - 1] == ':' 00319 && dst[slen - 2] != ':' /* skip decnet nodes */ 00320 && strcmp(src + slen, "[000000]") == 0) 00321 { 00322 dst[slen - 1] = '\0'; 00323 if ((ptr = getenv (dst)) 00324 && (rlen = strlen (ptr) - 1) > 0 00325 && (ptr[rlen] == FN_C_AFTER_DIR || ptr[rlen] == FN_C_AFTER_DIR_2) 00326 && ptr[rlen - 1] == '.') 00327 { 00328 VOID(strmov(esa,ptr)); 00329 esa[rlen - 1] = FN_C_AFTER_DIR; 00330 esa[rlen] = '\0'; 00331 return (directory_file_name (dst, esa)); 00332 } 00333 else 00334 dst[slen - 1] = ':'; 00335 } 00336 VOID(strmov(dst+slen,"[000000]")); 00337 slen += 8; 00338 } 00339 VOID(strmov(strmov(dst+slen,rptr+1)-1,".DIR.1")); 00340 return dst; 00341 } 00342 VOID(strmov(dst, src)); 00343 if (dst[slen] == '/' && slen > 1) 00344 dst[slen] = 0; 00345 return dst; 00346 #endif /* VMS */ 00347 } /* directory_file_name */
Here is the call graph for this function:

Here is the caller graph for this function:

| uint dirname_length | ( | const char * | name | ) |
Definition at line 22 of file mf_dirname.c.
References FN_DEVCHAR, FN_LIBCHAR, my_ismbchar, pos(), strrchr(), and use_mb.
Referenced by append_directory(), create_file(), dirname_part(), get_one_option(), main(), MYSQL_BIN_LOG::make_log_name(), my_print_default_files(), my_search_option_files(), mysql_load(), MYSQL_BIN_LOG::new_file_impl(), Load_log_processor::process(), and split_file_name().
00023 { 00024 register my_string pos,gpos; 00025 #ifdef BASKSLASH_MBTAIL 00026 CHARSET_INFO *fs= fs_character_set(); 00027 #endif 00028 #ifdef FN_DEVCHAR 00029 if ((pos=(char*)strrchr(name,FN_DEVCHAR)) == 0) 00030 #endif 00031 pos=(char*) name-1; 00032 00033 gpos= pos++; 00034 for ( ; *pos ; pos++) /* Find last FN_LIBCHAR */ 00035 { 00036 #ifdef BASKSLASH_MBTAIL 00037 uint l; 00038 if (use_mb(fs) && (l= my_ismbchar(fs, pos, pos + 3))) 00039 { 00040 pos+= l - 1; 00041 continue; 00042 } 00043 #endif 00044 if (*pos == FN_LIBCHAR || *pos == '/' 00045 #ifdef FN_C_AFTER_DIR 00046 || *pos == FN_C_AFTER_DIR || *pos == FN_C_AFTER_DIR_2 00047 #endif 00048 ) 00049 gpos=pos; 00050 } 00051 return ((uint) (uint) (gpos+1-(char*) name)); 00052 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 58 of file mf_dirname.c.
References convert_dirname(), DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, and dirname_length().
Referenced by convert_file(), find_uniq_filename(), fn_ext(), fn_format(), fn_same(), intern_filename(), my_path(), myrg_open(), sys_check_log_path(), and unpack_filename().
00059 { 00060 uint length; 00061 DBUG_ENTER("dirname_part"); 00062 DBUG_PRINT("enter",("'%s'",name)); 00063 00064 length=dirname_length(name); 00065 convert_dirname(to, name, name+length); 00066 DBUG_RETURN(length); 00067 } /* dirname */
Here is the call graph for this function:

Here is the caller graph for this function:

| void dont_break | ( | void | ) |
Definition at line 27 of file mf_brkhant.c.
References my_dont_interrupt.
Referenced by _mi_cmp_dynamic_record(), _mi_cmp_static_record(), and hp_get_new_block().
00028 { 00029 my_dont_interrupt=1; 00030 return; 00031 } /* dont_break */
Here is the caller graph for this function:

| my_bool dynstr_append | ( | DYNAMIC_STRING * | str, | |
| const char * | append | |||
| ) |
Definition at line 92 of file string.c.
References dynstr_append_mem(), and strlen().
Referenced by append_field(), append_info(), append_metadata(), build_insert_string(), build_query_string(), build_table_string(), do_system(), dump_all_tables_in_db(), dump_all_views_in_db(), dump_selected_tables(), dump_table(), get_table_structure(), handle_error(), lock_table(), mark_progress(), and replace().
00093 { 00094 return dynstr_append_mem(str,append,(uint) strlen(append)); 00095 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool dynstr_append_mem | ( | DYNAMIC_STRING * | str, | |
| const char * | append, | |||
| uint | length | |||
| ) |
Definition at line 98 of file string.c.
References st_dynamic_string::alloc_increment, FALSE, st_dynamic_string::length, st_dynamic_string::max_length, memcpy, my_realloc(), MY_WME, MYF, st_dynamic_string::str, and TRUE.
Referenced by append_field(), append_info(), append_metadata(), append_result(), append_stmt_result(), append_table_headings(), build_insert_string(), build_query_string(), connect_n_handle_errors(), do_echo(), do_eval(), dynstr_append(), get_table_structure(), handle_error(), mark_progress(), replace(), replace_dynstr_append_mem(), replace_strings_append(), run_query(), run_query_normal(), run_query_stmt(), and var_query_set().
00100 { 00101 char *new_ptr; 00102 if (str->length+length >= str->max_length) 00103 { 00104 uint new_length=(str->length+length+str->alloc_increment)/ 00105 str->alloc_increment; 00106 new_length*=str->alloc_increment; 00107 if (!(new_ptr=(char*) my_realloc(str->str,new_length,MYF(MY_WME)))) 00108 return TRUE; 00109 str->str=new_ptr; 00110 str->max_length=new_length; 00111 } 00112 memcpy(str->str + str->length,append,length); 00113 str->length+=length; 00114 str->str[str->length]=0; /* Safety for C programs */ 00115 return FALSE; 00116 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void dynstr_free | ( | DYNAMIC_STRING * | str | ) |
Definition at line 119 of file string.c.
References my_free, MY_WME, MYF, and st_dynamic_string::str.
Referenced by build_insert_string(), build_query_string(), build_table_string(), do_echo(), do_system(), dump_all_tables_in_db(), dump_all_views_in_db(), dump_selected_tables(), dyn_string_cmp(), free_used_memory(), get_view_structure(), main(), replace(), run_query(), run_query_stmt(), and var_query_set().
00120 { 00121 if (str->str) 00122 { 00123 my_free(str->str,MYF(MY_WME)); 00124 str->str=0; 00125 } 00126 }
Here is the caller graph for this function:

| my_bool dynstr_realloc | ( | DYNAMIC_STRING * | str, | |
| ulong | additional_size | |||
| ) |
Definition at line 76 of file string.c.
References st_dynamic_string::alloc_increment, DBUG_ENTER, DBUG_RETURN, FALSE, st_dynamic_string::length, st_dynamic_string::max_length, my_realloc(), MY_WME, MYF, st_dynamic_string::str, and TRUE.
Referenced by dump_table().
00077 { 00078 DBUG_ENTER("dynstr_realloc"); 00079 00080 if (!additional_size) DBUG_RETURN(FALSE); 00081 if (str->length + additional_size > str->max_length) 00082 { 00083 str->max_length=((str->length + additional_size+str->alloc_increment-1)/ 00084 str->alloc_increment)*str->alloc_increment; 00085 if (!(str->str=(char*) my_realloc(str->str,str->max_length,MYF(MY_WME)))) 00086 DBUG_RETURN(TRUE); 00087 } 00088 DBUG_RETURN(FALSE); 00089 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool dynstr_set | ( | DYNAMIC_STRING * | str, | |
| const char * | init_str | |||
| ) |
Definition at line 51 of file string.c.
References st_dynamic_string::alloc_increment, DBUG_ENTER, DBUG_RETURN, FALSE, st_dynamic_string::length, st_dynamic_string::max_length, memcpy, my_realloc(), MY_WME, MYF, st_dynamic_string::str, strlen(), and TRUE.
Referenced by dump_table(), get_table_structure(), replace(), run_query(), and run_query_stmt().
00052 { 00053 uint length=0; 00054 DBUG_ENTER("dynstr_set"); 00055 00056 if (init_str && (length= (uint) strlen(init_str)+1) > str->max_length) 00057 { 00058 str->max_length=((length+str->alloc_increment-1)/str->alloc_increment)* 00059 str->alloc_increment; 00060 if (!str->max_length) 00061 str->max_length=str->alloc_increment; 00062 if (!(str->str=(char*) my_realloc(str->str,str->max_length,MYF(MY_WME)))) 00063 DBUG_RETURN(TRUE); 00064 } 00065 if (init_str) 00066 { 00067 str->length=length-1; 00068 memcpy(str->str,init_str,length); 00069 } 00070 else 00071 str->length=0; 00072 DBUG_RETURN(FALSE); 00073 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int end_io_cache | ( | IO_CACHE * | info | ) |
Definition at line 1259 of file mf_iocache.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, my_b_flush_io_cache(), my_free, MY_WME, MYF, pthread_mutex_destroy, SEQ_READ_APPEND, and TYPE_NOT_SET.
Referenced by ha_myisam::check(), MYSQL_BIN_LOG::close(), MYSQL_LOG::close(), close_cached_file(), dump_local_log_entries(), load_db_opt(), mi_close(), mi_extra(), mi_lock_database(), mi_reset(), mi_update_status(), myisamchk(), myrg_open(), MYSQL_BIN_LOG::open(), MYSQL_LOG::open(), open_binlog(), and sql_create_definition_file().
01260 { 01261 int error=0; 01262 IO_CACHE_CALLBACK pre_close; 01263 DBUG_ENTER("end_io_cache"); 01264 DBUG_PRINT("enter",("cache: 0x%lx", (ulong) info)); 01265 01266 #ifdef THREAD 01267 /* 01268 if IO_CACHE is shared between several threads, only one 01269 thread needs to call end_io_cache() - just as init_io_cache() 01270 should be called only once and then memcopy'ed 01271 */ 01272 if (info->share) 01273 { 01274 pthread_cond_destroy(&info->share->cond); 01275 pthread_mutex_destroy(&info->share->mutex); 01276 info->share=0; 01277 } 01278 #endif 01279 01280 if ((pre_close=info->pre_close)) 01281 { 01282 (*pre_close)(info); 01283 info->pre_close= 0; 01284 } 01285 if (info->alloced_buffer) 01286 { 01287 info->alloced_buffer=0; 01288 if (info->file != -1) /* File doesn't exist */ 01289 error= my_b_flush_io_cache(info,1); 01290 my_free((gptr) info->buffer,MYF(MY_WME)); 01291 info->buffer=info->read_pos=(byte*) 0; 01292 } 01293 if (info->type == SEQ_READ_APPEND) 01294 { 01295 /* Destroy allocated mutex */ 01296 info->type= TYPE_NOT_SET; 01297 #ifdef THREAD 01298 pthread_mutex_destroy(&info->append_buffer_lock); 01299 #endif 01300 } 01301 DBUG_RETURN(error); 01302 } /* end_io_cache */
Here is the call graph for this function:

Here is the caller graph for this function:

| int end_record_cache | ( | RECORD_CACHE * | info | ) |
| ulong escape_quotes_for_mysql | ( | CHARSET_INFO * | charset_info, | |
| char * | to, | |||
| ulong | to_length, | |||
| const char * | from, | |||
| ulong | length | |||
| ) |
Definition at line 739 of file charset.c.
References charset_info, FALSE, my_ismbchar, TRUE, use_mb, and USE_MB.
Referenced by mysql_real_escape_string().
00742 { 00743 const char *to_start= to; 00744 const char *end, *to_end=to_start + (to_length ? to_length-1 : 2*length); 00745 my_bool overflow= FALSE; 00746 #ifdef USE_MB 00747 my_bool use_mb_flag= use_mb(charset_info); 00748 #endif 00749 for (end= from + length; from < end; from++) 00750 { 00751 #ifdef USE_MB 00752 int tmp_length; 00753 if (use_mb_flag && (tmp_length= my_ismbchar(charset_info, from, end))) 00754 { 00755 if (to + tmp_length > to_end) 00756 { 00757 overflow= TRUE; 00758 break; 00759 } 00760 while (tmp_length--) 00761 *to++= *from++; 00762 from--; 00763 continue; 00764 } 00765 /* 00766 We don't have the same issue here with a non-multi-byte character being 00767 turned into a multi-byte character by the addition of an escaping 00768 character, because we are only escaping the ' character with itself. 00769 */ 00770 #endif 00771 if (*from == '\'') 00772 { 00773 if (to + 2 > to_end) 00774 { 00775 overflow= TRUE; 00776 break; 00777 } 00778 *to++= '\''; 00779 *to++= '\''; 00780 } 00781 else 00782 { 00783 if (to + 1 > to_end) 00784 { 00785 overflow= TRUE; 00786 break; 00787 } 00788 *to++= *from; 00789 } 00790 } 00791 *to= 0; 00792 return overflow ? (ulong)~0 : (ulong) (to - to_start); 00793 }
Here is the caller graph for this function:

| ulong escape_string_for_mysql | ( | CHARSET_INFO * | charset_info, | |
| char * | to, | |||
| ulong | to_length, | |||
| const char * | from, | |||
| ulong | length | |||
| ) |
Definition at line 599 of file charset.c.
References charset_info, FALSE, my_ismbchar, my_mbcharlen, TRUE, and use_mb.
Referenced by append_query_string(), insert_params_from_vars_with_log(), mysql_escape_string(), and mysql_real_escape_string().
00602 { 00603 const char *to_start= to; 00604 const char *end, *to_end=to_start + (to_length ? to_length-1 : 2*length); 00605 my_bool overflow= FALSE; 00606 #ifdef USE_MB 00607 my_bool use_mb_flag= use_mb(charset_info); 00608 #endif 00609 for (end= from + length; from < end; from++) 00610 { 00611 char escape= 0; 00612 #ifdef USE_MB 00613 int tmp_length; 00614 if (use_mb_flag && (tmp_length= my_ismbchar(charset_info, from, end))) 00615 { 00616 if (to + tmp_length > to_end) 00617 { 00618 overflow= TRUE; 00619 break; 00620 } 00621 while (tmp_length--) 00622 *to++= *from++; 00623 from--; 00624 continue; 00625 } 00626 /* 00627 If the next character appears to begin a multi-byte character, we 00628 escape that first byte of that apparent multi-byte character. (The 00629 character just looks like a multi-byte character -- if it were actually 00630 a multi-byte character, it would have been passed through in the test 00631 above.) 00632 00633 Without this check, we can create a problem by converting an invalid 00634 multi-byte character into a valid one. For example, 0xbf27 is not 00635 a valid GBK character, but 0xbf5c is. (0x27 = ', 0x5c = \) 00636 */ 00637 if (use_mb_flag && (tmp_length= my_mbcharlen(charset_info, *from)) > 1) 00638 escape= *from; 00639 else 00640 #endif 00641 switch (*from) { 00642 case 0: /* Must be escaped for 'mysql' */ 00643 escape= '0'; 00644 break; 00645 case '\n': /* Must be escaped for logs */ 00646 escape= 'n'; 00647 break; 00648 case '\r': 00649 escape= 'r'; 00650 break; 00651 case '\\': 00652 escape= '\\'; 00653 break; 00654 case '\'': 00655 escape= '\''; 00656 break; 00657 case '"': /* Better safe than sorry */ 00658 escape= '"'; 00659 break; 00660 case '\032': /* This gives problems on Win32 */ 00661 escape= 'Z'; 00662 break; 00663 } 00664 if (escape) 00665 { 00666 if (to + 2 > to_end) 00667 { 00668 overflow= TRUE; 00669 break; 00670 } 00671 *to++= '\\'; 00672 *to++= escape; 00673 } 00674 else 00675 { 00676 if (to + 1 > to_end) 00677 { 00678 overflow= TRUE; 00679 break; 00680 } 00681 *to++= *from; 00682 } 00683 } 00684 *to= 0; 00685 return overflow ? (ulong)~0 : (ulong) (to - to_start); 00686 }
Here is the caller graph for this function:

| int flush_write_cache | ( | RECORD_CACHE * | info | ) |
| my_string fn_ext | ( | const char * | name | ) |
Definition at line 37 of file mf_fn_ext.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, dirname_part(), FN_EXTCHAR, FN_LIBCHAR, FN_REFLEN, pos(), strchr(), strend(), and strrchr().
Referenced by examine_log(), find_file_in_path(), find_files(), MYSQL_LOG::generate_name(), MYSQL_LOG::generate_new_name(), init_common_variables(), my_print_default_files(), mysql_alter_table(), mysql_rm_arc_files(), search_default_file(), search_default_file_with_ext(), and split_file_name().
00038 { 00039 register my_string pos,gpos; 00040 DBUG_ENTER("fn_ext"); 00041 DBUG_PRINT("mfunkt",("name: '%s'",name)); 00042 00043 #if defined(FN_DEVCHAR) || defined(FN_C_AFTER_DIR) || defined(BASKSLASH_MBTAIL) 00044 { 00045 char buff[FN_REFLEN]; 00046 gpos=(my_string) name+dirname_part(buff,(char*) name); 00047 } 00048 #else 00049 if (!(gpos= strrchr(name, FN_LIBCHAR))) 00050 gpos= (my_string) name; 00051 #endif 00052 pos=strchr(gpos,FN_EXTCHAR); 00053 DBUG_RETURN (pos ? pos : strend(gpos)); 00054 } /* fn_ext */
Here is the call graph for this function:

Here is the caller graph for this function:

| my_string fn_format | ( | my_string | to, | |
| const char * | name, | |||
| const char * | dir, | |||
| const char * | form, | |||
| uint | flag | |||
| ) |
Definition at line 27 of file mf_format.c.
References bmove(), convert_dirname(), DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, dirname_part(), FN_EXTCHAR, FN_LEN, FN_REFLEN, min, MY_APPEND_EXT, MY_PACK_FILENAME, my_readlink(), my_realpath(), MY_RELATIVE_PATH, MY_REPLACE_DIR, MY_REPLACE_EXT, MY_RESOLVE_LINK, MY_RESOLVE_SYMLINKS, MY_RETURN_REAL_PATH, MY_SAFE_PATH, MY_UNPACK_FILENAME, MYF, NullS, pack_dirname(), pos(), reg1, strchr(), strlen(), strlength(), strmake(), strmov(), test_if_hard_path(), and unpack_dirname().
Referenced by change_to_newfile(), check_result(), compress(), ha_tina::create(), create_file(), create_tmp_table(), default_local_infile_init(), handler::delete_table(), do_connect(), dump_progress(), dump_result_to_log_file(), dump_result_to_reject_file(), dump_table(), dyn_string_cmp(), Instance_options::fill_log_options(), fn_format_relative_to_data_home(), fn_same(), MYSQL_LOG::generate_new_name(), get_one_option(), get_share(), ha_archive::get_share(), ha_myisam::info(), init_server_components(), lock_table(), main(), make_default_log_name(), make_new_name(), make_old_name(), mi_delete_table(), mi_log(), mi_open(), mi_panic(), mi_rename(), mi_repair(), mi_repair_by_sort(), mi_repair_parallel(), mi_sort_index(), mi_sort_records(), my_redel(), myrg_create(), myrg_open(), mysql_create_like_table(), mysql_load(), mysql_register_view(), mysql_table_grant(), ha_myisammrg::open(), open_file(), MYSQL_BIN_LOG::open_index_file(), open_sql_file_for_table(), ha_tina::open_update_temp_file_if_needed(), ha_archive::optimize(), Load_log_processor::prepare_new_file_for_old_format(), read_server_arguments(), read_texts(), readfrm(), ha_tina::repair(), ha_tina::rnd_end(), search_default_file_with_ext(), sql_create_definition_file(), str_to_file(), test_if_case_insensitive(), Item_load_file::val_str(), write_to_table(), and writefrm().
00029 { 00030 reg1 uint length; 00031 char dev[FN_REFLEN], buff[FN_REFLEN], *pos, *startpos; 00032 const char *ext; 00033 DBUG_ENTER("fn_format"); 00034 DBUG_PRINT("enter",("name: %s dir: %s extension: %s flag: %d", 00035 name,dir,extension,flag)); 00036 00037 /* Copy and skip directory */ 00038 name+=(length=dirname_part(dev,(startpos=(my_string) name))); 00039 if (length == 0 || (flag & MY_REPLACE_DIR)) 00040 { 00041 /* Use given directory */ 00042 convert_dirname(dev,dir,NullS); /* Fix to this OS */ 00043 } 00044 else if ((flag & MY_RELATIVE_PATH) && !test_if_hard_path(dev)) 00045 { 00046 /* Put 'dir' before the given path */ 00047 strmake(buff,dev,sizeof(buff)-1); 00048 pos=convert_dirname(dev,dir,NullS); 00049 strmake(pos,buff,sizeof(buff)-1- (int) (pos-dev)); 00050 } 00051 00052 if (flag & MY_PACK_FILENAME) 00053 pack_dirname(dev,dev); /* Put in ./.. and ~/.. */ 00054 if (flag & MY_UNPACK_FILENAME) 00055 (void) unpack_dirname(dev,dev); /* Replace ~/.. with dir */ 00056 00057 if (!(flag & MY_APPEND_EXT) && 00058 (pos= (char*) strchr(name,FN_EXTCHAR)) != NullS) 00059 { 00060 if ((flag & MY_REPLACE_EXT) == 0) /* If we should keep old ext */ 00061 { 00062 length=strlength(name); /* Use old extension */ 00063 ext = ""; 00064 } 00065 else 00066 { 00067 length=(uint) (pos-(char*) name); /* Change extension */ 00068 ext= extension; 00069 } 00070 } 00071 else 00072 { 00073 length=strlength(name); /* No ext, use the now one */ 00074 ext=extension; 00075 } 00076 00077 if (strlen(dev)+length+strlen(ext) >= FN_REFLEN || length >= FN_LEN ) 00078 { 00079 /* To long path, return original or NULL */ 00080 uint tmp_length; 00081 if (flag & MY_SAFE_PATH) 00082 return NullS; 00083 tmp_length=strlength(startpos); 00084 DBUG_PRINT("error",("dev: '%s' ext: '%s' length: %d",dev,ext,length)); 00085 (void) strmake(to,startpos,min(tmp_length,FN_REFLEN-1)); 00086 } 00087 else 00088 { 00089 if (to == startpos) 00090 { 00091 bmove(buff,(char*) name,length); /* Save name for last copy */ 00092 name=buff; 00093 } 00094 pos=strmake(strmov(to,dev),name,length); 00095 (void) strmov(pos,ext); /* Don't convert extension */ 00096 } 00097 /* 00098 If MY_RETURN_REAL_PATH and MY_RESOLVE_SYMLINK is given, only do 00099 realpath if the file is a symbolic link 00100 */ 00101 if (flag & MY_RETURN_REAL_PATH) 00102 (void) my_realpath(to, to, MYF(flag & MY_RESOLVE_SYMLINKS ? 00103 MY_RESOLVE_LINK: 0)); 00104 else if (flag & MY_RESOLVE_SYMLINKS) 00105 { 00106 strmov(buff,to); 00107 (void) my_readlink(to, buff, MYF(0)); 00108 } 00109 DBUG_RETURN(to); 00110 } /* fn_format */
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 29 of file mf_same.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, dirname_part(), FN_EXTCHAR, fn_format(), FN_REFLEN, and strrchr().
Referenced by my_rename_with_symlink(), and myrg_create().
00030 { 00031 char dev[FN_REFLEN]; 00032 const char *ext; 00033 DBUG_ENTER("fn_same"); 00034 DBUG_PRINT("enter",("to: %s name: %s flag: %d",to,name,flag)); 00035 00036 if ((ext=strrchr(name+dirname_part(dev,name),FN_EXTCHAR)) == 0) 00037 ext=""; 00038 00039 DBUG_RETURN(fn_format(to,to,dev,ext,flag)); 00040 } /* fn_same */
Here is the call graph for this function:

Here is the caller graph for this function:

| void free_charsets | ( | void | ) |
Definition at line 431 of file charset.c.
References charset_initialized.
Referenced by clean_up(), my_end(), and mysql_server_end().
00432 { 00433 charset_initialized=0; 00434 }
Here is the caller graph for this function:

| void free_defaults | ( | char ** | argv | ) |
Definition at line 473 of file default.c.
References free_root(), memcpy_fixed, and MYF.
Referenced by clean_up(), Options::cleanup(), free_used_memory(), main(), mysql_end(), and mysql_read_default_options().
00474 { 00475 MEM_ROOT ptr; 00476 memcpy_fixed((char*) &ptr,(char *) argv - sizeof(ptr), sizeof(ptr)); 00477 free_root(&ptr,MYF(0)); 00478 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 327 of file my_alloc.c.
References ALIGN_SIZE, st_mem_root::block_num, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, st_mem_root::first_block_usage, st_mem_root::free, st_used_mem::left, mark_blocks_free(), my_free, MY_KEEP_PREALLOC, MY_MARK_BLOCKS_FREE, MYF, st_used_mem::next, st_mem_root::pre_alloc, reg1, st_used_mem::size, TRASH_MEM, and st_mem_root::used.
Referenced by _mi_ft_add(), _mi_ft_del(), _mi_ft_update(), acl_free(), acl_reload(), build_completion_hash(), Table_triggers_list::change_table_name(), closefrm(), completion_hash_clean(), create_tmp_table(), Event_scheduler::destroy(), dispatch_command(), Table_triggers_list::drop_all_triggers(), dump_selected_tables(), sp_head::execute(), execute_ddl_log_action(), sp_head::execute_function(), sp_head::execute_trigger(), free_defaults(), free_old_query(), free_rows(), free_table_share(), free_tmp_table(), free_tree(), ft_boolean_close_search(), ft_init_boolean_search(), ftparser_call_deinitializer(), grant_free(), grant_reload(), handle_bootstrap(), Guardian_thread::init(), Event_scheduler::load_events_from_db(), my_dirend(), my_tz_free(), mysql_end(), mysql_free_result(), mysql_reset_errors(), mysql_stmt_close(), mysql_stmt_prepare(), mysql_stmt_store_result(), open_table_from_share(), Server_side_cursor::operator delete(), sp_head::operator delete(), plugin_load(), reset_stmt_handle(), Event_scheduler::run(), sort_ft_key_read(), stmt_read_row_from_cursor(), SQL_SELECT::test_quick_select(), trie_free(), trie_init(), Guardian_thread::~Guardian_thread(), Instance_options::~Instance_options(), QUICK_GROUP_MIN_MAX_SELECT::~QUICK_GROUP_MIN_MAX_SELECT(), QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT(), QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT(), QUICK_ROR_INTERSECT_SELECT::~QUICK_ROR_INTERSECT_SELECT(), and QUICK_ROR_UNION_SELECT::~QUICK_ROR_UNION_SELECT().
00328 { 00329 reg1 USED_MEM *next,*old; 00330 DBUG_ENTER("free_root"); 00331 DBUG_PRINT("enter",("root: 0x%lx flags: %u", root, (uint) MyFlags)); 00332 00333 if (!root) /* QQ: Should be deleted */ 00334 DBUG_VOID_RETURN; /* purecov: inspected */ 00335 if (MyFlags & MY_MARK_BLOCKS_FREE) 00336 { 00337 mark_blocks_free(root); 00338 DBUG_VOID_RETURN; 00339 } 00340 if (!(MyFlags & MY_KEEP_PREALLOC)) 00341 root->pre_alloc=0; 00342 00343 for (next=root->used; next ;) 00344 { 00345 old=next; next= next->next ; 00346 if (old != root->pre_alloc) 00347 my_free((gptr) old,MYF(0)); 00348 } 00349 for (next=root->free ; next ;) 00350 { 00351 old=next; next= next->next; 00352 if (old != root->pre_alloc) 00353 my_free((gptr) old,MYF(0)); 00354 } 00355 root->used=root->free=0; 00356 if (root->pre_alloc) 00357 { 00358 root->free=root->pre_alloc; 00359 root->free->left=root->pre_alloc->size-ALIGN_SIZE(sizeof(USED_MEM)); 00360 TRASH_MEM(root->pre_alloc); 00361 root->free->next=0; 00362 } 00363 root->block_num= 4; 00364 root->first_block_usage= 0; 00365 DBUG_VOID_RETURN; 00366 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void free_tmpdir | ( | MY_TMPDIR * | tmpdir | ) |
Definition at line 87 of file mf_tempdir.c.
References st_my_tmpdir::list, st_my_tmpdir::max, my_free, MYF, and pthread_mutex_destroy.
Referenced by clean_up(), and main().
00088 { 00089 uint i; 00090 for (i=0; i<=tmpdir->max; i++) 00091 my_free(tmpdir->list[i], MYF(0)); 00092 my_free((gptr)tmpdir->list, MYF(0)); 00093 pthread_mutex_destroy(&tmpdir->mutex); 00094 }
Here is the caller graph for this function:

| void freeze_size | ( | DYNAMIC_ARRAY * | array | ) |
Definition at line 269 of file array.c.
References st_dynamic_array::buffer, st_dynamic_array::elements, max, st_dynamic_array::max_element, my_realloc(), MY_WME, MYF, and st_dynamic_array::size_of_element.
Referenced by acl_load(), display_table_locks(), and init_tmpdir().
00270 { 00271 uint elements=max(array->elements,1); 00272 00273 if (array->buffer && array->max_element != elements) 00274 { 00275 array->buffer=(char*) my_realloc(array->buffer, 00276 elements*array->size_of_element, 00277 MYF(MY_WME)); 00278 array->max_element=elements; 00279 } 00280 }
Here is the call graph for this function:

Here is the caller graph for this function:

| CHARSET_INFO* get_charset | ( | uint | cs_number, | |
| myf | flags | |||
| ) |
Definition at line 505 of file charset.c.
References all_charsets, array_elements, default_charset_info, EE_UNKNOWN_CHARSET, FN_REFLEN, get_charsets_dir(), get_internal_charset(), init_available_charsets(), int10_to_str(), ME_BELL, MY_CHARSET_INDEX, my_error(), MY_WME, MYF, NULL, charset_info_st::number, and strmov().
Referenced by sys_var_character_set::check(), sys_var_collation::check(), do_verify_prepare_field(), Dbdict::handleTabInfo(), mi_open(), open_binary_frm(), NdbDictInterface::parseTableInfo(), read_texts(), and thd_init_client_charset().
00506 { 00507 CHARSET_INFO *cs; 00508 if (cs_number == default_charset_info->number) 00509 return default_charset_info; 00510 00511 (void) init_available_charsets(MYF(0)); /* If it isn't initialized */ 00512 00513 if (!cs_number || cs_number >= array_elements(all_charsets)-1) 00514 return NULL; 00515 00516 cs=get_internal_charset(cs_number, flags); 00517 00518 if (!cs && (flags & MY_WME)) 00519 { 00520 char index_file[FN_REFLEN], cs_string[23]; 00521 strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX); 00522 cs_string[0]='#'; 00523 int10_to_str(cs_number, cs_string+1, 10); 00524 my_error(EE_UNKNOWN_CHARSET, MYF(ME_BELL), cs_string, index_file); 00525 } 00526 return cs; 00527 }
Here is the call graph for this function:

Here is the caller graph for this function:

| CHARSET_INFO* get_charset_by_csname | ( | const char * | cs_name, | |
| uint | cs_flags, | |||
| myf | my_flags | |||
| ) |
Definition at line 549 of file charset.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, EE_UNKNOWN_CHARSET, FN_REFLEN, get_charset_number(), get_charsets_dir(), get_internal_charset(), init_available_charsets(), ME_BELL, MY_CHARSET_INDEX, my_error(), MY_WME, MYF, NULL, and strmov().
Referenced by DTCollation::aggregate(), sys_var_character_set::check(), com_charset(), Event_timed::compile(), Item_func_set_collation::fix_length_and_dec(), Item_func_sha::fix_length_and_dec(), Item_func_md5::fix_length_and_dec(), get_old_charset_by_name(), get_options(), init_common_variables(), load_db_opt(), mysql_init_character_set(), mysql_prepare_table(), mysql_set_character_set(), MYSQLlex(), set_charset(), and usage().
00552 { 00553 uint cs_number; 00554 CHARSET_INFO *cs; 00555 DBUG_ENTER("get_charset_by_csname"); 00556 DBUG_PRINT("enter",("name: '%s'", cs_name)); 00557 00558 (void) init_available_charsets(MYF(0)); /* If it isn't initialized */ 00559 00560 cs_number= get_charset_number(cs_name, cs_flags); 00561 cs= cs_number ? get_internal_charset(cs_number, flags) : NULL; 00562 00563 if (!cs && (flags & MY_WME)) 00564 { 00565 char index_file[FN_REFLEN]; 00566 strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX); 00567 my_error(EE_UNKNOWN_CHARSET, MYF(ME_BELL), cs_name, index_file); 00568 } 00569 00570 DBUG_RETURN(cs); 00571 }
Here is the call graph for this function:

Here is the caller graph for this function:

| CHARSET_INFO* get_charset_by_name | ( | const char * | cs_name, | |
| myf | flags | |||
| ) |
Definition at line 529 of file charset.c.
References EE_UNKNOWN_COLLATION, FN_REFLEN, get_charsets_dir(), get_collation_number(), get_internal_charset(), init_available_charsets(), ME_BELL, MY_CHARSET_INDEX, my_error(), MY_WME, MYF, NULL, and strmov().
Referenced by sys_var_collation::check(), Item_func_set_collation::fix_length_and_dec(), get_options(), init_common_variables(), load_db_opt(), main(), mysql_init_character_set(), and print_index().
00530 { 00531 uint cs_number; 00532 CHARSET_INFO *cs; 00533 (void) init_available_charsets(MYF(0)); /* If it isn't initialized */ 00534 00535 cs_number=get_collation_number(cs_name); 00536 cs= cs_number ? get_internal_charset(cs_number,flags) : NULL; 00537 00538 if (!cs && (flags & MY_WME)) 00539 { 00540 char index_file[FN_REFLEN]; 00541 strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX); 00542 my_error(EE_UNKNOWN_COLLATION, MYF(ME_BELL), cs_name, index_file); 00543 } 00544 00545 return cs; 00546 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char* get_charset_name | ( | uint | cs_number | ) |
Definition at line 461 of file charset.c.
References all_charsets, init_available_charsets(), MYF, charset_info_st::name, and charset_info_st::number.
Referenced by descript(), open_table_error(), and print_field_types().
00462 { 00463 CHARSET_INFO *cs; 00464 init_available_charsets(MYF(0)); 00465 00466 cs=all_charsets[charset_number]; 00467 if (cs && (cs->number == charset_number) && cs->name ) 00468 return (char*) cs->name; 00469 00470 return (char*) "?"; /* this mimics find_type() */ 00471 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 444 of file charset.c.
References all_charsets, array_elements, init_available_charsets(), my_charset_latin1, my_strcasecmp, MYF, and charset_info_st::number.
Referenced by add_collation(), create_sys_files(), and get_charset_by_csname().
00445 { 00446 CHARSET_INFO **cs; 00447 init_available_charsets(MYF(0)); 00448 00449 for (cs= all_charsets; 00450 cs < all_charsets+array_elements(all_charsets)-1 ; 00451 cs++) 00452 { 00453 if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) && 00454 !my_strcasecmp(&my_charset_latin1, cs[0]->csname, charset_name)) 00455 return cs[0]->number; 00456 } 00457 return 0; 00458 }
Here is the call graph for this function:

Here is the caller graph for this function:

| char* get_charsets_dir | ( | char * | buf | ) |
Definition at line 346 of file charset.c.
References CHARSET_DIR, charsets_dir, convert_dirname(), DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, DEFAULT_CHARSET_HOME, FN_REFLEN, is_prefix(), NULL, NullS, SHAREDIR, strmake(), strxmov(), and test_if_hard_path().
Referenced by get_charset(), get_charset_by_csname(), get_charset_by_name(), get_internal_charset(), init_available_charsets(), mysql_init_character_set(), and mysql_set_character_set().
00347 { 00348 const char *sharedir= SHAREDIR; 00349 char *res; 00350 DBUG_ENTER("get_charsets_dir"); 00351 00352 if (charsets_dir != NULL) 00353 strmake(buf, charsets_dir, FN_REFLEN-1); 00354 else 00355 { 00356 if (test_if_hard_path(sharedir) || 00357 is_prefix(sharedir, DEFAULT_CHARSET_HOME)) 00358 strxmov(buf, sharedir, "/", CHARSET_DIR, NullS); 00359 else 00360 strxmov(buf, DEFAULT_CHARSET_HOME, "/", sharedir, "/", CHARSET_DIR, 00361 NullS); 00362 } 00363 res= convert_dirname(buf,buf,NullS); 00364 DBUG_PRINT("info",("charsets dir: '%s'", buf)); 00365 DBUG_RETURN(res); 00366 }
Here is the call graph for this function:

Here is the caller graph for this function:

| uint get_collation_number | ( | const char * | name | ) |
Definition at line 437 of file charset.c.
References get_collation_number_internal(), init_available_charsets(), and MYF.
Referenced by get_charset_by_name().
00438 { 00439 init_available_charsets(MYF(0)); 00440 return get_collation_number_internal(name); 00441 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void get_date | ( | my_string | to, | |
| int | timeflag, | |||
| time_t | use_time | |||
| ) |
Referenced by descript(), Event_timed::load_from_row(), main(), my_redel(), write_footer(), and write_parameter().
Here is the caller graph for this function:

| int get_defaults_options | ( | int | argc, | |
| char ** | argv, | |||
| char ** | defaults, | |||
| char ** | extra_defaults, | |||
| char ** | group_suffix | |||
| ) |
Definition at line 299 of file default.c.
References is_prefix().
Referenced by main(), and my_search_option_files().
00303 { 00304 int org_argc= argc, prev_argc= 0; 00305 *defaults= *extra_defaults= *group_suffix= 0; 00306 00307 while (argc >= 2 && argc != prev_argc) 00308 { 00309 /* Skip program name or previously handled argument */ 00310 argv++; 00311 prev_argc= argc; /* To check if we found */ 00312 if (!*defaults && is_prefix(*argv,"--defaults-file=")) 00313 { 00314 *defaults= *argv + sizeof("--defaults-file=")-1; 00315 argc--; 00316 continue; 00317 } 00318 if (!*extra_defaults && is_prefix(*argv,"--defaults-extra-file=")) 00319 { 00320 *extra_defaults= *argv + sizeof("--defaults-extra-file=")-1; 00321 argc--; 00322 continue; 00323 } 00324 if (!*group_suffix && is_prefix(*argv, "--defaults-group-suffix=")) 00325 { 00326 *group_suffix= *argv + sizeof("--defaults-group-suffix=")-1; 00327 argc--; 00328 continue; 00329 } 00330 } 00331 return org_argc - argc; 00332 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void get_dynamic | ( | DYNAMIC_ARRAY * | array, | |
| gptr | element, | |||
| uint | array_index | |||
| ) |
Definition at line 210 of file array.c.
References st_dynamic_array::buffer, bzero, DBUG_PRINT, st_dynamic_array::elements, memcpy, and st_dynamic_array::size_of_element.
Referenced by sp_pcontext::find_cond(), sp_pcontext::find_cursor(), sp_pcontext::find_handler(), sp_pcontext::find_variable(), Rpl_filter::find_wild(), Rpl_filter::free_string_array(), sp_pcontext::get_current_case_expr_id(), Named_value_arr::get_element(), sp_head::get_instr(), sp_head::last_instruction(), multi_reg_replace(), QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range(), QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range(), read_query(), resolve_addr(), sp_pcontext::retrieve_field_definitions(), Rpl_filter::table_rule_ent_dynamic_array_to_str(), QUICK_GROUP_MIN_MAX_SELECT::update_key_stat(), verify_sort(), and MYSQL_BIN_LOG::write().
00211 { 00212 if (idx >= array->elements) 00213 { 00214 DBUG_PRINT("warning",("To big array idx: %d, array size is %d", 00215 idx,array->elements)); 00216 bzero(element,array->size_of_element); 00217 return; 00218 } 00219 memcpy(element,array->buffer+idx*array->size_of_element, 00220 (size_t) array->size_of_element); 00221 }
Here is the caller graph for this function:

| int get_index_dynamic | ( | DYNAMIC_ARRAY * | array, | |
| gptr | element | |||
| ) |
Definition at line 293 of file array.c.
References st_dynamic_array::buffer, st_dynamic_array::elements, and st_dynamic_array::size_of_element.
00294 { 00295 uint ret; 00296 if (array->buffer > element) 00297 return -1; 00298 00299 ret= (element - array->buffer) / array->size_of_element; 00300 if (ret > array->elements) 00301 return -1; 00302 00303 return ret; 00304 00305 }
| qsort2_cmp get_ptr_compare | ( | uint | ) |
Definition at line 34 of file ptr_cmp.c.
References ptr_compare(), ptr_compare_0(), ptr_compare_1(), ptr_compare_2(), and ptr_compare_3().
Referenced by merge_buffers(), and my_string_ptr_sort().
00035 { 00036 if (size < 4) 00037 return (qsort2_cmp) ptr_compare; 00038 switch (size & 3) { 00039 case 0: return (qsort2_cmp) ptr_compare_0; 00040 case 1: return (qsort2_cmp) ptr_compare_1; 00041 case 2: return (qsort2_cmp) ptr_compare_2; 00042 case 3: return (qsort2_cmp) ptr_compare_3; 00043 } 00044 return 0; /* Impossible */ 00045 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void handle_recived_signals | ( | void | ) |
| my_bool has_path | ( | const char * | name | ) |
Definition at line 164 of file my_getwd.c.
References FN_DEVCHAR, FN_LIBCHAR, strchr(), and test.
Referenced by myrg_open().
00165 { 00166 return test(strchr(name, FN_LIBCHAR)) 00167 #if FN_LIBCHAR != '/' 00168 || test(strchr(name,'/')) 00169 #endif 00170 #ifdef FN_DEVCHAR 00171 || test(strchr(name, FN_DEVCHAR)) 00172 #endif 00173 ; 00174 }
Here is the call graph for this function:

Here is the caller graph for this function:

Referenced by Table_triggers_list::change_table_name(), cli_read_rows(), completion_hash_init(), Table_triggers_list::drop_all_triggers(), dump_selected_tables(), sp_head::execute(), free_old_query(), ft_init_boolean_search(), Guardian_thread::Guardian_thread(), Event_scheduler::init(), Instance_options::init(), Guardian_thread::init(), init_sql_alloc(), init_tree(), load_defaults(), Event_scheduler::load_events_from_db(), main(), mi_repair_by_sort(), mi_repair_parallel(), my_dir(), my_tz_init(), mysql_stmt_init(), open_tables(), sp_head::operator new(), and trie_init().
Here is the caller graph for this function:

| my_bool init_dynamic_array | ( | DYNAMIC_ARRAY * | array, | |
| uint | element_size, | |||
| uint | init_alloc, | |||
| uint alloc_increment | CALLER_INFO_PROTO | |||
| ) |
Definition at line 46 of file array.c.
References st_dynamic_array::alloc_increment, st_dynamic_array::buffer, DBUG_ENTER, DBUG_RETURN, st_dynamic_array::elements, FALSE, MALLOC_OVERHEAD, max, st_dynamic_array::max_element, my_malloc_ci, MY_WME, MYF, st_dynamic_array::size_of_element, and TRUE.
Referenced by add_init_command(), and Load_log_processor::init().
00049 { 00050 DBUG_ENTER("init_dynamic_array"); 00051 if (!alloc_increment) 00052 { 00053 alloc_increment=max((8192-MALLOC_OVERHEAD)/element_size,16); 00054 if (init_alloc > 8 && alloc_increment > init_alloc * 2) 00055 alloc_increment=init_alloc*2; 00056 } 00057 00058 if (!init_alloc) 00059 init_alloc=alloc_increment; 00060 array->elements=0; 00061 array->max_element=init_alloc; 00062 array->alloc_increment=alloc_increment; 00063 array->size_of_element=element_size; 00064 if (!(array->buffer=(char*) my_malloc_ci(element_size*init_alloc,MYF(MY_WME)))) 00065 { 00066 array->max_element=0; 00067 DBUG_RETURN(TRUE); 00068 } 00069 DBUG_RETURN(FALSE); 00070 }
Here is the caller graph for this function:

| my_bool init_dynamic_string | ( | DYNAMIC_STRING * | str, | |
| const char * | init_str, | |||
| uint | init_alloc, | |||
| uint | alloc_increment | |||
| ) |
Definition at line 26 of file string.c.
References st_dynamic_string::alloc_increment, DBUG_ENTER, DBUG_RETURN, FALSE, st_dynamic_string::length, st_dynamic_string::max_length, memcpy, my_malloc(), MY_WME, MYF, st_dynamic_string::str, strlen(), and TRUE.
Referenced by build_insert_string(), build_query_string(), build_table_string(), do_echo(), do_exec(), do_system(), dump_all_tables_in_db(), dump_all_views_in_db(), dump_selected_tables(), dyn_string_cmp(), get_table_structure(), get_view_structure(), init_dumping(), lock_table(), main(), replace(), run_query(), run_query_stmt(), and var_query_set().
00028 { 00029 uint length; 00030 DBUG_ENTER("init_dynamic_string"); 00031 00032 if (!alloc_increment) 00033 alloc_increment=128; 00034 length=1; 00035 if (init_str && (length= (uint) strlen(init_str)+1) < init_alloc) 00036 init_alloc=((length+alloc_increment-1)/alloc_increment)*alloc_increment; 00037 if (!init_alloc) 00038 init_alloc=alloc_increment; 00039 00040 if (!(str->str=(char*) my_malloc(init_alloc,MYF(MY_WME)))) 00041 DBUG_RETURN(TRUE); 00042 str->length=length-1; 00043 if (init_str) 00044 memcpy(str->str,init_str,length); 00045 str->max_length=init_alloc; 00046 str->alloc_increment=alloc_increment; 00047 DBUG_RETURN(FALSE); 00048 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void init_glob_errs | ( | void | ) |
Definition at line 56 of file errors.c.
Referenced by init_myfunc_errs(), and my_error().
Here is the caller graph for this function:

| int init_io_cache | ( | IO_CACHE * | info, | |
| File | file, | |||
| uint | cachesize, | |||
| enum cache_type | type, | |||
| my_off_t | seek_offset, | |||
| pbool | use_async_io, | |||
| myf | cache_myflags | |||
| ) |
Definition at line 157 of file mf_iocache.c.
References _my_b_async_read(), bzero, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, init_functions(), IO_SIZE, my_default_record_cache_size, my_disable_async_io, MY_DONT_CHECK_FILESIZE, MY_FNABP, my_malloc(), MY_MUTEX_INIT_FAST, MY_NABP, my_seek(), MY_SEEK_END, my_tell(), MY_WME, MYF, pthread_mutex_init, READ_CACHE, READ_NET, SEQ_READ_APPEND, test, TYPE_NOT_SET, WRITE_CACHE, and WRITE_NET.
Referenced by ha_myisam::check(), create_file(), dump_local_log_entries(), examine_log(), load_db_opt(), mi_extra(), mi_repair(), mi_repair_by_sort(), mi_repair_parallel(), mi_sort_records(), myisamchk(), myrg_open(), MYSQL_LOG::open(), open_binlog(), open_cached_file(), MYSQL_BIN_LOG::open_index_file(), READ_INFO::READ_INFO(), and sql_create_definition_file().
00160 { 00161 uint min_cache; 00162 my_off_t end_of_file= ~(my_off_t) 0; 00163 DBUG_ENTER("init_io_cache"); 00164 DBUG_PRINT("enter",("cache: 0x%lx type: %d pos: %ld", 00165 (ulong) info, (int) type, (ulong) seek_offset)); 00166 00167 info->file= file; 00168 info->type= TYPE_NOT_SET; /* Don't set it until mutex are created */ 00169 info->pos_in_file= seek_offset; 00170 info->pre_close = info->pre_read = info->post_read = 0; 00171 info->arg = 0; 00172 info->alloced_buffer = 0; 00173 info->buffer=0; 00174 info->seek_not_done= test(file >= 0 && seek_offset != my_tell(file, MYF(0))); 00175 info->disk_writes= 0; 00176 #ifdef THREAD 00177 info->share=0; 00178 #endif 00179 00180 if (!cachesize && !(cachesize= my_default_record_cache_size)) 00181 DBUG_RETURN(1); /* No cache requested */ 00182 min_cache=use_async_io ? IO_SIZE*4 : IO_SIZE*2; 00183 if (type == READ_CACHE || type == SEQ_READ_APPEND) 00184 { /* Assume file isn't growing */ 00185 if (!(cache_myflags & MY_DONT_CHECK_FILESIZE)) 00186 { 00187 /* Calculate end of file to avoid allocating oversized buffers */ 00188 end_of_file=my_seek(file,0L,MY_SEEK_END,MYF(0)); 00189 /* Need to reset seek_not_done now that we just did a seek. */ 00190 info->seek_not_done= end_of_file == seek_offset ? 0 : 1; 00191 if (end_of_file < seek_offset) 00192 end_of_file=seek_offset; 00193 /* Trim cache size if the file is very small */ 00194 if ((my_off_t) cachesize > end_of_file-seek_offset+IO_SIZE*2-1) 00195 { 00196 cachesize=(uint) (end_of_file-seek_offset)+IO_SIZE*2-1; 00197 use_async_io=0; /* No need to use async */ 00198 } 00199 } 00200 } 00201 cache_myflags &= ~MY_DONT_CHECK_FILESIZE; 00202 if (type != READ_NET && type != WRITE_NET) 00203 { 00204 /* Retry allocating memory in smaller blocks until we get one */ 00205 for (;;) 00206 { 00207 uint buffer_block; 00208 cachesize=(uint) ((ulong) (cachesize + min_cache-1) & 00209 (ulong) ~(min_cache-1)); 00210 if (cachesize < min_cache) 00211 cachesize = min_cache; 00212 buffer_block = cachesize; 00213 if (type == SEQ_READ_APPEND) 00214 buffer_block *= 2; 00215 if ((info->buffer= 00216 (byte*) my_malloc(buffer_block, 00217 MYF((cache_myflags & ~ MY_WME) | 00218 (cachesize == min_cache ? MY_WME : 0)))) != 0) 00219 { 00220 info->write_buffer=info->buffer; 00221 if (type == SEQ_READ_APPEND) 00222 info->write_buffer = info->buffer + cachesize; 00223 info->alloced_buffer=1; 00224 break; /* Enough memory found */ 00225 } 00226 if (cachesize == min_cache) 00227 DBUG_RETURN(2); /* Can't alloc cache */ 00228 cachesize= (uint) ((long) cachesize*3/4); /* Try with less memory */ 00229 } 00230 } 00231 00232 DBUG_PRINT("info",("init_io_cache: cachesize = %u",cachesize)); 00233 info->read_length=info->buffer_length=cachesize; 00234 info->myflags=cache_myflags & ~(MY_NABP | MY_FNABP); 00235 info->request_pos= info->read_pos= info->write_pos = info->buffer; 00236 if (type == SEQ_READ_APPEND) 00237 { 00238 info->append_read_pos = info->write_pos = info->write_buffer; 00239 info->write_end = info->write_buffer + info->buffer_length; 00240 #ifdef THREAD 00241 pthread_mutex_init(&info->append_buffer_lock,MY_MUTEX_INIT_FAST); 00242 #endif 00243 } 00244 #if defined(SAFE_MUTEX) && defined(THREAD) 00245 else 00246 { 00247 /* Clear mutex so that safe_mutex will notice that it's not initialized */ 00248 bzero((char*) &info->append_buffer_lock, sizeof(info)); 00249 } 00250 #endif 00251 00252 if (type == WRITE_CACHE) 00253 info->write_end= 00254 info->buffer+info->buffer_length- (seek_offset & (IO_SIZE-1)); 00255 else 00256 info->read_end=info->buffer; /* Nothing in cache */ 00257 00258 /* End_of_file may be changed by user later */ 00259 info->end_of_file= end_of_file; 00260 info->error=0; 00261 info->type= type; 00262 init_functions(info); 00263 #ifdef HAVE_AIOWAIT 00264 if (use_async_io && ! my_disable_async_io) 00265 { 00266 DBUG_PRINT("info",("Using async io")); 00267 info->read_length/=2; 00268 info->read_function=_my_b_async_read; 00269 } 00270 info->inited=info->aio_result.pending=0; 00271 #endif 00272 DBUG_RETURN(0); 00273 } /* init_io_cache */
Here is the call graph for this function:

Here is the caller graph for this function:

| int init_record_cache | ( | RECORD_CACHE * | info, | |
| uint | cachesize, | |||
| File | file, | |||
| uint | reclength, | |||
| enum cache_type | type, | |||
| pbool | use_async_io | |||
| ) |
Definition at line 26 of file mf_tempdir.c.
References st_dynamic_array::buffer, cleanup_dirname(), mySTL::copy(), st_my_tmpdir::cur, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, delete_dynamic(), DELIM, st_dynamic_array::elements, err, FALSE, FN_REFLEN, freeze_size(), getenv(), insert_dynamic(), st_my_tmpdir::list, st_my_tmpdir::max, my_init_dynamic_array, MY_MUTEX_INIT_FAST, my_strndup(), MY_WME, MYF, pthread_mutex_destroy, pthread_mutex_init, strcend(), strmake(), and TRUE.
Referenced by fix_paths(), get_options(), and main().
00027 { 00028 char *end, *copy; 00029 char buff[FN_REFLEN]; 00030 DYNAMIC_ARRAY t_arr; 00031 DBUG_ENTER("init_tmpdir"); 00032 DBUG_PRINT("enter", ("pathlist: %s", pathlist ? pathlist : "NULL")); 00033 00034 pthread_mutex_init(&tmpdir->mutex, MY_MUTEX_INIT_FAST); 00035 if (my_init_dynamic_array(&t_arr, sizeof(char*), 1, 5)) 00036 goto err; 00037 if (!pathlist || !pathlist[0]) 00038 { 00039 /* Get default temporary directory */ 00040 pathlist=getenv("TMPDIR"); /* Use this if possible */ 00041 #if defined( __WIN__) || defined(__NETWARE__) 00042 if (!pathlist) 00043 pathlist=getenv("TEMP"); 00044 if (!pathlist) 00045 pathlist=getenv("TMP"); 00046 #endif 00047 if (!pathlist || !pathlist[0]) 00048 pathlist=(char*) P_tmpdir; 00049 } 00050 do 00051 { 00052 uint length; 00053 end=strcend(pathlist, DELIM); 00054 strmake(buff, pathlist, (uint) (end-pathlist)); 00055 length= cleanup_dirname(buff, buff); 00056 if (!(copy= my_strndup(buff, length, MYF(MY_WME))) || 00057 insert_dynamic(&t_arr, (gptr) ©)) 00058 DBUG_RETURN(TRUE); 00059 pathlist=end+1; 00060 } 00061 while (*end); 00062 freeze_size(&t_arr); 00063 tmpdir->list=(char **)t_arr.buffer; 00064 tmpdir->max=t_arr.elements-1; 00065 tmpdir->cur=0; 00066 DBUG_RETURN(FALSE); 00067 00068 err: 00069 delete_dynamic(&t_arr); /* Safe to free */ 00070 pthread_mutex_destroy(&tmpdir->mutex); 00071 DBUG_RETURN(TRUE); 00072 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool insert_dynamic | ( | DYNAMIC_ARRAY * | array, | |
| gptr | element | |||
| ) |
Definition at line 85 of file array.c.
References alloc_dynamic(), buffer, st_dynamic_array::buffer, st_dynamic_array::elements, FALSE, st_dynamic_array::max_element, memcpy, st_dynamic_array::size_of_element, and TRUE.
Referenced by _mi_insert(), Named_value_arr::add_element(), add_ft_keys(), add_init_command(), sp_head::add_instr(), add_key_part(), QUICK_GROUP_MIN_MAX_SELECT::add_range(), add_status_vars(), Rpl_filter::add_wild_table_rule(), Dynamic_array< Elem >::append(), d_search(), get_quick_keys(), get_quick_select_for_ref(), get_var_with_binlog(), handle_default_option(), init_replace_regex(), init_sym_table(), init_tmpdir(), parse_input_file(), plugin_register_builtin(), print_result(), sp_pcontext::push_case_expr_id(), sp_pcontext::push_cond(), sp_pcontext::push_cursor(), sp_pcontext::push_handler(), sp_pcontext::push_variable(), and read_query().
00086 { 00087 gptr buffer; 00088 if (array->elements == array->max_element) 00089 { /* Call only when nessesary */ 00090 if (!(buffer=alloc_dynamic(array))) 00091 return TRUE; 00092 } 00093 else 00094 { 00095 buffer=array->buffer+(array->elements * array->size_of_element); 00096 array->elements++; 00097 } 00098 memcpy(buffer,element,(size_t) array->size_of_element); 00099 return FALSE; 00100 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 483 of file mf_pack.c.
References convert_dirname(), dirname_part(), FN_CURLIB, FN_DEVCHAR, FN_LIBCHAR, FN_PARENTDIR, FN_REFLEN, NullS, pos(), strcat(), strchr(), strinstr(), strlen(), strmov(), strnmov(), and strrchr().
Referenced by my_getwd(), my_init(), my_path(), pack_dirname(), and unpack_dirname().
00484 { 00485 #ifndef VMS 00486 { 00487 uint length; 00488 char buff[FN_REFLEN]; 00489 if (from == to) 00490 { /* Dirname may destroy from */ 00491 strmov(buff,from); 00492 from=buff; 00493 } 00494 length=dirname_part(to,from); /* Copy dirname & fix chars */ 00495 (void) strcat(to,from+length); 00496 return (to); 00497 } 00498 #else /* VMS */ 00499 00500 /* change 'dev:[lib]xxx' to 'dev:lib/xxx' */ 00501 /* change 'dev:xxx' to 'dev:xxx' */ 00502 /* change 'dev:x/y/[.lib]' to 'dev:x/y/lib/ */ 00503 /* change '[.lib]' to './lib/' */ 00504 /* change '[x.y]' or '[x.][y]' or '[x][.y]' to '/x/y/' */ 00505 /* change '[000000.x] or [x.000000]' to '/x/' */ 00506 00507 int par_length,root_length; 00508 my_string pos,from_pos,to_pos,end_pos; 00509 char buff[FN_REFLEN]; 00510 00511 convert_dirname(buff,from,NullS); /* change '<>' to '[]' */ 00512 from_pos=buff; 00513 if ((pos=strrchr(from_pos,FN_DEVCHAR))) /* Skip device part */ 00514 { 00515 pos++; 00516 to_pos=strnmov(to,from_pos,(size_s) (pos-from_pos)); 00517 from_pos=pos; 00518 } 00519 else 00520 to_pos=to; 00521 00522 root_length=strlen(FN_C_ROOT_DIR); 00523 if ((pos = strchr(from_pos,FN_C_BEFORE_DIR)) && 00524 (end_pos = strrchr(pos+1,FN_C_AFTER_DIR))) 00525 { 00526 to_pos=strnmov(to_pos,from_pos,(size_s) (pos-from_pos)); 00527 /* Copy all between ':' and '[' */ 00528 from_pos=pos+1; 00529 if (strinstr(from_pos,FN_C_ROOT_DIR) == 1 && 00530 (from_pos[root_length] == FN_C_DIR_SEP || 00531 from_pos[root_length] == FN_C_AFTER_DIR)) 00532 { 00533 from_pos+=root_length+1; 00534 } 00535 else if (*from_pos == FN_C_DIR_SEP) 00536 *(to_pos++) = FN_CURLIB; /* Set ./ first */ 00537 *(to_pos++) = FN_LIBCHAR; 00538 00539 par_length=strlen(FN_C_PARENT_DIR); 00540 pos=to_pos; 00541 for (; from_pos <= end_pos ; from_pos++) 00542 { 00543 switch (*from_pos) { 00544 case FN_C_DIR_SEP: 00545 case FN_C_AFTER_DIR: 00546 if (pos != to_pos) 00547 { 00548 if ((int) (to_pos-pos) == root_length && 00549 is_suffix(pos,FN_C_ROOT_DIR)) 00550 to_pos=pos; /* remove root-pos */ 00551 else 00552 { 00553 *(to_pos++)=FN_LIBCHAR; /* Find lib */ 00554 pos=to_pos; 00555 } 00556 } 00557 break; 00558 case FN_C_BEFORE_DIR: 00559 break; 00560 case '-': /* *(FN_C_PARENT_DIR): */ 00561 if (to_pos[-1] == FN_LIBCHAR && 00562 strncmp(from_pos,FN_C_PARENT_DIR,par_length) == 0) 00563 { /* Change '-' to '..' */ 00564 to_pos=strmov(to_pos,FN_PARENTDIR); 00565 *(to_pos++)=FN_LIBCHAR; 00566 pos=to_pos; 00567 from_pos+=par_length-1; 00568 break; 00569 } 00570 /* Fall through */ 00571 default: 00572 *(to_pos++)= *from_pos; 00573 break; 00574 } 00575 } 00576 } 00577 (void) strmov(to_pos,from_pos); 00578 return (to); 00579 #endif /* VMS */ 00580 } /* intern_filename */
Here is the call graph for this function:

Here is the caller graph for this function:

| int load_defaults | ( | const char * | conf_file, | |
| const char ** | groups, | |||
| int * | argc, | |||
| char *** | argv | |||
| ) |
Definition at line 366 of file default.c.
References handle_option_ctx::alloc, alloc_root(), args, st_typelib::count, ctx, DBUG_ENTER, DBUG_RETURN, delete_dynamic(), err, error, exit, handle_option_ctx::group, handle_default_option(), init_alloc_root(), init_default_directories(), memcpy, my_init_dynamic_array, my_search_option_files(), st_typelib::name, strcmp(), and st_typelib::type_names.
Referenced by get_options(), Configuration::init(), init_common_variables(), Options::load(), load_defaults(), InitConfigFileParser::load_mycnf_groups(), main(), mysql_read_default_options(), parse_args(), InitConfigFileParser::parse_mycnf(), and readArguments().
00368 { 00369 DYNAMIC_ARRAY args; 00370 TYPELIB group; 00371 my_bool found_print_defaults= 0; 00372 uint args_used= 0; 00373 int error= 0; 00374 MEM_ROOT alloc; 00375 char *ptr,**res; 00376 struct handle_option_ctx ctx; 00377 DBUG_ENTER("load_defaults"); 00378 00379 init_default_directories(); 00380 init_alloc_root(&alloc,512,0); 00381 /* 00382 Check if the user doesn't want any default option processing 00383 --no-defaults is always the first option 00384 */ 00385 if (*argc >= 2 && !strcmp(argv[0][1],"--no-defaults")) 00386 { 00387 /* remove the --no-defaults argument and return only the other arguments */ 00388 uint i; 00389 if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+ 00390 (*argc + 1)*sizeof(char*)))) 00391 goto err; 00392 res= (char**) (ptr+sizeof(alloc)); 00393 res[0]= **argv; /* Copy program name */ 00394 for (i=2 ; i < (uint) *argc ; i++) 00395 res[i-1]=argv[0][i]; 00396 res[i-1]=0; /* End pointer */ 00397 (*argc)--; 00398 *argv=res; 00399 *(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */ 00400 DBUG_RETURN(0); 00401 } 00402 00403 group.count=0; 00404 group.name= "defaults"; 00405 group.type_names= groups; 00406 00407 for (; *groups ; groups++) 00408 group.count++; 00409 00410 if (my_init_dynamic_array(&args, sizeof(char*),*argc, 32)) 00411 goto err; 00412 00413 ctx.alloc= &alloc; 00414 ctx.args= &args; 00415 ctx.group= &group; 00416 00417 error= my_search_option_files(conf_file, argc, argv, &args_used, 00418 handle_default_option, (void *) &ctx); 00419 /* 00420 Here error contains <> 0 only if we have a fully specified conf_file 00421 or a forced default file 00422 */ 00423 if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+ 00424 (args.elements + *argc +1) *sizeof(char*)))) 00425 goto err; 00426 res= (char**) (ptr+sizeof(alloc)); 00427 00428 /* copy name + found arguments + command line arguments to new array */ 00429 res[0]= argv[0][0]; /* Name MUST be set, even by embedded library */ 00430 memcpy((gptr) (res+1), args.buffer, args.elements*sizeof(char*)); 00431 /* Skip --defaults-xxx options */ 00432 (*argc)-= args_used; 00433 (*argv)+= args_used; 00434 00435 /* 00436 Check if we wan't to see the new argument list 00437 This options must always be the last of the default options 00438 */ 00439 if (*argc >= 2 && !strcmp(argv[0][1],"--print-defaults")) 00440 { 00441 found_print_defaults=1; 00442 --*argc; ++*argv; /* skip argument */ 00443 } 00444 00445 if (*argc) 00446 memcpy((gptr) (res+1+args.elements), (char*) ((*argv)+1), 00447 (*argc-1)*sizeof(char*)); 00448 res[args.elements+ *argc]=0; /* last null */ 00449 00450 (*argc)+=args.elements; 00451 *argv= (char**) res; 00452 *(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */ 00453 delete_dynamic(&args); 00454 if (found_print_defaults) 00455 { 00456 int i; 00457 printf("%s would have been started with the following arguments:\n", 00458 **argv); 00459 for (i=1 ; i < *argc ; i++) 00460 printf("%s ", (*argv)[i]); 00461 puts(""); 00462 exit(0); 00463 } 00464 DBUG_RETURN(error); 00465 00466 err: 00467 fprintf(stderr,"Fatal error in defaults handling. Program aborted\n"); 00468 exit(1); 00469 return 0; /* Keep compiler happy */ 00470 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 412 of file my_alloc.c.
References alloc_root(), memcpy, and pos().
Referenced by Table_triggers_list::change_table_name_in_triggers(), Field::clone(), get_quick_select(), GRANT_COLUMN::GRANT_COLUMN(), open_binary_frm(), sp_head::set_info(), and Prepared_statement::set_name().
00413 { 00414 char *pos; 00415 if ((pos=alloc_root(root,len))) 00416 memcpy(pos,str,len); 00417 return pos; 00418 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int modify_defaults_file | ( | const char * | file_location, | |
| const char * | option, | |||
| const char * | option_value, | |||
| const char * | section_name, | |||
| int | remove_option | |||
| ) |
Definition at line 65 of file default_modify.c.
References add_option(), BUFF_SIZE, DBUG_ENTER, DBUG_RETURN, err, FALSE, file_buffer, int(), my_charset_latin1, my_chsize(), my_fclose(), my_fopen(), my_free, MY_FREE_ON_ERROR, my_fseek(), my_fstat(), my_fwrite(), my_isspace, my_malloc(), MY_NABP, my_realloc(), MY_REMOVE_OPTION, MY_REMOVE_SECTION, MY_SEEK_SET, MY_STAT, MY_WME, MYF, NEWLINE, NEWLINE_LEN, O_BINARY, RESERVE, strend(), strlen(), strmov(), and TRUE.
Referenced by Abstract_option_cmd::correct_file(), and Drop_instance::execute_impl().
00068 { 00069 FILE *cnf_file; 00070 MY_STAT file_stat; 00071 char linebuff[BUFF_SIZE], *src_ptr, *dst_ptr, *file_buffer; 00072 uint opt_len= 0; 00073 uint optval_len= 0; 00074 uint sect_len, nr_newlines= 0, buffer_size; 00075 my_bool in_section= FALSE, opt_applied= 0; 00076 uint reserve_extended; 00077 uint new_opt_len; 00078 int reserve_occupied= 0; 00079 DBUG_ENTER("modify_defaults_file"); 00080 00081 if (!(cnf_file= my_fopen(file_location, O_RDWR | O_BINARY, MYF(0)))) 00082 DBUG_RETURN(2); 00083 00084 /* my_fstat doesn't use the flag parameter */ 00085 if (my_fstat(fileno(cnf_file), &file_stat, MYF(0))) 00086 goto malloc_err; 00087 00088 if (option && option_value) 00089 { 00090 opt_len= (uint) strlen(option); 00091 optval_len= (uint) strlen(option_value); 00092 } 00093 00094 new_opt_len= opt_len + 1 + optval_len + NEWLINE_LEN; 00095 00096 /* calculate the size of the buffer we need */ 00097 reserve_extended= (opt_len + 00098 1 + /* For '=' char */ 00099 optval_len + /* Option value len */ 00100 NEWLINE_LEN + /* Space for newline */ 00101 RESERVE); /* Some additional space */ 00102 00103 buffer_size= (file_stat.st_size + 00104 1); /* The ending zero */ 00105 00106 /* 00107 Reserve space to read the contents of the file and some more 00108 for the option we want to add. 00109 */ 00110 if (!(file_buffer= (char*) my_malloc(buffer_size + reserve_extended, 00111 MYF(MY_WME)))) 00112 goto malloc_err; 00113 00114 sect_len= (uint) strlen(section_name); 00115 00116 for (dst_ptr= file_buffer; fgets(linebuff, BUFF_SIZE, cnf_file); ) 00117 { 00118 /* Skip over whitespaces */ 00119 for (src_ptr= linebuff; my_isspace(&my_charset_latin1, *src_ptr); 00120 src_ptr++) 00121 {} 00122 00123 if (!*src_ptr) /* Empty line */ 00124 { 00125 nr_newlines++; 00126 continue; 00127 } 00128 00129 /* correct the option (if requested) */ 00130 if (option && in_section && !strncmp(src_ptr, option, opt_len) && 00131 (*(src_ptr + opt_len) == '=' || 00132 my_isspace(&my_charset_latin1, *(src_ptr + opt_len)) || 00133 *(src_ptr + opt_len) == '\0')) 00134 { 00135 char *old_src_ptr= src_ptr; 00136 src_ptr= strend(src_ptr+ opt_len); /* Find the end of the line */ 00137 00138 /* could be negative */ 00139 reserve_occupied+= (int) new_opt_len - (int) (src_ptr - old_src_ptr); 00140 if (reserve_occupied >= (int) reserve_extended) 00141 { 00142 reserve_extended= (uint) reserve_occupied + RESERVE; 00143 if (!(file_buffer= (char*) my_realloc(file_buffer, buffer_size + 00144 reserve_extended, 00145 MYF(MY_WME|MY_FREE_ON_ERROR)))) 00146 goto malloc_err; 00147 } 00148 opt_applied= 1; 00149 dst_ptr= add_option(dst_ptr, option_value, option, remove_option); 00150 } 00151 else 00152 { 00153 /* 00154 If we are going to the new group and have an option to apply, do 00155 it now. If we are removing a single option or the whole section 00156 this will only trigger opt_applied flag. 00157 */ 00158 00159 if (in_section && !opt_applied && *src_ptr == '[') 00160 { 00161 dst_ptr= add_option(dst_ptr, option_value, option, remove_option); 00162 opt_applied= 1; /* set the flag to do write() later */ 00163 reserve_occupied= new_opt_len+ opt_len + 1 + NEWLINE_LEN; 00164 } 00165 00166 for (; nr_newlines; nr_newlines--) 00167 dst_ptr= strmov(dst_ptr, NEWLINE); 00168 00169 /* Skip the section if MY_REMOVE_SECTION was given */ 00170 if (!in_section || remove_option != MY_REMOVE_SECTION) 00171 dst_ptr= strmov(dst_ptr, linebuff); 00172 } 00173 /* Look for a section */ 00174 if (*src_ptr == '[') 00175 { 00176 /* Copy the line to the buffer */ 00177 if (!strncmp(++src_ptr, section_name, sect_len)) 00178 { 00179 src_ptr+= sect_len; 00180 /* Skip over whitespaces. They are allowed after section name */ 00181 for (; my_isspace(&my_charset_latin1, *src_ptr); src_ptr++) 00182 {} 00183 00184 if (*src_ptr != ']') 00185 { 00186 in_section= FALSE; 00187 continue; /* Missing closing parenthesis. Assume this was no group */ 00188 } 00189 00190 if (remove_option == MY_REMOVE_SECTION) 00191 dst_ptr= dst_ptr - strlen(linebuff); 00192 00193 in_section= TRUE; 00194 } 00195 else 00196 in_section= FALSE; /* mark that this section is of no interest to us */ 00197 } 00198 } 00199 00200 /* 00201 File ended. Apply an option or set opt_applied flag (in case of 00202 MY_REMOVE_SECTION) so that the changes are saved. Do not do anything 00203 if we are removing non-existent option. 00204 */ 00205 00206 if (!opt_applied && in_section && (remove_option != MY_REMOVE_OPTION)) 00207 { 00208 /* New option still remains to apply at the end */ 00209 if (!remove_option && *(dst_ptr - 1) != '\n') 00210 dst_ptr= strmov(dst_ptr, NEWLINE); 00211 dst_ptr= add_option(dst_ptr, option_value, option, remove_option); 00212 opt_applied= 1; 00213 } 00214 for (; nr_newlines; nr_newlines--) 00215 dst_ptr= strmov(dst_ptr, NEWLINE); 00216 00217 if (opt_applied) 00218 { 00219 /* Don't write the file if there are no changes to be made */ 00220 if (my_chsize(fileno(cnf_file), (my_off_t) (dst_ptr - file_buffer), 0, 00221 MYF(MY_WME)) || 00222 my_fseek(cnf_file, 0, MY_SEEK_SET, MYF(0)) || 00223 my_fwrite(cnf_file, file_buffer, (uint) (dst_ptr - file_buffer), 00224 MYF(MY_NABP))) 00225 goto err; 00226 } 00227 if (my_fclose(cnf_file, MYF(MY_WME))) 00228 DBUG_RETURN(1); 00229 00230 my_free(file_buffer, MYF(0)); 00231 DBUG_RETURN(0); 00232 00233 err: 00234 my_free(file_buffer, MYF(0)); 00235 malloc_err: 00236 my_fclose(cnf_file, MYF(0)); 00237 DBUG_RETURN(1); /* out of resources */ 00238 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 244 of file my_alloc.c.
References ALIGN_SIZE, alloc_root(), args, DBUG_ENTER, DBUG_RETURN, and start().
Referenced by alloc_table_share(), close_handle_and_leave_table_as_lock(), create_tmp_table(), and create_virtual_tmp_table().
00245 { 00246 va_list args; 00247 char **ptr, *start, *res; 00248 uint tot_length, length; 00249 DBUG_ENTER("multi_alloc_root"); 00250 00251 va_start(args, root); 00252 tot_length= 0; 00253 while ((ptr= va_arg(args, char **))) 00254 { 00255 length= va_arg(args, uint); 00256 tot_length+= ALIGN_SIZE(length); 00257 } 00258 va_end(args); 00259 00260 if (!(start= (char*) alloc_root(root, tot_length))) 00261 DBUG_RETURN(0); /* purecov: inspected */ 00262 00263 va_start(args, root); 00264 res= start; 00265 while ((ptr= va_arg(args, char **))) 00266 { 00267 *ptr= res; 00268 length= va_arg(args, uint); 00269 res+= ALIGN_SIZE(length); 00270 } 00271 va_end(args); 00272 DBUG_RETURN((gptr) start); 00273 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_append | ( | const char * | from, | |
| const char * | to, | |||
| myf | MyFlags | |||
| ) |
Definition at line 33 of file my_append.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, err, IO_SIZE, my_close(), MY_NABP, my_open(), my_read, my_write, MYF, and VOID.
00038 { 00039 uint Count; 00040 File from_file,to_file; 00041 char buff[IO_SIZE]; 00042 DBUG_ENTER("my_append"); 00043 DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags)); 00044 00045 from_file=to_file= -1; 00046 00047 if ((from_file=my_open(from,O_RDONLY,MyFlags)) >= 0) 00048 { 00049 if ((to_file=my_open(to,O_APPEND | O_WRONLY,MyFlags)) >= 0) 00050 { 00051 while ((Count=my_read(from_file,buff,IO_SIZE,MyFlags)) != 0) 00052 if (Count == (uint) -1 || 00053 my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP))) 00054 goto err; 00055 if (my_close(from_file,MyFlags) | my_close(to_file,MyFlags)) 00056 DBUG_RETURN(-1); /* Error on close */ 00057 DBUG_RETURN(0); 00058 } 00059 } 00060 err: 00061 if (from_file >= 0) VOID(my_close(from_file,MyFlags)); 00062 if (to_file >= 0) VOID(my_close(to_file,MyFlags)); 00063 DBUG_RETURN(-1); 00064 }
Here is the call graph for this function:

Referenced by MYSQL_BIN_LOG::appendv(), my_b_safe_write(), sql_create_definition_file(), write_escaped_string(), and write_parameter().
Here is the caller graph for this function:

Definition at line 27 of file mf_iocache2.c.
References st_io_cache::append_read_pos, DBUG_ASSERT, dbug_volatile, st_io_cache::end_of_file, st_io_cache::file, my_seek(), MY_SEEK_END, MY_SEEK_SET, my_tell(), MYF, pthread_mutex_lock, pthread_mutex_unlock, st_io_cache::write_buffer, and st_io_cache::write_pos.
Referenced by MYSQL_BIN_LOG::append(), MYSQL_BIN_LOG::appendv(), and my_b_safe_tell().
00028 { 00029 /* 00030 Prevent optimizer from putting res in a register when debugging 00031 we need this to be able to see the value of res when the assert fails 00032 */ 00033 dbug_volatile my_off_t res; 00034 00035 /* 00036 We need to lock the append buffer mutex to keep flush_io_cache() 00037 from messing with the variables that we need in order to provide the 00038 answer to the question. 00039 */ 00040 #ifdef THREAD 00041 pthread_mutex_lock(&info->append_buffer_lock); 00042 #endif 00043 #ifndef DBUG_OFF 00044 /* 00045 Make sure EOF is where we think it is. Note that we cannot just use 00046 my_tell() because we have a reader thread that could have left the 00047 file offset in a non-EOF location 00048 */ 00049 { 00050 volatile my_off_t save_pos; 00051 save_pos = my_tell(info->file,MYF(0)); 00052 my_seek(info->file,(my_off_t)0,MY_SEEK_END,MYF(0)); 00053 /* 00054 Save the value of my_tell in res so we can see it when studying coredump 00055 */ 00056 DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer) 00057 == (res=my_tell(info->file,MYF(0)))); 00058 my_seek(info->file,save_pos,MY_SEEK_SET,MYF(0)); 00059 } 00060 #endif 00061 res = info->end_of_file + (info->write_pos-info->append_read_pos); 00062 #ifdef THREAD 00063 pthread_mutex_unlock(&info->append_buffer_lock); 00064 #endif 00065 return res; 00066 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 221 of file mf_iocache2.c.
References st_io_cache::file, my_b_tell, my_seek(), MY_SEEK_END, MYF, st_io_cache::seek_not_done, st_io_cache::type, and WRITE_CACHE.
Referenced by MYSQL_BIN_LOG::open().
00222 { 00223 if (info->type == WRITE_CACHE) 00224 { 00225 return my_b_tell(info); 00226 } 00227 else 00228 { 00229 info->seek_not_done=1; 00230 return my_seek(info->file,0L,MY_SEEK_END,MYF(0)); 00231 } 00232 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 140 of file mf_iocache2.c.
References st_io_cache::buffer, st_io_cache::end_of_file, st_io_cache::error, st_io_cache::file, IO_SIZE, MY_FILEPOS_ERROR, my_read, my_seek(), MY_SEEK_SET, MYF, st_io_cache::myflags, st_io_cache::pos_in_file, st_io_cache::read_end, st_io_cache::read_length, st_io_cache::read_pos, and st_io_cache::seek_not_done.
Referenced by my_b_gets(), and MYSQL_BIN_LOG::write().
00141 { 00142 my_off_t pos_in_file=(info->pos_in_file+ 00143 (uint) (info->read_end - info->buffer)); 00144 my_off_t max_length; 00145 uint diff_length,length; 00146 if (info->seek_not_done) 00147 { /* File touched, do seek */ 00148 if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) == 00149 MY_FILEPOS_ERROR) 00150 { 00151 info->error= 0; 00152 return 0; 00153 } 00154 info->seek_not_done=0; 00155 } 00156 diff_length=(uint) (pos_in_file & (IO_SIZE-1)); 00157 max_length= (my_off_t) (info->end_of_file - pos_in_file); 00158 if (max_length > (my_off_t) (info->read_length-diff_length)) 00159 max_length=(my_off_t) (info->read_length-diff_length); 00160 if (!max_length) 00161 { 00162 info->error= 0; 00163 return 0; /* EOF */ 00164 } 00165 else if ((length=my_read(info->file,info->buffer,(uint) max_length, 00166 info->myflags)) == (uint) -1) 00167 { 00168 info->error= -1; 00169 return 0; 00170 } 00171 info->read_pos=info->buffer; 00172 info->read_end=info->buffer+length; 00173 info->pos_in_file=pos_in_file; 00174 return length; 00175 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_b_flush_io_cache | ( | IO_CACHE * | info, | |
| int | need_append_buffer_lock | |||
| ) |
Definition at line 1168 of file mf_iocache.c.
References st_io_cache::append_read_pos, st_io_cache::buffer_length, DBUG_ASSERT, DBUG_ENTER, DBUG_RETURN, st_io_cache::disk_writes, st_io_cache::end_of_file, st_io_cache::error, st_io_cache::file, IO_SIZE, LOCK_APPEND_BUFFER, MY_FILEPOS_ERROR, MY_NABP, my_seek(), MY_SEEK_SET, my_tell(), my_write, MYF, st_io_cache::myflags, st_io_cache::pos_in_file, READ_NET, real_open_cached_file(), st_io_cache::seek_not_done, SEQ_READ_APPEND, set_if_bigger, st_io_cache::type, UNLOCK_APPEND_BUFFER, st_io_cache::write_buffer, WRITE_CACHE, st_io_cache::write_end, and st_io_cache::write_pos.
Referenced by _my_b_write(), end_io_cache(), my_b_append(), and reinit_io_cache().
01169 { 01170 uint length; 01171 my_bool append_cache; 01172 my_off_t pos_in_file; 01173 DBUG_ENTER("my_b_flush_io_cache"); 01174 01175 if (!(append_cache = (info->type == SEQ_READ_APPEND))) 01176 need_append_buffer_lock=0; 01177 01178 if (info->type == WRITE_CACHE || append_cache) 01179 {

