├── .gitignore ├── LICENSE ├── Main.cpp ├── MySQLPlugin.cpp ├── MySQLPlugin.hpp ├── README.md ├── ScriptFunctions.cpp ├── ScriptFunctions.hpp ├── bin ├── dummy ├── libcod4x_mysql.dll └── libcod4x_mysql.so ├── makefile ├── mysql ├── unix │ ├── include │ │ ├── big_endian.h │ │ ├── byte_order_generic.h │ │ ├── byte_order_generic_x86.h │ │ ├── decimal.h │ │ ├── errmsg.h │ │ ├── keycache.h │ │ ├── little_endian.h │ │ ├── m_ctype.h │ │ ├── m_string.h │ │ ├── my_alloc.h │ │ ├── my_byteorder.h │ │ ├── my_compiler.h │ │ ├── my_config.h │ │ ├── my_dbug.h │ │ ├── my_dir.h │ │ ├── my_getopt.h │ │ ├── my_global.h │ │ ├── my_list.h │ │ ├── my_pthread.h │ │ ├── my_sys.h │ │ ├── my_xml.h │ │ ├── mysql.h │ │ ├── mysql │ │ │ ├── client_authentication.h │ │ │ ├── client_plugin.h │ │ │ ├── client_plugin.h.pp │ │ │ ├── get_password.h │ │ │ ├── plugin_auth_common.h │ │ │ ├── plugin_trace.h │ │ │ ├── psi │ │ │ │ ├── mysql_file.h │ │ │ │ ├── mysql_idle.h │ │ │ │ ├── mysql_mdl.h │ │ │ │ ├── mysql_memory.h │ │ │ │ ├── mysql_ps.h │ │ │ │ ├── mysql_socket.h │ │ │ │ ├── mysql_sp.h │ │ │ │ ├── mysql_stage.h │ │ │ │ ├── mysql_statement.h │ │ │ │ ├── mysql_table.h │ │ │ │ ├── mysql_thread.h │ │ │ │ ├── mysql_transaction.h │ │ │ │ ├── psi.h │ │ │ │ ├── psi_base.h │ │ │ │ └── psi_memory.h │ │ │ ├── service_my_snprintf.h │ │ │ └── service_mysql_alloc.h │ │ ├── mysql_com.h │ │ ├── mysql_com_server.h │ │ ├── mysql_embed.h │ │ ├── mysql_time.h │ │ ├── mysql_version.h │ │ ├── mysqld_ername.h │ │ ├── mysqld_error.h │ │ ├── sql_common.h │ │ ├── sql_state.h │ │ ├── sslopt-case.h │ │ ├── sslopt-longopts.h │ │ ├── sslopt-vars.h │ │ └── typelib.h │ └── lib │ │ ├── libmysqlclient.a │ │ └── libmysqlclient.so └── windows │ ├── include │ ├── big_endian.h │ ├── byte_order_generic.h │ ├── byte_order_generic_x86.h │ ├── decimal.h │ ├── errmsg.h │ ├── keycache.h │ ├── little_endian.h │ ├── m_ctype.h │ ├── m_string.h │ ├── my_alloc.h │ ├── my_byteorder.h │ ├── my_compiler.h │ ├── my_config.h │ ├── my_dbug.h │ ├── my_dir.h │ ├── my_getopt.h │ ├── my_global.h │ ├── my_list.h │ ├── my_pthread.h │ ├── my_sys.h │ ├── my_xml.h │ ├── mysql.h │ ├── mysql │ │ ├── client_authentication.h │ │ ├── client_plugin.h │ │ ├── client_plugin.h.pp │ │ ├── get_password.h │ │ ├── plugin_auth_common.h │ │ ├── plugin_trace.h │ │ ├── psi │ │ │ ├── mysql_file.h │ │ │ ├── mysql_idle.h │ │ │ ├── mysql_mdl.h │ │ │ ├── mysql_memory.h │ │ │ ├── mysql_ps.h │ │ │ ├── mysql_socket.h │ │ │ ├── mysql_sp.h │ │ │ ├── mysql_stage.h │ │ │ ├── mysql_statement.h │ │ │ ├── mysql_table.h │ │ │ ├── mysql_thread.h │ │ │ ├── mysql_transaction.h │ │ │ ├── psi.h │ │ │ ├── psi_base.h │ │ │ └── psi_memory.h │ │ ├── service_my_snprintf.h │ │ └── service_mysql_alloc.h │ ├── mysql_com.h │ ├── mysql_com_server.h │ ├── mysql_embed.h │ ├── mysql_time.h │ ├── mysql_version.h │ ├── mysqld_ername.h │ ├── mysqld_error.h │ ├── sql_common.h │ ├── sql_state.h │ ├── sslopt-case.h │ ├── sslopt-longopts.h │ ├── sslopt-vars.h │ └── typelib.h │ └── lib │ ├── libmysql.dll │ ├── libmysql.lib │ └── libmysqlclient.a └── obj └── dummy /.gitignore: -------------------------------------------------------------------------------- 1 | obj/* 2 | !obj/dummy 3 | !bin/libcod4x_mysql.dll 4 | !bin/libcod4x_mysql.so 5 | .vscode/* -------------------------------------------------------------------------------- /Main.cpp: -------------------------------------------------------------------------------- 1 | #include "MySQLPlugin.hpp" 2 | 3 | PCL void OnInfoRequest(pluginInfo_t *info) 4 | { 5 | CMySQLPlugin::OnInfoRequest(info); 6 | } 7 | 8 | PCL int OnInit() 9 | { 10 | InitPlugin(); 11 | return GetPlugin()->OnInit(); 12 | } 13 | 14 | PCL void OnTerminate() 15 | { 16 | FreePlugin(); 17 | } 18 | 19 | PCL void OnExitLevel() 20 | { 21 | GetPlugin()->Clear(); 22 | } 23 | -------------------------------------------------------------------------------- /MySQLPlugin.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../pinc.h" 3 | 4 | //extern "C" 5 | //{ 6 | #ifdef WIN32 7 | #include "mysql/windows/include/mysql.h" 8 | #else 9 | #include "mysql/unix/include/mysql.h" 10 | #endif 11 | //} 12 | 13 | #define MYSQL_CONNECTION_COUNT 4 14 | 15 | class CMySQLPlugin 16 | { 17 | public: 18 | CMySQLPlugin(); 19 | ~CMySQLPlugin(); 20 | 21 | // No copy class. 22 | CMySQLPlugin(const CMySQLPlugin& Other_) = delete; 23 | void operator = (const CMySQLPlugin& Other_) = delete; 24 | 25 | int OnInit(); 26 | static void OnInfoRequest(pluginInfo_t* Info_); 27 | void Clear(); 28 | 29 | /* MySQL-documented */ 30 | void OnScript_Real_Connect(); 31 | void OnScript_Close(); 32 | void OnScript_Affected_Rows(); 33 | void OnScript_Query(); 34 | void OnScript_Num_Rows(); 35 | void OnScript_Num_Fields(); 36 | void OnScript_Fetch_Row(); 37 | /* MySQL-custom */ 38 | void OnScript_Fetch_Rows(); 39 | 40 | static CMySQLPlugin* g_MySQLPlugin; 41 | 42 | private: 43 | // Maintenance methods. 44 | static const char* const getName(); 45 | static const char* const getDescription(); 46 | static const char* const getShortDescription(); 47 | static unsigned int getMajorVersion(); 48 | static unsigned int getMinorVersion(); 49 | 50 | // Script methods. 51 | int getHandleIndexForScriptArg(const int ArgNum_) const; 52 | void checkConnection(const int HandleIndex_) const; 53 | void checkQuery(const int HandleIndex_) const; 54 | void pluginError(const char* const Format_, ...) const; 55 | 56 | 57 | // Members. 58 | MYSQL m_MySQL[MYSQL_CONNECTION_COUNT]; 59 | MYSQL_RES* m_MySQLResults[MYSQL_CONNECTION_COUNT]; 60 | bool m_MySQLInUse[MYSQL_CONNECTION_COUNT]; 61 | unsigned int m_MYSQLErrNo[MYSQL_CONNECTION_COUNT]; 62 | }; 63 | 64 | void InitPlugin(); 65 | CMySQLPlugin* const GetPlugin(); 66 | void FreePlugin(); 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mysql 2 | CoD4X MySQL support for GSC. Continious connection up to 4 databases supported. 3 | 4 | # Contributors 5 | - [Sharpienero](https://github.com/Sharpienero/) 6 | - [Michael Hillcox](https://github.com/MichaelHillcox/) 7 | - [T-Maxxx](https://github.com/T-Max/) 8 | 9 | # Script Docs 10 | ### MySQL Related Functions 11 | 12 | #### `mysql_real_connect(, , , , [int port=3306])` 13 | 14 | Connects to a database, returns handle to database connection. If you want to connect to multiple databases, you can call this function up to 4 times. Do not forget to close connection with [mysql_close()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_closehandle). TODO: link here! 15 | 16 | If "localhost" passed as `host`, for *NIX OS will be changed to "127.0.0.1". 17 | 18 | Usage example 1: `handle = mysql_real_connect("localhost", "cod4server", "12345678", "players");` 19 | 20 | Usage example 2: `handle = mysql_real_connect("255.125.255.125", "usr1337", "87654321", "stats", 1337);` 21 | 22 | 23 | #### `mysql_close()` 24 | 25 | Close a MySQL connection. Handle must be valid. 26 | 27 | Usage example: `mysql_close(handle);` 28 | 29 | #### `mysql_query(, )` 30 | 31 | Send a query to a database and saves the result for use in following functions. Must be called after [mysql_real_connect()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_real_connectstr-host-str-user-str-passwd-str-db-int-port3306). 32 | 33 | Usage example: `mysql_query(handle, "SELECT * from users");` 34 | 35 | #### `mysql_num_rows()` 36 | 37 | Returns the amount of rows received after latest query. Must be called after [mysql_real_connect()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_real_connectstr-host-str-user-str-passwd-str-db-int-port3306) and [mysql_query()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_queryhandle-str-query). 38 | 39 | Usage example: `rowsCount = mysql_num_rows(handle);` 40 | 41 | #### `mysql_affected_rows()` 42 | 43 | Returns the amount of affected rows after latest query. Must be called after [mysql_real_connect()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_real_connectstr-host-str-user-str-passwd-str-db-int-port3306) and [mysql_query()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_queryhandle-str-query). 44 | 45 | Usage example: `rowsCount = mysql_affected_rows(handle);` 46 | 47 | #### `mysql_num_fields()` 48 | 49 | Returns number of fields in latest query result. Must be called after [mysql_real_connect()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_real_connectstr-host-str-user-str-passwd-str-db-int-port3306) and [mysql_query()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_queryhandle-str-query). 50 | 51 | Usage example: `fieldsCount = mysql_num_field(handle);` 52 | 53 | #### `mysql_fetch_row()` 54 | 55 | Returns next row from latest query result as array. Array's keys are equal to column names and can be found with `getArrayKeys()`. An empty array returned if there's no more rows left. Must be called after [mysql_real_connect()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_real_connectstr-host-str-user-str-passwd-str-db-int-port3306) and [mysql_query()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_queryhandle-str-query). 56 | 57 | Usage example: 58 | ``` 59 | arr = mysql_fetch_row(handle); 60 | keys = getArrayKeys(arr); 61 | for(j = 0; j < keys.size; j++) 62 | { 63 | iprintln("Key=" + keys[j] + ", value=" + arr[keys[j]]); 64 | } 65 | ``` 66 | 67 | ### Non-MySQL Related Functions 68 | #### `mysql_fetch_rows()` 69 | 70 | Returns rest rows from latest query result as 2-dimensional array. Array's keys are equal to column names and can be found with `getArrayKeys()`. An empty array returned if there's no more rows left. Must be called after [mysql_real_connect()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_real_connectstr-host-str-user-str-passwd-str-db-int-port3306) and [mysql_query()](https://github.com/callofduty4x/mysql/blob/master/README.md#mysql_queryhandle-str-query). 71 | 72 | Usage example: 73 | ``` 74 | query = mysql_fetch_rows(handle); 75 | for(i = 0; i < query.size; i++) 76 | { 77 | keys = getArrayKeys(query[i]); 78 | for(j = 0; j < keys.size; j++) 79 | { 80 | iprintln("Row #" + i + ", Key=" + keys[j] + ", value=" + query[i][keys[j]] + "\n"); 81 | } 82 | } 83 | ``` 84 | -------------------------------------------------------------------------------- /ScriptFunctions.cpp: -------------------------------------------------------------------------------- 1 | #include "ScriptFunctions.hpp" 2 | #include "MySQLPlugin.hpp" 3 | 4 | void Scr_MySQL_Real_Connect_f() 5 | { 6 | GetPlugin()->OnScript_Real_Connect(); 7 | } 8 | 9 | void Scr_MySQL_Close_f() 10 | { 11 | GetPlugin()->OnScript_Close(); 12 | } 13 | 14 | void Scr_MySQL_Affected_Rows_f() 15 | { 16 | GetPlugin()->OnScript_Affected_Rows(); 17 | } 18 | 19 | void Scr_MySQL_Query_f() 20 | { 21 | GetPlugin()->OnScript_Query(); 22 | } 23 | 24 | void Scr_MySQL_Num_Rows_f() 25 | { 26 | GetPlugin()->OnScript_Num_Rows(); 27 | } 28 | 29 | void Scr_MySQL_Num_Fields_f() 30 | { 31 | GetPlugin()->OnScript_Num_Fields(); 32 | } 33 | 34 | void Scr_MySQL_Fetch_Row_f() 35 | { 36 | GetPlugin()->OnScript_Fetch_Row(); 37 | } 38 | 39 | void Scr_MySQL_Fetch_Rows_f() 40 | { 41 | GetPlugin()->OnScript_Fetch_Rows(); 42 | } 43 | -------------------------------------------------------------------------------- /ScriptFunctions.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Scr_MySQL_Real_Connect_f(); 4 | void Scr_MySQL_Close_f(); 5 | void Scr_MySQL_Affected_Rows_f(); 6 | void Scr_MySQL_Query_f(); 7 | void Scr_MySQL_Num_Rows_f(); 8 | void Scr_MySQL_Num_Fields_f(); 9 | void Scr_MySQL_Fetch_Row_f(); 10 | void Scr_MySQL_Fetch_Rows_f(); 11 | -------------------------------------------------------------------------------- /bin/dummy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callofduty4x/mysql/9bd45f86bc126c29ddb855fbc92d1a75410c1413/bin/dummy -------------------------------------------------------------------------------- /bin/libcod4x_mysql.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callofduty4x/mysql/9bd45f86bc126c29ddb855fbc92d1a75410c1413/bin/libcod4x_mysql.dll -------------------------------------------------------------------------------- /bin/libcod4x_mysql.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callofduty4x/mysql/9bd45f86bc126c29ddb855fbc92d1a75410c1413/bin/libcod4x_mysql.so -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | ############################################## 2 | # Name of your plugin. # 3 | # (output file: lib.so or .dll) # 4 | ############################################## 5 | PLUGIN_NAME=cod4x_mysql 6 | ####################################################### 7 | # Header files include directory for Windows and UNIX # 8 | ####################################################### 9 | INCLUDEDIR_UNIX=-Imysql/unix/include 10 | INCLUDEDIR_WIN32=-Imysql/windows/include 11 | ################################################# 12 | # Additional static libraries needs to be added # 13 | ################################################# 14 | ADDITIONALLIBS_UNIX=mysql/unix/lib/libmysqlclient.a 15 | ADDITIONALLIBS_WIN32=mysql/windows/lib/libmysql.lib 16 | 17 | 18 | 19 | 20 | ################################# 21 | # Common definitions # 22 | # (rarely needed to be changed) # 23 | ################################# 24 | CC=g++ 25 | # Noteworthy: server compiled against libgcc and libstdc++ statically, so 26 | # dynamic linking will cause crash at exit. 27 | CFLAGS=-m32 -O3 -Wall -s --pedantic -std=c++11 -static-libgcc -static-libstdc++ 28 | C_MODULES=$(wildcard *.c) 29 | CPP_MODULES=$(wildcard *.cpp) 30 | C_OBJECTS=$(patsubst %.c,obj/%.o,$(C_MODULES)) 31 | CPP_OBJECTS=$(patsubst %.cpp,obj/%.o,$(CPP_MODULES)) 32 | OBJECTS=$(C_OBJECTS) $(CPP_OBJECTS) 33 | 34 | TARGET_OS = $(shell $(CC) -dumpmachine) 35 | 36 | ifeq ($(TARGET_OS),mingw32) 37 | INCLUDEDIR=$(INCLUDEDIR_WIN32) 38 | ADDITIONALLIBS=$(ADDITIONALLIBS_WIN32) 39 | else ifeq ($(TARGET_OS),cygwin) 40 | else 41 | CFLAGS += -fPIC 42 | INCLUDEDIR=$(INCLUDEDIR_UNIX) 43 | ADDITIONALLIBS=$(ADDITIONALLIBS_UNIX) 44 | endif 45 | 46 | 47 | ############ 48 | # Recipies # 49 | ############ 50 | ifeq ($(TARGET_OS),mingw32) 51 | all: win32 52 | else 53 | all: unix 54 | endif 55 | @echo Done 56 | 57 | 58 | obj/%.o: %.cpp 59 | @echo $(CC) "$^ -> $@" 60 | @$(CC) $(CFLAGS) $(INCLUDEDIR) -o $@ -c $< 61 | 62 | ifeq ($(TARGET_OS),mingw32) 63 | clean: clean_win32 64 | else 65 | clean: clean_unix 66 | endif 67 | @echo Clean done 68 | 69 | 70 | ##################### 71 | # Recipies: Windows # 72 | ##################### 73 | win32: bin/lib$(PLUGIN_NAME).dll 74 | 75 | bin/lib$(PLUGIN_NAME).dll: $(OBJECTS) 76 | @echo $(CC) "$@" 77 | @$(CC) -shared $(CFLAGS) -o $@ $^ ../libcom_plugin.a $(ADDITIONALLIBS) 78 | 79 | clean_win32: 80 | @del $(subst /,\\,$(OBJECTS)) 81 | 82 | 83 | ################## 84 | # Recipies: UNIX # 85 | ################## 86 | unix: bin/lib$(PLUGIN_NAME).so 87 | 88 | bin/lib$(PLUGIN_NAME).so: $(OBJECTS) 89 | @echo $(CC) "$@" 90 | @$(CC) -shared $(CFLAGS) -o $@ $^ $(ADDITIONALLIBS) 91 | 92 | clean_unix: 93 | @rm -r $(OBJECTS) 94 | -------------------------------------------------------------------------------- /mysql/unix/include/big_endian.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #include 17 | 18 | /* 19 | Data in big-endian format. 20 | */ 21 | static inline void float4store(uchar *T, float A) 22 | { *(T)= ((uchar *) &A)[3]; 23 | *((T)+1)=(char) ((uchar *) &A)[2]; 24 | *((T)+2)=(char) ((uchar *) &A)[1]; 25 | *((T)+3)=(char) ((uchar *) &A)[0]; } 26 | 27 | static inline void float4get (float *V, const uchar *M) 28 | { float def_temp; 29 | ((uchar*) &def_temp)[0]=(M)[3]; 30 | ((uchar*) &def_temp)[1]=(M)[2]; 31 | ((uchar*) &def_temp)[2]=(M)[1]; 32 | ((uchar*) &def_temp)[3]=(M)[0]; 33 | (*V)=def_temp; } 34 | 35 | static inline void float8store(uchar *T, double V) 36 | { *(T)= ((uchar *) &V)[7]; 37 | *((T)+1)=(char) ((uchar *) &V)[6]; 38 | *((T)+2)=(char) ((uchar *) &V)[5]; 39 | *((T)+3)=(char) ((uchar *) &V)[4]; 40 | *((T)+4)=(char) ((uchar *) &V)[3]; 41 | *((T)+5)=(char) ((uchar *) &V)[2]; 42 | *((T)+6)=(char) ((uchar *) &V)[1]; 43 | *((T)+7)=(char) ((uchar *) &V)[0]; } 44 | 45 | static inline void float8get (double *V, const uchar *M) 46 | { double def_temp; 47 | ((uchar*) &def_temp)[0]=(M)[7]; 48 | ((uchar*) &def_temp)[1]=(M)[6]; 49 | ((uchar*) &def_temp)[2]=(M)[5]; 50 | ((uchar*) &def_temp)[3]=(M)[4]; 51 | ((uchar*) &def_temp)[4]=(M)[3]; 52 | ((uchar*) &def_temp)[5]=(M)[2]; 53 | ((uchar*) &def_temp)[6]=(M)[1]; 54 | ((uchar*) &def_temp)[7]=(M)[0]; 55 | (*V) = def_temp; } 56 | 57 | static inline void ushortget(uint16 *V, const uchar *pM) 58 | { *V = (uint16) (((uint16) ((uchar) (pM)[1]))+ 59 | ((uint16) ((uint16) (pM)[0]) << 8)); } 60 | static inline void shortget (int16 *V, const uchar *pM) 61 | { *V = (short) (((short) ((uchar) (pM)[1]))+ 62 | ((short) ((short) (pM)[0]) << 8)); } 63 | static inline void longget (int32 *V, const uchar *pM) 64 | { int32 def_temp; 65 | ((uchar*) &def_temp)[0]=(pM)[0]; 66 | ((uchar*) &def_temp)[1]=(pM)[1]; 67 | ((uchar*) &def_temp)[2]=(pM)[2]; 68 | ((uchar*) &def_temp)[3]=(pM)[3]; 69 | (*V)=def_temp; } 70 | static inline void ulongget (uint32 *V, const uchar *pM) 71 | { uint32 def_temp; 72 | ((uchar*) &def_temp)[0]=(pM)[0]; 73 | ((uchar*) &def_temp)[1]=(pM)[1]; 74 | ((uchar*) &def_temp)[2]=(pM)[2]; 75 | ((uchar*) &def_temp)[3]=(pM)[3]; 76 | (*V)=def_temp; } 77 | static inline void shortstore(uchar *T, int16 A) 78 | { uint def_temp=(uint) (A) ; 79 | *(((char*)T)+1)=(char)(def_temp); 80 | *(((char*)T)+0)=(char)(def_temp >> 8); } 81 | static inline void longstore (uchar *T, int32 A) 82 | { *(((char*)T)+3)=((A)); 83 | *(((char*)T)+2)=(((A) >> 8)); 84 | *(((char*)T)+1)=(((A) >> 16)); 85 | *(((char*)T)+0)=(((A) >> 24)); } 86 | 87 | static inline void floatget(float *V, const uchar *M) 88 | { 89 | memcpy(V, (M), sizeof(float)); 90 | } 91 | 92 | static inline void floatstore(uchar *T, float V) 93 | { 94 | memcpy((T), (&V), sizeof(float)); 95 | } 96 | 97 | static inline void doubleget(double *V, const uchar *M) 98 | { 99 | memcpy(V, (M), sizeof(double)); 100 | } 101 | 102 | static inline void doublestore(uchar *T, double V) 103 | { 104 | memcpy((T), &V, sizeof(double)); 105 | } 106 | 107 | static inline void longlongget(longlong *V, const uchar *M) 108 | { 109 | memcpy(V, (M), sizeof(ulonglong)); 110 | } 111 | static inline void longlongstore(uchar *T, longlong V) 112 | { 113 | memcpy((T), &V, sizeof(ulonglong)); 114 | } 115 | -------------------------------------------------------------------------------- /mysql/unix/include/byte_order_generic.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Endianness-independent definitions for architectures other 18 | than the x86 architecture. 19 | */ 20 | static inline int16 sint2korr(const uchar *A) 21 | { 22 | return 23 | (int16) (((int16) (A[0])) + 24 | ((int16) (A[1]) << 8)) 25 | ; 26 | } 27 | 28 | static inline int32 sint4korr(const uchar *A) 29 | { 30 | return 31 | (int32) (((int32) (A[0])) + 32 | (((int32) (A[1]) << 8)) + 33 | (((int32) (A[2]) << 16)) + 34 | (((int32) (A[3]) << 24))) 35 | ; 36 | } 37 | 38 | static inline uint16 uint2korr(const uchar *A) 39 | { 40 | return 41 | (uint16) (((uint16) (A[0])) + 42 | ((uint16) (A[1]) << 8)) 43 | ; 44 | } 45 | 46 | static inline uint32 uint4korr(const uchar *A) 47 | { 48 | return 49 | (uint32) (((uint32) (A[0])) + 50 | (((uint32) (A[1])) << 8) + 51 | (((uint32) (A[2])) << 16) + 52 | (((uint32) (A[3])) << 24)) 53 | ; 54 | } 55 | 56 | static inline ulonglong uint8korr(const uchar *A) 57 | { 58 | return 59 | ((ulonglong)(((uint32) (A[0])) + 60 | (((uint32) (A[1])) << 8) + 61 | (((uint32) (A[2])) << 16) + 62 | (((uint32) (A[3])) << 24)) + 63 | (((ulonglong) (((uint32) (A[4])) + 64 | (((uint32) (A[5])) << 8) + 65 | (((uint32) (A[6])) << 16) + 66 | (((uint32) (A[7])) << 24))) << 67 | 32)) 68 | ; 69 | } 70 | 71 | static inline longlong sint8korr(const uchar *A) 72 | { 73 | return (longlong) uint8korr(A); 74 | } 75 | 76 | static inline void int2store(uchar *T, uint16 A) 77 | { 78 | uint def_temp= A ; 79 | *(T)= (uchar)(def_temp); 80 | *(T+1)= (uchar)(def_temp >> 8); 81 | } 82 | 83 | static inline void int4store(uchar *T, uint32 A) 84 | { 85 | *(T)= (uchar) (A); 86 | *(T+1)=(uchar) (A >> 8); 87 | *(T+2)=(uchar) (A >> 16); 88 | *(T+3)=(uchar) (A >> 24); 89 | } 90 | 91 | static inline void int8store(uchar *T, ulonglong A) 92 | { 93 | uint def_temp= (uint) A, 94 | def_temp2= (uint) (A >> 32); 95 | int4store(T, def_temp); 96 | int4store(T+4,def_temp2); 97 | } 98 | -------------------------------------------------------------------------------- /mysql/unix/include/byte_order_generic_x86.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Optimized functions for the x86 architecture (_WIN32 included). 18 | */ 19 | static inline int16 sint2korr(const uchar *A) { return *((int16*) A); } 20 | 21 | static inline int32 sint4korr(const uchar *A) { return *((int32*) A); } 22 | 23 | static inline uint16 uint2korr(const uchar *A) { return *((uint16*) A); } 24 | 25 | static inline uint32 uint4korr(const uchar *A) { return *((uint32*) A); } 26 | 27 | static inline ulonglong uint8korr(const uchar *A) { return *((ulonglong*) A);} 28 | static inline longlong sint8korr(const uchar *A) { return *((longlong*) A); } 29 | 30 | static inline void int2store(uchar *T, uint16 A) 31 | { 32 | *((uint16*) T)= A; 33 | } 34 | 35 | static inline void int4store(uchar *T, uint32 A) 36 | { 37 | *((uint32*) T)= A; 38 | } 39 | 40 | static inline void int8store(uchar *T, ulonglong A) 41 | { 42 | *((ulonglong*) T)= A; 43 | } 44 | -------------------------------------------------------------------------------- /mysql/unix/include/decimal.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef _decimal_h 17 | #define _decimal_h 18 | 19 | typedef enum 20 | {TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR} 21 | decimal_round_mode; 22 | typedef int32 decimal_digit_t; 23 | 24 | /** 25 | intg is the number of *decimal* digits (NOT number of decimal_digit_t's !) 26 | before the point 27 | frac is the number of decimal digits after the point 28 | len is the length of buf (length of allocated space) in decimal_digit_t's, 29 | not in bytes 30 | sign false means positive, true means negative 31 | buf is an array of decimal_digit_t's 32 | */ 33 | typedef struct st_decimal_t { 34 | int intg, frac, len; 35 | my_bool sign; 36 | decimal_digit_t *buf; 37 | } decimal_t; 38 | 39 | int internal_str2dec(const char *from, decimal_t *to, char **end, 40 | my_bool fixed); 41 | int decimal2string(const decimal_t *from, char *to, int *to_len, 42 | int fixed_precision, int fixed_decimals, 43 | char filler); 44 | int decimal2ulonglong(decimal_t *from, ulonglong *to); 45 | int ulonglong2decimal(ulonglong from, decimal_t *to); 46 | int decimal2longlong(decimal_t *from, longlong *to); 47 | int longlong2decimal(longlong from, decimal_t *to); 48 | int decimal2double(const decimal_t *from, double *to); 49 | int double2decimal(double from, decimal_t *to); 50 | int decimal_actual_fraction(decimal_t *from); 51 | int decimal2bin(decimal_t *from, uchar *to, int precision, int scale); 52 | int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale); 53 | 54 | /** 55 | Convert decimal to lldiv_t. 56 | The integer part is stored in to->quot. 57 | The fractional part is multiplied to 10^9 and stored to to->rem. 58 | @param from Decimal value 59 | @param to lldiv_t value 60 | @retval 0 on success 61 | @retval !0 in error 62 | */ 63 | int decimal2lldiv_t(const decimal_t *from, lldiv_t *to); 64 | 65 | /** 66 | Convert doube to lldiv_t. 67 | The integer part is stored in to->quot. 68 | The fractional part is multiplied to 10^9 and stored to to->rem. 69 | @param from Decimal value 70 | @param to lldiv_t value 71 | @retval 0 on success 72 | @retval !0 in error 73 | */ 74 | 75 | int double2lldiv_t(double from, lldiv_t *to); 76 | int decimal_size(int precision, int scale); 77 | int decimal_bin_size(int precision, int scale); 78 | int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, 79 | int param); 80 | 81 | int decimal_intg(const decimal_t *from); 82 | int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to); 83 | int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to); 84 | int decimal_cmp(const decimal_t *from1, const decimal_t *from2); 85 | int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to); 86 | int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, 87 | int scale_incr); 88 | int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to); 89 | int decimal_round(const decimal_t *from, decimal_t *to, int new_scale, 90 | decimal_round_mode mode); 91 | int decimal_is_zero(const decimal_t *from); 92 | void max_decimal(int precision, int frac, decimal_t *to); 93 | 94 | #define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0) 95 | #define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1) 96 | 97 | /* set a decimal_t to zero */ 98 | 99 | #define decimal_make_zero(dec) do { \ 100 | (dec)->buf[0]=0; \ 101 | (dec)->intg=1; \ 102 | (dec)->frac=0; \ 103 | (dec)->sign=0; \ 104 | } while(0) 105 | 106 | /* 107 | returns the length of the buffer to hold string representation 108 | of the decimal (including decimal dot, possible sign and \0) 109 | */ 110 | 111 | #define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \ 112 | (dec)->frac + ((dec)->frac > 0) + 2) 113 | 114 | /* negate a decimal */ 115 | #define decimal_neg(dec) do { (dec)->sign^=1; } while(0) 116 | 117 | /* 118 | conventions: 119 | 120 | decimal_smth() == 0 -- everything's ok 121 | decimal_smth() <= 1 -- result is usable, but precision loss is possible 122 | decimal_smth() <= 2 -- result can be unusable, most significant digits 123 | could've been lost 124 | decimal_smth() > 2 -- no result was generated 125 | */ 126 | 127 | #define E_DEC_OK 0 128 | #define E_DEC_TRUNCATED 1 129 | #define E_DEC_OVERFLOW 2 130 | #define E_DEC_DIV_ZERO 4 131 | #define E_DEC_BAD_NUM 8 132 | #define E_DEC_OOM 16 133 | 134 | #define E_DEC_ERROR 31 135 | #define E_DEC_FATAL_ERROR 30 136 | 137 | #endif 138 | 139 | -------------------------------------------------------------------------------- /mysql/unix/include/errmsg.h: -------------------------------------------------------------------------------- 1 | #ifndef ERRMSG_INCLUDED 2 | #define ERRMSG_INCLUDED 3 | 4 | /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 18 | 19 | /* Error messages for MySQL clients */ 20 | /* (Error messages for the daemon are in sql/share/errmsg.txt) */ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | void init_client_errs(void); 26 | void finish_client_errs(void); 27 | extern const char *client_errors[]; /* Error messages */ 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #define CR_MIN_ERROR 2000 /* For easier client code */ 33 | #define CR_MAX_ERROR 2999 34 | #if !defined(ER) 35 | #define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \ 36 | client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR]) 37 | 38 | #endif 39 | #define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ 40 | 41 | /* Do not add error numbers before CR_ERROR_FIRST. */ 42 | /* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */ 43 | #define CR_ERROR_FIRST 2000 /*Copy first error nr.*/ 44 | #define CR_UNKNOWN_ERROR 2000 45 | #define CR_SOCKET_CREATE_ERROR 2001 46 | #define CR_CONNECTION_ERROR 2002 47 | #define CR_CONN_HOST_ERROR 2003 48 | #define CR_IPSOCK_ERROR 2004 49 | #define CR_UNKNOWN_HOST 2005 50 | #define CR_SERVER_GONE_ERROR 2006 51 | #define CR_VERSION_ERROR 2007 52 | #define CR_OUT_OF_MEMORY 2008 53 | #define CR_WRONG_HOST_INFO 2009 54 | #define CR_LOCALHOST_CONNECTION 2010 55 | #define CR_TCP_CONNECTION 2011 56 | #define CR_SERVER_HANDSHAKE_ERR 2012 57 | #define CR_SERVER_LOST 2013 58 | #define CR_COMMANDS_OUT_OF_SYNC 2014 59 | #define CR_NAMEDPIPE_CONNECTION 2015 60 | #define CR_NAMEDPIPEWAIT_ERROR 2016 61 | #define CR_NAMEDPIPEOPEN_ERROR 2017 62 | #define CR_NAMEDPIPESETSTATE_ERROR 2018 63 | #define CR_CANT_READ_CHARSET 2019 64 | #define CR_NET_PACKET_TOO_LARGE 2020 65 | #define CR_EMBEDDED_CONNECTION 2021 66 | #define CR_PROBE_SLAVE_STATUS 2022 67 | #define CR_PROBE_SLAVE_HOSTS 2023 68 | #define CR_PROBE_SLAVE_CONNECT 2024 69 | #define CR_PROBE_MASTER_CONNECT 2025 70 | #define CR_SSL_CONNECTION_ERROR 2026 71 | #define CR_MALFORMED_PACKET 2027 72 | #define CR_WRONG_LICENSE 2028 73 | 74 | /* new 4.1 error codes */ 75 | #define CR_NULL_POINTER 2029 76 | #define CR_NO_PREPARE_STMT 2030 77 | #define CR_PARAMS_NOT_BOUND 2031 78 | #define CR_DATA_TRUNCATED 2032 79 | #define CR_NO_PARAMETERS_EXISTS 2033 80 | #define CR_INVALID_PARAMETER_NO 2034 81 | #define CR_INVALID_BUFFER_USE 2035 82 | #define CR_UNSUPPORTED_PARAM_TYPE 2036 83 | 84 | #define CR_SHARED_MEMORY_CONNECTION 2037 85 | #define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038 86 | #define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039 87 | #define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040 88 | #define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041 89 | #define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042 90 | #define CR_SHARED_MEMORY_MAP_ERROR 2043 91 | #define CR_SHARED_MEMORY_EVENT_ERROR 2044 92 | #define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 93 | #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 94 | #define CR_CONN_UNKNOW_PROTOCOL 2047 95 | #define CR_INVALID_CONN_HANDLE 2048 96 | #define CR_UNUSED_1 2049 97 | #define CR_FETCH_CANCELED 2050 98 | #define CR_NO_DATA 2051 99 | #define CR_NO_STMT_METADATA 2052 100 | #define CR_NO_RESULT_SET 2053 101 | #define CR_NOT_IMPLEMENTED 2054 102 | #define CR_SERVER_LOST_EXTENDED 2055 103 | #define CR_STMT_CLOSED 2056 104 | #define CR_NEW_STMT_METADATA 2057 105 | #define CR_ALREADY_CONNECTED 2058 106 | #define CR_AUTH_PLUGIN_CANNOT_LOAD 2059 107 | #define CR_DUPLICATE_CONNECTION_ATTR 2060 108 | #define CR_AUTH_PLUGIN_ERR 2061 109 | #define CR_ERROR_LAST /*Copy last error nr:*/ 2061 110 | /* Add error numbers before CR_ERROR_LAST and change it accordingly. */ 111 | 112 | #endif /* ERRMSG_INCLUDED */ 113 | -------------------------------------------------------------------------------- /mysql/unix/include/little_endian.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Data in little-endian format. 18 | */ 19 | 20 | #include 21 | 22 | static inline void float4get (float *V, const uchar *M) 23 | { 24 | memcpy(V, (M), sizeof(float)); 25 | } 26 | 27 | static inline void float4store(uchar *V, float M) 28 | { 29 | memcpy(V, (&M), sizeof(float)); 30 | } 31 | 32 | static inline void float8get (double *V, const uchar *M) 33 | { 34 | memcpy(V, M, sizeof(double)); 35 | } 36 | 37 | static inline void float8store(uchar *V, double M) 38 | { 39 | memcpy(V, &M, sizeof(double)); 40 | } 41 | 42 | static inline void floatget (float *V, const uchar *M) { float4get(V, M); } 43 | static inline void floatstore (uchar *V, float M) { float4store(V, M); } 44 | 45 | /* Bi-endian hardware.... */ 46 | #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) 47 | static inline void doublestore(uchar *T, double V) 48 | { *(((char*)T)+0)=(char) ((uchar *) &V)[4]; 49 | *(((char*)T)+1)=(char) ((uchar *) &V)[5]; 50 | *(((char*)T)+2)=(char) ((uchar *) &V)[6]; 51 | *(((char*)T)+3)=(char) ((uchar *) &V)[7]; 52 | *(((char*)T)+4)=(char) ((uchar *) &V)[0]; 53 | *(((char*)T)+5)=(char) ((uchar *) &V)[1]; 54 | *(((char*)T)+6)=(char) ((uchar *) &V)[2]; 55 | *(((char*)T)+7)=(char) ((uchar *) &V)[3]; } 56 | static inline void doubleget(double *V, const uchar *M) 57 | { double def_temp; 58 | ((uchar*) &def_temp)[0]=(M)[4]; 59 | ((uchar*) &def_temp)[1]=(M)[5]; 60 | ((uchar*) &def_temp)[2]=(M)[6]; 61 | ((uchar*) &def_temp)[3]=(M)[7]; 62 | ((uchar*) &def_temp)[4]=(M)[0]; 63 | ((uchar*) &def_temp)[5]=(M)[1]; 64 | ((uchar*) &def_temp)[6]=(M)[2]; 65 | ((uchar*) &def_temp)[7]=(M)[3]; 66 | (*V) = def_temp; } 67 | 68 | #else /* Bi-endian hardware.... */ 69 | 70 | static inline void doublestore(uchar *T, double V) { memcpy(T, &V, sizeof(double)); } 71 | static inline void doubleget (double *V, const uchar *M) { memcpy(V, M, sizeof(double)); } 72 | 73 | #endif /* Bi-endian hardware.... */ 74 | 75 | static inline void ushortget(uint16 *V, const uchar *pM) { *V= uint2korr(pM); } 76 | static inline void shortget (int16 *V, const uchar *pM) { *V= sint2korr(pM); } 77 | static inline void longget (int32 *V, const uchar *pM) { *V= sint4korr(pM); } 78 | static inline void ulongget (uint32 *V, const uchar *pM) { *V= uint4korr(pM); } 79 | static inline void shortstore(uchar *T, int16 V) { int2store(T, V); } 80 | static inline void longstore (uchar *T, int32 V) { int4store(T, V); } 81 | 82 | static inline void longlongget(longlong *V, const uchar *M) 83 | { 84 | memcpy(V, (M), sizeof(ulonglong)); 85 | } 86 | static inline void longlongstore(uchar *T, longlong V) 87 | { 88 | memcpy((T), &V, sizeof(ulonglong)); 89 | } 90 | -------------------------------------------------------------------------------- /mysql/unix/include/my_alloc.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Data structures for mysys/my_alloc.c (root memory allocator) 18 | */ 19 | 20 | #ifndef _my_alloc_h 21 | #define _my_alloc_h 22 | 23 | #define ALLOC_MAX_BLOCK_TO_DROP 4096 24 | #define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10 25 | 26 | /* PSI_memory_key */ 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | typedef struct st_used_mem 34 | { /* struct for once_alloc (block) */ 35 | struct st_used_mem *next; /* Next block in use */ 36 | unsigned int left; /* memory left in block */ 37 | unsigned int size; /* size of block */ 38 | } USED_MEM; 39 | 40 | 41 | typedef struct st_mem_root 42 | { 43 | USED_MEM *free; /* blocks with free memory in it */ 44 | USED_MEM *used; /* blocks almost without free memory */ 45 | USED_MEM *pre_alloc; /* preallocated block */ 46 | /* if block have less memory it will be put in 'used' list */ 47 | size_t min_malloc; 48 | size_t block_size; /* initial block size */ 49 | unsigned int block_num; /* allocated blocks counter */ 50 | /* 51 | first free block in queue test counter (if it exceed 52 | MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) 53 | */ 54 | unsigned int first_block_usage; 55 | 56 | void (*error_handler)(void); 57 | 58 | PSI_memory_key m_psi_key; 59 | } MEM_ROOT; 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /mysql/unix/include/my_compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef MY_COMPILER_INCLUDED 2 | #define MY_COMPILER_INCLUDED 3 | 4 | /* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 18 | 19 | /** 20 | Header for compiler-dependent features. 21 | 22 | Intended to contain a set of reusable wrappers for preprocessor 23 | macros, attributes, pragmas, and any other features that are 24 | specific to a target compiler. 25 | */ 26 | 27 | #include /* size_t */ 28 | 29 | #if defined __GNUC__ 30 | /* 31 | Convenience macro to test the minimum required GCC version. 32 | These should be used with care as Clang also sets __GNUC__ and 33 | __GNUC_MINOR__ (currently to 4.2). Prefer using feature specific 34 | CMake checks in configure.cmake instead. 35 | */ 36 | # define MY_GNUC_PREREQ(maj, min) \ 37 | ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) 38 | # define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) 39 | #else 40 | # define MY_GNUC_PREREQ(maj, min) (0) 41 | #endif 42 | 43 | /* 44 | The macros below are borrowed from include/linux/compiler.h in the 45 | Linux kernel. Use them to indicate the likelyhood of the truthfulness 46 | of a condition. This serves two purposes - newer versions of gcc will be 47 | able to optimize for branch predication, which could yield siginficant 48 | performance gains in frequently executed sections of the code, and the 49 | other reason to use them is for documentation 50 | */ 51 | #ifdef HAVE_BUILTIN_EXPECT 52 | 53 | // likely/unlikely are likely to clash with other symbols, do not #define 54 | #if defined(__cplusplus) 55 | inline bool likely(bool expr) 56 | { 57 | return __builtin_expect(expr, true); 58 | } 59 | inline bool unlikely(bool expr) 60 | { 61 | return __builtin_expect(expr, false); 62 | } 63 | #else 64 | # define likely(x) __builtin_expect((x),1) 65 | # define unlikely(x) __builtin_expect((x),0) 66 | #endif 67 | 68 | #else /* HAVE_BUILTIN_EXPECT */ 69 | 70 | #if defined(__cplusplus) 71 | inline bool likely(bool expr) 72 | { 73 | return expr; 74 | } 75 | inline bool unlikely(bool expr) 76 | { 77 | return expr; 78 | } 79 | #else 80 | # define likely(x) (x) 81 | # define unlikely(x) (x) 82 | #endif 83 | 84 | #endif /* HAVE_BUILTIN_EXPECT */ 85 | 86 | /* Comunicate to the compiler the unreachability of the code. */ 87 | #ifdef HAVE_BUILTIN_UNREACHABLE 88 | # define MY_ASSERT_UNREACHABLE() __builtin_unreachable() 89 | #else 90 | # define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0) 91 | #endif 92 | 93 | #if defined __GNUC__ || defined __SUNPRO_C || defined __SUNPRO_CC 94 | /* Specifies the minimum alignment of a type. */ 95 | # define MY_ALIGNOF(type) __alignof__(type) 96 | /* Determine the alignment requirement of a type. */ 97 | # define MY_ALIGNED(n) __attribute__((__aligned__((n)))) 98 | /* Microsoft Visual C++ */ 99 | #elif defined _MSC_VER 100 | # define MY_ALIGNOF(type) __alignof(type) 101 | # define MY_ALIGNED(n) __declspec(align(n)) 102 | #else /* Make sure they are defined for other compilers. */ 103 | # define MY_ALIGNOF(type) 104 | # define MY_ALIGNED(size) 105 | #endif 106 | 107 | /* Visual Studio requires '__inline' for C code */ 108 | #if !defined(__cplusplus) && defined(_MSC_VER) 109 | # define inline __inline 110 | #endif 111 | 112 | /* Provide __func__ macro definition for Visual Studio. */ 113 | #if defined(_MSC_VER) 114 | # define __func__ __FUNCTION__ 115 | #endif 116 | 117 | /** 118 | C++ Type Traits 119 | */ 120 | #ifdef __cplusplus 121 | 122 | /** 123 | Opaque storage with a particular alignment. 124 | Partial specialization used due to MSVC++. 125 | */ 126 | template struct my_alignment_imp; 127 | template<> struct MY_ALIGNED(1) my_alignment_imp<1> {}; 128 | template<> struct MY_ALIGNED(2) my_alignment_imp<2> {}; 129 | template<> struct MY_ALIGNED(4) my_alignment_imp<4> {}; 130 | template<> struct MY_ALIGNED(8) my_alignment_imp<8> {}; 131 | template<> struct MY_ALIGNED(16) my_alignment_imp<16> {}; 132 | 133 | /** 134 | A POD type with a given size and alignment. 135 | 136 | @remark If the compiler does not support a alignment attribute 137 | (MY_ALIGN macro), the default alignment of a double is 138 | used instead. 139 | 140 | @tparam size The minimum size. 141 | @tparam alignment The desired alignment: 1, 2, 4, 8 or 16. 142 | */ 143 | template 144 | struct my_aligned_storage 145 | { 146 | union 147 | { 148 | char data[size]; 149 | my_alignment_imp align; 150 | }; 151 | }; 152 | 153 | #endif /* __cplusplus */ 154 | 155 | /* 156 | Disable __attribute__ for Sun Studio and Visual Studio. 157 | Note that Sun Studio supports some __attribute__ variants, 158 | but not format or unused which we use quite a lot. 159 | 160 | Sic: We should not (re-)define identifiers that begin with 161 | an underscore followed by an uppercase letter or another underscore. 162 | */ 163 | #if defined __SUNPRO_C || defined __SUNPRO_CC || defined _MSC_VER 164 | # define __attribute__(A) 165 | #endif 166 | 167 | #endif /* MY_COMPILER_INCLUDED */ 168 | -------------------------------------------------------------------------------- /mysql/unix/include/my_dir.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MY_DIR_H 17 | #define MY_DIR_H 18 | 19 | #include "my_global.h" 20 | 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Defines for my_dir and my_stat */ 28 | 29 | #ifdef _WIN32 30 | #define S_IROTH _S_IREAD 31 | #define S_IFIFO _S_IFIFO 32 | #endif 33 | 34 | #define MY_S_IFMT S_IFMT /* type of file */ 35 | #define MY_S_IFDIR S_IFDIR /* directory */ 36 | #define MY_S_IFCHR S_IFCHR /* character special */ 37 | #define MY_S_IFBLK S_IFBLK /* block special */ 38 | #define MY_S_IFREG S_IFREG /* regular */ 39 | #define MY_S_IFIFO S_IFIFO /* fifo */ 40 | #define MY_S_ISUID S_ISUID /* set user id on execution */ 41 | #define MY_S_ISGID S_ISGID /* set group id on execution */ 42 | #define MY_S_ISVTX S_ISVTX /* save swapped text even after use */ 43 | #define MY_S_IREAD S_IREAD /* read permission, owner */ 44 | #define MY_S_IWRITE S_IWRITE /* write permission, owner */ 45 | #define MY_S_IEXEC S_IEXEC /* execute/search permission, owner */ 46 | 47 | #define MY_S_ISDIR(m) (((m) & MY_S_IFMT) == MY_S_IFDIR) 48 | #define MY_S_ISCHR(m) (((m) & MY_S_IFMT) == MY_S_IFCHR) 49 | #define MY_S_ISBLK(m) (((m) & MY_S_IFMT) == MY_S_IFBLK) 50 | #define MY_S_ISREG(m) (((m) & MY_S_IFMT) == MY_S_IFREG) 51 | #define MY_S_ISFIFO(m) (((m) & MY_S_IFMT) == MY_S_IFIFO) 52 | 53 | #define MY_DONT_SORT 512 /* my_lib; Don't sort files */ 54 | #define MY_WANT_STAT 1024 /* my_lib; stat files */ 55 | 56 | /* typedefs for my_dir & my_stat */ 57 | 58 | #if(_MSC_VER) 59 | #define MY_STAT struct _stati64 /* 64 bit file size */ 60 | #else 61 | #define MY_STAT struct stat /* Orginal struct have what we need */ 62 | #endif 63 | 64 | /* Struct describing one file returned from my_dir */ 65 | typedef struct fileinfo 66 | { 67 | char *name; 68 | MY_STAT *mystat; 69 | } FILEINFO; 70 | 71 | typedef struct st_my_dir /* Struct returned from my_dir */ 72 | { 73 | /* 74 | These members are just copies of parts of DYNAMIC_ARRAY structure, 75 | which is allocated right after the end of MY_DIR structure (MEM_ROOT 76 | for storing names is also resides there). We've left them here because 77 | we don't want to change code that uses my_dir. 78 | */ 79 | struct fileinfo *dir_entry; 80 | uint number_off_files; 81 | } MY_DIR; 82 | 83 | extern MY_DIR *my_dir(const char *path,myf MyFlags); 84 | extern void my_dirend(MY_DIR *buffer); 85 | extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags); 86 | extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags); 87 | 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | 92 | #endif /* MY_DIR_H */ 93 | 94 | -------------------------------------------------------------------------------- /mysql/unix/include/my_list.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef _list_h_ 17 | #define _list_h_ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef struct st_list { 24 | struct st_list *prev,*next; 25 | void *data; 26 | } LIST; 27 | 28 | typedef int (*list_walk_action)(void *,void *); 29 | 30 | extern LIST *list_add(LIST *root,LIST *element); 31 | extern LIST *list_delete(LIST *root,LIST *element); 32 | extern LIST *list_cons(void *data,LIST *root); 33 | extern LIST *list_reverse(LIST *root); 34 | extern void list_free(LIST *root,unsigned int free_data); 35 | extern unsigned int list_length(LIST *); 36 | extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); 37 | 38 | #define list_rest(a) ((a)->next) 39 | #define list_push(a,b) (a)=list_cons((b),(a)) 40 | #define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); } 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /mysql/unix/include/my_xml.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 15 | 16 | 17 | #ifndef _my_xml_h 18 | #define _my_xml_h 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | 25 | #define MY_XML_OK 0 26 | #define MY_XML_ERROR 1 27 | 28 | /* 29 | A flag whether to use absolute tag names in call-back functions, 30 | like "a", "a.b" and "a.b.c" (used in character set file parser), 31 | or relative names like "a", "b" and "c". 32 | */ 33 | #define MY_XML_FLAG_RELATIVE_NAMES 1 34 | 35 | /* 36 | A flag whether to skip normilization of text values before calling 37 | call-back functions: i.e. skip leading/trailing spaces, 38 | \r, \n, \t characters. 39 | */ 40 | #define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2 41 | 42 | enum my_xml_node_type 43 | { 44 | MY_XML_NODE_TAG, /* can have TAG, ATTR and TEXT children */ 45 | MY_XML_NODE_ATTR, /* can have TEXT children */ 46 | MY_XML_NODE_TEXT /* cannot have children */ 47 | }; 48 | 49 | typedef struct xml_stack_st 50 | { 51 | int flags; 52 | enum my_xml_node_type current_node_type; 53 | char errstr[128]; 54 | 55 | struct { 56 | char static_buffer[128]; 57 | char *buffer; 58 | size_t buffer_size; 59 | char *start; 60 | char *end; 61 | } attr; 62 | 63 | const char *beg; 64 | const char *cur; 65 | const char *end; 66 | void *user_data; 67 | int (*enter)(struct xml_stack_st *st,const char *val, size_t len); 68 | int (*value)(struct xml_stack_st *st,const char *val, size_t len); 69 | int (*leave_xml)(struct xml_stack_st *st,const char *val, size_t len); 70 | } MY_XML_PARSER; 71 | 72 | void my_xml_parser_create(MY_XML_PARSER *st); 73 | void my_xml_parser_free(MY_XML_PARSER *st); 74 | int my_xml_parse(MY_XML_PARSER *st,const char *str, size_t len); 75 | 76 | void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, 77 | const char *, 78 | size_t len)); 79 | void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, 80 | const char *, 81 | size_t len)); 82 | void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, 83 | const char *, 84 | size_t len)); 85 | void my_xml_set_user_data(MY_XML_PARSER *st, void *); 86 | 87 | size_t my_xml_error_pos(MY_XML_PARSER *st); 88 | uint my_xml_error_lineno(MY_XML_PARSER *st); 89 | 90 | const char *my_xml_error_string(MY_XML_PARSER *st); 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* _my_xml_h */ 97 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/client_authentication.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | #ifndef CLIENT_AUTHENTICATION_H 16 | #define CLIENT_AUTHENTICATION_H 17 | #include 18 | #include "mysql.h" 19 | #include "mysql/client_plugin.h" 20 | 21 | C_MODE_START 22 | int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql); 23 | int sha256_password_init(char *, size_t, int, va_list); 24 | int sha256_password_deinit(void); 25 | C_MODE_END 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/client_plugin.h.pp: -------------------------------------------------------------------------------- 1 | struct st_mysql_client_plugin 2 | { 3 | int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *); 4 | }; 5 | struct st_mysql; 6 | #include 7 | typedef struct st_plugin_vio_info 8 | { 9 | enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, 10 | MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; 11 | int socket; 12 | } MYSQL_PLUGIN_VIO_INFO; 13 | typedef struct st_plugin_vio 14 | { 15 | int (*read_packet)(struct st_plugin_vio *vio, 16 | unsigned char **buf); 17 | int (*write_packet)(struct st_plugin_vio *vio, 18 | const unsigned char *packet, 19 | int packet_len); 20 | void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); 21 | } MYSQL_PLUGIN_VIO; 22 | struct st_mysql_client_plugin_AUTHENTICATION 23 | { 24 | int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *); 25 | int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); 26 | }; 27 | struct st_mysql_client_plugin * 28 | mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, 29 | int argc, ...); 30 | struct st_mysql_client_plugin * 31 | mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type, 32 | int argc, va_list args); 33 | struct st_mysql_client_plugin * 34 | mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type); 35 | struct st_mysql_client_plugin * 36 | mysql_client_register_plugin(struct st_mysql *mysql, 37 | struct st_mysql_client_plugin *plugin); 38 | int mysql_plugin_options(struct st_mysql_client_plugin *plugin, 39 | const char *option, const void *value); 40 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/get_password.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | ** Ask for a password from tty 18 | ** This is an own file to avoid conflicts with curses 19 | */ 20 | 21 | #ifndef MYSQL_GET_PASSWORD_H_INCLUDED 22 | #define MYSQL_GET_PASSWORD_H_INCLUDED 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | typedef char *(* strdup_handler_t)(const char *, int); 29 | char *get_tty_password_ext(const char *opt_message, 30 | strdup_handler_t strdup_function); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* ! MYSQL_GET_PASSWORD_H_INCLUDED */ 37 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/plugin_auth_common.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED 2 | /* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; version 2 of the License. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 16 | 17 | /** 18 | @file 19 | 20 | This file defines constants and data structures that are the same for 21 | both client- and server-side authentication plugins. 22 | */ 23 | #define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED 24 | 25 | /** the max allowed length for a user name */ 26 | #define MYSQL_USERNAME_LENGTH 48 27 | 28 | /** 29 | return values of the plugin authenticate_user() method. 30 | */ 31 | 32 | /** 33 | Authentication failed, plugin internal error. 34 | An error occurred in the authentication plugin itself. 35 | These errors are reported in table performance_schema.host_cache, 36 | column COUNT_AUTH_PLUGIN_ERRORS. 37 | */ 38 | #define CR_AUTH_PLUGIN_ERROR 3 39 | /** 40 | Authentication failed, client server handshake. 41 | An error occurred during the client server handshake. 42 | These errors are reported in table performance_schema.host_cache, 43 | column COUNT_HANDSHAKE_ERRORS. 44 | */ 45 | #define CR_AUTH_HANDSHAKE 2 46 | /** 47 | Authentication failed, user credentials. 48 | For example, wrong passwords. 49 | These errors are reported in table performance_schema.host_cache, 50 | column COUNT_AUTHENTICATION_ERRORS. 51 | */ 52 | #define CR_AUTH_USER_CREDENTIALS 1 53 | /** 54 | Authentication failed. Additionally, all other CR_xxx values 55 | (libmysql error code) can be used too. 56 | 57 | The client plugin may set the error code and the error message directly 58 | in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error 59 | code was returned, an error message in the MYSQL structure will be 60 | overwritten. If CR_ERROR is returned without setting the error in MYSQL, 61 | CR_UNKNOWN_ERROR will be user. 62 | */ 63 | #define CR_ERROR 0 64 | /** 65 | Authentication (client part) was successful. It does not mean that the 66 | authentication as a whole was successful, usually it only means 67 | that the client was able to send the user name and the password to the 68 | server. If CR_OK is returned, the libmysql reads the next packet expecting 69 | it to be one of OK, ERROR, or CHANGE_PLUGIN packets. 70 | */ 71 | #define CR_OK -1 72 | /** 73 | Authentication was successful. 74 | It means that the client has done its part successfully and also that 75 | a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN). 76 | In this case, libmysql will not read a packet from the server, 77 | but it will use the data at mysql->net.read_pos. 78 | 79 | A plugin may return this value if the number of roundtrips in the 80 | authentication protocol is not known in advance, and the client plugin 81 | needs to read one packet more to determine if the authentication is finished 82 | or not. 83 | */ 84 | #define CR_OK_HANDSHAKE_COMPLETE -2 85 | 86 | /* 87 | We need HANDLE definition if on Windows. Define WIN32_LEAN_AND_MEAN (if 88 | not already done) to minimize amount of imported declarations. 89 | */ 90 | #ifdef _WIN32 91 | #ifndef WIN32_LEAN_AND_MEAN 92 | #define WIN32_LEAN_AND_MEAN 93 | #endif 94 | #include 95 | #endif 96 | 97 | typedef struct st_plugin_vio_info 98 | { 99 | enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, 100 | MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; 101 | int socket; /**< it's set, if the protocol is SOCKET or TCP */ 102 | #ifdef _WIN32 103 | HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */ 104 | #endif 105 | } MYSQL_PLUGIN_VIO_INFO; 106 | 107 | /** 108 | Provides plugin access to communication channel 109 | */ 110 | typedef struct st_plugin_vio 111 | { 112 | /** 113 | Plugin provides a pointer reference and this function sets it to the 114 | contents of any incoming packet. Returns the packet length, or -1 if 115 | the plugin should terminate. 116 | */ 117 | int (*read_packet)(struct st_plugin_vio *vio, 118 | unsigned char **buf); 119 | 120 | /** 121 | Plugin provides a buffer with data and the length and this 122 | function sends it as a packet. Returns 0 on success, 1 on failure. 123 | */ 124 | int (*write_packet)(struct st_plugin_vio *vio, 125 | const unsigned char *packet, 126 | int packet_len); 127 | 128 | /** 129 | Fills in a st_plugin_vio_info structure, providing the information 130 | about the connection. 131 | */ 132 | void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); 133 | 134 | } MYSQL_PLUGIN_VIO; 135 | 136 | #endif 137 | 138 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/psi/mysql_idle.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_IDLE_H 17 | #define MYSQL_IDLE_H 18 | 19 | /** 20 | @file mysql/psi/mysql_idle.h 21 | Instrumentation helpers for idle waits. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_IDLE_CALL 27 | #define PSI_IDLE_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Idle_instrumentation Idle Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def MYSQL_START_IDLE_WAIT 38 | Instrumentation helper for table io_waits. 39 | This instrumentation marks the start of a wait event. 40 | @param LOCKER the locker 41 | @param STATE the locker state 42 | @sa MYSQL_END_IDLE_WAIT. 43 | */ 44 | #ifdef HAVE_PSI_IDLE_INTERFACE 45 | #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \ 46 | LOCKER= inline_mysql_start_idle_wait(STATE, __FILE__, __LINE__) 47 | #else 48 | #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \ 49 | do {} while (0) 50 | #endif 51 | 52 | /** 53 | @def MYSQL_END_IDLE_WAIT 54 | Instrumentation helper for idle waits. 55 | This instrumentation marks the end of a wait event. 56 | @param LOCKER the locker 57 | @sa MYSQL_START_IDLE_WAIT. 58 | */ 59 | #ifdef HAVE_PSI_IDLE_INTERFACE 60 | #define MYSQL_END_IDLE_WAIT(LOCKER) \ 61 | inline_mysql_end_idle_wait(LOCKER) 62 | #else 63 | #define MYSQL_END_IDLE_WAIT(LOCKER) \ 64 | do {} while (0) 65 | #endif 66 | 67 | #ifdef HAVE_PSI_IDLE_INTERFACE 68 | /** 69 | Instrumentation calls for MYSQL_START_IDLE_WAIT. 70 | @sa MYSQL_END_IDLE_WAIT. 71 | */ 72 | static inline struct PSI_idle_locker * 73 | inline_mysql_start_idle_wait(PSI_idle_locker_state *state, 74 | const char *src_file, int src_line) 75 | { 76 | struct PSI_idle_locker *locker; 77 | locker= PSI_IDLE_CALL(start_idle_wait)(state, src_file, src_line); 78 | return locker; 79 | } 80 | 81 | /** 82 | Instrumentation calls for MYSQL_END_IDLE_WAIT. 83 | @sa MYSQL_START_IDLE_WAIT. 84 | */ 85 | static inline void 86 | inline_mysql_end_idle_wait(struct PSI_idle_locker *locker) 87 | { 88 | if (likely(locker != NULL)) 89 | PSI_IDLE_CALL(end_idle_wait)(locker); 90 | } 91 | #endif 92 | 93 | /** @} (end of group Idle_instrumentation) */ 94 | 95 | #endif 96 | 97 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/psi/mysql_mdl.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_MDL_H 17 | #define MYSQL_MDL_H 18 | 19 | /** 20 | @file mysql/psi/mysql_mdl.h 21 | Instrumentation helpers for metadata locks. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_METADATA_CALL 27 | #define PSI_METADATA_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Thread_instrumentation Metadata Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def mysql_mdl_create(K, M, A) 38 | Instrumented metadata lock creation. 39 | @param I Metadata lock identity 40 | @param K Metadata key 41 | @param T Metadata lock type 42 | @param D Metadata lock duration 43 | @param S Metadata lock status 44 | @param F request source file 45 | @param L request source line 46 | */ 47 | 48 | #ifdef HAVE_PSI_METADATA_INTERFACE 49 | #define mysql_mdl_create(I, K, T, D, S, F, L) \ 50 | inline_mysql_mdl_create(I, K, T, D, S, F, L) 51 | #else 52 | #define mysql_mdl_create(I, K, T, D, S, F, L) NULL 53 | #endif 54 | 55 | #ifdef HAVE_PSI_METADATA_INTERFACE 56 | #define mysql_mdl_set_status(L, S) \ 57 | inline_mysql_mdl_set_status(L, S) 58 | #else 59 | #define mysql_mdl_set_status(L, S) \ 60 | do {} while (0) 61 | #endif 62 | 63 | 64 | /** 65 | @def mysql_mdl_destroy(M) 66 | Instrumented metadata lock destruction. 67 | @param M Metadata lock 68 | */ 69 | #ifdef HAVE_PSI_METADATA_INTERFACE 70 | #define mysql_mdl_destroy(M) \ 71 | inline_mysql_mdl_destroy(M, __FILE__, __LINE__) 72 | #else 73 | #define mysql_mdl_destroy(M) \ 74 | do {} while (0) 75 | #endif 76 | 77 | #ifdef HAVE_PSI_METADATA_INTERFACE 78 | 79 | static inline PSI_metadata_lock * 80 | inline_mysql_mdl_create(void *identity, 81 | const MDL_key *mdl_key, 82 | enum_mdl_type mdl_type, 83 | enum_mdl_duration mdl_duration, 84 | MDL_wait::enum_wait_status mdl_status, 85 | const char *src_file, uint src_line) 86 | { 87 | PSI_metadata_lock *result; 88 | 89 | /* static_cast: Fit a round C++ enum peg into a square C int hole ... */ 90 | result= PSI_METADATA_CALL(create_metadata_lock) 91 | (identity, 92 | mdl_key, 93 | static_cast (mdl_type), 94 | static_cast (mdl_duration), 95 | static_cast (mdl_status), 96 | src_file, src_line); 97 | 98 | return result; 99 | } 100 | 101 | static inline void inline_mysql_mdl_set_status( 102 | PSI_metadata_lock *psi, 103 | MDL_wait::enum_wait_status mdl_status) 104 | { 105 | if (psi != NULL) 106 | PSI_METADATA_CALL(set_metadata_lock_status)(psi, mdl_status); 107 | } 108 | 109 | static inline void inline_mysql_mdl_destroy( 110 | PSI_metadata_lock *psi, 111 | const char *src_file, uint src_line) 112 | { 113 | if (psi != NULL) 114 | PSI_METADATA_CALL(destroy_metadata_lock)(psi); 115 | } 116 | #endif /* HAVE_PSI_METADATA_INTERFACE */ 117 | 118 | /** @} (end of group Metadata_instrumentation) */ 119 | 120 | #endif 121 | 122 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/psi/mysql_memory.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_MEMORY_H 17 | #define MYSQL_MEMORY_H 18 | 19 | /** 20 | @file mysql/psi/mysql_memory.h 21 | Instrumentation helpers for memory allocation. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_MEMORY_CALL 27 | #define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Memory_instrumentation Memory Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def mysql_memory_register(P1, P2, P3) 38 | Memory registration. 39 | */ 40 | #define mysql_memory_register(P1, P2, P3) \ 41 | inline_mysql_memory_register(P1, P2, P3) 42 | 43 | static inline void inline_mysql_memory_register( 44 | #ifdef HAVE_PSI_MEMORY_INTERFACE 45 | const char *category, 46 | PSI_memory_info *info, 47 | int count) 48 | #else 49 | const char *category __attribute__((unused)), 50 | void *info __attribute__((unused)), 51 | int count __attribute__((unused))) 52 | #endif 53 | { 54 | #ifdef HAVE_PSI_MEMORY_INTERFACE 55 | PSI_MEMORY_CALL(register_memory)(category, info, count); 56 | #endif 57 | } 58 | 59 | /** @} (end of group Memory_instrumentation) */ 60 | 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/psi/mysql_ps.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_PS_H 17 | #define MYSQL_PS_H 18 | 19 | /** 20 | @file mysql/psi/mysql_ps.h 21 | Instrumentation helpers for prepared statements. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_PS_CALL 27 | #define PSI_PS_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | #ifdef HAVE_PSI_PS_INTERFACE 31 | #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \ 32 | inline_mysql_create_prepared_stmt(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) 33 | #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \ 34 | inline_mysql_execute_prepared_stmt(LOCKER, PREPARED_STMT) 35 | #define MYSQL_DESTROY_PS(PREPARED_STMT) \ 36 | inline_mysql_destroy_prepared_stmt(PREPARED_STMT) 37 | #define MYSQL_REPREPARE_PS(PREPARED_STMT) \ 38 | inline_mysql_reprepare_prepared_stmt(PREPARED_STMT) 39 | #else 40 | #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \ 41 | NULL 42 | #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \ 43 | do {} while (0) 44 | #define MYSQL_DESTROY_PS(PREPARED_STMT) \ 45 | do {} while (0) 46 | #define MYSQL_REPREPARE_PS(PREPARED_STMT) \ 47 | do {} while (0) 48 | #endif 49 | 50 | #ifdef HAVE_PSI_PS_INTERFACE 51 | static inline struct PSI_prepared_stmt* 52 | inline_mysql_create_prepared_stmt(void *identity, uint stmt_id, 53 | PSI_statement_locker *locker, 54 | const char *stmt_name, size_t stmt_name_length, 55 | const char *sqltext, size_t sqltext_length) 56 | { 57 | if (locker == NULL) 58 | return NULL; 59 | return PSI_PS_CALL(create_prepared_stmt)(identity, stmt_id, 60 | locker, 61 | stmt_name, stmt_name_length, 62 | sqltext, sqltext_length); 63 | } 64 | 65 | static inline void 66 | inline_mysql_execute_prepared_stmt(PSI_statement_locker *locker, 67 | PSI_prepared_stmt* prepared_stmt) 68 | { 69 | if (prepared_stmt != NULL && locker != NULL) 70 | PSI_PS_CALL(execute_prepared_stmt)(locker, prepared_stmt); 71 | } 72 | 73 | static inline void 74 | inline_mysql_destroy_prepared_stmt(PSI_prepared_stmt *prepared_stmt) 75 | { 76 | if (prepared_stmt != NULL) 77 | PSI_PS_CALL(destroy_prepared_stmt)(prepared_stmt); 78 | } 79 | 80 | static inline void 81 | inline_mysql_reprepare_prepared_stmt(PSI_prepared_stmt *prepared_stmt) 82 | { 83 | if (prepared_stmt != NULL) 84 | PSI_PS_CALL(reprepare_prepared_stmt)(prepared_stmt); 85 | } 86 | #endif 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/psi/mysql_sp.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_SP_H 17 | #define MYSQL_SP_H 18 | 19 | /** 20 | @file mysql/psi/mysql_sp.h 21 | Instrumentation helpers for stored programs. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_SP_CALL 27 | #define PSI_SP_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | #ifdef HAVE_PSI_SP_INTERFACE 31 | #define MYSQL_START_SP(STATE, SP_SHARE) \ 32 | inline_mysql_start_sp(STATE, SP_SHARE) 33 | #else 34 | #define MYSQL_START_SP(STATE, SP_SHARE) \ 35 | NULL 36 | #endif 37 | 38 | 39 | #ifdef HAVE_PSI_SP_INTERFACE 40 | #define MYSQL_END_SP(LOCKER) \ 41 | inline_mysql_end_sp(LOCKER) 42 | #else 43 | #define MYSQL_END_SP(LOCKER) \ 44 | do {} while (0) 45 | #endif 46 | 47 | #ifdef HAVE_PSI_SP_INTERFACE 48 | #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \ 49 | inline_mysql_drop_sp(OT, SN, SNL, ON, ONL) 50 | #else 51 | #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \ 52 | do {} while (0) 53 | #endif 54 | 55 | #ifdef HAVE_PSI_SP_INTERFACE 56 | #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \ 57 | inline_mysql_get_sp_share(OT, SN, SNL, ON, ONL) 58 | #else 59 | #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \ 60 | NULL 61 | #endif 62 | 63 | #ifdef HAVE_PSI_SP_INTERFACE 64 | static inline struct PSI_sp_locker* 65 | inline_mysql_start_sp(PSI_sp_locker_state *state, PSI_sp_share *sp_share) 66 | { 67 | return PSI_SP_CALL(start_sp)(state, sp_share); 68 | } 69 | 70 | static inline void inline_mysql_end_sp(PSI_sp_locker *locker) 71 | { 72 | if (likely(locker != NULL)) 73 | PSI_SP_CALL(end_sp)(locker); 74 | } 75 | 76 | static inline void 77 | inline_mysql_drop_sp(uint sp_type, 78 | const char* schema_name, uint shcema_name_length, 79 | const char* object_name, uint object_name_length) 80 | { 81 | PSI_SP_CALL(drop_sp)(sp_type, 82 | schema_name, shcema_name_length, 83 | object_name, object_name_length); 84 | } 85 | 86 | static inline PSI_sp_share* 87 | inline_mysql_get_sp_share(uint sp_type, 88 | const char* schema_name, uint shcema_name_length, 89 | const char* object_name, uint object_name_length) 90 | { 91 | return PSI_SP_CALL(get_sp_share)(sp_type, 92 | schema_name, shcema_name_length, 93 | object_name, object_name_length); 94 | } 95 | #endif 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/psi/mysql_stage.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_STAGE_H 17 | #define MYSQL_STAGE_H 18 | 19 | /** 20 | @file mysql/psi/mysql_stage.h 21 | Instrumentation helpers for stages. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_STAGE_CALL 27 | #define PSI_STAGE_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Stage_instrumentation Stage Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def mysql_stage_register(P1, P2, P3) 38 | Stage registration. 39 | */ 40 | #ifdef HAVE_PSI_STAGE_INTERFACE 41 | #define mysql_stage_register(P1, P2, P3) \ 42 | inline_mysql_stage_register(P1, P2, P3) 43 | #else 44 | #define mysql_stage_register(P1, P2, P3) \ 45 | do {} while (0) 46 | #endif 47 | 48 | /** 49 | @def MYSQL_SET_STAGE 50 | Set the current stage 51 | @param K the stage key 52 | @param F the source file name 53 | @param L the source file line 54 | @return the current stage progress 55 | */ 56 | #ifdef HAVE_PSI_STAGE_INTERFACE 57 | #define MYSQL_SET_STAGE(K, F, L) \ 58 | inline_mysql_set_stage(K, F, L) 59 | #else 60 | #define MYSQL_SET_STAGE(K, F, L) \ 61 | NULL 62 | #endif 63 | 64 | #ifdef HAVE_PSI_STAGE_INTERFACE 65 | static inline void inline_mysql_stage_register( 66 | const char *category, PSI_stage_info **info, int count) 67 | { 68 | PSI_STAGE_CALL(register_stage)(category, info, count); 69 | } 70 | #endif 71 | 72 | #ifdef HAVE_PSI_STAGE_INTERFACE 73 | static inline PSI_stage_progress* 74 | inline_mysql_set_stage(PSI_stage_key key, 75 | const char *src_file, int src_line) 76 | { 77 | return PSI_STAGE_CALL(start_stage)(key, src_file, src_line); 78 | } 79 | #endif 80 | 81 | #ifdef HAVE_PSI_STAGE_INTERFACE 82 | #define mysql_stage_set_work_completed(P1, P2) \ 83 | inline_mysql_stage_set_work_completed(P1, P2) 84 | #else 85 | #define mysql_stage_set_work_completed(P1, P2) \ 86 | do {} while (0) 87 | #endif 88 | 89 | #ifdef HAVE_PSI_STAGE_INTERFACE 90 | #define mysql_stage_inc_work_completed(P1, P2) \ 91 | inline_mysql_stage_inc_work_completed(P1, P2) 92 | #else 93 | #define mysql_stage_inc_work_completed(P1, P2) \ 94 | do {} while (0) 95 | #endif 96 | 97 | #ifdef HAVE_PSI_STAGE_INTERFACE 98 | #define mysql_stage_set_work_estimated(P1, P2) \ 99 | inline_mysql_stage_set_work_estimated(P1, P2) 100 | #else 101 | #define mysql_stage_set_work_estimated(P1, P2) \ 102 | do {} while (0) 103 | #endif 104 | 105 | #ifdef HAVE_PSI_STAGE_INTERFACE 106 | static inline void 107 | inline_mysql_stage_set_work_completed(PSI_stage_progress *progress, 108 | ulonglong val) 109 | { 110 | if (progress != NULL) 111 | progress->m_work_completed= val; 112 | } 113 | #endif 114 | 115 | #ifdef HAVE_PSI_STAGE_INTERFACE 116 | static inline void 117 | inline_mysql_stage_inc_work_completed(PSI_stage_progress *progress, 118 | ulonglong val) 119 | { 120 | if (progress != NULL) 121 | progress->m_work_completed+= val; 122 | } 123 | #endif 124 | 125 | #ifdef HAVE_PSI_STAGE_INTERFACE 126 | static inline void 127 | inline_mysql_stage_set_work_estimated(PSI_stage_progress *progress, 128 | ulonglong val) 129 | { 130 | if (progress != NULL) 131 | progress->m_work_estimated= val; 132 | } 133 | #endif 134 | 135 | /** @} (end of group Stage_instrumentation) */ 136 | 137 | #endif 138 | 139 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/psi/mysql_table.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_TABLE_H 17 | #define MYSQL_TABLE_H 18 | 19 | /** 20 | @file mysql/psi/mysql_table.h 21 | Instrumentation helpers for table io. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_TABLE_CALL 27 | #define PSI_TABLE_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Table_instrumentation Table Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def MYSQL_TABLE_WAIT_VARIABLES 38 | Instrumentation helper for table waits. 39 | This instrumentation declares local variables. 40 | Do not use a ';' after this macro 41 | @param LOCKER the locker 42 | @param STATE the locker state 43 | @sa MYSQL_START_TABLE_IO_WAIT. 44 | @sa MYSQL_END_TABLE_IO_WAIT. 45 | @sa MYSQL_START_TABLE_LOCK_WAIT. 46 | @sa MYSQL_END_TABLE_LOCK_WAIT. 47 | */ 48 | #ifdef HAVE_PSI_TABLE_INTERFACE 49 | #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE) \ 50 | struct PSI_table_locker* LOCKER; \ 51 | PSI_table_locker_state STATE; 52 | #else 53 | #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE) 54 | #endif 55 | 56 | /** 57 | @def MYSQL_START_TABLE_LOCK_WAIT 58 | Instrumentation helper for table lock waits. 59 | This instrumentation marks the start of a wait event. 60 | @param LOCKER the locker 61 | @param STATE the locker state 62 | @param PSI the instrumented table 63 | @param OP the table operation to be performed 64 | @param FLAGS per table operation flags. 65 | @sa MYSQL_END_TABLE_LOCK_WAIT. 66 | */ 67 | #ifdef HAVE_PSI_TABLE_INTERFACE 68 | #define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \ 69 | LOCKER= inline_mysql_start_table_lock_wait(STATE, PSI, \ 70 | OP, FLAGS, __FILE__, __LINE__) 71 | #else 72 | #define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \ 73 | do {} while (0) 74 | #endif 75 | 76 | /** 77 | @def MYSQL_END_TABLE_LOCK_WAIT 78 | Instrumentation helper for table lock waits. 79 | This instrumentation marks the end of a wait event. 80 | @param LOCKER the locker 81 | @sa MYSQL_START_TABLE_LOCK_WAIT. 82 | */ 83 | #ifdef HAVE_PSI_TABLE_INTERFACE 84 | #define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \ 85 | inline_mysql_end_table_lock_wait(LOCKER) 86 | #else 87 | #define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \ 88 | do {} while (0) 89 | #endif 90 | 91 | #ifdef HAVE_PSI_TABLE_INTERFACE 92 | #define MYSQL_UNLOCK_TABLE(T) \ 93 | inline_mysql_unlock_table(T) 94 | #else 95 | #define MYSQL_UNLOCK_TABLE(T) \ 96 | do {} while (0) 97 | #endif 98 | 99 | #ifdef HAVE_PSI_TABLE_INTERFACE 100 | /** 101 | Instrumentation calls for MYSQL_START_TABLE_LOCK_WAIT. 102 | @sa MYSQL_END_TABLE_LOCK_WAIT. 103 | */ 104 | static inline struct PSI_table_locker * 105 | inline_mysql_start_table_lock_wait(PSI_table_locker_state *state, 106 | struct PSI_table *psi, 107 | enum PSI_table_lock_operation op, 108 | ulong flags, const char *src_file, int src_line) 109 | { 110 | if (psi != NULL) 111 | { 112 | struct PSI_table_locker *locker; 113 | locker= PSI_TABLE_CALL(start_table_lock_wait) 114 | (state, psi, op, flags, src_file, src_line); 115 | return locker; 116 | } 117 | return NULL; 118 | } 119 | 120 | /** 121 | Instrumentation calls for MYSQL_END_TABLE_LOCK_WAIT. 122 | @sa MYSQL_START_TABLE_LOCK_WAIT. 123 | */ 124 | static inline void 125 | inline_mysql_end_table_lock_wait(struct PSI_table_locker *locker) 126 | { 127 | if (locker != NULL) 128 | PSI_TABLE_CALL(end_table_lock_wait)(locker); 129 | } 130 | 131 | static inline void 132 | inline_mysql_unlock_table(struct PSI_table *table) 133 | { 134 | if (table != NULL) 135 | PSI_TABLE_CALL(unlock_table)(table); 136 | } 137 | #endif 138 | 139 | /** @} (end of group Table_instrumentation) */ 140 | 141 | #endif 142 | 143 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/psi/psi_base.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_PSI_BASE_H 17 | #define MYSQL_PSI_BASE_H 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /** 24 | @file mysql/psi/psi_base.h 25 | Performance schema instrumentation interface. 26 | 27 | @defgroup Instrumentation_interface Instrumentation Interface 28 | @ingroup Performance_schema 29 | @{ 30 | */ 31 | 32 | #define PSI_INSTRUMENT_ME 0 33 | 34 | #define PSI_NOT_INSTRUMENTED 0 35 | 36 | /** 37 | Global flag. 38 | This flag indicate that an instrumentation point is a global variable, 39 | or a singleton. 40 | */ 41 | #define PSI_FLAG_GLOBAL (1 << 0) 42 | 43 | /** 44 | Mutable flag. 45 | This flag indicate that an instrumentation point is a general placeholder, 46 | that can mutate into a more specific instrumentation point. 47 | */ 48 | #define PSI_FLAG_MUTABLE (1 << 1) 49 | 50 | #define PSI_FLAG_THREAD (1 << 2) 51 | 52 | /** 53 | Stage progress flag. 54 | This flag apply to the stage instruments only. 55 | It indicates the instrumentation provides progress data. 56 | */ 57 | #define PSI_FLAG_STAGE_PROGRESS (1 << 3) 58 | 59 | #ifdef HAVE_PSI_INTERFACE 60 | 61 | /** 62 | Shared Exclusive flag. 63 | Indicates that rwlock support the shared exclusive state. 64 | */ 65 | #define PSI_RWLOCK_FLAG_SX (1 << 4) 66 | 67 | /** 68 | @def PSI_VERSION_1 69 | Performance Schema Interface number for version 1. 70 | This version is supported. 71 | */ 72 | #define PSI_VERSION_1 1 73 | 74 | /** 75 | @def PSI_VERSION_2 76 | Performance Schema Interface number for version 2. 77 | This version is not implemented, it's a placeholder. 78 | */ 79 | #define PSI_VERSION_2 2 80 | 81 | /** 82 | @def PSI_CURRENT_VERSION 83 | Performance Schema Interface number for the most recent version. 84 | The most current version is @c PSI_VERSION_1 85 | */ 86 | #define PSI_CURRENT_VERSION 1 87 | 88 | /** 89 | @def USE_PSI_1 90 | Define USE_PSI_1 to use the interface version 1. 91 | */ 92 | 93 | /** 94 | @def USE_PSI_2 95 | Define USE_PSI_2 to use the interface version 2. 96 | */ 97 | 98 | /** 99 | @def HAVE_PSI_1 100 | Define HAVE_PSI_1 if the interface version 1 needs to be compiled in. 101 | */ 102 | 103 | /** 104 | @def HAVE_PSI_2 105 | Define HAVE_PSI_2 if the interface version 2 needs to be compiled in. 106 | */ 107 | 108 | #ifndef USE_PSI_2 109 | #ifndef USE_PSI_1 110 | #define USE_PSI_1 111 | #endif 112 | #endif 113 | 114 | #ifdef USE_PSI_1 115 | #define HAVE_PSI_1 116 | #endif 117 | 118 | #ifdef USE_PSI_2 119 | #define HAVE_PSI_2 120 | #endif 121 | 122 | /* 123 | Allow to override PSI_XXX_CALL at compile time 124 | with more efficient implementations, if available. 125 | If nothing better is available, 126 | make a dynamic call using the PSI_server function pointer. 127 | */ 128 | 129 | #define PSI_DYNAMIC_CALL(M) PSI_server->M 130 | 131 | #endif /* HAVE_PSI_INTERFACE */ 132 | 133 | /** @} */ 134 | 135 | #ifdef __cplusplus 136 | } 137 | #endif 138 | 139 | #endif /* MYSQL_PSI_BASE_H */ 140 | 141 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/psi/psi_memory.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_PSI_MEMORY_H 17 | #define MYSQL_PSI_MEMORY_H 18 | 19 | #include "psi_base.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /** 26 | @file mysql/psi/psi_memory.h 27 | Performance schema instrumentation interface. 28 | 29 | @defgroup Instrumentation_interface Instrumentation Interface 30 | @ingroup Performance_schema 31 | @{ 32 | */ 33 | 34 | #ifdef HAVE_PSI_INTERFACE 35 | #ifndef DISABLE_ALL_PSI 36 | #ifndef DISABLE_PSI_MEMORY 37 | #define HAVE_PSI_MEMORY_INTERFACE 38 | #endif /* DISABLE_PSI_MEMORY */ 39 | #endif /* DISABLE_ALL_PSI */ 40 | #endif /* HAVE_PSI_INTERFACE */ 41 | 42 | /** 43 | Instrumented memory key. 44 | To instrument memory, a memory key must be obtained using @c register_memory. 45 | Using a zero key always disable the instrumentation. 46 | */ 47 | typedef unsigned int PSI_memory_key; 48 | 49 | #ifdef HAVE_PSI_1 50 | 51 | /** 52 | @defgroup Group_PSI_v1 Application Binary Interface, version 1 53 | @ingroup Instrumentation_interface 54 | @{ 55 | */ 56 | 57 | /** 58 | Memory instrument information. 59 | @since PSI_VERSION_1 60 | This structure is used to register instrumented memory. 61 | */ 62 | struct PSI_memory_info_v1 63 | { 64 | /** Pointer to the key assigned to the registered memory. */ 65 | PSI_memory_key *m_key; 66 | /** The name of the memory instrument to register. */ 67 | const char *m_name; 68 | /** 69 | The flags of the socket instrument to register. 70 | @sa PSI_FLAG_GLOBAL 71 | */ 72 | int m_flags; 73 | }; 74 | typedef struct PSI_memory_info_v1 PSI_memory_info_v1; 75 | 76 | /** 77 | Memory registration API. 78 | @param category a category name (typically a plugin name) 79 | @param info an array of memory info to register 80 | @param count the size of the info array 81 | */ 82 | typedef void (*register_memory_v1_t) 83 | (const char *category, struct PSI_memory_info_v1 *info, int count); 84 | 85 | /** 86 | Instrument memory allocation. 87 | @param key the memory instrument key 88 | @param size the size of memory allocated 89 | @return the effective memory instrument key 90 | */ 91 | typedef PSI_memory_key (*memory_alloc_v1_t) 92 | (PSI_memory_key key, size_t size); 93 | 94 | /** 95 | Instrument memory re allocation. 96 | @param key the memory instrument key 97 | @param old_size the size of memory previously allocated 98 | @param new_size the size of memory re allocated 99 | @return the effective memory instrument key 100 | */ 101 | typedef PSI_memory_key (*memory_realloc_v1_t) 102 | (PSI_memory_key key, size_t old_size, size_t new_size); 103 | 104 | /** 105 | Instrument memory free. 106 | @param key the memory instrument key 107 | @param size the size of memory allocated 108 | */ 109 | typedef void (*memory_free_v1_t) 110 | (PSI_memory_key key, size_t size); 111 | 112 | /** @} (end of group Group_PSI_v1) */ 113 | 114 | #endif /* HAVE_PSI_1 */ 115 | 116 | #ifdef HAVE_PSI_2 117 | struct PSI_memory_info_v2 118 | { 119 | int placeholder; 120 | }; 121 | 122 | #endif /* HAVE_PSI_2 */ 123 | 124 | #ifdef USE_PSI_1 125 | typedef struct PSI_memory_info_v1 PSI_memory_info; 126 | #endif 127 | 128 | #ifdef USE_PSI_2 129 | typedef struct PSI_memory_info_v2 PSI_memory_info; 130 | #endif 131 | 132 | /** @} (end of group Instrumentation_interface) */ 133 | 134 | #ifdef __cplusplus 135 | } 136 | #endif 137 | 138 | 139 | #endif /* MYSQL_PSI_MEMORY_H */ 140 | 141 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/service_my_snprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED 2 | /* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; version 2 of the License. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 16 | 17 | /** 18 | @file 19 | my_snprintf service 20 | 21 | Portable and limited vsnprintf() implementation. 22 | 23 | This is a portable, limited vsnprintf() implementation, with some 24 | extra features. "Portable" means that it'll produce identical result 25 | on all platforms (for example, on Windows and Linux system printf %e 26 | formats the exponent differently, on different systems %p either 27 | prints leading 0x or not, %s may accept null pointer or crash on 28 | it). "Limited" means that it does not support all the C89 features. 29 | But it supports few extensions, not in any standard. 30 | 31 | my_vsnprintf(to, n, fmt, ap) 32 | 33 | @param[out] to A buffer to store the result in 34 | @param[in] n Store up to n-1 characters, followed by an end 0 35 | @param[in] fmt printf-like format string 36 | @param[in] ap Arguments 37 | 38 | @return a number of bytes written to a buffer *excluding* terminating '\0' 39 | 40 | @post 41 | The syntax of a format string is generally the same: 42 | % 43 | where everithing but the format is optional. 44 | 45 | Three one-character flags are recognized: 46 | '0' has the standard zero-padding semantics; 47 | '-' is parsed, but silently ignored; 48 | '`' (backtick) is only supported for strings (%s) and means that the 49 | string will be quoted according to MySQL identifier quoting rules. 50 | 51 | Both and can be specified as numbers or '*'. 52 | If an asterisk is used, an argument of type int is consumed. 53 | 54 | can be 'l', 'll', or 'z'. 55 | 56 | Supported formats are 's' (null pointer is accepted, printed as 57 | "(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o', 58 | 'X', 'p' (works as 0x%x). 59 | 60 | Standard syntax for positional arguments $n is supported. 61 | 62 | Extensions: 63 | 64 | Flag '`' (backtick): see above. 65 | 66 | Format 'b': binary buffer, prints exactly bytes from the 67 | argument, without stopping at '\0'. 68 | */ 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | #ifndef MYSQL_ABI_CHECK 75 | #include 76 | #include 77 | #endif 78 | 79 | extern struct my_snprintf_service_st { 80 | size_t (*my_snprintf_type)(char*, size_t, const char*, ...); 81 | size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); 82 | } *my_snprintf_service; 83 | 84 | #ifdef MYSQL_DYNAMIC_PLUGIN 85 | 86 | #define my_vsnprintf my_snprintf_service->my_vsnprintf_type 87 | #define my_snprintf my_snprintf_service->my_snprintf_type 88 | 89 | #else 90 | 91 | size_t my_snprintf(char* to, size_t n, const char* fmt, ...); 92 | size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); 93 | 94 | #endif 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED 101 | #endif 102 | 103 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql/service_mysql_alloc.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED 17 | #define MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED 18 | 19 | #ifndef MYSQL_ABI_CHECK 20 | #include 21 | #endif 22 | 23 | /* PSI_memory_key */ 24 | #include "mysql/psi/psi_memory.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* myf */ 31 | typedef int myf_t; 32 | 33 | typedef void * (*mysql_malloc_t)(PSI_memory_key key, size_t size, myf_t flags); 34 | typedef void * (*mysql_realloc_t)(PSI_memory_key key, void *ptr, size_t size, myf_t flags); 35 | typedef void (*mysql_free_t)(void *ptr); 36 | typedef void * (*my_memdup_t)(PSI_memory_key key, const void *from, size_t length, myf_t flags); 37 | typedef char * (*my_strdup_t)(PSI_memory_key key, const char *from, myf_t flags); 38 | typedef char * (*my_strndup_t)(PSI_memory_key key, const char *from, size_t length, myf_t flags); 39 | 40 | struct mysql_malloc_service_st 41 | { 42 | mysql_malloc_t mysql_malloc; 43 | mysql_realloc_t mysql_realloc; 44 | mysql_free_t mysql_free; 45 | my_memdup_t my_memdup; 46 | my_strdup_t my_strdup; 47 | my_strndup_t my_strndup; 48 | }; 49 | 50 | extern struct mysql_malloc_service_st *mysql_malloc_service; 51 | 52 | #ifdef MYSQL_DYNAMIC_PLUGIN 53 | 54 | #define my_malloc mysql_malloc_service->mysql_malloc 55 | #define my_realloc mysql_malloc_service->mysql_realloc 56 | #define my_free mysql_malloc_service->mysql_free 57 | #define my_memdup mysql_malloc_service->my_memdup 58 | #define my_strdup mysql_malloc_service->my_strdup 59 | #define my_strndup mysql_malloc_service->my_strndup 60 | 61 | #else 62 | 63 | extern void * my_malloc(PSI_memory_key key, size_t size, myf_t flags); 64 | extern void * my_realloc(PSI_memory_key key, void *ptr, size_t size, myf_t flags); 65 | extern void my_free(void *ptr); 66 | extern void * my_memdup(PSI_memory_key key, const void *from, size_t length, myf_t flags); 67 | extern char * my_strdup(PSI_memory_key key, const char *from, myf_t flags); 68 | extern char * my_strndup(PSI_memory_key key, const char *from, size_t length, myf_t flags); 69 | 70 | #endif 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif 77 | 78 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql_com_server.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Definitions private to the server, 18 | used in the networking layer to notify specific events. 19 | */ 20 | 21 | #ifndef _mysql_com_server_h 22 | #define _mysql_com_server_h 23 | 24 | struct st_net_server; 25 | 26 | typedef void (*before_header_callback_fn) 27 | (struct st_net *net, void *user_data, size_t count); 28 | 29 | typedef void (*after_header_callback_fn) 30 | (struct st_net *net, void *user_data, size_t count, my_bool rc); 31 | 32 | struct st_net_server 33 | { 34 | before_header_callback_fn m_before_header; 35 | after_header_callback_fn m_after_header; 36 | void *m_user_data; 37 | }; 38 | 39 | typedef struct st_net_server NET_SERVER; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql_embed.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQL_EMBED_INCLUDED 2 | #define MYSQL_EMBED_INCLUDED 3 | 4 | /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 18 | 19 | /* Defines that are unique to the embedded version of MySQL */ 20 | 21 | #ifdef EMBEDDED_LIBRARY 22 | 23 | /* Things we don't need in the embedded version of MySQL */ 24 | /* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */ 25 | 26 | #undef HAVE_DLOPEN /* No udf functions */ 27 | 28 | #endif /* EMBEDDED_LIBRARY */ 29 | #endif /* MYSQL_EMBED_INCLUDED */ 30 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql_time.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 15 | 16 | #ifndef _mysql_time_h_ 17 | #define _mysql_time_h_ 18 | 19 | /* 20 | Time declarations shared between the server and client API: 21 | you should not add anything to this header unless it's used 22 | (and hence should be visible) in mysql.h. 23 | If you're looking for a place to add new time-related declaration, 24 | it's most likely my_time.h. See also "C API Handling of Date 25 | and Time Values" chapter in documentation. 26 | */ 27 | 28 | enum enum_mysql_timestamp_type 29 | { 30 | MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, 31 | MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 32 | }; 33 | 34 | 35 | /* 36 | Structure which is used to represent datetime values inside MySQL. 37 | 38 | We assume that values in this structure are normalized, i.e. year <= 9999, 39 | month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions 40 | in server such as my_system_gmt_sec() or make_time() family of functions 41 | rely on this (actually now usage of make_*() family relies on a bit weaker 42 | restriction). Also functions that produce MYSQL_TIME as result ensure this. 43 | There is one exception to this rule though if this structure holds time 44 | value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold 45 | bigger values. 46 | */ 47 | typedef struct st_mysql_time 48 | { 49 | unsigned int year, month, day, hour, minute, second; 50 | unsigned long second_part; /**< microseconds */ 51 | my_bool neg; 52 | enum enum_mysql_timestamp_type time_type; 53 | } MYSQL_TIME; 54 | 55 | #endif /* _mysql_time_h_ */ 56 | -------------------------------------------------------------------------------- /mysql/unix/include/mysql_version.h: -------------------------------------------------------------------------------- 1 | /* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB 2 | & Detron HB, 1996, 1999-2004, 2007 MySQL AB. 3 | This file is public domain and comes with NO WARRANTY of any kind 4 | */ 5 | 6 | /* Version numbers for protocol & mysqld */ 7 | 8 | #ifndef _mysql_version_h 9 | #define _mysql_version_h 10 | #ifdef _CUSTOMCONFIG_ 11 | #include 12 | #else 13 | #define PROTOCOL_VERSION 10 14 | #define MYSQL_SERVER_VERSION "5.7.6-m16" 15 | #define MYSQL_VERSION_ID 50706 16 | #define MYSQL_PORT 3306 17 | #define MYSQL_PORT_DEFAULT 0 18 | #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" 19 | #define MYSQL_CONFIG_NAME "my" 20 | #define MYSQL_COMPILATION_COMMENT "MySQL Connector/C (GPL)" 21 | #define LIBMYSQL_VERSION "6.1.6" 22 | #define LIBMYSQL_VERSION_ID 60106 23 | 24 | /* mysqld compile time options */ 25 | #endif /* _CUSTOMCONFIG_ */ 26 | 27 | #ifndef LICENSE 28 | #define LICENSE GPL 29 | #endif /* LICENSE */ 30 | 31 | #endif /* _mysql_version_h */ 32 | -------------------------------------------------------------------------------- /mysql/unix/include/sslopt-case.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) 17 | #ifdef MYSQL_CLIENT 18 | case OPT_SSL_SSL: 19 | /* 20 | A client side --ssl option handling. 21 | --ssl=1 means enforce (use=1, enforce=1) 22 | --ssl=0 means can't enforce (use=0, enforce=0) 23 | no --ssl means default : no enforce (use=1), just try (enforce=1) 24 | */ 25 | opt_ssl_enforce= opt_use_ssl; 26 | break; 27 | #endif 28 | case OPT_SSL_KEY: 29 | case OPT_SSL_CERT: 30 | case OPT_SSL_CA: 31 | case OPT_SSL_CAPATH: 32 | case OPT_SSL_CIPHER: 33 | case OPT_SSL_CRL: 34 | case OPT_SSL_CRLPATH: 35 | /* 36 | Enable use of SSL if we are using any ssl option 37 | One can disable SSL later by using --skip-ssl or --ssl=0 38 | */ 39 | opt_use_ssl= TRUE; 40 | /* crl has no effect in yaSSL */ 41 | #ifdef HAVE_YASSL 42 | opt_ssl_crl= NULL; 43 | opt_ssl_crlpath= NULL; 44 | #endif 45 | break; 46 | #endif -------------------------------------------------------------------------------- /mysql/unix/include/sslopt-longopts.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) 17 | 18 | {"ssl", OPT_SSL_SSL, 19 | "If set to ON, this option enforces that SSL is established before client " 20 | "attempts to authenticate to the server. To disable client SSL capabilities " 21 | "use --ssl=OFF.", 22 | &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, 23 | {"ssl-ca", OPT_SSL_CA, 24 | "CA file in PEM format.", 25 | &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, 26 | 0, 0, 0, 0, 0, 0}, 27 | {"ssl-capath", OPT_SSL_CAPATH, 28 | "CA directory.", 29 | &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, 30 | 0, 0, 0, 0, 0, 0}, 31 | {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format.", 32 | &opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, 33 | 0, 0, 0, 0, 0, 0}, 34 | {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use.", 35 | &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, 36 | 0, 0, 0, 0, 0, 0}, 37 | {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format.", 38 | &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, 39 | 0, 0, 0, 0, 0, 0}, 40 | {"ssl-crl", OPT_SSL_CRL, "Certificate revocation list.", 41 | &opt_ssl_crl, &opt_ssl_crl, 0, GET_STR, REQUIRED_ARG, 42 | 0, 0, 0, 0, 0, 0}, 43 | {"ssl-crlpath", OPT_SSL_CRLPATH, 44 | "Certificate revocation list path.", 45 | &opt_ssl_crlpath, &opt_ssl_crlpath, 0, GET_STR, REQUIRED_ARG, 46 | 0, 0, 0, 0, 0, 0}, 47 | #ifdef MYSQL_CLIENT 48 | {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, 49 | "Verify server's \"Common Name\" in its cert against hostname used " 50 | "when connecting. This option is disabled by default.", 51 | &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert, 52 | 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, 53 | #endif 54 | #endif /* HAVE_OPENSSL */ -------------------------------------------------------------------------------- /mysql/unix/include/sslopt-vars.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef SSLOPT_VARS_INCLUDED 17 | #define SSLOPT_VARS_INCLUDED 18 | 19 | #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) 20 | /* Always try to use SSL per default */ 21 | static my_bool opt_use_ssl = TRUE; 22 | /* Fall back on unencrypted connections per default */ 23 | static my_bool opt_ssl_enforce= FALSE; 24 | static char *opt_ssl_ca = 0; 25 | static char *opt_ssl_capath = 0; 26 | static char *opt_ssl_cert = 0; 27 | static char *opt_ssl_cipher = 0; 28 | static char *opt_ssl_key = 0; 29 | static char *opt_ssl_crl = 0; 30 | static char *opt_ssl_crlpath = 0; 31 | #ifndef MYSQL_CLIENT 32 | #error This header is supposed to be used only in the client 33 | #endif 34 | #define SSL_SET_OPTIONS(mysql) \ 35 | if (opt_use_ssl) \ 36 | { \ 37 | mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, \ 38 | opt_ssl_capath, opt_ssl_cipher); \ 39 | mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl); \ 40 | mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath); \ 41 | mysql_options(mysql, MYSQL_OPT_SSL_ENFORCE, &opt_ssl_enforce); \ 42 | } \ 43 | mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, \ 44 | (char*)&opt_ssl_verify_server_cert) 45 | 46 | static my_bool opt_ssl_verify_server_cert= 0; 47 | #else 48 | #define SSL_SET_OPTIONS(mysql) do { } while(0) 49 | #endif 50 | #endif /* SSLOPT_VARS_INCLUDED */ 51 | -------------------------------------------------------------------------------- /mysql/unix/include/typelib.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 15 | 16 | 17 | #ifndef _typelib_h 18 | #define _typelib_h 19 | 20 | #include "my_alloc.h" 21 | 22 | typedef struct st_typelib { /* Different types saved here */ 23 | unsigned int count; /* How many types */ 24 | const char *name; /* Name of typelib */ 25 | const char **type_names; 26 | unsigned int *type_lengths; 27 | } TYPELIB; 28 | 29 | extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); 30 | extern int find_type_or_exit(const char *x, TYPELIB *typelib, 31 | const char *option); 32 | #define FIND_TYPE_BASIC 0 33 | /** makes @c find_type() require the whole name, no prefix */ 34 | #define FIND_TYPE_NO_PREFIX (1 << 0) 35 | /** always implicitely on, so unused, but old code may pass it */ 36 | #define FIND_TYPE_NO_OVERWRITE (1 << 1) 37 | /** makes @c find_type() accept a number */ 38 | #define FIND_TYPE_ALLOW_NUMBER (1 << 2) 39 | /** makes @c find_type() treat ',' as terminator */ 40 | #define FIND_TYPE_COMMA_TERM (1 << 3) 41 | 42 | extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); 43 | extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); 44 | extern const char *get_type(TYPELIB *typelib,unsigned int nr); 45 | extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); 46 | 47 | extern TYPELIB sql_protocol_typelib; 48 | 49 | my_ulonglong find_set_from_flags(const TYPELIB *lib, unsigned int default_name, 50 | my_ulonglong cur_set, my_ulonglong default_set, 51 | const char *str, unsigned int length, 52 | char **err_pos, unsigned int *err_len); 53 | 54 | #endif /* _typelib_h */ 55 | -------------------------------------------------------------------------------- /mysql/unix/lib/libmysqlclient.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callofduty4x/mysql/9bd45f86bc126c29ddb855fbc92d1a75410c1413/mysql/unix/lib/libmysqlclient.a -------------------------------------------------------------------------------- /mysql/unix/lib/libmysqlclient.so: -------------------------------------------------------------------------------- 1 | libmysqlclient.so.18 -------------------------------------------------------------------------------- /mysql/windows/include/big_endian.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #include 17 | 18 | /* 19 | Data in big-endian format. 20 | */ 21 | static inline void float4store(uchar *T, float A) 22 | { *(T)= ((uchar *) &A)[3]; 23 | *((T)+1)=(char) ((uchar *) &A)[2]; 24 | *((T)+2)=(char) ((uchar *) &A)[1]; 25 | *((T)+3)=(char) ((uchar *) &A)[0]; } 26 | 27 | static inline void float4get (float *V, const uchar *M) 28 | { float def_temp; 29 | ((uchar*) &def_temp)[0]=(M)[3]; 30 | ((uchar*) &def_temp)[1]=(M)[2]; 31 | ((uchar*) &def_temp)[2]=(M)[1]; 32 | ((uchar*) &def_temp)[3]=(M)[0]; 33 | (*V)=def_temp; } 34 | 35 | static inline void float8store(uchar *T, double V) 36 | { *(T)= ((uchar *) &V)[7]; 37 | *((T)+1)=(char) ((uchar *) &V)[6]; 38 | *((T)+2)=(char) ((uchar *) &V)[5]; 39 | *((T)+3)=(char) ((uchar *) &V)[4]; 40 | *((T)+4)=(char) ((uchar *) &V)[3]; 41 | *((T)+5)=(char) ((uchar *) &V)[2]; 42 | *((T)+6)=(char) ((uchar *) &V)[1]; 43 | *((T)+7)=(char) ((uchar *) &V)[0]; } 44 | 45 | static inline void float8get (double *V, const uchar *M) 46 | { double def_temp; 47 | ((uchar*) &def_temp)[0]=(M)[7]; 48 | ((uchar*) &def_temp)[1]=(M)[6]; 49 | ((uchar*) &def_temp)[2]=(M)[5]; 50 | ((uchar*) &def_temp)[3]=(M)[4]; 51 | ((uchar*) &def_temp)[4]=(M)[3]; 52 | ((uchar*) &def_temp)[5]=(M)[2]; 53 | ((uchar*) &def_temp)[6]=(M)[1]; 54 | ((uchar*) &def_temp)[7]=(M)[0]; 55 | (*V) = def_temp; } 56 | 57 | static inline void ushortget(uint16 *V, const uchar *pM) 58 | { *V = (uint16) (((uint16) ((uchar) (pM)[1]))+ 59 | ((uint16) ((uint16) (pM)[0]) << 8)); } 60 | static inline void shortget (int16 *V, const uchar *pM) 61 | { *V = (short) (((short) ((uchar) (pM)[1]))+ 62 | ((short) ((short) (pM)[0]) << 8)); } 63 | static inline void longget (int32 *V, const uchar *pM) 64 | { int32 def_temp; 65 | ((uchar*) &def_temp)[0]=(pM)[0]; 66 | ((uchar*) &def_temp)[1]=(pM)[1]; 67 | ((uchar*) &def_temp)[2]=(pM)[2]; 68 | ((uchar*) &def_temp)[3]=(pM)[3]; 69 | (*V)=def_temp; } 70 | static inline void ulongget (uint32 *V, const uchar *pM) 71 | { uint32 def_temp; 72 | ((uchar*) &def_temp)[0]=(pM)[0]; 73 | ((uchar*) &def_temp)[1]=(pM)[1]; 74 | ((uchar*) &def_temp)[2]=(pM)[2]; 75 | ((uchar*) &def_temp)[3]=(pM)[3]; 76 | (*V)=def_temp; } 77 | static inline void shortstore(uchar *T, int16 A) 78 | { uint def_temp=(uint) (A) ; 79 | *(((char*)T)+1)=(char)(def_temp); 80 | *(((char*)T)+0)=(char)(def_temp >> 8); } 81 | static inline void longstore (uchar *T, int32 A) 82 | { *(((char*)T)+3)=((A)); 83 | *(((char*)T)+2)=(((A) >> 8)); 84 | *(((char*)T)+1)=(((A) >> 16)); 85 | *(((char*)T)+0)=(((A) >> 24)); } 86 | 87 | static inline void floatget(float *V, const uchar *M) 88 | { 89 | memcpy(V, (M), sizeof(float)); 90 | } 91 | 92 | static inline void floatstore(uchar *T, float V) 93 | { 94 | memcpy((T), (&V), sizeof(float)); 95 | } 96 | 97 | static inline void doubleget(double *V, const uchar *M) 98 | { 99 | memcpy(V, (M), sizeof(double)); 100 | } 101 | 102 | static inline void doublestore(uchar *T, double V) 103 | { 104 | memcpy((T), &V, sizeof(double)); 105 | } 106 | 107 | static inline void longlongget(longlong *V, const uchar *M) 108 | { 109 | memcpy(V, (M), sizeof(ulonglong)); 110 | } 111 | static inline void longlongstore(uchar *T, longlong V) 112 | { 113 | memcpy((T), &V, sizeof(ulonglong)); 114 | } 115 | -------------------------------------------------------------------------------- /mysql/windows/include/byte_order_generic.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Endianness-independent definitions for architectures other 18 | than the x86 architecture. 19 | */ 20 | static inline int16 sint2korr(const uchar *A) 21 | { 22 | return 23 | (int16) (((int16) (A[0])) + 24 | ((int16) (A[1]) << 8)) 25 | ; 26 | } 27 | 28 | static inline int32 sint4korr(const uchar *A) 29 | { 30 | return 31 | (int32) (((int32) (A[0])) + 32 | (((int32) (A[1]) << 8)) + 33 | (((int32) (A[2]) << 16)) + 34 | (((int32) (A[3]) << 24))) 35 | ; 36 | } 37 | 38 | static inline uint16 uint2korr(const uchar *A) 39 | { 40 | return 41 | (uint16) (((uint16) (A[0])) + 42 | ((uint16) (A[1]) << 8)) 43 | ; 44 | } 45 | 46 | static inline uint32 uint4korr(const uchar *A) 47 | { 48 | return 49 | (uint32) (((uint32) (A[0])) + 50 | (((uint32) (A[1])) << 8) + 51 | (((uint32) (A[2])) << 16) + 52 | (((uint32) (A[3])) << 24)) 53 | ; 54 | } 55 | 56 | static inline ulonglong uint8korr(const uchar *A) 57 | { 58 | return 59 | ((ulonglong)(((uint32) (A[0])) + 60 | (((uint32) (A[1])) << 8) + 61 | (((uint32) (A[2])) << 16) + 62 | (((uint32) (A[3])) << 24)) + 63 | (((ulonglong) (((uint32) (A[4])) + 64 | (((uint32) (A[5])) << 8) + 65 | (((uint32) (A[6])) << 16) + 66 | (((uint32) (A[7])) << 24))) << 67 | 32)) 68 | ; 69 | } 70 | 71 | static inline longlong sint8korr(const uchar *A) 72 | { 73 | return (longlong) uint8korr(A); 74 | } 75 | 76 | static inline void int2store(uchar *T, uint16 A) 77 | { 78 | uint def_temp= A ; 79 | *(T)= (uchar)(def_temp); 80 | *(T+1)= (uchar)(def_temp >> 8); 81 | } 82 | 83 | static inline void int4store(uchar *T, uint32 A) 84 | { 85 | *(T)= (uchar) (A); 86 | *(T+1)=(uchar) (A >> 8); 87 | *(T+2)=(uchar) (A >> 16); 88 | *(T+3)=(uchar) (A >> 24); 89 | } 90 | 91 | static inline void int8store(uchar *T, ulonglong A) 92 | { 93 | uint def_temp= (uint) A, 94 | def_temp2= (uint) (A >> 32); 95 | int4store(T, def_temp); 96 | int4store(T+4,def_temp2); 97 | } 98 | -------------------------------------------------------------------------------- /mysql/windows/include/byte_order_generic_x86.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Optimized functions for the x86 architecture (_WIN32 included). 18 | */ 19 | static inline int16 sint2korr(const uchar *A) { return *((int16*) A); } 20 | 21 | static inline int32 sint4korr(const uchar *A) { return *((int32*) A); } 22 | 23 | static inline uint16 uint2korr(const uchar *A) { return *((uint16*) A); } 24 | 25 | static inline uint32 uint4korr(const uchar *A) { return *((uint32*) A); } 26 | 27 | static inline ulonglong uint8korr(const uchar *A) { return *((ulonglong*) A);} 28 | static inline longlong sint8korr(const uchar *A) { return *((longlong*) A); } 29 | 30 | static inline void int2store(uchar *T, uint16 A) 31 | { 32 | *((uint16*) T)= A; 33 | } 34 | 35 | static inline void int4store(uchar *T, uint32 A) 36 | { 37 | *((uint32*) T)= A; 38 | } 39 | 40 | static inline void int8store(uchar *T, ulonglong A) 41 | { 42 | *((ulonglong*) T)= A; 43 | } 44 | -------------------------------------------------------------------------------- /mysql/windows/include/decimal.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef _decimal_h 17 | #define _decimal_h 18 | 19 | typedef enum 20 | {TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR} 21 | decimal_round_mode; 22 | typedef int32 decimal_digit_t; 23 | 24 | /** 25 | intg is the number of *decimal* digits (NOT number of decimal_digit_t's !) 26 | before the point 27 | frac is the number of decimal digits after the point 28 | len is the length of buf (length of allocated space) in decimal_digit_t's, 29 | not in bytes 30 | sign false means positive, true means negative 31 | buf is an array of decimal_digit_t's 32 | */ 33 | typedef struct st_decimal_t { 34 | int intg, frac, len; 35 | my_bool sign; 36 | decimal_digit_t *buf; 37 | } decimal_t; 38 | 39 | int internal_str2dec(const char *from, decimal_t *to, char **end, 40 | my_bool fixed); 41 | int decimal2string(const decimal_t *from, char *to, int *to_len, 42 | int fixed_precision, int fixed_decimals, 43 | char filler); 44 | int decimal2ulonglong(decimal_t *from, ulonglong *to); 45 | int ulonglong2decimal(ulonglong from, decimal_t *to); 46 | int decimal2longlong(decimal_t *from, longlong *to); 47 | int longlong2decimal(longlong from, decimal_t *to); 48 | int decimal2double(const decimal_t *from, double *to); 49 | int double2decimal(double from, decimal_t *to); 50 | int decimal_actual_fraction(decimal_t *from); 51 | int decimal2bin(decimal_t *from, uchar *to, int precision, int scale); 52 | int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale); 53 | 54 | /** 55 | Convert decimal to lldiv_t. 56 | The integer part is stored in to->quot. 57 | The fractional part is multiplied to 10^9 and stored to to->rem. 58 | @param from Decimal value 59 | @param to lldiv_t value 60 | @retval 0 on success 61 | @retval !0 in error 62 | */ 63 | int decimal2lldiv_t(const decimal_t *from, lldiv_t *to); 64 | 65 | /** 66 | Convert doube to lldiv_t. 67 | The integer part is stored in to->quot. 68 | The fractional part is multiplied to 10^9 and stored to to->rem. 69 | @param from Decimal value 70 | @param to lldiv_t value 71 | @retval 0 on success 72 | @retval !0 in error 73 | */ 74 | 75 | int double2lldiv_t(double from, lldiv_t *to); 76 | int decimal_size(int precision, int scale); 77 | int decimal_bin_size(int precision, int scale); 78 | int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, 79 | int param); 80 | 81 | int decimal_intg(const decimal_t *from); 82 | int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to); 83 | int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to); 84 | int decimal_cmp(const decimal_t *from1, const decimal_t *from2); 85 | int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to); 86 | int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, 87 | int scale_incr); 88 | int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to); 89 | int decimal_round(const decimal_t *from, decimal_t *to, int new_scale, 90 | decimal_round_mode mode); 91 | int decimal_is_zero(const decimal_t *from); 92 | void max_decimal(int precision, int frac, decimal_t *to); 93 | 94 | #define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0) 95 | #define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1) 96 | 97 | /* set a decimal_t to zero */ 98 | 99 | #define decimal_make_zero(dec) do { \ 100 | (dec)->buf[0]=0; \ 101 | (dec)->intg=1; \ 102 | (dec)->frac=0; \ 103 | (dec)->sign=0; \ 104 | } while(0) 105 | 106 | /* 107 | returns the length of the buffer to hold string representation 108 | of the decimal (including decimal dot, possible sign and \0) 109 | */ 110 | 111 | #define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \ 112 | (dec)->frac + ((dec)->frac > 0) + 2) 113 | 114 | /* negate a decimal */ 115 | #define decimal_neg(dec) do { (dec)->sign^=1; } while(0) 116 | 117 | /* 118 | conventions: 119 | 120 | decimal_smth() == 0 -- everything's ok 121 | decimal_smth() <= 1 -- result is usable, but precision loss is possible 122 | decimal_smth() <= 2 -- result can be unusable, most significant digits 123 | could've been lost 124 | decimal_smth() > 2 -- no result was generated 125 | */ 126 | 127 | #define E_DEC_OK 0 128 | #define E_DEC_TRUNCATED 1 129 | #define E_DEC_OVERFLOW 2 130 | #define E_DEC_DIV_ZERO 4 131 | #define E_DEC_BAD_NUM 8 132 | #define E_DEC_OOM 16 133 | 134 | #define E_DEC_ERROR 31 135 | #define E_DEC_FATAL_ERROR 30 136 | 137 | #endif 138 | 139 | -------------------------------------------------------------------------------- /mysql/windows/include/errmsg.h: -------------------------------------------------------------------------------- 1 | #ifndef ERRMSG_INCLUDED 2 | #define ERRMSG_INCLUDED 3 | 4 | /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 18 | 19 | /* Error messages for MySQL clients */ 20 | /* (Error messages for the daemon are in sql/share/errmsg.txt) */ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | void init_client_errs(void); 26 | void finish_client_errs(void); 27 | extern const char *client_errors[]; /* Error messages */ 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #define CR_MIN_ERROR 2000 /* For easier client code */ 33 | #define CR_MAX_ERROR 2999 34 | #if !defined(ER) 35 | #define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \ 36 | client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR]) 37 | 38 | #endif 39 | #define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ 40 | 41 | /* Do not add error numbers before CR_ERROR_FIRST. */ 42 | /* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */ 43 | #define CR_ERROR_FIRST 2000 /*Copy first error nr.*/ 44 | #define CR_UNKNOWN_ERROR 2000 45 | #define CR_SOCKET_CREATE_ERROR 2001 46 | #define CR_CONNECTION_ERROR 2002 47 | #define CR_CONN_HOST_ERROR 2003 48 | #define CR_IPSOCK_ERROR 2004 49 | #define CR_UNKNOWN_HOST 2005 50 | #define CR_SERVER_GONE_ERROR 2006 51 | #define CR_VERSION_ERROR 2007 52 | #define CR_OUT_OF_MEMORY 2008 53 | #define CR_WRONG_HOST_INFO 2009 54 | #define CR_LOCALHOST_CONNECTION 2010 55 | #define CR_TCP_CONNECTION 2011 56 | #define CR_SERVER_HANDSHAKE_ERR 2012 57 | #define CR_SERVER_LOST 2013 58 | #define CR_COMMANDS_OUT_OF_SYNC 2014 59 | #define CR_NAMEDPIPE_CONNECTION 2015 60 | #define CR_NAMEDPIPEWAIT_ERROR 2016 61 | #define CR_NAMEDPIPEOPEN_ERROR 2017 62 | #define CR_NAMEDPIPESETSTATE_ERROR 2018 63 | #define CR_CANT_READ_CHARSET 2019 64 | #define CR_NET_PACKET_TOO_LARGE 2020 65 | #define CR_EMBEDDED_CONNECTION 2021 66 | #define CR_PROBE_SLAVE_STATUS 2022 67 | #define CR_PROBE_SLAVE_HOSTS 2023 68 | #define CR_PROBE_SLAVE_CONNECT 2024 69 | #define CR_PROBE_MASTER_CONNECT 2025 70 | #define CR_SSL_CONNECTION_ERROR 2026 71 | #define CR_MALFORMED_PACKET 2027 72 | #define CR_WRONG_LICENSE 2028 73 | 74 | /* new 4.1 error codes */ 75 | #define CR_NULL_POINTER 2029 76 | #define CR_NO_PREPARE_STMT 2030 77 | #define CR_PARAMS_NOT_BOUND 2031 78 | #define CR_DATA_TRUNCATED 2032 79 | #define CR_NO_PARAMETERS_EXISTS 2033 80 | #define CR_INVALID_PARAMETER_NO 2034 81 | #define CR_INVALID_BUFFER_USE 2035 82 | #define CR_UNSUPPORTED_PARAM_TYPE 2036 83 | 84 | #define CR_SHARED_MEMORY_CONNECTION 2037 85 | #define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038 86 | #define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039 87 | #define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040 88 | #define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041 89 | #define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042 90 | #define CR_SHARED_MEMORY_MAP_ERROR 2043 91 | #define CR_SHARED_MEMORY_EVENT_ERROR 2044 92 | #define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 93 | #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 94 | #define CR_CONN_UNKNOW_PROTOCOL 2047 95 | #define CR_INVALID_CONN_HANDLE 2048 96 | #define CR_UNUSED_1 2049 97 | #define CR_FETCH_CANCELED 2050 98 | #define CR_NO_DATA 2051 99 | #define CR_NO_STMT_METADATA 2052 100 | #define CR_NO_RESULT_SET 2053 101 | #define CR_NOT_IMPLEMENTED 2054 102 | #define CR_SERVER_LOST_EXTENDED 2055 103 | #define CR_STMT_CLOSED 2056 104 | #define CR_NEW_STMT_METADATA 2057 105 | #define CR_ALREADY_CONNECTED 2058 106 | #define CR_AUTH_PLUGIN_CANNOT_LOAD 2059 107 | #define CR_DUPLICATE_CONNECTION_ATTR 2060 108 | #define CR_AUTH_PLUGIN_ERR 2061 109 | #define CR_ERROR_LAST /*Copy last error nr:*/ 2061 110 | /* Add error numbers before CR_ERROR_LAST and change it accordingly. */ 111 | 112 | #endif /* ERRMSG_INCLUDED */ 113 | -------------------------------------------------------------------------------- /mysql/windows/include/little_endian.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Data in little-endian format. 18 | */ 19 | 20 | #include 21 | 22 | static inline void float4get (float *V, const uchar *M) 23 | { 24 | memcpy(V, (M), sizeof(float)); 25 | } 26 | 27 | static inline void float4store(uchar *V, float M) 28 | { 29 | memcpy(V, (&M), sizeof(float)); 30 | } 31 | 32 | static inline void float8get (double *V, const uchar *M) 33 | { 34 | memcpy(V, M, sizeof(double)); 35 | } 36 | 37 | static inline void float8store(uchar *V, double M) 38 | { 39 | memcpy(V, &M, sizeof(double)); 40 | } 41 | 42 | static inline void floatget (float *V, const uchar *M) { float4get(V, M); } 43 | static inline void floatstore (uchar *V, float M) { float4store(V, M); } 44 | 45 | /* Bi-endian hardware.... */ 46 | #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) 47 | static inline void doublestore(uchar *T, double V) 48 | { *(((char*)T)+0)=(char) ((uchar *) &V)[4]; 49 | *(((char*)T)+1)=(char) ((uchar *) &V)[5]; 50 | *(((char*)T)+2)=(char) ((uchar *) &V)[6]; 51 | *(((char*)T)+3)=(char) ((uchar *) &V)[7]; 52 | *(((char*)T)+4)=(char) ((uchar *) &V)[0]; 53 | *(((char*)T)+5)=(char) ((uchar *) &V)[1]; 54 | *(((char*)T)+6)=(char) ((uchar *) &V)[2]; 55 | *(((char*)T)+7)=(char) ((uchar *) &V)[3]; } 56 | static inline void doubleget(double *V, const uchar *M) 57 | { double def_temp; 58 | ((uchar*) &def_temp)[0]=(M)[4]; 59 | ((uchar*) &def_temp)[1]=(M)[5]; 60 | ((uchar*) &def_temp)[2]=(M)[6]; 61 | ((uchar*) &def_temp)[3]=(M)[7]; 62 | ((uchar*) &def_temp)[4]=(M)[0]; 63 | ((uchar*) &def_temp)[5]=(M)[1]; 64 | ((uchar*) &def_temp)[6]=(M)[2]; 65 | ((uchar*) &def_temp)[7]=(M)[3]; 66 | (*V) = def_temp; } 67 | 68 | #else /* Bi-endian hardware.... */ 69 | 70 | static inline void doublestore(uchar *T, double V) { memcpy(T, &V, sizeof(double)); } 71 | static inline void doubleget (double *V, const uchar *M) { memcpy(V, M, sizeof(double)); } 72 | 73 | #endif /* Bi-endian hardware.... */ 74 | 75 | static inline void ushortget(uint16 *V, const uchar *pM) { *V= uint2korr(pM); } 76 | static inline void shortget (int16 *V, const uchar *pM) { *V= sint2korr(pM); } 77 | static inline void longget (int32 *V, const uchar *pM) { *V= sint4korr(pM); } 78 | static inline void ulongget (uint32 *V, const uchar *pM) { *V= uint4korr(pM); } 79 | static inline void shortstore(uchar *T, int16 V) { int2store(T, V); } 80 | static inline void longstore (uchar *T, int32 V) { int4store(T, V); } 81 | 82 | static inline void longlongget(longlong *V, const uchar *M) 83 | { 84 | memcpy(V, (M), sizeof(ulonglong)); 85 | } 86 | static inline void longlongstore(uchar *T, longlong V) 87 | { 88 | memcpy((T), &V, sizeof(ulonglong)); 89 | } 90 | -------------------------------------------------------------------------------- /mysql/windows/include/my_alloc.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Data structures for mysys/my_alloc.c (root memory allocator) 18 | */ 19 | 20 | #ifndef _my_alloc_h 21 | #define _my_alloc_h 22 | 23 | #define ALLOC_MAX_BLOCK_TO_DROP 4096 24 | #define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10 25 | 26 | /* PSI_memory_key */ 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | typedef struct st_used_mem 34 | { /* struct for once_alloc (block) */ 35 | struct st_used_mem *next; /* Next block in use */ 36 | unsigned int left; /* memory left in block */ 37 | unsigned int size; /* size of block */ 38 | } USED_MEM; 39 | 40 | 41 | typedef struct st_mem_root 42 | { 43 | USED_MEM *free; /* blocks with free memory in it */ 44 | USED_MEM *used; /* blocks almost without free memory */ 45 | USED_MEM *pre_alloc; /* preallocated block */ 46 | /* if block have less memory it will be put in 'used' list */ 47 | size_t min_malloc; 48 | size_t block_size; /* initial block size */ 49 | unsigned int block_num; /* allocated blocks counter */ 50 | /* 51 | first free block in queue test counter (if it exceed 52 | MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) 53 | */ 54 | unsigned int first_block_usage; 55 | 56 | void (*error_handler)(void); 57 | 58 | PSI_memory_key m_psi_key; 59 | } MEM_ROOT; 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /mysql/windows/include/my_compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef MY_COMPILER_INCLUDED 2 | #define MY_COMPILER_INCLUDED 3 | 4 | /* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 18 | 19 | /** 20 | Header for compiler-dependent features. 21 | 22 | Intended to contain a set of reusable wrappers for preprocessor 23 | macros, attributes, pragmas, and any other features that are 24 | specific to a target compiler. 25 | */ 26 | 27 | #include /* size_t */ 28 | 29 | #if defined __GNUC__ 30 | /* 31 | Convenience macro to test the minimum required GCC version. 32 | These should be used with care as Clang also sets __GNUC__ and 33 | __GNUC_MINOR__ (currently to 4.2). Prefer using feature specific 34 | CMake checks in configure.cmake instead. 35 | */ 36 | # define MY_GNUC_PREREQ(maj, min) \ 37 | ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) 38 | # define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) 39 | #else 40 | # define MY_GNUC_PREREQ(maj, min) (0) 41 | #endif 42 | 43 | /* 44 | The macros below are borrowed from include/linux/compiler.h in the 45 | Linux kernel. Use them to indicate the likelyhood of the truthfulness 46 | of a condition. This serves two purposes - newer versions of gcc will be 47 | able to optimize for branch predication, which could yield siginficant 48 | performance gains in frequently executed sections of the code, and the 49 | other reason to use them is for documentation 50 | */ 51 | #ifdef HAVE_BUILTIN_EXPECT 52 | 53 | // likely/unlikely are likely to clash with other symbols, do not #define 54 | #if defined(__cplusplus) 55 | inline bool likely(bool expr) 56 | { 57 | return __builtin_expect(expr, true); 58 | } 59 | inline bool unlikely(bool expr) 60 | { 61 | return __builtin_expect(expr, false); 62 | } 63 | #else 64 | # define likely(x) __builtin_expect((x),1) 65 | # define unlikely(x) __builtin_expect((x),0) 66 | #endif 67 | 68 | #else /* HAVE_BUILTIN_EXPECT */ 69 | 70 | #if defined(__cplusplus) 71 | inline bool likely(bool expr) 72 | { 73 | return expr; 74 | } 75 | inline bool unlikely(bool expr) 76 | { 77 | return expr; 78 | } 79 | #else 80 | # define likely(x) (x) 81 | # define unlikely(x) (x) 82 | #endif 83 | 84 | #endif /* HAVE_BUILTIN_EXPECT */ 85 | 86 | /* Comunicate to the compiler the unreachability of the code. */ 87 | #ifdef HAVE_BUILTIN_UNREACHABLE 88 | # define MY_ASSERT_UNREACHABLE() __builtin_unreachable() 89 | #else 90 | # define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0) 91 | #endif 92 | 93 | #if defined __GNUC__ || defined __SUNPRO_C || defined __SUNPRO_CC 94 | /* Specifies the minimum alignment of a type. */ 95 | # define MY_ALIGNOF(type) __alignof__(type) 96 | /* Determine the alignment requirement of a type. */ 97 | # define MY_ALIGNED(n) __attribute__((__aligned__((n)))) 98 | /* Microsoft Visual C++ */ 99 | #elif defined _MSC_VER 100 | # define MY_ALIGNOF(type) __alignof(type) 101 | # define MY_ALIGNED(n) __declspec(align(n)) 102 | #else /* Make sure they are defined for other compilers. */ 103 | # define MY_ALIGNOF(type) 104 | # define MY_ALIGNED(size) 105 | #endif 106 | 107 | /* Visual Studio requires '__inline' for C code */ 108 | #if !defined(__cplusplus) && defined(_MSC_VER) 109 | # define inline __inline 110 | #endif 111 | 112 | /* Provide __func__ macro definition for Visual Studio. */ 113 | #if defined(_MSC_VER) 114 | # define __func__ __FUNCTION__ 115 | #endif 116 | 117 | /** 118 | C++ Type Traits 119 | */ 120 | #ifdef __cplusplus 121 | 122 | /** 123 | Opaque storage with a particular alignment. 124 | Partial specialization used due to MSVC++. 125 | */ 126 | template struct my_alignment_imp; 127 | template<> struct MY_ALIGNED(1) my_alignment_imp<1> {}; 128 | template<> struct MY_ALIGNED(2) my_alignment_imp<2> {}; 129 | template<> struct MY_ALIGNED(4) my_alignment_imp<4> {}; 130 | template<> struct MY_ALIGNED(8) my_alignment_imp<8> {}; 131 | template<> struct MY_ALIGNED(16) my_alignment_imp<16> {}; 132 | 133 | /** 134 | A POD type with a given size and alignment. 135 | 136 | @remark If the compiler does not support a alignment attribute 137 | (MY_ALIGN macro), the default alignment of a double is 138 | used instead. 139 | 140 | @tparam size The minimum size. 141 | @tparam alignment The desired alignment: 1, 2, 4, 8 or 16. 142 | */ 143 | template 144 | struct my_aligned_storage 145 | { 146 | union 147 | { 148 | char data[size]; 149 | my_alignment_imp align; 150 | }; 151 | }; 152 | 153 | #endif /* __cplusplus */ 154 | 155 | /* 156 | Disable __attribute__ for Sun Studio and Visual Studio. 157 | Note that Sun Studio supports some __attribute__ variants, 158 | but not format or unused which we use quite a lot. 159 | 160 | Sic: We should not (re-)define identifiers that begin with 161 | an underscore followed by an uppercase letter or another underscore. 162 | */ 163 | #if defined __SUNPRO_C || defined __SUNPRO_CC || defined _MSC_VER 164 | # define __attribute__(A) 165 | #endif 166 | 167 | #endif /* MY_COMPILER_INCLUDED */ 168 | -------------------------------------------------------------------------------- /mysql/windows/include/my_dir.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MY_DIR_H 17 | #define MY_DIR_H 18 | 19 | #include "my_global.h" 20 | 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Defines for my_dir and my_stat */ 28 | 29 | #ifdef _WIN32 30 | #define S_IROTH _S_IREAD 31 | #define S_IFIFO _S_IFIFO 32 | #endif 33 | 34 | #define MY_S_IFMT S_IFMT /* type of file */ 35 | #define MY_S_IFDIR S_IFDIR /* directory */ 36 | #define MY_S_IFCHR S_IFCHR /* character special */ 37 | #define MY_S_IFBLK S_IFBLK /* block special */ 38 | #define MY_S_IFREG S_IFREG /* regular */ 39 | #define MY_S_IFIFO S_IFIFO /* fifo */ 40 | #define MY_S_ISUID S_ISUID /* set user id on execution */ 41 | #define MY_S_ISGID S_ISGID /* set group id on execution */ 42 | #define MY_S_ISVTX S_ISVTX /* save swapped text even after use */ 43 | #define MY_S_IREAD S_IREAD /* read permission, owner */ 44 | #define MY_S_IWRITE S_IWRITE /* write permission, owner */ 45 | #define MY_S_IEXEC S_IEXEC /* execute/search permission, owner */ 46 | 47 | #define MY_S_ISDIR(m) (((m) & MY_S_IFMT) == MY_S_IFDIR) 48 | #define MY_S_ISCHR(m) (((m) & MY_S_IFMT) == MY_S_IFCHR) 49 | #define MY_S_ISBLK(m) (((m) & MY_S_IFMT) == MY_S_IFBLK) 50 | #define MY_S_ISREG(m) (((m) & MY_S_IFMT) == MY_S_IFREG) 51 | #define MY_S_ISFIFO(m) (((m) & MY_S_IFMT) == MY_S_IFIFO) 52 | 53 | #define MY_DONT_SORT 512 /* my_lib; Don't sort files */ 54 | #define MY_WANT_STAT 1024 /* my_lib; stat files */ 55 | 56 | /* typedefs for my_dir & my_stat */ 57 | 58 | #if(_MSC_VER) 59 | #define MY_STAT struct _stati64 /* 64 bit file size */ 60 | #else 61 | #define MY_STAT struct stat /* Orginal struct have what we need */ 62 | #endif 63 | 64 | /* Struct describing one file returned from my_dir */ 65 | typedef struct fileinfo 66 | { 67 | char *name; 68 | MY_STAT *mystat; 69 | } FILEINFO; 70 | 71 | typedef struct st_my_dir /* Struct returned from my_dir */ 72 | { 73 | /* 74 | These members are just copies of parts of DYNAMIC_ARRAY structure, 75 | which is allocated right after the end of MY_DIR structure (MEM_ROOT 76 | for storing names is also resides there). We've left them here because 77 | we don't want to change code that uses my_dir. 78 | */ 79 | struct fileinfo *dir_entry; 80 | uint number_off_files; 81 | } MY_DIR; 82 | 83 | extern MY_DIR *my_dir(const char *path,myf MyFlags); 84 | extern void my_dirend(MY_DIR *buffer); 85 | extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags); 86 | extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags); 87 | 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | 92 | #endif /* MY_DIR_H */ 93 | 94 | -------------------------------------------------------------------------------- /mysql/windows/include/my_list.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef _list_h_ 17 | #define _list_h_ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef struct st_list { 24 | struct st_list *prev,*next; 25 | void *data; 26 | } LIST; 27 | 28 | typedef int (*list_walk_action)(void *,void *); 29 | 30 | extern LIST *list_add(LIST *root,LIST *element); 31 | extern LIST *list_delete(LIST *root,LIST *element); 32 | extern LIST *list_cons(void *data,LIST *root); 33 | extern LIST *list_reverse(LIST *root); 34 | extern void list_free(LIST *root,unsigned int free_data); 35 | extern unsigned int list_length(LIST *); 36 | extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); 37 | 38 | #define list_rest(a) ((a)->next) 39 | #define list_push(a,b) (a)=list_cons((b),(a)) 40 | #define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); } 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /mysql/windows/include/my_xml.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 15 | 16 | 17 | #ifndef _my_xml_h 18 | #define _my_xml_h 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | 25 | #define MY_XML_OK 0 26 | #define MY_XML_ERROR 1 27 | 28 | /* 29 | A flag whether to use absolute tag names in call-back functions, 30 | like "a", "a.b" and "a.b.c" (used in character set file parser), 31 | or relative names like "a", "b" and "c". 32 | */ 33 | #define MY_XML_FLAG_RELATIVE_NAMES 1 34 | 35 | /* 36 | A flag whether to skip normilization of text values before calling 37 | call-back functions: i.e. skip leading/trailing spaces, 38 | \r, \n, \t characters. 39 | */ 40 | #define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2 41 | 42 | enum my_xml_node_type 43 | { 44 | MY_XML_NODE_TAG, /* can have TAG, ATTR and TEXT children */ 45 | MY_XML_NODE_ATTR, /* can have TEXT children */ 46 | MY_XML_NODE_TEXT /* cannot have children */ 47 | }; 48 | 49 | typedef struct xml_stack_st 50 | { 51 | int flags; 52 | enum my_xml_node_type current_node_type; 53 | char errstr[128]; 54 | 55 | struct { 56 | char static_buffer[128]; 57 | char *buffer; 58 | size_t buffer_size; 59 | char *start; 60 | char *end; 61 | } attr; 62 | 63 | const char *beg; 64 | const char *cur; 65 | const char *end; 66 | void *user_data; 67 | int (*enter)(struct xml_stack_st *st,const char *val, size_t len); 68 | int (*value)(struct xml_stack_st *st,const char *val, size_t len); 69 | int (*leave_xml)(struct xml_stack_st *st,const char *val, size_t len); 70 | } MY_XML_PARSER; 71 | 72 | void my_xml_parser_create(MY_XML_PARSER *st); 73 | void my_xml_parser_free(MY_XML_PARSER *st); 74 | int my_xml_parse(MY_XML_PARSER *st,const char *str, size_t len); 75 | 76 | void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, 77 | const char *, 78 | size_t len)); 79 | void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, 80 | const char *, 81 | size_t len)); 82 | void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, 83 | const char *, 84 | size_t len)); 85 | void my_xml_set_user_data(MY_XML_PARSER *st, void *); 86 | 87 | size_t my_xml_error_pos(MY_XML_PARSER *st); 88 | uint my_xml_error_lineno(MY_XML_PARSER *st); 89 | 90 | const char *my_xml_error_string(MY_XML_PARSER *st); 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* _my_xml_h */ 97 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/client_authentication.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | #ifndef CLIENT_AUTHENTICATION_H 16 | #define CLIENT_AUTHENTICATION_H 17 | #include 18 | #include "mysql.h" 19 | #include "mysql/client_plugin.h" 20 | 21 | C_MODE_START 22 | int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql); 23 | int sha256_password_init(char *, size_t, int, va_list); 24 | int sha256_password_deinit(void); 25 | C_MODE_END 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/client_plugin.h.pp: -------------------------------------------------------------------------------- 1 | struct st_mysql_client_plugin 2 | { 3 | int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *); 4 | }; 5 | struct st_mysql; 6 | #include 7 | typedef struct st_plugin_vio_info 8 | { 9 | enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, 10 | MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; 11 | int socket; 12 | } MYSQL_PLUGIN_VIO_INFO; 13 | typedef struct st_plugin_vio 14 | { 15 | int (*read_packet)(struct st_plugin_vio *vio, 16 | unsigned char **buf); 17 | int (*write_packet)(struct st_plugin_vio *vio, 18 | const unsigned char *packet, 19 | int packet_len); 20 | void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); 21 | } MYSQL_PLUGIN_VIO; 22 | struct st_mysql_client_plugin_AUTHENTICATION 23 | { 24 | int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *); 25 | int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); 26 | }; 27 | struct st_mysql_client_plugin * 28 | mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, 29 | int argc, ...); 30 | struct st_mysql_client_plugin * 31 | mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type, 32 | int argc, va_list args); 33 | struct st_mysql_client_plugin * 34 | mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type); 35 | struct st_mysql_client_plugin * 36 | mysql_client_register_plugin(struct st_mysql *mysql, 37 | struct st_mysql_client_plugin *plugin); 38 | int mysql_plugin_options(struct st_mysql_client_plugin *plugin, 39 | const char *option, const void *value); 40 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/get_password.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | ** Ask for a password from tty 18 | ** This is an own file to avoid conflicts with curses 19 | */ 20 | 21 | #ifndef MYSQL_GET_PASSWORD_H_INCLUDED 22 | #define MYSQL_GET_PASSWORD_H_INCLUDED 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | typedef char *(* strdup_handler_t)(const char *, int); 29 | char *get_tty_password_ext(const char *opt_message, 30 | strdup_handler_t strdup_function); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* ! MYSQL_GET_PASSWORD_H_INCLUDED */ 37 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/plugin_auth_common.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED 2 | /* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; version 2 of the License. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 16 | 17 | /** 18 | @file 19 | 20 | This file defines constants and data structures that are the same for 21 | both client- and server-side authentication plugins. 22 | */ 23 | #define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED 24 | 25 | /** the max allowed length for a user name */ 26 | #define MYSQL_USERNAME_LENGTH 48 27 | 28 | /** 29 | return values of the plugin authenticate_user() method. 30 | */ 31 | 32 | /** 33 | Authentication failed, plugin internal error. 34 | An error occurred in the authentication plugin itself. 35 | These errors are reported in table performance_schema.host_cache, 36 | column COUNT_AUTH_PLUGIN_ERRORS. 37 | */ 38 | #define CR_AUTH_PLUGIN_ERROR 3 39 | /** 40 | Authentication failed, client server handshake. 41 | An error occurred during the client server handshake. 42 | These errors are reported in table performance_schema.host_cache, 43 | column COUNT_HANDSHAKE_ERRORS. 44 | */ 45 | #define CR_AUTH_HANDSHAKE 2 46 | /** 47 | Authentication failed, user credentials. 48 | For example, wrong passwords. 49 | These errors are reported in table performance_schema.host_cache, 50 | column COUNT_AUTHENTICATION_ERRORS. 51 | */ 52 | #define CR_AUTH_USER_CREDENTIALS 1 53 | /** 54 | Authentication failed. Additionally, all other CR_xxx values 55 | (libmysql error code) can be used too. 56 | 57 | The client plugin may set the error code and the error message directly 58 | in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error 59 | code was returned, an error message in the MYSQL structure will be 60 | overwritten. If CR_ERROR is returned without setting the error in MYSQL, 61 | CR_UNKNOWN_ERROR will be user. 62 | */ 63 | #define CR_ERROR 0 64 | /** 65 | Authentication (client part) was successful. It does not mean that the 66 | authentication as a whole was successful, usually it only means 67 | that the client was able to send the user name and the password to the 68 | server. If CR_OK is returned, the libmysql reads the next packet expecting 69 | it to be one of OK, ERROR, or CHANGE_PLUGIN packets. 70 | */ 71 | #define CR_OK -1 72 | /** 73 | Authentication was successful. 74 | It means that the client has done its part successfully and also that 75 | a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN). 76 | In this case, libmysql will not read a packet from the server, 77 | but it will use the data at mysql->net.read_pos. 78 | 79 | A plugin may return this value if the number of roundtrips in the 80 | authentication protocol is not known in advance, and the client plugin 81 | needs to read one packet more to determine if the authentication is finished 82 | or not. 83 | */ 84 | #define CR_OK_HANDSHAKE_COMPLETE -2 85 | 86 | /* 87 | We need HANDLE definition if on Windows. Define WIN32_LEAN_AND_MEAN (if 88 | not already done) to minimize amount of imported declarations. 89 | */ 90 | #ifdef _WIN32 91 | #ifndef WIN32_LEAN_AND_MEAN 92 | #define WIN32_LEAN_AND_MEAN 93 | #endif 94 | #include 95 | #endif 96 | 97 | typedef struct st_plugin_vio_info 98 | { 99 | enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, 100 | MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; 101 | int socket; /**< it's set, if the protocol is SOCKET or TCP */ 102 | #ifdef _WIN32 103 | HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */ 104 | #endif 105 | } MYSQL_PLUGIN_VIO_INFO; 106 | 107 | /** 108 | Provides plugin access to communication channel 109 | */ 110 | typedef struct st_plugin_vio 111 | { 112 | /** 113 | Plugin provides a pointer reference and this function sets it to the 114 | contents of any incoming packet. Returns the packet length, or -1 if 115 | the plugin should terminate. 116 | */ 117 | int (*read_packet)(struct st_plugin_vio *vio, 118 | unsigned char **buf); 119 | 120 | /** 121 | Plugin provides a buffer with data and the length and this 122 | function sends it as a packet. Returns 0 on success, 1 on failure. 123 | */ 124 | int (*write_packet)(struct st_plugin_vio *vio, 125 | const unsigned char *packet, 126 | int packet_len); 127 | 128 | /** 129 | Fills in a st_plugin_vio_info structure, providing the information 130 | about the connection. 131 | */ 132 | void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); 133 | 134 | } MYSQL_PLUGIN_VIO; 135 | 136 | #endif 137 | 138 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/psi/mysql_idle.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_IDLE_H 17 | #define MYSQL_IDLE_H 18 | 19 | /** 20 | @file mysql/psi/mysql_idle.h 21 | Instrumentation helpers for idle waits. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_IDLE_CALL 27 | #define PSI_IDLE_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Idle_instrumentation Idle Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def MYSQL_START_IDLE_WAIT 38 | Instrumentation helper for table io_waits. 39 | This instrumentation marks the start of a wait event. 40 | @param LOCKER the locker 41 | @param STATE the locker state 42 | @sa MYSQL_END_IDLE_WAIT. 43 | */ 44 | #ifdef HAVE_PSI_IDLE_INTERFACE 45 | #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \ 46 | LOCKER= inline_mysql_start_idle_wait(STATE, __FILE__, __LINE__) 47 | #else 48 | #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \ 49 | do {} while (0) 50 | #endif 51 | 52 | /** 53 | @def MYSQL_END_IDLE_WAIT 54 | Instrumentation helper for idle waits. 55 | This instrumentation marks the end of a wait event. 56 | @param LOCKER the locker 57 | @sa MYSQL_START_IDLE_WAIT. 58 | */ 59 | #ifdef HAVE_PSI_IDLE_INTERFACE 60 | #define MYSQL_END_IDLE_WAIT(LOCKER) \ 61 | inline_mysql_end_idle_wait(LOCKER) 62 | #else 63 | #define MYSQL_END_IDLE_WAIT(LOCKER) \ 64 | do {} while (0) 65 | #endif 66 | 67 | #ifdef HAVE_PSI_IDLE_INTERFACE 68 | /** 69 | Instrumentation calls for MYSQL_START_IDLE_WAIT. 70 | @sa MYSQL_END_IDLE_WAIT. 71 | */ 72 | static inline struct PSI_idle_locker * 73 | inline_mysql_start_idle_wait(PSI_idle_locker_state *state, 74 | const char *src_file, int src_line) 75 | { 76 | struct PSI_idle_locker *locker; 77 | locker= PSI_IDLE_CALL(start_idle_wait)(state, src_file, src_line); 78 | return locker; 79 | } 80 | 81 | /** 82 | Instrumentation calls for MYSQL_END_IDLE_WAIT. 83 | @sa MYSQL_START_IDLE_WAIT. 84 | */ 85 | static inline void 86 | inline_mysql_end_idle_wait(struct PSI_idle_locker *locker) 87 | { 88 | if (likely(locker != NULL)) 89 | PSI_IDLE_CALL(end_idle_wait)(locker); 90 | } 91 | #endif 92 | 93 | /** @} (end of group Idle_instrumentation) */ 94 | 95 | #endif 96 | 97 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/psi/mysql_mdl.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_MDL_H 17 | #define MYSQL_MDL_H 18 | 19 | /** 20 | @file mysql/psi/mysql_mdl.h 21 | Instrumentation helpers for metadata locks. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_METADATA_CALL 27 | #define PSI_METADATA_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Thread_instrumentation Metadata Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def mysql_mdl_create(K, M, A) 38 | Instrumented metadata lock creation. 39 | @param I Metadata lock identity 40 | @param K Metadata key 41 | @param T Metadata lock type 42 | @param D Metadata lock duration 43 | @param S Metadata lock status 44 | @param F request source file 45 | @param L request source line 46 | */ 47 | 48 | #ifdef HAVE_PSI_METADATA_INTERFACE 49 | #define mysql_mdl_create(I, K, T, D, S, F, L) \ 50 | inline_mysql_mdl_create(I, K, T, D, S, F, L) 51 | #else 52 | #define mysql_mdl_create(I, K, T, D, S, F, L) NULL 53 | #endif 54 | 55 | #ifdef HAVE_PSI_METADATA_INTERFACE 56 | #define mysql_mdl_set_status(L, S) \ 57 | inline_mysql_mdl_set_status(L, S) 58 | #else 59 | #define mysql_mdl_set_status(L, S) \ 60 | do {} while (0) 61 | #endif 62 | 63 | 64 | /** 65 | @def mysql_mdl_destroy(M) 66 | Instrumented metadata lock destruction. 67 | @param M Metadata lock 68 | */ 69 | #ifdef HAVE_PSI_METADATA_INTERFACE 70 | #define mysql_mdl_destroy(M) \ 71 | inline_mysql_mdl_destroy(M, __FILE__, __LINE__) 72 | #else 73 | #define mysql_mdl_destroy(M) \ 74 | do {} while (0) 75 | #endif 76 | 77 | #ifdef HAVE_PSI_METADATA_INTERFACE 78 | 79 | static inline PSI_metadata_lock * 80 | inline_mysql_mdl_create(void *identity, 81 | const MDL_key *mdl_key, 82 | enum_mdl_type mdl_type, 83 | enum_mdl_duration mdl_duration, 84 | MDL_wait::enum_wait_status mdl_status, 85 | const char *src_file, uint src_line) 86 | { 87 | PSI_metadata_lock *result; 88 | 89 | /* static_cast: Fit a round C++ enum peg into a square C int hole ... */ 90 | result= PSI_METADATA_CALL(create_metadata_lock) 91 | (identity, 92 | mdl_key, 93 | static_cast (mdl_type), 94 | static_cast (mdl_duration), 95 | static_cast (mdl_status), 96 | src_file, src_line); 97 | 98 | return result; 99 | } 100 | 101 | static inline void inline_mysql_mdl_set_status( 102 | PSI_metadata_lock *psi, 103 | MDL_wait::enum_wait_status mdl_status) 104 | { 105 | if (psi != NULL) 106 | PSI_METADATA_CALL(set_metadata_lock_status)(psi, mdl_status); 107 | } 108 | 109 | static inline void inline_mysql_mdl_destroy( 110 | PSI_metadata_lock *psi, 111 | const char *src_file, uint src_line) 112 | { 113 | if (psi != NULL) 114 | PSI_METADATA_CALL(destroy_metadata_lock)(psi); 115 | } 116 | #endif /* HAVE_PSI_METADATA_INTERFACE */ 117 | 118 | /** @} (end of group Metadata_instrumentation) */ 119 | 120 | #endif 121 | 122 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/psi/mysql_memory.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_MEMORY_H 17 | #define MYSQL_MEMORY_H 18 | 19 | /** 20 | @file mysql/psi/mysql_memory.h 21 | Instrumentation helpers for memory allocation. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_MEMORY_CALL 27 | #define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Memory_instrumentation Memory Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def mysql_memory_register(P1, P2, P3) 38 | Memory registration. 39 | */ 40 | #define mysql_memory_register(P1, P2, P3) \ 41 | inline_mysql_memory_register(P1, P2, P3) 42 | 43 | static inline void inline_mysql_memory_register( 44 | #ifdef HAVE_PSI_MEMORY_INTERFACE 45 | const char *category, 46 | PSI_memory_info *info, 47 | int count) 48 | #else 49 | const char *category __attribute__((unused)), 50 | void *info __attribute__((unused)), 51 | int count __attribute__((unused))) 52 | #endif 53 | { 54 | #ifdef HAVE_PSI_MEMORY_INTERFACE 55 | PSI_MEMORY_CALL(register_memory)(category, info, count); 56 | #endif 57 | } 58 | 59 | /** @} (end of group Memory_instrumentation) */ 60 | 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/psi/mysql_ps.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_PS_H 17 | #define MYSQL_PS_H 18 | 19 | /** 20 | @file mysql/psi/mysql_ps.h 21 | Instrumentation helpers for prepared statements. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_PS_CALL 27 | #define PSI_PS_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | #ifdef HAVE_PSI_PS_INTERFACE 31 | #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \ 32 | inline_mysql_create_prepared_stmt(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) 33 | #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \ 34 | inline_mysql_execute_prepared_stmt(LOCKER, PREPARED_STMT) 35 | #define MYSQL_DESTROY_PS(PREPARED_STMT) \ 36 | inline_mysql_destroy_prepared_stmt(PREPARED_STMT) 37 | #define MYSQL_REPREPARE_PS(PREPARED_STMT) \ 38 | inline_mysql_reprepare_prepared_stmt(PREPARED_STMT) 39 | #else 40 | #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \ 41 | NULL 42 | #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \ 43 | do {} while (0) 44 | #define MYSQL_DESTROY_PS(PREPARED_STMT) \ 45 | do {} while (0) 46 | #define MYSQL_REPREPARE_PS(PREPARED_STMT) \ 47 | do {} while (0) 48 | #endif 49 | 50 | #ifdef HAVE_PSI_PS_INTERFACE 51 | static inline struct PSI_prepared_stmt* 52 | inline_mysql_create_prepared_stmt(void *identity, uint stmt_id, 53 | PSI_statement_locker *locker, 54 | const char *stmt_name, size_t stmt_name_length, 55 | const char *sqltext, size_t sqltext_length) 56 | { 57 | if (locker == NULL) 58 | return NULL; 59 | return PSI_PS_CALL(create_prepared_stmt)(identity, stmt_id, 60 | locker, 61 | stmt_name, stmt_name_length, 62 | sqltext, sqltext_length); 63 | } 64 | 65 | static inline void 66 | inline_mysql_execute_prepared_stmt(PSI_statement_locker *locker, 67 | PSI_prepared_stmt* prepared_stmt) 68 | { 69 | if (prepared_stmt != NULL && locker != NULL) 70 | PSI_PS_CALL(execute_prepared_stmt)(locker, prepared_stmt); 71 | } 72 | 73 | static inline void 74 | inline_mysql_destroy_prepared_stmt(PSI_prepared_stmt *prepared_stmt) 75 | { 76 | if (prepared_stmt != NULL) 77 | PSI_PS_CALL(destroy_prepared_stmt)(prepared_stmt); 78 | } 79 | 80 | static inline void 81 | inline_mysql_reprepare_prepared_stmt(PSI_prepared_stmt *prepared_stmt) 82 | { 83 | if (prepared_stmt != NULL) 84 | PSI_PS_CALL(reprepare_prepared_stmt)(prepared_stmt); 85 | } 86 | #endif 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/psi/mysql_sp.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_SP_H 17 | #define MYSQL_SP_H 18 | 19 | /** 20 | @file mysql/psi/mysql_sp.h 21 | Instrumentation helpers for stored programs. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_SP_CALL 27 | #define PSI_SP_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | #ifdef HAVE_PSI_SP_INTERFACE 31 | #define MYSQL_START_SP(STATE, SP_SHARE) \ 32 | inline_mysql_start_sp(STATE, SP_SHARE) 33 | #else 34 | #define MYSQL_START_SP(STATE, SP_SHARE) \ 35 | NULL 36 | #endif 37 | 38 | 39 | #ifdef HAVE_PSI_SP_INTERFACE 40 | #define MYSQL_END_SP(LOCKER) \ 41 | inline_mysql_end_sp(LOCKER) 42 | #else 43 | #define MYSQL_END_SP(LOCKER) \ 44 | do {} while (0) 45 | #endif 46 | 47 | #ifdef HAVE_PSI_SP_INTERFACE 48 | #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \ 49 | inline_mysql_drop_sp(OT, SN, SNL, ON, ONL) 50 | #else 51 | #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \ 52 | do {} while (0) 53 | #endif 54 | 55 | #ifdef HAVE_PSI_SP_INTERFACE 56 | #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \ 57 | inline_mysql_get_sp_share(OT, SN, SNL, ON, ONL) 58 | #else 59 | #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \ 60 | NULL 61 | #endif 62 | 63 | #ifdef HAVE_PSI_SP_INTERFACE 64 | static inline struct PSI_sp_locker* 65 | inline_mysql_start_sp(PSI_sp_locker_state *state, PSI_sp_share *sp_share) 66 | { 67 | return PSI_SP_CALL(start_sp)(state, sp_share); 68 | } 69 | 70 | static inline void inline_mysql_end_sp(PSI_sp_locker *locker) 71 | { 72 | if (likely(locker != NULL)) 73 | PSI_SP_CALL(end_sp)(locker); 74 | } 75 | 76 | static inline void 77 | inline_mysql_drop_sp(uint sp_type, 78 | const char* schema_name, uint shcema_name_length, 79 | const char* object_name, uint object_name_length) 80 | { 81 | PSI_SP_CALL(drop_sp)(sp_type, 82 | schema_name, shcema_name_length, 83 | object_name, object_name_length); 84 | } 85 | 86 | static inline PSI_sp_share* 87 | inline_mysql_get_sp_share(uint sp_type, 88 | const char* schema_name, uint shcema_name_length, 89 | const char* object_name, uint object_name_length) 90 | { 91 | return PSI_SP_CALL(get_sp_share)(sp_type, 92 | schema_name, shcema_name_length, 93 | object_name, object_name_length); 94 | } 95 | #endif 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/psi/mysql_stage.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_STAGE_H 17 | #define MYSQL_STAGE_H 18 | 19 | /** 20 | @file mysql/psi/mysql_stage.h 21 | Instrumentation helpers for stages. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_STAGE_CALL 27 | #define PSI_STAGE_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Stage_instrumentation Stage Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def mysql_stage_register(P1, P2, P3) 38 | Stage registration. 39 | */ 40 | #ifdef HAVE_PSI_STAGE_INTERFACE 41 | #define mysql_stage_register(P1, P2, P3) \ 42 | inline_mysql_stage_register(P1, P2, P3) 43 | #else 44 | #define mysql_stage_register(P1, P2, P3) \ 45 | do {} while (0) 46 | #endif 47 | 48 | /** 49 | @def MYSQL_SET_STAGE 50 | Set the current stage 51 | @param K the stage key 52 | @param F the source file name 53 | @param L the source file line 54 | @return the current stage progress 55 | */ 56 | #ifdef HAVE_PSI_STAGE_INTERFACE 57 | #define MYSQL_SET_STAGE(K, F, L) \ 58 | inline_mysql_set_stage(K, F, L) 59 | #else 60 | #define MYSQL_SET_STAGE(K, F, L) \ 61 | NULL 62 | #endif 63 | 64 | #ifdef HAVE_PSI_STAGE_INTERFACE 65 | static inline void inline_mysql_stage_register( 66 | const char *category, PSI_stage_info **info, int count) 67 | { 68 | PSI_STAGE_CALL(register_stage)(category, info, count); 69 | } 70 | #endif 71 | 72 | #ifdef HAVE_PSI_STAGE_INTERFACE 73 | static inline PSI_stage_progress* 74 | inline_mysql_set_stage(PSI_stage_key key, 75 | const char *src_file, int src_line) 76 | { 77 | return PSI_STAGE_CALL(start_stage)(key, src_file, src_line); 78 | } 79 | #endif 80 | 81 | #ifdef HAVE_PSI_STAGE_INTERFACE 82 | #define mysql_stage_set_work_completed(P1, P2) \ 83 | inline_mysql_stage_set_work_completed(P1, P2) 84 | #else 85 | #define mysql_stage_set_work_completed(P1, P2) \ 86 | do {} while (0) 87 | #endif 88 | 89 | #ifdef HAVE_PSI_STAGE_INTERFACE 90 | #define mysql_stage_inc_work_completed(P1, P2) \ 91 | inline_mysql_stage_inc_work_completed(P1, P2) 92 | #else 93 | #define mysql_stage_inc_work_completed(P1, P2) \ 94 | do {} while (0) 95 | #endif 96 | 97 | #ifdef HAVE_PSI_STAGE_INTERFACE 98 | #define mysql_stage_set_work_estimated(P1, P2) \ 99 | inline_mysql_stage_set_work_estimated(P1, P2) 100 | #else 101 | #define mysql_stage_set_work_estimated(P1, P2) \ 102 | do {} while (0) 103 | #endif 104 | 105 | #ifdef HAVE_PSI_STAGE_INTERFACE 106 | static inline void 107 | inline_mysql_stage_set_work_completed(PSI_stage_progress *progress, 108 | ulonglong val) 109 | { 110 | if (progress != NULL) 111 | progress->m_work_completed= val; 112 | } 113 | #endif 114 | 115 | #ifdef HAVE_PSI_STAGE_INTERFACE 116 | static inline void 117 | inline_mysql_stage_inc_work_completed(PSI_stage_progress *progress, 118 | ulonglong val) 119 | { 120 | if (progress != NULL) 121 | progress->m_work_completed+= val; 122 | } 123 | #endif 124 | 125 | #ifdef HAVE_PSI_STAGE_INTERFACE 126 | static inline void 127 | inline_mysql_stage_set_work_estimated(PSI_stage_progress *progress, 128 | ulonglong val) 129 | { 130 | if (progress != NULL) 131 | progress->m_work_estimated= val; 132 | } 133 | #endif 134 | 135 | /** @} (end of group Stage_instrumentation) */ 136 | 137 | #endif 138 | 139 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/psi/mysql_table.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_TABLE_H 17 | #define MYSQL_TABLE_H 18 | 19 | /** 20 | @file mysql/psi/mysql_table.h 21 | Instrumentation helpers for table io. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_TABLE_CALL 27 | #define PSI_TABLE_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Table_instrumentation Table Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def MYSQL_TABLE_WAIT_VARIABLES 38 | Instrumentation helper for table waits. 39 | This instrumentation declares local variables. 40 | Do not use a ';' after this macro 41 | @param LOCKER the locker 42 | @param STATE the locker state 43 | @sa MYSQL_START_TABLE_IO_WAIT. 44 | @sa MYSQL_END_TABLE_IO_WAIT. 45 | @sa MYSQL_START_TABLE_LOCK_WAIT. 46 | @sa MYSQL_END_TABLE_LOCK_WAIT. 47 | */ 48 | #ifdef HAVE_PSI_TABLE_INTERFACE 49 | #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE) \ 50 | struct PSI_table_locker* LOCKER; \ 51 | PSI_table_locker_state STATE; 52 | #else 53 | #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE) 54 | #endif 55 | 56 | /** 57 | @def MYSQL_START_TABLE_LOCK_WAIT 58 | Instrumentation helper for table lock waits. 59 | This instrumentation marks the start of a wait event. 60 | @param LOCKER the locker 61 | @param STATE the locker state 62 | @param PSI the instrumented table 63 | @param OP the table operation to be performed 64 | @param FLAGS per table operation flags. 65 | @sa MYSQL_END_TABLE_LOCK_WAIT. 66 | */ 67 | #ifdef HAVE_PSI_TABLE_INTERFACE 68 | #define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \ 69 | LOCKER= inline_mysql_start_table_lock_wait(STATE, PSI, \ 70 | OP, FLAGS, __FILE__, __LINE__) 71 | #else 72 | #define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \ 73 | do {} while (0) 74 | #endif 75 | 76 | /** 77 | @def MYSQL_END_TABLE_LOCK_WAIT 78 | Instrumentation helper for table lock waits. 79 | This instrumentation marks the end of a wait event. 80 | @param LOCKER the locker 81 | @sa MYSQL_START_TABLE_LOCK_WAIT. 82 | */ 83 | #ifdef HAVE_PSI_TABLE_INTERFACE 84 | #define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \ 85 | inline_mysql_end_table_lock_wait(LOCKER) 86 | #else 87 | #define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \ 88 | do {} while (0) 89 | #endif 90 | 91 | #ifdef HAVE_PSI_TABLE_INTERFACE 92 | #define MYSQL_UNLOCK_TABLE(T) \ 93 | inline_mysql_unlock_table(T) 94 | #else 95 | #define MYSQL_UNLOCK_TABLE(T) \ 96 | do {} while (0) 97 | #endif 98 | 99 | #ifdef HAVE_PSI_TABLE_INTERFACE 100 | /** 101 | Instrumentation calls for MYSQL_START_TABLE_LOCK_WAIT. 102 | @sa MYSQL_END_TABLE_LOCK_WAIT. 103 | */ 104 | static inline struct PSI_table_locker * 105 | inline_mysql_start_table_lock_wait(PSI_table_locker_state *state, 106 | struct PSI_table *psi, 107 | enum PSI_table_lock_operation op, 108 | ulong flags, const char *src_file, int src_line) 109 | { 110 | if (psi != NULL) 111 | { 112 | struct PSI_table_locker *locker; 113 | locker= PSI_TABLE_CALL(start_table_lock_wait) 114 | (state, psi, op, flags, src_file, src_line); 115 | return locker; 116 | } 117 | return NULL; 118 | } 119 | 120 | /** 121 | Instrumentation calls for MYSQL_END_TABLE_LOCK_WAIT. 122 | @sa MYSQL_START_TABLE_LOCK_WAIT. 123 | */ 124 | static inline void 125 | inline_mysql_end_table_lock_wait(struct PSI_table_locker *locker) 126 | { 127 | if (locker != NULL) 128 | PSI_TABLE_CALL(end_table_lock_wait)(locker); 129 | } 130 | 131 | static inline void 132 | inline_mysql_unlock_table(struct PSI_table *table) 133 | { 134 | if (table != NULL) 135 | PSI_TABLE_CALL(unlock_table)(table); 136 | } 137 | #endif 138 | 139 | /** @} (end of group Table_instrumentation) */ 140 | 141 | #endif 142 | 143 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/psi/psi_base.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_PSI_BASE_H 17 | #define MYSQL_PSI_BASE_H 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /** 24 | @file mysql/psi/psi_base.h 25 | Performance schema instrumentation interface. 26 | 27 | @defgroup Instrumentation_interface Instrumentation Interface 28 | @ingroup Performance_schema 29 | @{ 30 | */ 31 | 32 | #define PSI_INSTRUMENT_ME 0 33 | 34 | #define PSI_NOT_INSTRUMENTED 0 35 | 36 | /** 37 | Global flag. 38 | This flag indicate that an instrumentation point is a global variable, 39 | or a singleton. 40 | */ 41 | #define PSI_FLAG_GLOBAL (1 << 0) 42 | 43 | /** 44 | Mutable flag. 45 | This flag indicate that an instrumentation point is a general placeholder, 46 | that can mutate into a more specific instrumentation point. 47 | */ 48 | #define PSI_FLAG_MUTABLE (1 << 1) 49 | 50 | #define PSI_FLAG_THREAD (1 << 2) 51 | 52 | /** 53 | Stage progress flag. 54 | This flag apply to the stage instruments only. 55 | It indicates the instrumentation provides progress data. 56 | */ 57 | #define PSI_FLAG_STAGE_PROGRESS (1 << 3) 58 | 59 | #ifdef HAVE_PSI_INTERFACE 60 | 61 | /** 62 | Shared Exclusive flag. 63 | Indicates that rwlock support the shared exclusive state. 64 | */ 65 | #define PSI_RWLOCK_FLAG_SX (1 << 4) 66 | 67 | /** 68 | @def PSI_VERSION_1 69 | Performance Schema Interface number for version 1. 70 | This version is supported. 71 | */ 72 | #define PSI_VERSION_1 1 73 | 74 | /** 75 | @def PSI_VERSION_2 76 | Performance Schema Interface number for version 2. 77 | This version is not implemented, it's a placeholder. 78 | */ 79 | #define PSI_VERSION_2 2 80 | 81 | /** 82 | @def PSI_CURRENT_VERSION 83 | Performance Schema Interface number for the most recent version. 84 | The most current version is @c PSI_VERSION_1 85 | */ 86 | #define PSI_CURRENT_VERSION 1 87 | 88 | /** 89 | @def USE_PSI_1 90 | Define USE_PSI_1 to use the interface version 1. 91 | */ 92 | 93 | /** 94 | @def USE_PSI_2 95 | Define USE_PSI_2 to use the interface version 2. 96 | */ 97 | 98 | /** 99 | @def HAVE_PSI_1 100 | Define HAVE_PSI_1 if the interface version 1 needs to be compiled in. 101 | */ 102 | 103 | /** 104 | @def HAVE_PSI_2 105 | Define HAVE_PSI_2 if the interface version 2 needs to be compiled in. 106 | */ 107 | 108 | #ifndef USE_PSI_2 109 | #ifndef USE_PSI_1 110 | #define USE_PSI_1 111 | #endif 112 | #endif 113 | 114 | #ifdef USE_PSI_1 115 | #define HAVE_PSI_1 116 | #endif 117 | 118 | #ifdef USE_PSI_2 119 | #define HAVE_PSI_2 120 | #endif 121 | 122 | /* 123 | Allow to override PSI_XXX_CALL at compile time 124 | with more efficient implementations, if available. 125 | If nothing better is available, 126 | make a dynamic call using the PSI_server function pointer. 127 | */ 128 | 129 | #define PSI_DYNAMIC_CALL(M) PSI_server->M 130 | 131 | #endif /* HAVE_PSI_INTERFACE */ 132 | 133 | /** @} */ 134 | 135 | #ifdef __cplusplus 136 | } 137 | #endif 138 | 139 | #endif /* MYSQL_PSI_BASE_H */ 140 | 141 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/psi/psi_memory.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_PSI_MEMORY_H 17 | #define MYSQL_PSI_MEMORY_H 18 | 19 | #include "psi_base.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /** 26 | @file mysql/psi/psi_memory.h 27 | Performance schema instrumentation interface. 28 | 29 | @defgroup Instrumentation_interface Instrumentation Interface 30 | @ingroup Performance_schema 31 | @{ 32 | */ 33 | 34 | #ifdef HAVE_PSI_INTERFACE 35 | #ifndef DISABLE_ALL_PSI 36 | #ifndef DISABLE_PSI_MEMORY 37 | #define HAVE_PSI_MEMORY_INTERFACE 38 | #endif /* DISABLE_PSI_MEMORY */ 39 | #endif /* DISABLE_ALL_PSI */ 40 | #endif /* HAVE_PSI_INTERFACE */ 41 | 42 | /** 43 | Instrumented memory key. 44 | To instrument memory, a memory key must be obtained using @c register_memory. 45 | Using a zero key always disable the instrumentation. 46 | */ 47 | typedef unsigned int PSI_memory_key; 48 | 49 | #ifdef HAVE_PSI_1 50 | 51 | /** 52 | @defgroup Group_PSI_v1 Application Binary Interface, version 1 53 | @ingroup Instrumentation_interface 54 | @{ 55 | */ 56 | 57 | /** 58 | Memory instrument information. 59 | @since PSI_VERSION_1 60 | This structure is used to register instrumented memory. 61 | */ 62 | struct PSI_memory_info_v1 63 | { 64 | /** Pointer to the key assigned to the registered memory. */ 65 | PSI_memory_key *m_key; 66 | /** The name of the memory instrument to register. */ 67 | const char *m_name; 68 | /** 69 | The flags of the socket instrument to register. 70 | @sa PSI_FLAG_GLOBAL 71 | */ 72 | int m_flags; 73 | }; 74 | typedef struct PSI_memory_info_v1 PSI_memory_info_v1; 75 | 76 | /** 77 | Memory registration API. 78 | @param category a category name (typically a plugin name) 79 | @param info an array of memory info to register 80 | @param count the size of the info array 81 | */ 82 | typedef void (*register_memory_v1_t) 83 | (const char *category, struct PSI_memory_info_v1 *info, int count); 84 | 85 | /** 86 | Instrument memory allocation. 87 | @param key the memory instrument key 88 | @param size the size of memory allocated 89 | @return the effective memory instrument key 90 | */ 91 | typedef PSI_memory_key (*memory_alloc_v1_t) 92 | (PSI_memory_key key, size_t size); 93 | 94 | /** 95 | Instrument memory re allocation. 96 | @param key the memory instrument key 97 | @param old_size the size of memory previously allocated 98 | @param new_size the size of memory re allocated 99 | @return the effective memory instrument key 100 | */ 101 | typedef PSI_memory_key (*memory_realloc_v1_t) 102 | (PSI_memory_key key, size_t old_size, size_t new_size); 103 | 104 | /** 105 | Instrument memory free. 106 | @param key the memory instrument key 107 | @param size the size of memory allocated 108 | */ 109 | typedef void (*memory_free_v1_t) 110 | (PSI_memory_key key, size_t size); 111 | 112 | /** @} (end of group Group_PSI_v1) */ 113 | 114 | #endif /* HAVE_PSI_1 */ 115 | 116 | #ifdef HAVE_PSI_2 117 | struct PSI_memory_info_v2 118 | { 119 | int placeholder; 120 | }; 121 | 122 | #endif /* HAVE_PSI_2 */ 123 | 124 | #ifdef USE_PSI_1 125 | typedef struct PSI_memory_info_v1 PSI_memory_info; 126 | #endif 127 | 128 | #ifdef USE_PSI_2 129 | typedef struct PSI_memory_info_v2 PSI_memory_info; 130 | #endif 131 | 132 | /** @} (end of group Instrumentation_interface) */ 133 | 134 | #ifdef __cplusplus 135 | } 136 | #endif 137 | 138 | 139 | #endif /* MYSQL_PSI_MEMORY_H */ 140 | 141 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/service_my_snprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED 2 | /* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; version 2 of the License. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 16 | 17 | /** 18 | @file 19 | my_snprintf service 20 | 21 | Portable and limited vsnprintf() implementation. 22 | 23 | This is a portable, limited vsnprintf() implementation, with some 24 | extra features. "Portable" means that it'll produce identical result 25 | on all platforms (for example, on Windows and Linux system printf %e 26 | formats the exponent differently, on different systems %p either 27 | prints leading 0x or not, %s may accept null pointer or crash on 28 | it). "Limited" means that it does not support all the C89 features. 29 | But it supports few extensions, not in any standard. 30 | 31 | my_vsnprintf(to, n, fmt, ap) 32 | 33 | @param[out] to A buffer to store the result in 34 | @param[in] n Store up to n-1 characters, followed by an end 0 35 | @param[in] fmt printf-like format string 36 | @param[in] ap Arguments 37 | 38 | @return a number of bytes written to a buffer *excluding* terminating '\0' 39 | 40 | @post 41 | The syntax of a format string is generally the same: 42 | % 43 | where everithing but the format is optional. 44 | 45 | Three one-character flags are recognized: 46 | '0' has the standard zero-padding semantics; 47 | '-' is parsed, but silently ignored; 48 | '`' (backtick) is only supported for strings (%s) and means that the 49 | string will be quoted according to MySQL identifier quoting rules. 50 | 51 | Both and can be specified as numbers or '*'. 52 | If an asterisk is used, an argument of type int is consumed. 53 | 54 | can be 'l', 'll', or 'z'. 55 | 56 | Supported formats are 's' (null pointer is accepted, printed as 57 | "(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o', 58 | 'X', 'p' (works as 0x%x). 59 | 60 | Standard syntax for positional arguments $n is supported. 61 | 62 | Extensions: 63 | 64 | Flag '`' (backtick): see above. 65 | 66 | Format 'b': binary buffer, prints exactly bytes from the 67 | argument, without stopping at '\0'. 68 | */ 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | #ifndef MYSQL_ABI_CHECK 75 | #include 76 | #include 77 | #endif 78 | 79 | extern struct my_snprintf_service_st { 80 | size_t (*my_snprintf_type)(char*, size_t, const char*, ...); 81 | size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); 82 | } *my_snprintf_service; 83 | 84 | #ifdef MYSQL_DYNAMIC_PLUGIN 85 | 86 | #define my_vsnprintf my_snprintf_service->my_vsnprintf_type 87 | #define my_snprintf my_snprintf_service->my_snprintf_type 88 | 89 | #else 90 | 91 | size_t my_snprintf(char* to, size_t n, const char* fmt, ...); 92 | size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); 93 | 94 | #endif 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED 101 | #endif 102 | 103 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql/service_mysql_alloc.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED 17 | #define MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED 18 | 19 | #ifndef MYSQL_ABI_CHECK 20 | #include 21 | #endif 22 | 23 | /* PSI_memory_key */ 24 | #include "mysql/psi/psi_memory.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* myf */ 31 | typedef int myf_t; 32 | 33 | typedef void * (*mysql_malloc_t)(PSI_memory_key key, size_t size, myf_t flags); 34 | typedef void * (*mysql_realloc_t)(PSI_memory_key key, void *ptr, size_t size, myf_t flags); 35 | typedef void (*mysql_free_t)(void *ptr); 36 | typedef void * (*my_memdup_t)(PSI_memory_key key, const void *from, size_t length, myf_t flags); 37 | typedef char * (*my_strdup_t)(PSI_memory_key key, const char *from, myf_t flags); 38 | typedef char * (*my_strndup_t)(PSI_memory_key key, const char *from, size_t length, myf_t flags); 39 | 40 | struct mysql_malloc_service_st 41 | { 42 | mysql_malloc_t mysql_malloc; 43 | mysql_realloc_t mysql_realloc; 44 | mysql_free_t mysql_free; 45 | my_memdup_t my_memdup; 46 | my_strdup_t my_strdup; 47 | my_strndup_t my_strndup; 48 | }; 49 | 50 | extern struct mysql_malloc_service_st *mysql_malloc_service; 51 | 52 | #ifdef MYSQL_DYNAMIC_PLUGIN 53 | 54 | #define my_malloc mysql_malloc_service->mysql_malloc 55 | #define my_realloc mysql_malloc_service->mysql_realloc 56 | #define my_free mysql_malloc_service->mysql_free 57 | #define my_memdup mysql_malloc_service->my_memdup 58 | #define my_strdup mysql_malloc_service->my_strdup 59 | #define my_strndup mysql_malloc_service->my_strndup 60 | 61 | #else 62 | 63 | extern void * my_malloc(PSI_memory_key key, size_t size, myf_t flags); 64 | extern void * my_realloc(PSI_memory_key key, void *ptr, size_t size, myf_t flags); 65 | extern void my_free(void *ptr); 66 | extern void * my_memdup(PSI_memory_key key, const void *from, size_t length, myf_t flags); 67 | extern char * my_strdup(PSI_memory_key key, const char *from, myf_t flags); 68 | extern char * my_strndup(PSI_memory_key key, const char *from, size_t length, myf_t flags); 69 | 70 | #endif 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif 77 | 78 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql_com_server.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Definitions private to the server, 18 | used in the networking layer to notify specific events. 19 | */ 20 | 21 | #ifndef _mysql_com_server_h 22 | #define _mysql_com_server_h 23 | 24 | struct st_net_server; 25 | 26 | typedef void (*before_header_callback_fn) 27 | (struct st_net *net, void *user_data, size_t count); 28 | 29 | typedef void (*after_header_callback_fn) 30 | (struct st_net *net, void *user_data, size_t count, my_bool rc); 31 | 32 | struct st_net_server 33 | { 34 | before_header_callback_fn m_before_header; 35 | after_header_callback_fn m_after_header; 36 | void *m_user_data; 37 | }; 38 | 39 | typedef struct st_net_server NET_SERVER; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql_embed.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQL_EMBED_INCLUDED 2 | #define MYSQL_EMBED_INCLUDED 3 | 4 | /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 18 | 19 | /* Defines that are unique to the embedded version of MySQL */ 20 | 21 | #ifdef EMBEDDED_LIBRARY 22 | 23 | /* Things we don't need in the embedded version of MySQL */ 24 | /* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */ 25 | 26 | #undef HAVE_DLOPEN /* No udf functions */ 27 | 28 | #endif /* EMBEDDED_LIBRARY */ 29 | #endif /* MYSQL_EMBED_INCLUDED */ 30 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql_time.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 15 | 16 | #ifndef _mysql_time_h_ 17 | #define _mysql_time_h_ 18 | 19 | /* 20 | Time declarations shared between the server and client API: 21 | you should not add anything to this header unless it's used 22 | (and hence should be visible) in mysql.h. 23 | If you're looking for a place to add new time-related declaration, 24 | it's most likely my_time.h. See also "C API Handling of Date 25 | and Time Values" chapter in documentation. 26 | */ 27 | 28 | enum enum_mysql_timestamp_type 29 | { 30 | MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, 31 | MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 32 | }; 33 | 34 | 35 | /* 36 | Structure which is used to represent datetime values inside MySQL. 37 | 38 | We assume that values in this structure are normalized, i.e. year <= 9999, 39 | month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions 40 | in server such as my_system_gmt_sec() or make_time() family of functions 41 | rely on this (actually now usage of make_*() family relies on a bit weaker 42 | restriction). Also functions that produce MYSQL_TIME as result ensure this. 43 | There is one exception to this rule though if this structure holds time 44 | value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold 45 | bigger values. 46 | */ 47 | typedef struct st_mysql_time 48 | { 49 | unsigned int year, month, day, hour, minute, second; 50 | unsigned long second_part; /**< microseconds */ 51 | my_bool neg; 52 | enum enum_mysql_timestamp_type time_type; 53 | } MYSQL_TIME; 54 | 55 | #endif /* _mysql_time_h_ */ 56 | -------------------------------------------------------------------------------- /mysql/windows/include/mysql_version.h: -------------------------------------------------------------------------------- 1 | /* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB 2 | & Detron HB, 1996, 1999-2004, 2007 MySQL AB. 3 | This file is public domain and comes with NO WARRANTY of any kind 4 | */ 5 | 6 | /* Version numbers for protocol & mysqld */ 7 | 8 | #ifndef _mysql_version_h 9 | #define _mysql_version_h 10 | #ifdef _CUSTOMCONFIG_ 11 | #include 12 | #else 13 | #define PROTOCOL_VERSION 10 14 | #define MYSQL_SERVER_VERSION "5.7.6-m16" 15 | #define MYSQL_VERSION_ID 50706 16 | #define MYSQL_PORT 3306 17 | #define MYSQL_PORT_DEFAULT 0 18 | #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" 19 | #define MYSQL_CONFIG_NAME "my" 20 | #define MYSQL_COMPILATION_COMMENT "MySQL Connector/C (GPL)" 21 | #define LIBMYSQL_VERSION "6.1.6" 22 | #define LIBMYSQL_VERSION_ID 60106 23 | 24 | /* mysqld compile time options */ 25 | #endif /* _CUSTOMCONFIG_ */ 26 | 27 | #ifndef LICENSE 28 | #define LICENSE GPL 29 | #endif /* LICENSE */ 30 | 31 | #endif /* _mysql_version_h */ 32 | -------------------------------------------------------------------------------- /mysql/windows/include/sslopt-case.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) 17 | #ifdef MYSQL_CLIENT 18 | case OPT_SSL_SSL: 19 | /* 20 | A client side --ssl option handling. 21 | --ssl=1 means enforce (use=1, enforce=1) 22 | --ssl=0 means can't enforce (use=0, enforce=0) 23 | no --ssl means default : no enforce (use=1), just try (enforce=1) 24 | */ 25 | opt_ssl_enforce= opt_use_ssl; 26 | break; 27 | #endif 28 | case OPT_SSL_KEY: 29 | case OPT_SSL_CERT: 30 | case OPT_SSL_CA: 31 | case OPT_SSL_CAPATH: 32 | case OPT_SSL_CIPHER: 33 | case OPT_SSL_CRL: 34 | case OPT_SSL_CRLPATH: 35 | /* 36 | Enable use of SSL if we are using any ssl option 37 | One can disable SSL later by using --skip-ssl or --ssl=0 38 | */ 39 | opt_use_ssl= TRUE; 40 | /* crl has no effect in yaSSL */ 41 | #ifdef HAVE_YASSL 42 | opt_ssl_crl= NULL; 43 | opt_ssl_crlpath= NULL; 44 | #endif 45 | break; 46 | #endif -------------------------------------------------------------------------------- /mysql/windows/include/sslopt-longopts.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) 17 | 18 | {"ssl", OPT_SSL_SSL, 19 | "If set to ON, this option enforces that SSL is established before client " 20 | "attempts to authenticate to the server. To disable client SSL capabilities " 21 | "use --ssl=OFF.", 22 | &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, 23 | {"ssl-ca", OPT_SSL_CA, 24 | "CA file in PEM format.", 25 | &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, 26 | 0, 0, 0, 0, 0, 0}, 27 | {"ssl-capath", OPT_SSL_CAPATH, 28 | "CA directory.", 29 | &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, 30 | 0, 0, 0, 0, 0, 0}, 31 | {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format.", 32 | &opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, 33 | 0, 0, 0, 0, 0, 0}, 34 | {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use.", 35 | &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, 36 | 0, 0, 0, 0, 0, 0}, 37 | {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format.", 38 | &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, 39 | 0, 0, 0, 0, 0, 0}, 40 | {"ssl-crl", OPT_SSL_CRL, "Certificate revocation list.", 41 | &opt_ssl_crl, &opt_ssl_crl, 0, GET_STR, REQUIRED_ARG, 42 | 0, 0, 0, 0, 0, 0}, 43 | {"ssl-crlpath", OPT_SSL_CRLPATH, 44 | "Certificate revocation list path.", 45 | &opt_ssl_crlpath, &opt_ssl_crlpath, 0, GET_STR, REQUIRED_ARG, 46 | 0, 0, 0, 0, 0, 0}, 47 | #ifdef MYSQL_CLIENT 48 | {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, 49 | "Verify server's \"Common Name\" in its cert against hostname used " 50 | "when connecting. This option is disabled by default.", 51 | &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert, 52 | 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, 53 | #endif 54 | #endif /* HAVE_OPENSSL */ -------------------------------------------------------------------------------- /mysql/windows/include/sslopt-vars.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef SSLOPT_VARS_INCLUDED 17 | #define SSLOPT_VARS_INCLUDED 18 | 19 | #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) 20 | /* Always try to use SSL per default */ 21 | static my_bool opt_use_ssl = TRUE; 22 | /* Fall back on unencrypted connections per default */ 23 | static my_bool opt_ssl_enforce= FALSE; 24 | static char *opt_ssl_ca = 0; 25 | static char *opt_ssl_capath = 0; 26 | static char *opt_ssl_cert = 0; 27 | static char *opt_ssl_cipher = 0; 28 | static char *opt_ssl_key = 0; 29 | static char *opt_ssl_crl = 0; 30 | static char *opt_ssl_crlpath = 0; 31 | #ifndef MYSQL_CLIENT 32 | #error This header is supposed to be used only in the client 33 | #endif 34 | #define SSL_SET_OPTIONS(mysql) \ 35 | if (opt_use_ssl) \ 36 | { \ 37 | mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, \ 38 | opt_ssl_capath, opt_ssl_cipher); \ 39 | mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl); \ 40 | mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath); \ 41 | mysql_options(mysql, MYSQL_OPT_SSL_ENFORCE, &opt_ssl_enforce); \ 42 | } \ 43 | mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, \ 44 | (char*)&opt_ssl_verify_server_cert) 45 | 46 | static my_bool opt_ssl_verify_server_cert= 0; 47 | #else 48 | #define SSL_SET_OPTIONS(mysql) do { } while(0) 49 | #endif 50 | #endif /* SSLOPT_VARS_INCLUDED */ 51 | -------------------------------------------------------------------------------- /mysql/windows/include/typelib.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 15 | 16 | 17 | #ifndef _typelib_h 18 | #define _typelib_h 19 | 20 | #include "my_alloc.h" 21 | 22 | typedef struct st_typelib { /* Different types saved here */ 23 | unsigned int count; /* How many types */ 24 | const char *name; /* Name of typelib */ 25 | const char **type_names; 26 | unsigned int *type_lengths; 27 | } TYPELIB; 28 | 29 | extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); 30 | extern int find_type_or_exit(const char *x, TYPELIB *typelib, 31 | const char *option); 32 | #define FIND_TYPE_BASIC 0 33 | /** makes @c find_type() require the whole name, no prefix */ 34 | #define FIND_TYPE_NO_PREFIX (1 << 0) 35 | /** always implicitely on, so unused, but old code may pass it */ 36 | #define FIND_TYPE_NO_OVERWRITE (1 << 1) 37 | /** makes @c find_type() accept a number */ 38 | #define FIND_TYPE_ALLOW_NUMBER (1 << 2) 39 | /** makes @c find_type() treat ',' as terminator */ 40 | #define FIND_TYPE_COMMA_TERM (1 << 3) 41 | 42 | extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); 43 | extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); 44 | extern const char *get_type(TYPELIB *typelib,unsigned int nr); 45 | extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); 46 | 47 | extern TYPELIB sql_protocol_typelib; 48 | 49 | my_ulonglong find_set_from_flags(const TYPELIB *lib, unsigned int default_name, 50 | my_ulonglong cur_set, my_ulonglong default_set, 51 | const char *str, unsigned int length, 52 | char **err_pos, unsigned int *err_len); 53 | 54 | #endif /* _typelib_h */ 55 | -------------------------------------------------------------------------------- /mysql/windows/lib/libmysql.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callofduty4x/mysql/9bd45f86bc126c29ddb855fbc92d1a75410c1413/mysql/windows/lib/libmysql.dll -------------------------------------------------------------------------------- /mysql/windows/lib/libmysql.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callofduty4x/mysql/9bd45f86bc126c29ddb855fbc92d1a75410c1413/mysql/windows/lib/libmysql.lib -------------------------------------------------------------------------------- /mysql/windows/lib/libmysqlclient.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callofduty4x/mysql/9bd45f86bc126c29ddb855fbc92d1a75410c1413/mysql/windows/lib/libmysqlclient.a -------------------------------------------------------------------------------- /obj/dummy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callofduty4x/mysql/9bd45f86bc126c29ddb855fbc92d1a75410c1413/obj/dummy --------------------------------------------------------------------------------