mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
First Commit
For Azeroth!
This commit is contained in:
65
dep/mysqllite/libmysql/client_settings.h
Normal file
65
dep/mysqllite/libmysql/client_settings.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/* Copyright (C) 2003-2005 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef CLIENT_SETTINGS_INCLUDED
|
||||
#define CLIENT_SETTINGS_INCLUDED
|
||||
#else
|
||||
#error You have already included an client_settings.h and it should not be included twice
|
||||
#endif /* CLIENT_SETTINGS_INCLUDED */
|
||||
|
||||
extern uint mysql_port;
|
||||
extern char * mysql_unix_port;
|
||||
|
||||
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \
|
||||
CLIENT_LONG_FLAG | \
|
||||
CLIENT_TRANSACTIONS | \
|
||||
CLIENT_PROTOCOL_41 | \
|
||||
CLIENT_SECURE_CONNECTION | \
|
||||
CLIENT_MULTI_RESULTS | \
|
||||
CLIENT_PS_MULTI_RESULTS | \
|
||||
CLIENT_PLUGIN_AUTH)
|
||||
|
||||
sig_handler my_pipe_sig_handler(int sig);
|
||||
void read_user_name(char *name);
|
||||
my_bool handle_local_infile(MYSQL *mysql, const char *net_filename);
|
||||
|
||||
void mysql_read_default_options(struct st_mysql_options *options,
|
||||
const char *filename,const char *group);
|
||||
void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name);
|
||||
MYSQL * STDCALL
|
||||
cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
||||
const char *passwd, const char *db,
|
||||
uint port, const char *unix_socket,ulong client_flag);
|
||||
|
||||
void cli_mysql_close(MYSQL *mysql);
|
||||
|
||||
MYSQL_FIELD * cli_list_fields(MYSQL *mysql);
|
||||
my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt);
|
||||
MYSQL_DATA * cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
|
||||
uint fields);
|
||||
int cli_stmt_execute(MYSQL_STMT *stmt);
|
||||
int cli_read_binary_rows(MYSQL_STMT *stmt);
|
||||
int cli_unbuffered_fetch(MYSQL *mysql, char **row);
|
||||
const char * cli_read_statistics(MYSQL *mysql);
|
||||
int cli_read_change_user_result(MYSQL *mysql);
|
||||
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
int init_embedded_server(int argc, char **argv, char **groups);
|
||||
void end_embedded_server();
|
||||
#endif /*EMBEDDED_LIBRARY*/
|
||||
|
||||
C_MODE_START
|
||||
extern int mysql_init_character_set(MYSQL *mysql);
|
||||
C_MODE_END
|
||||
125
dep/mysqllite/libmysql/errmsg.c
Normal file
125
dep/mysqllite/libmysql/errmsg.c
Normal file
@@ -0,0 +1,125 @@
|
||||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
There are special exceptions to the terms and conditions of the GPL as it
|
||||
is applied to this software.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Error messages for MySQL clients */
|
||||
/* (Error messages for the daemon are in share/language/errmsg.sys) */
|
||||
|
||||
#include <my_global.h>
|
||||
#include <my_sys.h>
|
||||
#include "errmsg.h"
|
||||
|
||||
const char *client_errors[]=
|
||||
{
|
||||
"Unknown MySQL error",
|
||||
"Can't create UNIX socket (%d)",
|
||||
"Can't connect to local MySQL server through socket '%-.100s' (%d)",
|
||||
"Can't connect to MySQL server on '%-.100s' (%d)",
|
||||
"Can't create TCP/IP socket (%d)",
|
||||
"Unknown MySQL server host '%-.100s' (%d)",
|
||||
"MySQL server has gone away",
|
||||
"Protocol mismatch; server version = %d, client version = %d",
|
||||
"MySQL client ran out of memory",
|
||||
"Wrong host info",
|
||||
"Localhost via UNIX socket",
|
||||
"%-.100s via TCP/IP",
|
||||
"Error in server handshake",
|
||||
"Lost connection to MySQL server during query",
|
||||
"Commands out of sync; you can't run this command now",
|
||||
"Named pipe: %-.32s",
|
||||
"Can't wait for named pipe to host: %-.64s pipe: %-.32s (%lu)",
|
||||
"Can't open named pipe to host: %-.64s pipe: %-.32s (%lu)",
|
||||
"Can't set state of named pipe to host: %-.64s pipe: %-.32s (%lu)",
|
||||
"Can't initialize character set %-.32s (path: %-.100s)",
|
||||
"Got packet bigger than 'max_allowed_packet' bytes",
|
||||
"Embedded server",
|
||||
"Error on SHOW SLAVE STATUS:",
|
||||
"Error on SHOW SLAVE HOSTS:",
|
||||
"Error connecting to slave:",
|
||||
"Error connecting to master:",
|
||||
"SSL connection error",
|
||||
"Malformed packet",
|
||||
"This client library is licensed only for use with MySQL servers having '%s' license",
|
||||
"Invalid use of null pointer",
|
||||
"Statement not prepared",
|
||||
"No data supplied for parameters in prepared statement",
|
||||
"Data truncated",
|
||||
"No parameters exist in the statement",
|
||||
"Invalid parameter number",
|
||||
"Can't send long data for non-string/non-binary data types (parameter: %d)",
|
||||
"Using unsupported buffer type: %d (parameter: %d)",
|
||||
"Shared memory: %-.100s",
|
||||
"Can't open shared memory; client could not create request event (%lu)",
|
||||
"Can't open shared memory; no answer event received from server (%lu)",
|
||||
"Can't open shared memory; server could not allocate file mapping (%lu)",
|
||||
"Can't open shared memory; server could not get pointer to file mapping (%lu)",
|
||||
"Can't open shared memory; client could not allocate file mapping (%lu)",
|
||||
"Can't open shared memory; client could not get pointer to file mapping (%lu)",
|
||||
"Can't open shared memory; client could not create %s event (%lu)",
|
||||
"Can't open shared memory; no answer from server (%lu)",
|
||||
"Can't open shared memory; cannot send request event to server (%lu)",
|
||||
"Wrong or unknown protocol",
|
||||
"Invalid connection handle",
|
||||
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
|
||||
"Row retrieval was canceled by mysql_stmt_close() call",
|
||||
"Attempt to read column without prior row fetch",
|
||||
"Prepared statement contains no metadata",
|
||||
"Attempt to read a row while there is no result set associated with the statement",
|
||||
"This feature is not implemented yet",
|
||||
"Lost connection to MySQL server at '%s', system error: %d",
|
||||
"Statement closed indirectly because of a preceeding %s() call",
|
||||
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
|
||||
"This handle is already connected. Use a separate handle for each connection.",
|
||||
"Authentication plugin '%s' cannot be loaded: %s",
|
||||
""
|
||||
};
|
||||
|
||||
const char** get_client_errmsgs()
|
||||
{
|
||||
return client_errors;
|
||||
}
|
||||
|
||||
/*
|
||||
Register client error messages for use with my_error().
|
||||
|
||||
SYNOPSIS
|
||||
init_client_errs()
|
||||
|
||||
RETURN
|
||||
void
|
||||
*/
|
||||
|
||||
void init_client_errs(void)
|
||||
{
|
||||
(void) my_error_register(get_client_errmsgs, CR_ERROR_FIRST, CR_ERROR_LAST);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Unregister client error messages.
|
||||
|
||||
SYNOPSIS
|
||||
finish_client_errs()
|
||||
|
||||
RETURN
|
||||
void
|
||||
*/
|
||||
|
||||
void finish_client_errs(void)
|
||||
{
|
||||
(void) my_error_unregister(CR_ERROR_FIRST, CR_ERROR_LAST);
|
||||
}
|
||||
209
dep/mysqllite/libmysql/get_password.c
Normal file
209
dep/mysqllite/libmysql/get_password.c
Normal file
@@ -0,0 +1,209 @@
|
||||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
There are special exceptions to the terms and conditions of the GPL as it
|
||||
is applied to this software.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
** Ask for a password from tty
|
||||
** This is an own file to avoid conflicts with curses
|
||||
*/
|
||||
#include <my_global.h>
|
||||
#include <my_sys.h>
|
||||
#include "mysql.h"
|
||||
#include <m_string.h>
|
||||
#include <m_ctype.h>
|
||||
|
||||
#if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE)
|
||||
#undef HAVE_GETPASS
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETPASS
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif /* HAVE_PWD_H */
|
||||
#else /* ! HAVE_GETPASS */
|
||||
#if !defined(__WIN__)
|
||||
#include <sys/ioctl.h>
|
||||
#ifdef HAVE_TERMIOS_H /* For tty-password */
|
||||
#include <termios.h>
|
||||
#define TERMIO struct termios
|
||||
#else
|
||||
#ifdef HAVE_TERMIO_H /* For tty-password */
|
||||
#include <termio.h>
|
||||
#define TERMIO struct termio
|
||||
#else
|
||||
#include <sgtty.h>
|
||||
#define TERMIO struct sgttyb
|
||||
#endif
|
||||
#endif
|
||||
#ifdef alpha_linux_port
|
||||
#include <asm/ioctls.h> /* QQ; Fix this in configure */
|
||||
#include <asm/termiobits.h>
|
||||
#endif
|
||||
#else
|
||||
#include <conio.h>
|
||||
#endif /* __WIN__ */
|
||||
#endif /* HAVE_GETPASS */
|
||||
|
||||
#ifdef HAVE_GETPASSPHRASE /* For Solaris */
|
||||
#define getpass(A) getpassphrase(A)
|
||||
#endif
|
||||
|
||||
#if defined(__WIN__)
|
||||
/* were just going to fake it here and get input from the keyboard */
|
||||
char *get_tty_password(const char *opt_message)
|
||||
{
|
||||
char to[80];
|
||||
char *pos=to,*end=to+sizeof(to)-1;
|
||||
int i=0;
|
||||
DBUG_ENTER("get_tty_password");
|
||||
_cputs(opt_message ? opt_message : "Enter password: ");
|
||||
for (;;)
|
||||
{
|
||||
char tmp;
|
||||
tmp=_getch();
|
||||
if (tmp == '\b' || (int) tmp == 127)
|
||||
{
|
||||
if (pos != to)
|
||||
{
|
||||
_cputs("\b \b");
|
||||
pos--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (tmp == '\n' || tmp == '\r' || tmp == 3)
|
||||
break;
|
||||
if (iscntrl(tmp) || pos == end)
|
||||
continue;
|
||||
_cputs("*");
|
||||
*(pos++) = tmp;
|
||||
}
|
||||
while (pos != to && isspace(pos[-1]) == ' ')
|
||||
pos--; /* Allow dummy space at end */
|
||||
*pos=0;
|
||||
_cputs("\n");
|
||||
DBUG_RETURN(my_strdup(to,MYF(MY_FAE)));
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#ifndef HAVE_GETPASS
|
||||
/*
|
||||
Can't use fgets, because readline will get confused
|
||||
length is max number of chars in to, not counting \0
|
||||
to will not include the eol characters.
|
||||
*/
|
||||
|
||||
static void get_password(char *to,uint length,int fd, my_bool echo)
|
||||
{
|
||||
char *pos=to,*end=to+length;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
char tmp;
|
||||
if (my_read(fd,&tmp,1,MYF(0)) != 1)
|
||||
break;
|
||||
if (tmp == '\b' || (int) tmp == 127)
|
||||
{
|
||||
if (pos != to)
|
||||
{
|
||||
if (echo)
|
||||
{
|
||||
fputs("\b \b",stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
pos--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (tmp == '\n' || tmp == '\r' || tmp == 3)
|
||||
break;
|
||||
if (iscntrl(tmp) || pos == end)
|
||||
continue;
|
||||
if (echo)
|
||||
{
|
||||
fputc('*',stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
*(pos++) = tmp;
|
||||
}
|
||||
while (pos != to && isspace(pos[-1]) == ' ')
|
||||
pos--; /* Allow dummy space at end */
|
||||
*pos=0;
|
||||
return;
|
||||
}
|
||||
#endif /* ! HAVE_GETPASS */
|
||||
|
||||
|
||||
char *get_tty_password(const char *opt_message)
|
||||
{
|
||||
#ifdef HAVE_GETPASS
|
||||
char *passbuff;
|
||||
#else /* ! HAVE_GETPASS */
|
||||
TERMIO org,tmp;
|
||||
#endif /* HAVE_GETPASS */
|
||||
char buff[80];
|
||||
|
||||
DBUG_ENTER("get_tty_password");
|
||||
|
||||
#ifdef HAVE_GETPASS
|
||||
passbuff = getpass(opt_message ? opt_message : "Enter password: ");
|
||||
|
||||
/* copy the password to buff and clear original (static) buffer */
|
||||
strnmov(buff, passbuff, sizeof(buff) - 1);
|
||||
#ifdef _PASSWORD_LEN
|
||||
memset(passbuff, 0, _PASSWORD_LEN);
|
||||
#endif
|
||||
#else
|
||||
if (isatty(fileno(stdout)))
|
||||
{
|
||||
fputs(opt_message ? opt_message : "Enter password: ",stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
#if defined(HAVE_TERMIOS_H)
|
||||
tcgetattr(fileno(stdin), &org);
|
||||
tmp = org;
|
||||
tmp.c_lflag &= ~(ECHO | ISIG | ICANON);
|
||||
tmp.c_cc[VMIN] = 1;
|
||||
tmp.c_cc[VTIME] = 0;
|
||||
tcsetattr(fileno(stdin), TCSADRAIN, &tmp);
|
||||
get_password(buff, sizeof(buff)-1, fileno(stdin), isatty(fileno(stdout)));
|
||||
tcsetattr(fileno(stdin), TCSADRAIN, &org);
|
||||
#elif defined(HAVE_TERMIO_H)
|
||||
ioctl(fileno(stdin), (int) TCGETA, &org);
|
||||
tmp=org;
|
||||
tmp.c_lflag &= ~(ECHO | ISIG | ICANON);
|
||||
tmp.c_cc[VMIN] = 1;
|
||||
tmp.c_cc[VTIME]= 0;
|
||||
ioctl(fileno(stdin),(int) TCSETA, &tmp);
|
||||
get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stdout)));
|
||||
ioctl(fileno(stdin),(int) TCSETA, &org);
|
||||
#else
|
||||
gtty(fileno(stdin), &org);
|
||||
tmp=org;
|
||||
tmp.sg_flags &= ~ECHO;
|
||||
tmp.sg_flags |= RAW;
|
||||
stty(fileno(stdin), &tmp);
|
||||
get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stdout)));
|
||||
stty(fileno(stdin), &org);
|
||||
#endif
|
||||
if (isatty(fileno(stdout)))
|
||||
fputc('\n',stdout);
|
||||
#endif /* HAVE_GETPASS */
|
||||
|
||||
DBUG_RETURN(my_strdup(buff,MYF(MY_FAE)));
|
||||
}
|
||||
#endif /*__WIN__*/
|
||||
4832
dep/mysqllite/libmysql/libmysql.c
Normal file
4832
dep/mysqllite/libmysql/libmysql.c
Normal file
File diff suppressed because it is too large
Load Diff
107
dep/mysqllite/libmysql/libmysql_exports.def
Normal file
107
dep/mysqllite/libmysql/libmysql_exports.def
Normal file
@@ -0,0 +1,107 @@
|
||||
EXPORTS
|
||||
load_defaults
|
||||
mysql_thread_end
|
||||
mysql_thread_init
|
||||
myodbc_remove_escape
|
||||
mysql_affected_rows
|
||||
mysql_autocommit
|
||||
mysql_stmt_bind_param
|
||||
mysql_stmt_bind_result
|
||||
mysql_change_user
|
||||
mysql_character_set_name
|
||||
mysql_close
|
||||
mysql_commit
|
||||
mysql_data_seek
|
||||
mysql_debug
|
||||
mysql_dump_debug_info
|
||||
mysql_eof
|
||||
mysql_errno
|
||||
mysql_error
|
||||
mysql_escape_string
|
||||
mysql_hex_string
|
||||
mysql_stmt_execute
|
||||
mysql_stmt_fetch
|
||||
mysql_stmt_fetch_column
|
||||
mysql_fetch_field
|
||||
mysql_fetch_field_direct
|
||||
mysql_fetch_fields
|
||||
mysql_fetch_lengths
|
||||
mysql_fetch_row
|
||||
mysql_field_count
|
||||
mysql_field_seek
|
||||
mysql_field_tell
|
||||
mysql_free_result
|
||||
mysql_get_client_info
|
||||
mysql_get_host_info
|
||||
mysql_get_proto_info
|
||||
mysql_get_server_info
|
||||
mysql_get_client_version
|
||||
mysql_get_ssl_cipher
|
||||
mysql_info
|
||||
mysql_init
|
||||
mysql_insert_id
|
||||
mysql_kill
|
||||
mysql_set_server_option
|
||||
mysql_list_dbs
|
||||
mysql_list_fields
|
||||
mysql_list_processes
|
||||
mysql_list_tables
|
||||
mysql_more_results
|
||||
mysql_next_result
|
||||
mysql_num_fields
|
||||
mysql_num_rows
|
||||
mysql_options
|
||||
mysql_stmt_param_count
|
||||
mysql_stmt_param_metadata
|
||||
mysql_ping
|
||||
mysql_stmt_result_metadata
|
||||
mysql_query
|
||||
mysql_read_query_result
|
||||
mysql_real_connect
|
||||
mysql_real_escape_string
|
||||
mysql_real_query
|
||||
mysql_refresh
|
||||
mysql_rollback
|
||||
mysql_row_seek
|
||||
mysql_row_tell
|
||||
mysql_select_db
|
||||
mysql_stmt_send_long_data
|
||||
mysql_send_query
|
||||
mysql_shutdown
|
||||
mysql_ssl_set
|
||||
mysql_stat
|
||||
mysql_stmt_affected_rows
|
||||
mysql_stmt_close
|
||||
mysql_stmt_reset
|
||||
mysql_stmt_data_seek
|
||||
mysql_stmt_errno
|
||||
mysql_stmt_error
|
||||
mysql_stmt_free_result
|
||||
mysql_stmt_num_rows
|
||||
mysql_stmt_row_seek
|
||||
mysql_stmt_row_tell
|
||||
mysql_stmt_store_result
|
||||
mysql_store_result
|
||||
mysql_thread_id
|
||||
mysql_thread_safe
|
||||
mysql_use_result
|
||||
mysql_warning_count
|
||||
mysql_stmt_sqlstate
|
||||
mysql_sqlstate
|
||||
mysql_get_server_version
|
||||
mysql_stmt_prepare
|
||||
mysql_stmt_init
|
||||
mysql_stmt_insert_id
|
||||
mysql_stmt_attr_get
|
||||
mysql_stmt_attr_set
|
||||
mysql_stmt_field_count
|
||||
mysql_set_local_infile_default
|
||||
mysql_set_local_infile_handler
|
||||
mysql_embedded
|
||||
mysql_server_init
|
||||
mysql_server_end
|
||||
mysql_set_character_set
|
||||
mysql_get_character_set_info
|
||||
mysql_stmt_next_result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user