1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

Commit resolved conflicts

This commit is contained in:
Olivier Bertrand
2015-09-18 18:39:08 +02:00
2447 changed files with 98282 additions and 33454 deletions

3
.gitattributes vendored
View File

@@ -20,6 +20,9 @@ storage/connect/mysql-test/connect/std_data/*.dat binary
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.frm binary
*.MYD binary
*.MYI binary
*.c diff=cpp
*.h diff=cpp

View File

@@ -401,7 +401,6 @@ IF(WIN32)
ADD_SUBDIRECTORY(win/upgrade_wizard)
ADD_SUBDIRECTORY(win/packaging)
ENDIF()
ADD_SUBDIRECTORY(packaging/solaris)
INCLUDE(for_clients)

View File

@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=1
MYSQL_VERSION_PATCH=5
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_EXTRA=

View File

@@ -1109,7 +1109,7 @@ int main(int argc, char **argv)
printf("This installation of MySQL is already upgraded to %s, "
"use --force if you still need to run mysql_upgrade\n",
MYSQL_SERVER_VERSION);
die(NULL);
goto end;
}
if (opt_version_check && check_version_match())
@@ -1138,6 +1138,7 @@ int main(int argc, char **argv)
DBUG_ASSERT(phase == phases_total);
end:
free_used_memory();
my_end(my_end_arg);
exit(0);

View File

@@ -2240,7 +2240,7 @@ static Exit_status check_header(IO_CACHE* file,
Format_description_log_event *new_description_event;
my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(new_description_event= (Format_description_log_event*)
Log_event::read_log_event(file, glob_description_event,
Log_event::read_log_event(file, 0, glob_description_event,
opt_verify_binlog_checksum)))
/* EOF can't be hit here normally, so it's a real error */
{
@@ -2274,7 +2274,7 @@ static Exit_status check_header(IO_CACHE* file,
{
Log_event *ev;
my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(ev= Log_event::read_log_event(file, glob_description_event,
if (!(ev= Log_event::read_log_event(file, 0, glob_description_event,
opt_verify_binlog_checksum)))
{
/* EOF can't be hit here normally, so it's a real error */
@@ -2388,7 +2388,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
char llbuff[21];
my_off_t old_off = my_b_tell(file);
Log_event* ev = Log_event::read_log_event(file, glob_description_event,
Log_event* ev = Log_event::read_log_event(file, 0, glob_description_event,
opt_verify_binlog_checksum);
if (!ev)
{
@@ -2575,6 +2575,11 @@ void *sql_alloc(size_t size)
return alloc_root(&s_mem_root, size);
}
struct encryption_service_st encryption_handler=
{
0, 0, 0, 0, 0, 0, 0
};
/*
We must include this here as it's compiled with different options for
the server

View File

@@ -54,6 +54,7 @@ static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static int first_error = 0;
static char *opt_skip_database;
DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
DYNAMIC_ARRAY views4repair;
static char *shared_memory_base_name=0;
static uint opt_protocol=0;
@@ -878,11 +879,19 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view)
switch (what_to_do) {
case DO_CHECK:
op = "CHECK";
if (opt_quick) end = strmov(end, " QUICK");
if (opt_fast) end = strmov(end, " FAST");
if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */
if (opt_extended) end = strmov(end, " EXTENDED");
if (opt_check_only_changed) end = strmov(end, " CHANGED");
if (view)
{
if (opt_fast || opt_check_only_changed)
DBUG_RETURN(0);
}
else
{
if (opt_quick) end = strmov(end, " QUICK");
if (opt_fast) end = strmov(end, " FAST");
if (opt_extended) end = strmov(end, " EXTENDED");
if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */
if (opt_check_only_changed) end = strmov(end, " CHANGED");
}
if (opt_upgrade) end = strmov(end, " FOR UPGRADE");
break;
case DO_REPAIR:
@@ -967,6 +976,7 @@ static void print_result()
uint length_of_db;
uint i;
my_bool found_error=0, table_rebuild=0;
DYNAMIC_ARRAY *array4repair= &tables4repair;
DBUG_ENTER("print_result");
res = mysql_use_result(sock);
@@ -1003,9 +1013,10 @@ static void print_result()
else
{
char *table_name= prev + (length_of_db+1);
insert_dynamic(&tables4repair, table_name);
insert_dynamic(array4repair, table_name);
}
}
array4repair= &tables4repair;
found_error=0;
table_rebuild=0;
prev_alter[0]= 0;
@@ -1021,8 +1032,11 @@ static void print_result()
we have to run upgrade on it. In this case we write a nicer message
than "Please do "REPAIR TABLE""...
*/
if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR TABLE"))
if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR "))
{
printf("%-50s %s", row[0], "Needs upgrade");
array4repair= strstr(row[3], "VIEW") ? &views4repair : &tables4repair;
}
else
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
if (opt_auto_repair && strcmp(row[2],"note"))
@@ -1053,7 +1067,7 @@ static void print_result()
else
{
char *table_name= prev + (length_of_db+1);
insert_dynamic(&tables4repair, table_name);
insert_dynamic(array4repair, table_name);
}
}
mysql_free_result(res);
@@ -1173,6 +1187,8 @@ int main(int argc, char **argv)
if (opt_auto_repair &&
(my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,
64, MYF(0)) ||
my_init_dynamic_array(&views4repair, sizeof(char)*(NAME_LEN*2+2),16,
64, MYF(0)) ||
my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,
64, MYF(0)) ||
my_init_dynamic_array(&alter_table_cmds, MAX_ALTER_STR_SIZE, 0, 1,
@@ -1203,6 +1219,13 @@ int main(int argc, char **argv)
rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i));
for (i = 0; i < alter_table_cmds.elements ; i++)
run_query((char*) dynamic_array_ptr(&alter_table_cmds, i), 1);
if (!opt_silent && views4repair.elements)
puts("\nRepairing views");
for (i = 0; i < views4repair.elements ; i++)
{
char *name= (char*) dynamic_array_ptr(&views4repair, i);
handle_request_for_tables(name, fixed_name_length(name), TRUE);
}
}
ret= MY_TEST(first_error);
@@ -1210,8 +1233,10 @@ int main(int argc, char **argv)
dbDisconnect(current_host);
if (opt_auto_repair)
{
delete_dynamic(&views4repair);
delete_dynamic(&tables4repair);
delete_dynamic(&tables4rebuild);
delete_dynamic(&alter_table_cmds);
}
end1:
my_free(opt_password);

View File

@@ -97,7 +97,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
static char *alloc_query_str(ulong size);
static void field_escape(DYNAMIC_STRING* in, const char *from);
static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_med= 1,
quick= 1, extended_insert= 1,
lock_tables=1,ignore_errors=0,flush_logs=0,flush_privileges=0,
opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0,
@@ -203,6 +203,8 @@ const char *compatible_mode_names[]=
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
"", compatible_mode_names, NULL};
#define MED_ENGINES "MRG_MyISAM, MRG_ISAM, CONNECT, OQGRAPH, SPIDER, VP, FEDERATED"
HASH ignore_table;
static struct my_option my_long_options[] =
@@ -431,6 +433,9 @@ static struct my_option my_long_options[] =
NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data", 'd', "No row information.", &opt_no_data,
&opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data-med", 0, "No row information for engines that "
"Manage External Data (" MED_ENGINES ").", &opt_no_data_med,
&opt_no_data_med, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"no-set-names", 'N', "Same as --skip-set-charset.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"opt", OPT_OPTIMIZE,
@@ -5506,12 +5511,12 @@ char check_if_ignore_table(const char *table_name, char *table_type)
/*
If these two types, we do want to skip dumping the table
*/
if (!opt_no_data &&
(!my_strcasecmp(&my_charset_latin1, table_type, "MRG_MyISAM") ||
!strcmp(table_type,"MRG_ISAM") ||
!strcmp(table_type,"CONNECT") ||
!strcmp(table_type,"FEDERATED")))
result= IGNORE_DATA;
if (!opt_no_data && opt_no_data_med)
{
const char *found= strstr(" " MED_ENGINES ",", table_type);
if (found && found[-1] == ' ' && found[strlen(table_type)] == ',')
result= IGNORE_DATA;
}
}
mysql_free_result(res);
DBUG_RETURN(result);

View File

@@ -36,7 +36,7 @@
/* Global Thread counter */
uint counter;
uint counter= 0;
pthread_mutex_t counter_mutex;
pthread_cond_t count_threshhold;
@@ -489,6 +489,11 @@ static void safe_exit(int error, MYSQL *mysql)
{
if (error && ignore_errors)
return;
/* in multi-threaded mode protect from concurrent safe_exit's */
if (counter)
pthread_mutex_lock(&counter_mutex);
if (mysql)
mysql_close(mysql);

View File

@@ -1,5 +1,6 @@
/*
Copyright (c) 2005, 2012, Oracle and/or its affiliates.
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -242,7 +243,7 @@ void print_conclusions_csv(conclusions *con);
void generate_stats(conclusions *con, option_string *eng, stats *sptr);
uint parse_comma(const char *string, uint **range);
uint parse_delimiter(const char *script, statement **stmt, char delm);
uint parse_option(const char *origin, option_string **stmt, char delm);
int parse_option(const char *origin, option_string **stmt, char delm);
static int drop_schema(MYSQL *mysql, const char *db);
uint get_random_string(char *buf);
static statement *build_table_string(void);
@@ -1264,7 +1265,13 @@ get_options(int *argc,char ***argv)
if (num_int_cols_opt)
{
option_string *str;
parse_option(num_int_cols_opt, &str, ',');
if(parse_option(num_int_cols_opt, &str, ',') == -1)
{
fprintf(stderr, "Invalid value specified for the option "
"'number-int-cols'\n");
option_cleanup(str);
return 1;
}
num_int_cols= atoi(str->string);
if (str->option)
num_int_cols_index= atoi(str->option);
@@ -1275,7 +1282,13 @@ get_options(int *argc,char ***argv)
if (num_char_cols_opt)
{
option_string *str;
parse_option(num_char_cols_opt, &str, ',');
if(parse_option(num_char_cols_opt, &str, ',') == -1)
{
fprintf(stderr, "Invalid value specified for the option "
"'number-char-cols'\n");
option_cleanup(str);
return 1;
}
num_char_cols= atoi(str->string);
if (str->option)
num_char_cols_index= atoi(str->option);
@@ -1512,7 +1525,13 @@ get_options(int *argc,char ***argv)
printf("Parsing engines to use.\n");
if (default_engine)
parse_option(default_engine, &engine_options, ',');
{
if(parse_option(default_engine, &engine_options, ',') == -1)
{
fprintf(stderr, "Invalid value specified for the option 'engine'\n");
return 1;
}
}
if (tty_password)
opt_password= get_tty_password(NullS);
@@ -1989,7 +2008,7 @@ end:
DBUG_RETURN(0);
}
uint
int
parse_option(const char *origin, option_string **stmt, char delm)
{
char *retstr;
@@ -2014,6 +2033,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
char buffer[HUGE_STRING_LENGTH]= "";
char *buffer_ptr;
/*
Return an error if the length of the any of the comma seprated value
exceeds HUGE_STRING_LENGTH.
*/
if ((size_t)(retstr - ptr) > HUGE_STRING_LENGTH)
return -1;
count++;
strncpy(buffer, ptr, (size_t)(retstr - ptr));
/*
@@ -2053,6 +2079,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
{
char *origin_ptr;
/*
Return an error if the length of the any of the comma seprated value
exceeds HUGE_STRING_LENGTH.
*/
if (strlen(ptr) > HUGE_STRING_LENGTH)
return -1;
if ((origin_ptr= strchr(ptr, ':')))
{
char *option_ptr;
@@ -2063,13 +2096,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
option_ptr= (char *)ptr + 1 + tmp->length;
/* Move past the : and the first string */
tmp->option_length= (size_t)((ptr + length) - option_ptr);
tmp->option_length= strlen(option_ptr);
tmp->option= my_strndup(option_ptr, tmp->option_length,
MYF(MY_FAE));
}
else
{
tmp->length= (size_t)((ptr + length) - ptr);
tmp->length= strlen(ptr);
tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE));
}

View File

@@ -33,7 +33,7 @@
And many others
*/
#define MTEST_VERSION "3.4"
#define MTEST_VERSION "3.5"
#include "client_priv.h"
#include <mysql_version.h>
@@ -121,7 +121,7 @@ static my_bool tty_password= 0;
static my_bool opt_mark_progress= 0;
static my_bool ps_protocol= 0, ps_protocol_enabled= 0;
static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
static my_bool view_protocol= 0, view_protocol_enabled= 0;
static my_bool view_protocol= 0, view_protocol_enabled= 0, wait_longer= 0;
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
static my_bool parsing_disabled= 0;
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
@@ -839,6 +839,7 @@ static void handle_no_active_connection(struct st_command* command,
#define EMB_END_CONNECTION 3
#define EMB_PREPARE_STMT 4
#define EMB_EXECUTE_STMT 5
#define EMB_CLOSE_STMT 6
/* workaround for MySQL BUG#57491 */
#undef MY_WME
@@ -887,6 +888,9 @@ pthread_handler_t connection_thread(void *arg)
case EMB_EXECUTE_STMT:
cn->result= mysql_stmt_execute(cn->stmt);
break;
case EMB_CLOSE_STMT:
cn->result= mysql_stmt_close(cn->stmt);
break;
default:
DBUG_ASSERT(0);
}
@@ -984,6 +988,17 @@ static int do_stmt_execute(struct st_connection *cn)
}
static int do_stmt_close(struct st_connection *cn)
{
/* The cn->stmt is already set. */
if (!cn->has_thread)
return mysql_stmt_close(cn->stmt);
signal_connection_thd(cn, EMB_CLOSE_STMT);
wait_query_thread_done(cn);
return cn->result;
}
static void emb_close_connection(struct st_connection *cn)
{
if (!cn->has_thread)
@@ -1019,6 +1034,7 @@ static void init_connection_thd(struct st_connection *cn)
#define do_read_query_result(cn) mysql_read_query_result(cn->mysql)
#define do_stmt_prepare(cn, q, q_len) mysql_stmt_prepare(cn->stmt, q, q_len)
#define do_stmt_execute(cn) mysql_stmt_execute(cn->stmt)
#define do_stmt_close(cn) mysql_stmt_close(cn->stmt)
#endif /*EMBEDDED_LIBRARY*/
@@ -1378,11 +1394,11 @@ void close_connections()
DBUG_ENTER("close_connections");
for (--next_con; next_con >= connections; --next_con)
{
if (next_con->stmt)
do_stmt_close(next_con);
#ifdef EMBEDDED_LIBRARY
emb_close_connection(next_con);
#endif
if (next_con->stmt)
mysql_stmt_close(next_con->stmt);
next_con->stmt= 0;
mysql_close(next_con->mysql);
next_con->mysql= 0;
@@ -4641,7 +4657,7 @@ void do_sync_with_master2(struct st_command *command, long offset,
MYSQL_ROW row;
MYSQL *mysql= cur_con->mysql;
char query_buf[FN_REFLEN+128];
int timeout= 300; /* seconds */
int timeout= wait_longer ? 1500 : 300; /* seconds */
if (!master_pos.file[0])
die("Calling 'sync_with_master' without calling 'save_master_pos'");
@@ -4995,7 +5011,7 @@ static int my_kill(int pid, int sig)
void do_shutdown_server(struct st_command *command)
{
long timeout=60;
long timeout= wait_longer ? 60*5 : 60;
int pid;
DYNAMIC_STRING ds_pidfile_name;
MYSQL* mysql = cur_con->mysql;
@@ -5064,7 +5080,6 @@ void do_shutdown_server(struct st_command *command)
(void)my_kill(pid, 9);
DBUG_VOID_RETURN;
}
@@ -5491,7 +5506,11 @@ void do_close_connection(struct st_command *command)
con->mysql->net.vio = 0;
}
}
#else
#endif /*!EMBEDDED_LIBRARY*/
if (con->stmt)
do_stmt_close(con);
con->stmt= 0;
#ifdef EMBEDDED_LIBRARY
/*
As query could be still executed in a separate theread
we need to check if the query's thread was finished and probably wait
@@ -5499,9 +5518,6 @@ void do_close_connection(struct st_command *command)
*/
emb_close_connection(con);
#endif /*EMBEDDED_LIBRARY*/
if (con->stmt)
mysql_stmt_close(con->stmt);
con->stmt= 0;
mysql_close(con->mysql);
con->mysql= 0;
@@ -6936,6 +6952,9 @@ static struct my_option my_long_options[] =
"Number of seconds before connection timeout.",
&opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
120, 0, 3600 * 12, 0, 0, 0},
{"wait-longer-for-timeouts", 0,
"Wait longer for timeouts. Useful when running under valgrind",
&wait_longer, &wait_longer, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"plugin_dir", 0, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

View File

@@ -28,7 +28,7 @@ ELSE()
SET(RUN_ABI_CHECK 0)
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC AND RUN_ABI_CHECK)
IF(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang" AND RUN_ABI_CHECK)
IF(CMAKE_C_COMPILER MATCHES "ccache$")
SET(COMPILER ${CMAKE_C_COMPILER_ARG1})
STRING(REGEX REPLACE "^ " "" COMPILER ${COMPILER})

View File

@@ -9,11 +9,13 @@ SET(fail_patterns
FAIL_REGEX "unrecognized .*option"
FAIL_REGEX "ignoring unknown option"
FAIL_REGEX "warning:.*ignored"
FAIL_REGEX "warning:.*is valid for.*but not for"
FAIL_REGEX "warning:.*redefined"
FAIL_REGEX "[Ww]arning: [Oo]ption"
)
MACRO (MY_CHECK_C_COMPILER_FLAG flag result)
MACRO (MY_CHECK_C_COMPILER_FLAG flag)
STRING(REGEX REPLACE "[-,= ]" "_" result "HAVE_C_${flag}")
SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}")
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${result}
@@ -21,7 +23,8 @@ MACRO (MY_CHECK_C_COMPILER_FLAG flag result)
SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}")
ENDMACRO()
MACRO (MY_CHECK_CXX_COMPILER_FLAG flag result)
MACRO (MY_CHECK_CXX_COMPILER_FLAG flag)
STRING(REGEX REPLACE "[-,= ]" "_" result "HAVE_CXX_${flag}")
SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}")
CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${result}
@@ -35,10 +38,11 @@ FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag)
IF(WIN32)
RETURN()
ENDIF()
MY_CHECK_C_COMPILER_FLAG(${flag} HAVE_C_${flag})
MY_CHECK_CXX_COMPILER_FLAG(${flag} HAVE_CXX_${flag})
MY_CHECK_C_COMPILER_FLAG(${flag})
MY_CHECK_CXX_COMPILER_FLAG(${flag})
STRING(REGEX REPLACE "[-,= ]" "_" result "${flag}")
FOREACH(lang C CXX)
IF (HAVE_${lang}_${flag})
IF (HAVE_${lang}_${result})
IF(ARGN)
FOREACH(type ${ARGN})
SET(CMAKE_${lang}_FLAGS_${type} "${CMAKE_${lang}_FLAGS_${type}} ${flag}" PARENT_SCOPE)

View File

@@ -21,11 +21,12 @@ SET(CPACK_COMPONENT_MANPAGESCLIENT_GROUP "client")
SET(CPACK_COMPONENT_README_GROUP "server")
SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "shared")
SET(CPACK_COMPONENT_COMMON_GROUP "common")
SET(CPACK_COMPONENT_CLIENTPLUGINS_GROUP "common")
SET(CPACK_COMPONENT_COMPAT_GROUP "compat")
SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts
SupportFiles Development ManPagesDevelopment
ManPagesTest Readme ManPagesClient Test
Common Client SharedLibraries)
Common Client SharedLibraries ClientPlugins)
SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")

View File

@@ -58,7 +58,7 @@ FOREACH(file ${ABI_HEADERS})
EXECUTE_PROCESS(
COMMAND ${COMPILER}
-E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
-E -nostdinc -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
-I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
${file}
ERROR_QUIET OUTPUT_FILE ${tmpfile})

View File

@@ -308,17 +308,15 @@ INCLUDE(CheckCCompilerFlag)
SET(VISIBILITY_HIDDEN_FLAG)
IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
ELSEIF(UNIX)
CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
IF(HAVE_VISIBILITY_HIDDEN)
SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden")
ENDIF()
ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
ENDIF()
# We try to hide the symbols in yassl/zlib to avoid name clashes with
# other libraries like openssl.
FUNCTION(RESTRICT_SYMBOL_EXPORTS target)

View File

@@ -15,8 +15,8 @@
# Common warning flags for GCC, G++, Clang and Clang++
SET(MY_WARNING_FLAGS "-Wall -Wextra -Wformat-security -Wno-init-self")
MY_CHECK_C_COMPILER_FLAG("-Wvla" HAVE_WVLA) # Requires GCC 4.3+ or Clang
IF(HAVE_WVLA)
MY_CHECK_C_COMPILER_FLAG("-Wvla") # Requires GCC 4.3+ or Clang
IF(HAVE_C__Wvla)
SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wvla")
ENDIF()
@@ -41,11 +41,11 @@ IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
ENDIF()
# Set warning flags for GCC/Clang
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
IF(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
SET(MY_MAINTAINER_C_WARNINGS "${MY_C_WARNING_FLAGS}")
ENDIF()
# Set warning flags for G++/Clang++
IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
SET(MY_MAINTAINER_CXX_WARNINGS "${MY_CXX_WARNING_FLAGS}")
ENDIF()

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2015, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -60,9 +60,9 @@ IF(NOT GIT_EXECUTABLE)
# Save bison output first.
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
${CMAKE_BINARY_DIR}/sql_yacc.cc COPY_ONLY)
${CMAKE_BINARY_DIR}/sql_yacc.cc COPYONLY)
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h
${CMAKE_BINARY_DIR}/sql_yacc.h COPY_ONLY)
${CMAKE_BINARY_DIR}/sql_yacc.h COPYONLY)
IF(CMAKE_GENERATOR MATCHES "Makefiles")
# make clean
@@ -74,9 +74,9 @@ IF(NOT GIT_EXECUTABLE)
# Restore bison output
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.cc
${CMAKE_BINARY_DIR}/sql/sql_yacc.cc COPY_ONLY)
${CMAKE_BINARY_DIR}/sql/sql_yacc.cc COPYONLY)
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.h
${CMAKE_BINARY_DIR}/sql/sql_yacc.h COPY_ONLY)
${CMAKE_BINARY_DIR}/sql/sql_yacc.h COPYONLY)
FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.cc)
FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.h)
ENDIF()

View File

@@ -352,7 +352,6 @@ SET(C_HAS___inline 1 CACHE INTERNAL "")
SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "")
SET(FIONREAD_IN_SYS_FILIO CACHE INTERNAL "")
SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "")
SET(HAVE_CXXABI_H CACHE INTERNAL "")
SET(HAVE_NDIR_H CACHE INTERNAL "")
SET(HAVE_SYS_NDIR_H CACHE INTERNAL "")
SET(HAVE_SYS_NDIR_H CACHE INTERNAL "")
@@ -371,4 +370,8 @@ SET(HAVE_SYS_UTSNAME_H CACHE INTERNAL "")
SET(HAVE_PTHREAD_ATTR_GETGUARDSIZE CACHE INTERNAL "")
SET(HAVE_UCONTEXT_H CACHE INTERNAL "")
SET(HAVE_SOCKPEERCRED CACHE INTERNAL "")
SET(HAVE_ABI_CXA_DEMANGLE CACHE INTERNAL "")
SET(HAVE_GCC_ATOMIC_BUILTINS CACHE INTERNAL "")
SET(HAVE_GCC_C11_ATOMICS CACHE INTERNAL "")
SET(HAVE_VISIBILITY_HIDDEN CACHE INTERNAL "")
ENDIF(MSVC)

View File

@@ -147,7 +147,6 @@ MACRO (MYSQL_CHECK_SSL)
IF (WITH_SSL_PATH)
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
ENDIF()
MESSAGE(STATUS "suffixes <${CMAKE_FIND_LIBRARY_SUFFIXES}>")
FIND_LIBRARY(OPENSSL_LIBRARIES
NAMES ssl ssleay32 ssleay32MD
HINTS ${OPENSSL_ROOT_DIR}/lib)

View File

@@ -27,7 +27,6 @@
#cmakedefine HAVE_BSEARCH 1
#cmakedefine HAVE_CRYPT_H 1
#cmakedefine HAVE_CURSES_H 1
#cmakedefine HAVE_CXXABI_H 1
#cmakedefine HAVE_BFD_H 1
#cmakedefine HAVE_NCURSES_H 1
#cmakedefine HAVE_NDIR_H 1
@@ -88,6 +87,7 @@
#cmakedefine HAVE_SYS_UTSNAME_H 1
#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_STREAM_H 1
#cmakedefine HAVE_SYS_SYSCALL_H 1
#cmakedefine HAVE_SYS_TERMCAP_H 1
#cmakedefine HAVE_SYS_TIMEB_H 1
#cmakedefine HAVE_SYS_TIMES_H 1
@@ -205,7 +205,7 @@
#cmakedefine HAVE_MADVISE 1
#cmakedefine HAVE_DECL_MADVISE 1
#cmakedefine HAVE_DECL_TGOTO 1
#cmakedefine HAVE_DECL_MHA_MAPSIZE_VA
#cmakedefine HAVE_DECL_MHA_MAPSIZE_VA 1
#cmakedefine HAVE_MALLINFO 1
#cmakedefine HAVE_MEMCPY 1
#cmakedefine HAVE_MEMMOVE 1
@@ -400,7 +400,7 @@
#cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@
#cmakedefine HAVE_MBSTATE_T
#cmakedefine HAVE_MBSTATE_T 1
#define MAX_INDEXES 64
@@ -435,15 +435,15 @@
#cmakedefine HAVE_WCTYPE_H 1
#cmakedefine HAVE_WCHAR_H 1
#cmakedefine HAVE_LANGINFO_H 1
#cmakedefine HAVE_MBRLEN
#cmakedefine HAVE_MBSCMP
#cmakedefine HAVE_MBSRTOWCS
#cmakedefine HAVE_WCRTOMB
#cmakedefine HAVE_MBRTOWC
#cmakedefine HAVE_WCSCOLL
#cmakedefine HAVE_WCSDUP
#cmakedefine HAVE_WCWIDTH
#cmakedefine HAVE_WCTYPE
#cmakedefine HAVE_MBRLEN 1
#cmakedefine HAVE_MBSCMP 1
#cmakedefine HAVE_MBSRTOWCS 1
#cmakedefine HAVE_WCRTOMB 1
#cmakedefine HAVE_MBRTOWC 1
#cmakedefine HAVE_WCSCOLL 1
#cmakedefine HAVE_WCSDUP 1
#cmakedefine HAVE_WCWIDTH 1
#cmakedefine HAVE_WCTYPE 1
#cmakedefine HAVE_ISWLOWER 1
#cmakedefine HAVE_ISWUPPER 1
#cmakedefine HAVE_TOWLOWER 1
@@ -457,7 +457,7 @@
#cmakedefine HAVE_STRCASECMP 1
#cmakedefine HAVE_STRNCASECMP 1
#cmakedefine HAVE_STRDUP 1
#cmakedefine HAVE_LANGINFO_CODESET
#cmakedefine HAVE_LANGINFO_CODESET 1
#cmakedefine HAVE_TCGETATTR 1
#cmakedefine HAVE_FLOCKFILE 1
@@ -475,6 +475,7 @@
#cmakedefine MY_ATOMIC_MODE_DUMMY 1
#cmakedefine HAVE_GCC_ATOMIC_BUILTINS 1
#cmakedefine HAVE_GCC_C11_ATOMICS 1
#cmakedefine HAVE_SOLARIS_ATOMIC 1
#cmakedefine HAVE_DECL_SHM_HUGETLB 1
#cmakedefine HAVE_LARGE_PAGES 1

View File

@@ -52,7 +52,7 @@ IF(NOT SYSTEM_TYPE)
ENDIF()
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# MySQL "canonical" GCC flags. At least -fno-rtti flag affects
# ABI and cannot be simply removed.
SET(CMAKE_CXX_FLAGS
@@ -175,7 +175,6 @@ CHECK_INCLUDE_FILES (alloca.h HAVE_ALLOCA_H)
CHECK_INCLUDE_FILES (aio.h HAVE_AIO_H)
CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H)
CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H)
CHECK_INCLUDE_FILE_CXX (cxxabi.h HAVE_CXXABI_H)
CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H)
@@ -229,6 +228,7 @@ CHECK_INCLUDE_FILES ("sys/types.h;sys/shm.h" HAVE_SYS_SHM_H)
CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES (sys/stream.h HAVE_SYS_STREAM_H)
CHECK_INCLUDE_FILES (sys/syscall.h HAVE_SYS_SYSCALL_H)
CHECK_INCLUDE_FILES (sys/termcap.h HAVE_SYS_TERMCAP_H)
CHECK_INCLUDE_FILES ("curses.h;term.h" HAVE_TERM_H)
CHECK_INCLUDE_FILES (asm/termbits.h HAVE_ASM_TERMBITS_H)
@@ -275,8 +275,8 @@ ENDIF()
FIND_PACKAGE (Threads)
FUNCTION(MY_CHECK_PTHREAD_ONCE_INIT)
CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG)
IF(NOT HAVE_WERROR_FLAG)
MY_CHECK_C_COMPILER_FLAG("-Werror")
IF(NOT HAVE_C__Werror)
RETURN()
ENDIF()
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
@@ -320,6 +320,7 @@ ENDIF()
#
# Tests for functions
#
CHECK_FUNCTION_EXISTS (accept4 HAVE_ACCEPT4)
CHECK_FUNCTION_EXISTS (access HAVE_ACCESS)
#CHECK_FUNCTION_EXISTS (aiowait HAVE_AIOWAIT)
CHECK_FUNCTION_EXISTS (aio_read HAVE_AIO_READ)
@@ -880,7 +881,7 @@ ENDIF(NOT HAVE_POSIX_SIGNALS)
# Assume regular sprintf
SET(SPRINTFS_RETURNS_INT 1)
IF(CMAKE_COMPILER_IS_GNUCXX AND HAVE_CXXABI_H)
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
CHECK_CXX_SOURCE_COMPILES("
#include <cxxabi.h>
int main(int argc, char **argv)
@@ -952,7 +953,6 @@ SET(SIGNAL_WITH_VIO_CLOSE 1)
MARK_AS_ADVANCED(NO_ALARM)
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(WITH_ATOMIC_OPS STREQUAL "up")
SET(MY_ATOMIC_MODE_DUMMY 1 CACHE BOOL "Assume single-CPU mode, no concurrency")
ELSEIF(WITH_ATOMIC_OPS STREQUAL "smp")
@@ -981,10 +981,17 @@ ELSEIF(NOT WITH_ATOMIC_OPS)
return 0;
}"
HAVE_GCC_ATOMIC_BUILTINS)
CHECK_CXX_SOURCE_COMPILES("
int main()
{
long long int var= 1;
long long int *ptr= &var;
return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
}"
HAVE_GCC_C11_ATOMICS)
ELSE()
MESSAGE(FATAL_ERROR "${WITH_ATOMIC_OPS} is not a valid value for WITH_ATOMIC_OPS!")
ENDIF()
ENDIF()
SET(WITH_ATOMIC_OPS "${WITH_ATOMIC_OPS}" CACHE STRING "Implement atomic operations using atomic CPU instructions for multi-processor (smp) or uniprocessor (up) configuration. By default gcc built-in sync functions are used, if available and 'smp' configuration otherwise.")
MARK_AS_ADVANCED(WITH_ATOMIC_OPS MY_ATOMIC_MODE_DUMMY)

View File

@@ -1,2 +1,3 @@
[mysqld_safe]
skip_log_error
syslog

View File

@@ -4,7 +4,13 @@ Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net>
Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, cmake (>= 2.7), libaio-dev, ${MAYBE_LIBCRACK} libjemalloc-dev (>= 3.0.0)
Build-Depends: procps | hurd, debhelper, libncurses5-dev (>= 5.0-6),
perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3),
zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev,
libpam0g-dev, psmisc, po-debconf, chrpath,
dpatch, gawk, bison, lsb-release, hardening-wrapper,
cmake (>= 2.7), libaio-dev, ${MAYBE_LIBCRACK}
libjemalloc-dev (>= 3.0.0)
Standards-Version: 3.8.3
Homepage: http://mariadb.org/
Vcs-Browser: https://github.com/MariaDB/server/tree/10.1/
@@ -16,7 +22,9 @@ Architecture: any
Depends: mariadb-common, libmysqlclient18 (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends}
Conflicts: mariadb-server-10.0 (<< 10.0.5), mariadb-galera-server-10.0 (<< 10.0.5),
mariadb-server-5.5 (<< 5.5.33), mariadb-galera-server-5.5 (<< 5.5.33),
mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3
mariadb-server-5.1,
mariadb-server-5.2,
mariadb-server-5.3
Description: MariaDB database client library
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
@@ -105,13 +113,15 @@ Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0,
mysql-client-core-5.1, mysql-client-core-5.5,
mariadb-client-5.1, mariadb-client-core-5.1,
mariadb-client-5.2, mariadb-client-core-5.2,
mariadb-client-5.3, mariadb-client-core-5.3
mariadb-client-5.3, mariadb-client-core-5.3,
mariadb-client-5.5, mariadb-client-core-5.5
Replaces: mysql-client (<< 5.0.51), mysql-client-5.0,
mysql-client-5.1, mysql-client-5.5,
mysql-client-core-5.1, mysql-client-core-5.5,
mariadb-client-5.1, mariadb-client-core-5.1,
mariadb-client-5.2, mariadb-client-core-5.2,
mariadb-client-5.3, mariadb-client-core-5.3
mariadb-client-5.3, mariadb-client-core-5.3,
mariadb-client-5.5, mariadb-client-core-5.5
Description: MariaDB database core client binaries
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
@@ -131,11 +141,16 @@ Provides: virtual-mysql-client, mysql-client,
mysql-client-4.1, mysql-client-5.1, mysql-client-5.5
Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1,
mariadb-client (<< ${source:Version}),
mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, mysql-client-5.5
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
mariadb-client-5.5, mysql-client-5.5
Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1,
mysql-client-5.5,
mariadb-client (<< ${source:Version}),
mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
mariadb-client-5.5, mysql-client-5.5
Description: MariaDB database client binaries
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
@@ -149,18 +164,16 @@ Package: mariadb-server-core-10.1
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libmariadbclient18 (>= ${binary:Version})
Provides: mysql-server-core, mysql-server-core-5.1, mysql-server-core-5.5
Conflicts: mariadb-server-5.1 (<< 5.1.60),
mariadb-server-5.2 (<< 5.2.10),
mariadb-server-5.3 (<< 5.3.3),
mysql-server-5.0,
mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5,
mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5
Replaces: mariadb-server-5.1 (<< 5.1.60),
mariadb-server-5.2 (<< 5.2.10),
mariadb-server-5.3 (<< 5.3.3),
mysql-server-5.0,
mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5,
mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5
Conflicts: mysql-server-5.0, mysql-server-core-5.0,
mariadb-server-core-5.1, mysql-server-core-5.1,
mariadb-server-core-5.2,
mariadb-server-core-5.3,
mariadb-server-core-5.5, mysql-server-core-5.5
Replaces: mysql-server-5.0, mysql-server-core-5.0,
mariadb-server-core-5.1, mysql-server-core-5.1,
mariadb-server-core-5.2,
mariadb-server-core-5.3,
mariadb-server-core-5.5, mysql-server-core-5.5
Description: MariaDB database core server files
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
@@ -173,10 +186,10 @@ Package: mariadb-test-10.1
Section: database
Architecture: any
Depends: mariadb-server-10.1 (= ${source:Version}), mariadb-client-10.1 (= ${source:Version})
Suggests: patch
Conflicts: mariadb-test (<< ${source:Version}),
mariadb-test-5.1, mariadb-test-5.2, mariadb-test-5.3,
mariadb-server-5.5 (<< 5.5.33), mariadb-galera-server-5.5 (<< 5.5.33)
Suggests: patch
Replaces: mariadb-test (<< ${source:Version}),
mariadb-test-5.1, mariadb-test-5.2, mariadb-test-5.3
Description: MariaDB database regression test suite
@@ -199,12 +212,18 @@ Depends: mariadb-client-10.1 (>= ${source:Version}), libdbi-perl,
coreutils, bsdutils, findutils, tar
Provides: mariadb-server, mysql-server, virtual-mysql-server
Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}),
mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5,
mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3,
mysql-server-4.1, mysql-server-5.0,
mariadb-server-5.1, mysql-server-5.1,
mariadb-server-5.2,
mariadb-server-5.3,
mariadb-server-5.5, mysql-server-5.5,
mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0
Replaces: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}),
mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5,
mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3,
mysql-server-4.1, mysql-server-5.0,
mariadb-server-5.1, mysql-server-5.1,
mariadb-server-5.2,
mariadb-server-5.3,
mariadb-server-5.5, mysql-server-5.5,
libmariadbclient16 (<< 5.3.4), libmariadbclient-dev (<< 5.5.0),
mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0
Description: MariaDB database server binaries

View File

@@ -4,7 +4,13 @@ Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net>
Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, cmake (>= 2.7), libaio-dev, ${MAYBE_LIBCRACK} libjemalloc-dev (>= 3.0.0)
Build-Depends: procps | hurd, debhelper, libncurses5-dev (>= 5.0-6),
perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3),
zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev,
libpam0g-dev, psmisc, po-debconf, chrpath,
dpatch, gawk, bison, lsb-release, hardening-wrapper,
cmake (>= 2.7), libaio-dev, ${MAYBE_LIBCRACK}
libjemalloc-dev (>= 3.0.0)
Standards-Version: 3.8.2
Homepage: http://mariadb.org/
Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/10.1/files
@@ -16,7 +22,9 @@ Architecture: any
Depends: mariadb-common, libmysqlclient18 (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends}
Conflicts: mariadb-server-10.0 (<< 10.0.5), mariadb-galera-server-10.0 (<< 10.0.5),
mariadb-server-5.5 (<< 5.5.33), mariadb-galera-server-5.5 (<< 5.5.33),
mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3
mariadb-server-5.1,
mariadb-server-5.2,
mariadb-server-5.3
Description: MariaDB database client library
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
@@ -105,13 +113,15 @@ Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0,
mysql-client-core-5.1, mysql-client-core-5.5,
mariadb-client-5.1, mariadb-client-core-5.1,
mariadb-client-5.2, mariadb-client-core-5.2,
mariadb-client-5.3, mariadb-client-core-5.3
mariadb-client-5.3, mariadb-client-core-5.3,
mariadb-client-5.5, mariadb-client-core-5.5
Replaces: mysql-client (<< 5.0.51), mysql-client-5.0,
mysql-client-5.1, mysql-client-5.5,
mysql-client-core-5.1, mysql-client-core-5.5,
mariadb-client-5.1, mariadb-client-core-5.1,
mariadb-client-5.2, mariadb-client-core-5.2,
mariadb-client-5.3, mariadb-client-core-5.3
mariadb-client-5.3, mariadb-client-core-5.3,
mariadb-client-5.5, mariadb-client-core-5.5
Description: MariaDB database core client binaries
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
@@ -131,11 +141,16 @@ Provides: virtual-mysql-client, mysql-client,
mysql-client-4.1, mysql-client-5.1, mysql-client-5.5
Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1,
mariadb-client (<< ${source:Version}),
mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, mysql-client-5.5
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
mariadb-client-5.5, mysql-client-5.5
Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1,
mysql-client-5.5,
mariadb-client (<< ${source:Version}),
mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
mariadb-client-5.5, mysql-client-5.5
Description: MariaDB database client binaries
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
@@ -149,12 +164,16 @@ Package: mariadb-server-core-10.1
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libmariadbclient18 (>= ${binary:Version})
Provides: mysql-server-core, mysql-server-core-5.1, mysql-server-core-5.5
Conflicts: mysql-server-5.0,
mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5,
mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5
Replaces: mysql-server-5.0,
mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5,
mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5
Conflicts: mysql-server-5.0, mysql-server-core-5.0,
mariadb-server-core-5.1, mysql-server-core-5.1,
mariadb-server-core-5.2,
mariadb-server-core-5.3,
mariadb-server-core-5.5, mysql-server-core-5.5
Replaces: mysql-server-5.0, mysql-server-core-5.0,
mariadb-server-core-5.1, mysql-server-core-5.1,
mariadb-server-core-5.2,
mariadb-server-core-5.3,
mariadb-server-core-5.5, mysql-server-core-5.5
Description: MariaDB database core server files
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
@@ -193,12 +212,18 @@ Depends: mariadb-client-10.1 (>= ${source:Version}), libdbi-perl,
coreutils, bsdutils, findutils, tar
Provides: mariadb-server, mysql-server, virtual-mysql-server
Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}),
mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5,
mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3,
mysql-server-4.1, mysql-server-5.0,
mariadb-server-5.1, mysql-server-5.1,
mariadb-server-5.2,
mariadb-server-5.3,
mariadb-server-5.5, mysql-server-5.5,
mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0
Replaces: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}),
mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5,
mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3,
mysql-server-4.1, mysql-server-5.0,
mariadb-server-5.1, mysql-server-5.1,
mariadb-server-5.2,
mariadb-server-5.3,
mariadb-server-5.5, mysql-server-5.5,
libmariadbclient16 (<< 5.3.4), libmariadbclient-dev (<< 5.5.0),
mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0
Description: MariaDB database server binaries

View File

@@ -20,12 +20,9 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
ADD_DEFINITIONS(${SSL_DEFINES})
IF(CMAKE_COMPILER_IS_GNUXX)
#Remove -fno-implicit-templates
#(yassl sources cannot be compiled with it)
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS
${CMAKE_CXX_FLAGS})
ENDIF()
#Remove -fno-implicit-templates
#(yassl sources cannot be compiled with it)
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp
src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
src/yassl_imp.cpp src/yassl_int.cpp)

View File

@@ -31,8 +31,8 @@
#define make_atomic_store_body(S) *a= v
#define MY_ATOMIC_MODE "gcc-builtins-up"
#elif defined(__ATOMIC_SEQ_CST)
#define MY_ATOMIC_MODE "gcc-builtins-smp"
#elif defined(HAVE_GCC_C11_ATOMICS)
#define MY_ATOMIC_MODE "gcc-atomics-smp"
#define make_atomic_load_body(S) \
ret= __atomic_load_n(a, __ATOMIC_SEQ_CST)
#define make_atomic_store_body(S) \

View File

@@ -201,6 +201,10 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
#define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */
#define MY_CS_LOWER_SORT 32768 /* If use lower case as weight */
#define MY_CS_STRNXFRM_BAD_NWEIGHTS 0x10000 /* strnxfrm ignores "nweights" */
#define MY_CS_NOPAD 0x20000 /* if does not ignore trailing spaces */
#define MY_CS_NON1TO1 0x40000 /* Has a complex mapping from characters
to weights, e.g. contractions, expansions,
ignorable characters */
#define MY_CHARSET_UNDEFINED 0
/* Character repertoire flags */
@@ -351,7 +355,6 @@ struct my_collation_handler_st
my_bool (*propagate)(CHARSET_INFO *cs, const uchar *str, size_t len);
};
extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
@@ -512,6 +515,20 @@ struct my_charset_handler_st
char *dst, size_t dst_length,
const char *src, size_t src_length,
size_t nchars, MY_STRCOPY_STATUS *status);
/**
Write a character to the target string, using its native code.
For Unicode character sets (utf8, ucs2, utf16, utf16le, utf32, filename)
native codes are equvalent to Unicode code points.
For 8bit character sets the native code is just the byte value.
For Asian characters sets:
- MB1 native code is just the byte value (e.g. on the ASCII range)
- MB2 native code is ((b0 << 8) + b1).
- MB3 native code is ((b0 <<16) + (b1 << 8) + b2)
Note, CHARSET_INFO::min_sort_char and CHARSET_INFO::max_sort_char
are defined in native notation and should be written using
cs->cset->native_to_mb() rather than cs->cset->wc_mb().
*/
my_charset_conv_wc_mb native_to_mb;
};
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
@@ -665,6 +682,7 @@ extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
int my_wc_mb_bin(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *);
int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *);

View File

@@ -501,7 +501,9 @@ enum ha_base_keytype {
#define HA_ERR_DISK_FULL 189
#define HA_ERR_INCOMPATIBLE_DEFINITION 190
#define HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE 191 /* Too many words in a phrase */
#define HA_ERR_LAST 191 /* Copy of last error nr */
#define HA_ERR_DECRYPTION_FAILED 192 /* Table encrypted but
decypt failed */
#define HA_ERR_LAST 192 /* Copy of last error nr */
/* Number of different errors */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)

View File

@@ -36,58 +36,54 @@ extern "C" {
/* The max key length of all supported algorithms */
#define MY_AES_MAX_KEY_LENGTH 32
#define MY_AES_CTX_SIZE 512
enum my_aes_mode {
MY_AES_ECB, MY_AES_CBC
#ifdef HAVE_EncryptAes128Ctr
int my_aes_encrypt_ctr(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length);
#define my_aes_decrypt_ctr my_aes_encrypt_ctr
, MY_AES_CTR
#endif
#ifdef HAVE_EncryptAes128Gcm
int my_aes_encrypt_gcm(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length);
int my_aes_decrypt_gcm(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length);
, MY_AES_GCM
#endif
};
int my_aes_encrypt_cbc(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
int my_aes_crypt_init(void *ctx, enum my_aes_mode mode, int flags,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen);
int my_aes_crypt_update(void *ctx, const uchar *src, uint slen,
uchar *dst, uint *dlen);
int my_aes_crypt_finish(void *ctx, uchar *dst, uint *dlen);
int my_aes_crypt(enum my_aes_mode mode, int flags,
const uchar *src, uint slen, uchar *dst, uint *dlen,
const uchar *key, uint klen, const uchar *iv, uint ivlen);
int my_aes_decrypt_cbc(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
/*
calculate the length of the cyphertext from the length of the plaintext
for different AES encryption modes with padding enabled.
Without padding (ENCRYPTION_FLAG_NOPAD) cyphertext has the same length
as the plaintext
*/
static inline uint my_aes_get_size(enum my_aes_mode mode __attribute__((unused)), uint source_length)
{
#ifdef HAVE_EncryptAes128Ctr
if (mode == MY_AES_CTR)
return source_length;
#ifdef HAVE_EncryptAes128Gcm
if (mode == MY_AES_GCM)
return source_length + MY_AES_BLOCK_SIZE;
#endif
#endif
return (source_length / MY_AES_BLOCK_SIZE + 1) * MY_AES_BLOCK_SIZE;
}
int my_aes_encrypt_ecb(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
int my_aes_decrypt_ecb(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
static inline uint my_aes_ctx_size(enum my_aes_mode mode __attribute__((unused)))
{
return MY_AES_CTX_SIZE;
}
int my_random_bytes(uchar* buf, int num);
uint my_aes_get_size(uint source_length);
#ifdef __cplusplus
}
#endif

View File

@@ -39,8 +39,9 @@ C_MODE_START
#define GET_DOUBLE 14
#define GET_FLAGSET 15
#define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127
#define GET_ASK_ADDR 128
#define GET_AUTO 64
#define GET_TYPE_MASK 63
/**
Enumeration of the my_option::arg_type attributes.
@@ -100,6 +101,7 @@ typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *,
extern char *disabled_my_option;
extern char *autoset_my_option;
extern my_bool my_getopt_print_errors;
extern my_bool my_getopt_skip_unknown;
extern my_bool my_getopt_prefix_matching;

View File

@@ -477,6 +477,13 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#define UNINIT_VAR(x) x
#endif
/* This is only to be used when reseting variables in a class constructor */
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
#define LINT_INIT(x) x= 0
#else
#define LINT_INIT(x)
#endif
#if !defined(HAVE_UINT)
#undef HAVE_UINT
#define HAVE_UINT
@@ -594,6 +601,12 @@ typedef SOCKET_SIZE_TYPE size_socket;
#ifndef O_NOFOLLOW
#define O_NOFOLLOW 0
#endif
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
#ifndef SOCK_CLOEXEC
#define SOCK_CLOEXEC 0
#endif
/* additional file share flags for win32 */
#ifdef __WIN__

View File

@@ -94,7 +94,8 @@ static const char *handler_error_messages[]=
"Operation was interrupted by end user (probably kill command?)",
"Disk full",
"Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You have to dump and restore the table to fix this",
"Too many words in a FTS phrase or proximity search"
"Too many words in a FTS phrase or proximity search",
"Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match."
};
#endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */

View File

@@ -35,8 +35,7 @@
#define HAVE_WRITE_CORE
#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \
HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \
#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && HAVE_ABI_CXA_DEMANGLE && \
HAVE_WEAK_SYMBOL
#define BACKTRACE_DEMANGLE 1
#endif

View File

@@ -175,6 +175,7 @@ extern void set_malloc_size_cb(MALLOC_SIZE_CB func);
/* defines when allocating data */
extern void *my_malloc(size_t Size,myf MyFlags);
extern void *my_multi_malloc(myf MyFlags, ...);
extern void *my_multi_malloc_large(myf MyFlags, ...);
extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags);
extern void my_free(void *ptr);
extern void *my_memdup(const void *from,size_t length,myf MyFlags);
@@ -204,16 +205,17 @@ extern void my_large_free(uchar *ptr);
#endif /* GNUC */
#define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) ((void)0)
#define my_safe_alloca(size, max_alloca_sz) ((size <= max_alloca_sz) ? \
my_alloca(size) : \
my_malloc(size, MYF(0)))
#define my_safe_afree(ptr, size, max_alloca_sz) if (size > max_alloca_sz) \
my_free(ptr)
#define MAX_ALLOCA_SZ 4096
#define my_safe_alloca(size) (((size) <= MAX_ALLOCA_SZ) ? \
my_alloca(size) : \
my_malloc((size), MYF(MY_THREAD_SPECIFIC|MY_WME)))
#define my_safe_afree(ptr, size) \
do { if ((size) > MAX_ALLOCA_SZ) my_free(ptr); } while(0)
#else
#define my_alloca(SZ) my_malloc(SZ,MYF(MY_FAE))
#define my_afree(PTR) my_free(PTR)
#define my_safe_alloca(size, max_alloca_sz) my_alloca(size)
#define my_safe_afree(ptr, size, max_alloca_sz) my_afree(ptr)
#define my_safe_alloca(size) my_alloca(size)
#define my_safe_afree(ptr, size) my_afree(ptr)
#endif /* HAVE_ALLOCA */
#ifndef errno /* did we already get it? */
@@ -613,7 +615,6 @@ my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */
int my_b_pread(IO_CACHE *info, uchar *Buffer, size_t Count, my_off_t pos);
typedef uint32 ha_checksum;
extern ulong my_crc_dbug_check;
#include <my_alloc.h>
@@ -1028,9 +1029,9 @@ extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info,
char *to, size_t to_length,
const char *from, size_t length);
extern void thd_increment_bytes_sent(ulong length);
extern void thd_increment_bytes_received(ulong length);
extern void thd_increment_net_big_packet_count(ulong length);
extern void thd_increment_bytes_sent(void *thd, ulong length);
extern void thd_increment_bytes_received(void *thd, ulong length);
extern void thd_increment_net_big_packet_count(void *thd, ulong length);
#ifdef __WIN__
extern my_bool have_tcpip; /* Is set if tcpip is used */

View File

@@ -1,7 +1,5 @@
typedef char my_bool;
typedef int my_socket;
#include "mysql_version.h"
#include "mysql_com.h"
enum enum_server_command
{
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
@@ -31,7 +29,7 @@ typedef struct st_net {
my_bool thread_specific_malloc;
my_bool compress;
my_bool unused3;
unsigned char *unused;
void *thd;
unsigned int last_errno;
unsigned char error;
my_bool unused4;
@@ -83,7 +81,7 @@ enum enum_mysql_set_option
MYSQL_OPTION_MULTI_STATEMENTS_ON,
MYSQL_OPTION_MULTI_STATEMENTS_OFF
};
my_bool my_net_init(NET *net, Vio* vio, unsigned int my_flags);
my_bool my_net_init(NET *net, Vio* vio, void *thd, unsigned int my_flags);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net, my_bool clear_buffer);
@@ -102,7 +100,7 @@ struct my_rnd_struct;
enum Item_result
{
STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT,
TIME_RESULT,IMPOSSIBLE_RESULT
TIME_RESULT
};
typedef struct st_udf_args
{
@@ -143,7 +141,6 @@ void get_tty_password_buff(const char *opt_message, char *to, size_t length);
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
my_bool my_thread_init(void);
void my_thread_end(void);
#include "mysql_time.h"
typedef long my_time_t;
enum enum_mysql_timestamp_type
{
@@ -157,7 +154,6 @@ typedef struct st_mysql_time
my_bool neg;
enum enum_mysql_timestamp_type time_type;
} MYSQL_TIME;
#include "my_list.h"
typedef struct st_list {
struct st_list *prev,*next;
void *data;
@@ -199,8 +195,6 @@ typedef struct st_mysql_field {
typedef char **MYSQL_ROW;
typedef unsigned int MYSQL_FIELD_OFFSET;
typedef unsigned long long my_ulonglong;
#include "typelib.h"
#include "my_alloc.h"
typedef struct st_used_mem
{
struct st_used_mem *next;
@@ -244,7 +238,6 @@ typedef struct st_mysql_rows {
unsigned long length;
} MYSQL_ROWS;
typedef MYSQL_ROWS *MYSQL_ROW_OFFSET;
#include "my_alloc.h"
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
typedef struct st_mysql_data {
MYSQL_ROWS *data;

View File

@@ -3,7 +3,6 @@ struct st_mysql_client_plugin
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 *);
};
struct st_mysql;
#include <mysql/plugin_auth_common.h>
typedef struct st_plugin_vio_info
{
enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
@@ -24,7 +23,6 @@ struct st_mysql_client_plugin_AUTHENTICATION
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 *);
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
};
#include <mysql/auth_dialog_client.h>
struct st_mysql;
typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql,
int type, const char *prompt, char *buf, int buf_len);

View File

@@ -1,15 +1,11 @@
#include "plugin.h"
typedef char my_bool;
typedef void * MYSQL_PLUGIN;
#include <mysql/services.h>
#include <mysql/service_my_snprintf.h>
extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
#include <mysql/service_thd_alloc.h>
struct st_mysql_lex_string
{
char *str;
@@ -33,7 +29,6 @@ void *thd_memdup(void* thd, const void* str, unsigned int size);
MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
const char *str, unsigned int size,
int allocate_lex_string);
#include <mysql/service_thd_wait.h>
typedef enum _thd_wait_type_e {
THD_WAIT_SLEEP= 1,
THD_WAIT_DISKIO= 2,
@@ -54,7 +49,6 @@ extern struct thd_wait_service_st {
} *thd_wait_service;
void thd_wait_begin(void* thd, int wait_type);
void thd_wait_end(void* thd);
#include <mysql/service_progress_report.h>
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
void (*thd_progress_report_func)(void* thd,
@@ -75,9 +69,7 @@ void thd_progress_next_stage(void* thd);
void thd_progress_end(void* thd);
const char *set_thd_proc_info(void*, const char * info, const char *func,
const char *file, unsigned int line);
#include <mysql/service_debug_sync.h>
extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t);
#include <mysql/service_kill_statement.h>
enum thd_kill_levels {
THD_IS_NOT_KILLED=0,
THD_ABORT_SOFTLY=50,
@@ -87,8 +79,6 @@ extern struct kill_statement_service_st {
enum thd_kill_levels (*thd_kill_level_func)(const void*);
} *thd_kill_statement_service;
enum thd_kill_levels thd_kill_level(const void*);
#include <mysql/service_thd_timezone.h>
#include "mysql_time.h"
typedef long my_time_t;
enum enum_mysql_timestamp_type
{
@@ -108,7 +98,6 @@ extern struct thd_timezone_service_st {
} *thd_timezone_service;
my_time_t thd_TIME_to_gmt_sec(void* thd, const MYSQL_TIME *ltime, unsigned int *errcode);
void thd_gmt_sec_to_TIME(void* thd, MYSQL_TIME *ltime, my_time_t t);
#include <mysql/service_sha1.h>
extern struct my_sha1_service_st {
void (*my_sha1_type)(unsigned char*, const char*, size_t);
void (*my_sha1_multi_type)(unsigned char*, ...);
@@ -123,7 +112,6 @@ size_t my_sha1_context_size();
void my_sha1_init(void *context);
void my_sha1_input(void *context, const unsigned char *buf, size_t len);
void my_sha1_result(void *context, unsigned char *digest);
#include <mysql/service_md5.h>
extern struct my_md5_service_st {
void (*my_md5_type)(unsigned char*, const char*, size_t);
void (*my_md5_multi_type)(unsigned char*, ...);
@@ -138,7 +126,6 @@ size_t my_md5_context_size();
void my_md5_init(void *context);
void my_md5_input(void *context, const unsigned char *buf, size_t len);
void my_md5_result(void *context, unsigned char *digest);
#include <mysql/service_logger.h>
typedef struct logger_handle_st LOGGER_HANDLE;
extern struct logger_service_st {
void (*logger_init_mutexes)();
@@ -160,14 +147,12 @@ extern struct logger_service_st {
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
int logger_rotate(LOGGER_HANDLE *log);
#include <mysql/service_thd_autoinc.h>
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,
unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;
void thd_get_autoinc(const void* thd,
unsigned long* off, unsigned long* inc);
#include <mysql/service_thd_error_context.h>
extern struct thd_error_context_service_st {
const char *(*thd_get_error_message_func)(const void* thd);
unsigned int (*thd_get_error_number_func)(const void* thd);
@@ -185,7 +170,6 @@ void thd_inc_error_row(void* thd);
char *thd_get_error_context_description(void* thd,
char *buffer, unsigned int length,
unsigned int max_query_length);
#include <mysql/service_thd_specifics.h>
typedef int MYSQL_THD_KEY_T;
extern struct thd_specifics_service_st {
int (*thd_key_create_func)(MYSQL_THD_KEY_T *key);
@@ -197,23 +181,46 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption.h>
typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int no_padding, unsigned int key_id,
unsigned int key_version);
struct encryption_service_st {
unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
unsigned int (*encryption_key_get_latest_version_func)(unsigned int key_id);
unsigned int (*encryption_key_get_func)(unsigned int key_id, unsigned int key_version,
unsigned char* buffer, unsigned int* length);
unsigned int (*encryption_ctx_size_func)(unsigned int key_id, unsigned int key_version);
int (*encryption_ctx_init_func)(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id,
unsigned int key_version);
int (*encryption_ctx_update_func)(void *ctx, const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen);
int (*encryption_ctx_finish_func)(void *ctx, unsigned char* dst, unsigned int* dlen);
unsigned int (*encryption_encrypted_length_func)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};
extern struct encryption_service_st encryption_handler;
#include <mysql/service_encryption_scheme.h>
static inline unsigned int encryption_key_id_exists(unsigned int id)
{
return encryption_handler.encryption_key_get_latest_version_func(id) != (~(unsigned int)0);
}
static inline unsigned int encryption_key_version_exists(unsigned int id, unsigned int version)
{
unsigned int unused;
return encryption_handler.encryption_key_get_func((id),(version),(NULL),(&unused)) != (~(unsigned int)0);
}
static inline int encryption_crypt(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id, unsigned int key_version)
{
void *ctx= alloca(encryption_handler.encryption_ctx_size_func((key_id),(key_version)));
int res1, res2;
unsigned int d1, d2;
if ((res1= encryption_handler.encryption_ctx_init_func((ctx),(key),(klen),(iv),(ivlen),(flags),(key_id),(key_version))))
return res1;
res1= encryption_handler.encryption_ctx_update_func((ctx),(src),(slen),(dst),(&d1));
res2= encryption_handler.encryption_ctx_finish_func((ctx),(dst + d1),(&d2));
*dlen= d1 + d2;
return res1 ? res1 : res2;
}
struct st_encryption_scheme_key {
unsigned int version;
unsigned char key[16];
@@ -315,8 +322,6 @@ struct st_maria_plugin
const char *version_info;
unsigned int maturity;
};
#include "plugin_ftparser.h"
#include "plugin.h"
enum enum_ftparser_mode
{
MYSQL_FTPARSER_SIMPLE_MODE= 0,

View File

@@ -1,15 +1,11 @@
#include <mysql/plugin.h>
typedef char my_bool;
typedef void * MYSQL_PLUGIN;
#include <mysql/services.h>
#include <mysql/service_my_snprintf.h>
extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
#include <mysql/service_thd_alloc.h>
struct st_mysql_lex_string
{
char *str;
@@ -33,7 +29,6 @@ void *thd_memdup(void* thd, const void* str, unsigned int size);
MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
const char *str, unsigned int size,
int allocate_lex_string);
#include <mysql/service_thd_wait.h>
typedef enum _thd_wait_type_e {
THD_WAIT_SLEEP= 1,
THD_WAIT_DISKIO= 2,
@@ -54,7 +49,6 @@ extern struct thd_wait_service_st {
} *thd_wait_service;
void thd_wait_begin(void* thd, int wait_type);
void thd_wait_end(void* thd);
#include <mysql/service_progress_report.h>
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
void (*thd_progress_report_func)(void* thd,
@@ -75,9 +69,7 @@ void thd_progress_next_stage(void* thd);
void thd_progress_end(void* thd);
const char *set_thd_proc_info(void*, const char * info, const char *func,
const char *file, unsigned int line);
#include <mysql/service_debug_sync.h>
extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t);
#include <mysql/service_kill_statement.h>
enum thd_kill_levels {
THD_IS_NOT_KILLED=0,
THD_ABORT_SOFTLY=50,
@@ -87,8 +79,6 @@ extern struct kill_statement_service_st {
enum thd_kill_levels (*thd_kill_level_func)(const void*);
} *thd_kill_statement_service;
enum thd_kill_levels thd_kill_level(const void*);
#include <mysql/service_thd_timezone.h>
#include "mysql_time.h"
typedef long my_time_t;
enum enum_mysql_timestamp_type
{
@@ -108,7 +98,6 @@ extern struct thd_timezone_service_st {
} *thd_timezone_service;
my_time_t thd_TIME_to_gmt_sec(void* thd, const MYSQL_TIME *ltime, unsigned int *errcode);
void thd_gmt_sec_to_TIME(void* thd, MYSQL_TIME *ltime, my_time_t t);
#include <mysql/service_sha1.h>
extern struct my_sha1_service_st {
void (*my_sha1_type)(unsigned char*, const char*, size_t);
void (*my_sha1_multi_type)(unsigned char*, ...);
@@ -123,7 +112,6 @@ size_t my_sha1_context_size();
void my_sha1_init(void *context);
void my_sha1_input(void *context, const unsigned char *buf, size_t len);
void my_sha1_result(void *context, unsigned char *digest);
#include <mysql/service_md5.h>
extern struct my_md5_service_st {
void (*my_md5_type)(unsigned char*, const char*, size_t);
void (*my_md5_multi_type)(unsigned char*, ...);
@@ -138,7 +126,6 @@ size_t my_md5_context_size();
void my_md5_init(void *context);
void my_md5_input(void *context, const unsigned char *buf, size_t len);
void my_md5_result(void *context, unsigned char *digest);
#include <mysql/service_logger.h>
typedef struct logger_handle_st LOGGER_HANDLE;
extern struct logger_service_st {
void (*logger_init_mutexes)();
@@ -160,14 +147,12 @@ extern struct logger_service_st {
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
int logger_rotate(LOGGER_HANDLE *log);
#include <mysql/service_thd_autoinc.h>
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,
unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;
void thd_get_autoinc(const void* thd,
unsigned long* off, unsigned long* inc);
#include <mysql/service_thd_error_context.h>
extern struct thd_error_context_service_st {
const char *(*thd_get_error_message_func)(const void* thd);
unsigned int (*thd_get_error_number_func)(const void* thd);
@@ -185,7 +170,6 @@ void thd_inc_error_row(void* thd);
char *thd_get_error_context_description(void* thd,
char *buffer, unsigned int length,
unsigned int max_query_length);
#include <mysql/service_thd_specifics.h>
typedef int MYSQL_THD_KEY_T;
extern struct thd_specifics_service_st {
int (*thd_key_create_func)(MYSQL_THD_KEY_T *key);
@@ -197,23 +181,46 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption.h>
typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int no_padding, unsigned int key_id,
unsigned int key_version);
struct encryption_service_st {
unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
unsigned int (*encryption_key_get_latest_version_func)(unsigned int key_id);
unsigned int (*encryption_key_get_func)(unsigned int key_id, unsigned int key_version,
unsigned char* buffer, unsigned int* length);
unsigned int (*encryption_ctx_size_func)(unsigned int key_id, unsigned int key_version);
int (*encryption_ctx_init_func)(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id,
unsigned int key_version);
int (*encryption_ctx_update_func)(void *ctx, const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen);
int (*encryption_ctx_finish_func)(void *ctx, unsigned char* dst, unsigned int* dlen);
unsigned int (*encryption_encrypted_length_func)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};
extern struct encryption_service_st encryption_handler;
#include <mysql/service_encryption_scheme.h>
static inline unsigned int encryption_key_id_exists(unsigned int id)
{
return encryption_handler.encryption_key_get_latest_version_func(id) != (~(unsigned int)0);
}
static inline unsigned int encryption_key_version_exists(unsigned int id, unsigned int version)
{
unsigned int unused;
return encryption_handler.encryption_key_get_func((id),(version),(NULL),(&unused)) != (~(unsigned int)0);
}
static inline int encryption_crypt(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id, unsigned int key_version)
{
void *ctx= alloca(encryption_handler.encryption_ctx_size_func((key_id),(key_version)));
int res1, res2;
unsigned int d1, d2;
if ((res1= encryption_handler.encryption_ctx_init_func((ctx),(key),(klen),(iv),(ivlen),(flags),(key_id),(key_version))))
return res1;
res1= encryption_handler.encryption_ctx_update_func((ctx),(src),(slen),(dst),(&d1));
res2= encryption_handler.encryption_ctx_finish_func((ctx),(dst + d1),(&d2));
*dlen= d1 + d2;
return res1 ? res1 : res2;
}
struct st_encryption_scheme_key {
unsigned int version;
unsigned char key[16];
@@ -315,8 +322,6 @@ struct st_maria_plugin
const char *version_info;
unsigned int maturity;
};
#include "plugin_ftparser.h"
#include "plugin.h"
enum enum_ftparser_mode
{
MYSQL_FTPARSER_SIMPLE_MODE= 0,
@@ -406,7 +411,6 @@ void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
void thd_set_ha_data(void* thd, const struct handlerton *hton,
const void *ha_data);
void thd_wakeup_subsequent_commits(void* thd, int wakeup_error);
#include <mysql/plugin_auth_common.h>
typedef struct st_plugin_vio_info
{
enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,

View File

@@ -27,7 +27,7 @@
#include <mysql/plugin.h>
#define MariaDB_ENCRYPTION_INTERFACE_VERSION 0x0200
#define MariaDB_ENCRYPTION_INTERFACE_VERSION 0x0300
/**
Encryption plugin descriptor
@@ -36,6 +36,8 @@ struct st_mariadb_encryption
{
int interface_version; /**< version plugin uses */
/*********** KEY MANAGEMENT ********************************************/
/**
function returning latest key version for a given key id
@@ -66,8 +68,51 @@ struct st_mariadb_encryption
unsigned int (*get_key)(unsigned int key_id, unsigned int version,
unsigned char *key, unsigned int *key_length);
encrypt_decrypt_func encrypt;
encrypt_decrypt_func decrypt;
/*********** ENCRYPTION ************************************************/
/*
the caller uses encryption as follows:
1. create the encryption context object of the crypt_ctx_size() bytes.
2. initialize it with crypt_ctx_init().
3. repeat crypt_ctx_update() until there are no more data to encrypt.
4. write the remaining output bytes and destroy the context object
with crypt_ctx_finish().
*/
/**
returns the size of the encryption context object in bytes
*/
unsigned int (*crypt_ctx_size)(unsigned int key_id, unsigned int key_version);
/**
initializes the encryption context object.
*/
int (*crypt_ctx_init)(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id,
unsigned int key_version);
/**
processes (encrypts or decrypts) a chunk of data
writes the output to th dst buffer. note that it might write
more bytes that were in the input. or less. or none at all.
*/
int (*crypt_ctx_update)(void *ctx, const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen);
/**
writes the remaining output bytes and destroys the encryption context
crypt_ctx_update might've cached part of the output in the context,
this method will flush these data out.
*/
int (*crypt_ctx_finish)(void *ctx, unsigned char* dst, unsigned int* dlen);
/**
returns the length of the encrypted data
it returns the exact length, given only the source length.
which means, this API only supports encryption algorithms where
the length of the encrypted data only depends on the length of the
input (a.k.a. compression is not supported).
*/
unsigned int (*encrypted_length)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};
#endif

View File

@@ -1,15 +1,11 @@
#include <mysql/plugin.h>
typedef char my_bool;
typedef void * MYSQL_PLUGIN;
#include <mysql/services.h>
#include <mysql/service_my_snprintf.h>
extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
#include <mysql/service_thd_alloc.h>
struct st_mysql_lex_string
{
char *str;
@@ -33,7 +29,6 @@ void *thd_memdup(void* thd, const void* str, unsigned int size);
MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
const char *str, unsigned int size,
int allocate_lex_string);
#include <mysql/service_thd_wait.h>
typedef enum _thd_wait_type_e {
THD_WAIT_SLEEP= 1,
THD_WAIT_DISKIO= 2,
@@ -54,7 +49,6 @@ extern struct thd_wait_service_st {
} *thd_wait_service;
void thd_wait_begin(void* thd, int wait_type);
void thd_wait_end(void* thd);
#include <mysql/service_progress_report.h>
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
void (*thd_progress_report_func)(void* thd,
@@ -75,9 +69,7 @@ void thd_progress_next_stage(void* thd);
void thd_progress_end(void* thd);
const char *set_thd_proc_info(void*, const char * info, const char *func,
const char *file, unsigned int line);
#include <mysql/service_debug_sync.h>
extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t);
#include <mysql/service_kill_statement.h>
enum thd_kill_levels {
THD_IS_NOT_KILLED=0,
THD_ABORT_SOFTLY=50,
@@ -87,8 +79,6 @@ extern struct kill_statement_service_st {
enum thd_kill_levels (*thd_kill_level_func)(const void*);
} *thd_kill_statement_service;
enum thd_kill_levels thd_kill_level(const void*);
#include <mysql/service_thd_timezone.h>
#include "mysql_time.h"
typedef long my_time_t;
enum enum_mysql_timestamp_type
{
@@ -108,7 +98,6 @@ extern struct thd_timezone_service_st {
} *thd_timezone_service;
my_time_t thd_TIME_to_gmt_sec(void* thd, const MYSQL_TIME *ltime, unsigned int *errcode);
void thd_gmt_sec_to_TIME(void* thd, MYSQL_TIME *ltime, my_time_t t);
#include <mysql/service_sha1.h>
extern struct my_sha1_service_st {
void (*my_sha1_type)(unsigned char*, const char*, size_t);
void (*my_sha1_multi_type)(unsigned char*, ...);
@@ -123,7 +112,6 @@ size_t my_sha1_context_size();
void my_sha1_init(void *context);
void my_sha1_input(void *context, const unsigned char *buf, size_t len);
void my_sha1_result(void *context, unsigned char *digest);
#include <mysql/service_md5.h>
extern struct my_md5_service_st {
void (*my_md5_type)(unsigned char*, const char*, size_t);
void (*my_md5_multi_type)(unsigned char*, ...);
@@ -138,7 +126,6 @@ size_t my_md5_context_size();
void my_md5_init(void *context);
void my_md5_input(void *context, const unsigned char *buf, size_t len);
void my_md5_result(void *context, unsigned char *digest);
#include <mysql/service_logger.h>
typedef struct logger_handle_st LOGGER_HANDLE;
extern struct logger_service_st {
void (*logger_init_mutexes)();
@@ -160,14 +147,12 @@ extern struct logger_service_st {
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
int logger_rotate(LOGGER_HANDLE *log);
#include <mysql/service_thd_autoinc.h>
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,
unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;
void thd_get_autoinc(const void* thd,
unsigned long* off, unsigned long* inc);
#include <mysql/service_thd_error_context.h>
extern struct thd_error_context_service_st {
const char *(*thd_get_error_message_func)(const void* thd);
unsigned int (*thd_get_error_number_func)(const void* thd);
@@ -185,7 +170,6 @@ void thd_inc_error_row(void* thd);
char *thd_get_error_context_description(void* thd,
char *buffer, unsigned int length,
unsigned int max_query_length);
#include <mysql/service_thd_specifics.h>
typedef int MYSQL_THD_KEY_T;
extern struct thd_specifics_service_st {
int (*thd_key_create_func)(MYSQL_THD_KEY_T *key);
@@ -197,23 +181,46 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption.h>
typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int no_padding, unsigned int key_id,
unsigned int key_version);
struct encryption_service_st {
unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
unsigned int (*encryption_key_get_latest_version_func)(unsigned int key_id);
unsigned int (*encryption_key_get_func)(unsigned int key_id, unsigned int key_version,
unsigned char* buffer, unsigned int* length);
unsigned int (*encryption_ctx_size_func)(unsigned int key_id, unsigned int key_version);
int (*encryption_ctx_init_func)(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id,
unsigned int key_version);
int (*encryption_ctx_update_func)(void *ctx, const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen);
int (*encryption_ctx_finish_func)(void *ctx, unsigned char* dst, unsigned int* dlen);
unsigned int (*encryption_encrypted_length_func)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};
extern struct encryption_service_st encryption_handler;
#include <mysql/service_encryption_scheme.h>
static inline unsigned int encryption_key_id_exists(unsigned int id)
{
return encryption_handler.encryption_key_get_latest_version_func(id) != (~(unsigned int)0);
}
static inline unsigned int encryption_key_version_exists(unsigned int id, unsigned int version)
{
unsigned int unused;
return encryption_handler.encryption_key_get_func((id),(version),(NULL),(&unused)) != (~(unsigned int)0);
}
static inline int encryption_crypt(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id, unsigned int key_version)
{
void *ctx= alloca(encryption_handler.encryption_ctx_size_func((key_id),(key_version)));
int res1, res2;
unsigned int d1, d2;
if ((res1= encryption_handler.encryption_ctx_init_func((ctx),(key),(klen),(iv),(ivlen),(flags),(key_id),(key_version))))
return res1;
res1= encryption_handler.encryption_ctx_update_func((ctx),(src),(slen),(dst),(&d1));
res2= encryption_handler.encryption_ctx_finish_func((ctx),(dst + d1),(&d2));
*dlen= d1 + d2;
return res1 ? res1 : res2;
}
struct st_encryption_scheme_key {
unsigned int version;
unsigned char key[16];
@@ -315,8 +322,6 @@ struct st_maria_plugin
const char *version_info;
unsigned int maturity;
};
#include "plugin_ftparser.h"
#include "plugin.h"
enum enum_ftparser_mode
{
MYSQL_FTPARSER_SIMPLE_MODE= 0,
@@ -412,6 +417,13 @@ struct st_mariadb_encryption
unsigned int (*get_latest_key_version)(unsigned int key_id);
unsigned int (*get_key)(unsigned int key_id, unsigned int version,
unsigned char *key, unsigned int *key_length);
encrypt_decrypt_func encrypt;
encrypt_decrypt_func decrypt;
unsigned int (*crypt_ctx_size)(unsigned int key_id, unsigned int key_version);
int (*crypt_ctx_init)(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id,
unsigned int key_version);
int (*crypt_ctx_update)(void *ctx, const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen);
int (*crypt_ctx_finish)(void *ctx, unsigned char* dst, unsigned int* dlen);
unsigned int (*encrypted_length)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};

View File

@@ -1,15 +1,11 @@
#include "plugin.h"
typedef char my_bool;
typedef void * MYSQL_PLUGIN;
#include <mysql/services.h>
#include <mysql/service_my_snprintf.h>
extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
#include <mysql/service_thd_alloc.h>
struct st_mysql_lex_string
{
char *str;
@@ -33,7 +29,6 @@ void *thd_memdup(void* thd, const void* str, unsigned int size);
MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
const char *str, unsigned int size,
int allocate_lex_string);
#include <mysql/service_thd_wait.h>
typedef enum _thd_wait_type_e {
THD_WAIT_SLEEP= 1,
THD_WAIT_DISKIO= 2,
@@ -54,7 +49,6 @@ extern struct thd_wait_service_st {
} *thd_wait_service;
void thd_wait_begin(void* thd, int wait_type);
void thd_wait_end(void* thd);
#include <mysql/service_progress_report.h>
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
void (*thd_progress_report_func)(void* thd,
@@ -75,9 +69,7 @@ void thd_progress_next_stage(void* thd);
void thd_progress_end(void* thd);
const char *set_thd_proc_info(void*, const char * info, const char *func,
const char *file, unsigned int line);
#include <mysql/service_debug_sync.h>
extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t);
#include <mysql/service_kill_statement.h>
enum thd_kill_levels {
THD_IS_NOT_KILLED=0,
THD_ABORT_SOFTLY=50,
@@ -87,8 +79,6 @@ extern struct kill_statement_service_st {
enum thd_kill_levels (*thd_kill_level_func)(const void*);
} *thd_kill_statement_service;
enum thd_kill_levels thd_kill_level(const void*);
#include <mysql/service_thd_timezone.h>
#include "mysql_time.h"
typedef long my_time_t;
enum enum_mysql_timestamp_type
{
@@ -108,7 +98,6 @@ extern struct thd_timezone_service_st {
} *thd_timezone_service;
my_time_t thd_TIME_to_gmt_sec(void* thd, const MYSQL_TIME *ltime, unsigned int *errcode);
void thd_gmt_sec_to_TIME(void* thd, MYSQL_TIME *ltime, my_time_t t);
#include <mysql/service_sha1.h>
extern struct my_sha1_service_st {
void (*my_sha1_type)(unsigned char*, const char*, size_t);
void (*my_sha1_multi_type)(unsigned char*, ...);
@@ -123,7 +112,6 @@ size_t my_sha1_context_size();
void my_sha1_init(void *context);
void my_sha1_input(void *context, const unsigned char *buf, size_t len);
void my_sha1_result(void *context, unsigned char *digest);
#include <mysql/service_md5.h>
extern struct my_md5_service_st {
void (*my_md5_type)(unsigned char*, const char*, size_t);
void (*my_md5_multi_type)(unsigned char*, ...);
@@ -138,7 +126,6 @@ size_t my_md5_context_size();
void my_md5_init(void *context);
void my_md5_input(void *context, const unsigned char *buf, size_t len);
void my_md5_result(void *context, unsigned char *digest);
#include <mysql/service_logger.h>
typedef struct logger_handle_st LOGGER_HANDLE;
extern struct logger_service_st {
void (*logger_init_mutexes)();
@@ -160,14 +147,12 @@ extern struct logger_service_st {
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
int logger_rotate(LOGGER_HANDLE *log);
#include <mysql/service_thd_autoinc.h>
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,
unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;
void thd_get_autoinc(const void* thd,
unsigned long* off, unsigned long* inc);
#include <mysql/service_thd_error_context.h>
extern struct thd_error_context_service_st {
const char *(*thd_get_error_message_func)(const void* thd);
unsigned int (*thd_get_error_number_func)(const void* thd);
@@ -185,7 +170,6 @@ void thd_inc_error_row(void* thd);
char *thd_get_error_context_description(void* thd,
char *buffer, unsigned int length,
unsigned int max_query_length);
#include <mysql/service_thd_specifics.h>
typedef int MYSQL_THD_KEY_T;
extern struct thd_specifics_service_st {
int (*thd_key_create_func)(MYSQL_THD_KEY_T *key);
@@ -197,23 +181,46 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption.h>
typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int no_padding, unsigned int key_id,
unsigned int key_version);
struct encryption_service_st {
unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
unsigned int (*encryption_key_get_latest_version_func)(unsigned int key_id);
unsigned int (*encryption_key_get_func)(unsigned int key_id, unsigned int key_version,
unsigned char* buffer, unsigned int* length);
unsigned int (*encryption_ctx_size_func)(unsigned int key_id, unsigned int key_version);
int (*encryption_ctx_init_func)(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id,
unsigned int key_version);
int (*encryption_ctx_update_func)(void *ctx, const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen);
int (*encryption_ctx_finish_func)(void *ctx, unsigned char* dst, unsigned int* dlen);
unsigned int (*encryption_encrypted_length_func)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};
extern struct encryption_service_st encryption_handler;
#include <mysql/service_encryption_scheme.h>
static inline unsigned int encryption_key_id_exists(unsigned int id)
{
return encryption_handler.encryption_key_get_latest_version_func(id) != (~(unsigned int)0);
}
static inline unsigned int encryption_key_version_exists(unsigned int id, unsigned int version)
{
unsigned int unused;
return encryption_handler.encryption_key_get_func((id),(version),(NULL),(&unused)) != (~(unsigned int)0);
}
static inline int encryption_crypt(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id, unsigned int key_version)
{
void *ctx= alloca(encryption_handler.encryption_ctx_size_func((key_id),(key_version)));
int res1, res2;
unsigned int d1, d2;
if ((res1= encryption_handler.encryption_ctx_init_func((ctx),(key),(klen),(iv),(ivlen),(flags),(key_id),(key_version))))
return res1;
res1= encryption_handler.encryption_ctx_update_func((ctx),(src),(slen),(dst),(&d1));
res2= encryption_handler.encryption_ctx_finish_func((ctx),(dst + d1),(&d2));
*dlen= d1 + d2;
return res1 ? res1 : res2;
}
struct st_encryption_scheme_key {
unsigned int version;
unsigned char key[16];
@@ -315,7 +322,6 @@ struct st_maria_plugin
const char *version_info;
unsigned int maturity;
};
#include "plugin_ftparser.h"
struct st_mysql_daemon
{
int interface_version;

View File

@@ -1,15 +1,11 @@
#include <mysql/plugin.h>
typedef char my_bool;
typedef void * MYSQL_PLUGIN;
#include <mysql/services.h>
#include <mysql/service_my_snprintf.h>
extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
#include <mysql/service_thd_alloc.h>
struct st_mysql_lex_string
{
char *str;
@@ -33,7 +29,6 @@ void *thd_memdup(void* thd, const void* str, unsigned int size);
MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
const char *str, unsigned int size,
int allocate_lex_string);
#include <mysql/service_thd_wait.h>
typedef enum _thd_wait_type_e {
THD_WAIT_SLEEP= 1,
THD_WAIT_DISKIO= 2,
@@ -54,7 +49,6 @@ extern struct thd_wait_service_st {
} *thd_wait_service;
void thd_wait_begin(void* thd, int wait_type);
void thd_wait_end(void* thd);
#include <mysql/service_progress_report.h>
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
void (*thd_progress_report_func)(void* thd,
@@ -75,9 +69,7 @@ void thd_progress_next_stage(void* thd);
void thd_progress_end(void* thd);
const char *set_thd_proc_info(void*, const char * info, const char *func,
const char *file, unsigned int line);
#include <mysql/service_debug_sync.h>
extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t);
#include <mysql/service_kill_statement.h>
enum thd_kill_levels {
THD_IS_NOT_KILLED=0,
THD_ABORT_SOFTLY=50,
@@ -87,8 +79,6 @@ extern struct kill_statement_service_st {
enum thd_kill_levels (*thd_kill_level_func)(const void*);
} *thd_kill_statement_service;
enum thd_kill_levels thd_kill_level(const void*);
#include <mysql/service_thd_timezone.h>
#include "mysql_time.h"
typedef long my_time_t;
enum enum_mysql_timestamp_type
{
@@ -108,7 +98,6 @@ extern struct thd_timezone_service_st {
} *thd_timezone_service;
my_time_t thd_TIME_to_gmt_sec(void* thd, const MYSQL_TIME *ltime, unsigned int *errcode);
void thd_gmt_sec_to_TIME(void* thd, MYSQL_TIME *ltime, my_time_t t);
#include <mysql/service_sha1.h>
extern struct my_sha1_service_st {
void (*my_sha1_type)(unsigned char*, const char*, size_t);
void (*my_sha1_multi_type)(unsigned char*, ...);
@@ -123,7 +112,6 @@ size_t my_sha1_context_size();
void my_sha1_init(void *context);
void my_sha1_input(void *context, const unsigned char *buf, size_t len);
void my_sha1_result(void *context, unsigned char *digest);
#include <mysql/service_md5.h>
extern struct my_md5_service_st {
void (*my_md5_type)(unsigned char*, const char*, size_t);
void (*my_md5_multi_type)(unsigned char*, ...);
@@ -138,7 +126,6 @@ size_t my_md5_context_size();
void my_md5_init(void *context);
void my_md5_input(void *context, const unsigned char *buf, size_t len);
void my_md5_result(void *context, unsigned char *digest);
#include <mysql/service_logger.h>
typedef struct logger_handle_st LOGGER_HANDLE;
extern struct logger_service_st {
void (*logger_init_mutexes)();
@@ -160,14 +147,12 @@ extern struct logger_service_st {
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
int logger_rotate(LOGGER_HANDLE *log);
#include <mysql/service_thd_autoinc.h>
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,
unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;
void thd_get_autoinc(const void* thd,
unsigned long* off, unsigned long* inc);
#include <mysql/service_thd_error_context.h>
extern struct thd_error_context_service_st {
const char *(*thd_get_error_message_func)(const void* thd);
unsigned int (*thd_get_error_number_func)(const void* thd);
@@ -185,7 +170,6 @@ void thd_inc_error_row(void* thd);
char *thd_get_error_context_description(void* thd,
char *buffer, unsigned int length,
unsigned int max_query_length);
#include <mysql/service_thd_specifics.h>
typedef int MYSQL_THD_KEY_T;
extern struct thd_specifics_service_st {
int (*thd_key_create_func)(MYSQL_THD_KEY_T *key);
@@ -197,23 +181,46 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption.h>
typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int no_padding, unsigned int key_id,
unsigned int key_version);
struct encryption_service_st {
unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
unsigned int (*encryption_key_get_latest_version_func)(unsigned int key_id);
unsigned int (*encryption_key_get_func)(unsigned int key_id, unsigned int key_version,
unsigned char* buffer, unsigned int* length);
unsigned int (*encryption_ctx_size_func)(unsigned int key_id, unsigned int key_version);
int (*encryption_ctx_init_func)(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id,
unsigned int key_version);
int (*encryption_ctx_update_func)(void *ctx, const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen);
int (*encryption_ctx_finish_func)(void *ctx, unsigned char* dst, unsigned int* dlen);
unsigned int (*encryption_encrypted_length_func)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};
extern struct encryption_service_st encryption_handler;
#include <mysql/service_encryption_scheme.h>
static inline unsigned int encryption_key_id_exists(unsigned int id)
{
return encryption_handler.encryption_key_get_latest_version_func(id) != (~(unsigned int)0);
}
static inline unsigned int encryption_key_version_exists(unsigned int id, unsigned int version)
{
unsigned int unused;
return encryption_handler.encryption_key_get_func((id),(version),(NULL),(&unused)) != (~(unsigned int)0);
}
static inline int encryption_crypt(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id, unsigned int key_version)
{
void *ctx= alloca(encryption_handler.encryption_ctx_size_func((key_id),(key_version)));
int res1, res2;
unsigned int d1, d2;
if ((res1= encryption_handler.encryption_ctx_init_func((ctx),(key),(klen),(iv),(ivlen),(flags),(key_id),(key_version))))
return res1;
res1= encryption_handler.encryption_ctx_update_func((ctx),(src),(slen),(dst),(&d1));
res2= encryption_handler.encryption_ctx_finish_func((ctx),(dst + d1),(&d2));
*dlen= d1 + d2;
return res1 ? res1 : res2;
}
struct st_encryption_scheme_key {
unsigned int version;
unsigned char key[16];
@@ -315,8 +322,6 @@ struct st_maria_plugin
const char *version_info;
unsigned int maturity;
};
#include "plugin_ftparser.h"
#include "plugin.h"
enum enum_ftparser_mode
{
MYSQL_FTPARSER_SIMPLE_MODE= 0,

View File

@@ -553,7 +553,7 @@ inline_mysql_socket_socket
int domain, int type, int protocol)
{
MYSQL_SOCKET mysql_socket= MYSQL_INVALID_SOCKET;
mysql_socket.fd= socket(domain, type, protocol);
mysql_socket.fd= socket(domain, type | SOCK_CLOEXEC, protocol);
#ifdef HAVE_PSI_SOCKET_INTERFACE
if (likely(mysql_socket.fd != INVALID_SOCKET))
@@ -1013,6 +1013,8 @@ inline_mysql_socket_accept
#endif
MYSQL_SOCKET socket_listen, struct sockaddr *addr, socklen_t *addr_len)
{
int flags;
MYSQL_SOCKET socket_accept= MYSQL_INVALID_SOCKET;
socklen_t addr_length= (addr_len != NULL) ? *addr_len : 0;
@@ -1026,7 +1028,19 @@ inline_mysql_socket_accept
(&state, socket_listen.m_psi, PSI_SOCKET_CONNECT, (size_t)0, src_file, src_line);
/* Instrumented code */
#ifdef HAVE_ACCEPT4
socket_accept.fd= accept4(socket_listen.fd, addr, &addr_length,
SOCK_CLOEXEC);
#else
socket_accept.fd= accept(socket_listen.fd, addr, &addr_length);
#ifdef FD_CLOEXEC
flags= fcntl(socket_accept.fd, F_GETFD);
if (flags != -1) {
flags |= FD_CLOEXEC;
fcntl(socket_accept.fd, F_SETFD, flags);
}
#endif
#endif
/* Instrumentation end */
if (locker != NULL)
@@ -1036,7 +1050,19 @@ inline_mysql_socket_accept
#endif
{
/* Non instrumented code */
#ifdef HAVE_ACCEPT4
socket_accept.fd= accept4(socket_listen.fd, addr, &addr_length,
SOCK_CLOEXEC);
#else
socket_accept.fd= accept(socket_listen.fd, addr, &addr_length);
#ifdef FD_CLOEXEC
flags= fcntl(socket_accept.fd, F_GETFD);
if (flags != -1) {
flags |= FD_CLOEXEC;
fcntl(socket_accept.fd, F_SETFD, flags);
}
#endif
#endif
}
#ifdef HAVE_PSI_SOCKET_INTERFACE

View File

@@ -30,6 +30,9 @@
*/
#ifdef HAVE_PSI_TABLE_INTERFACE
#define MYSQL_UNBIND_TABLE(handler) (handler)->unbind_psi()
#define MYSQL_REBIND_TABLE(handler) (handler)->rebind_psi()
#define PSI_CALL_unbind_table PSI_TABLE_CALL(unbind_table)
#define PSI_CALL_rebind_table PSI_TABLE_CALL(rebind_table)
#define PSI_CALL_open_table PSI_TABLE_CALL(open_table)
@@ -38,13 +41,16 @@
#define PSI_CALL_release_table_share PSI_TABLE_CALL(release_table_share)
#define PSI_CALL_drop_table_share PSI_TABLE_CALL(drop_table_share)
#else
#define PSI_CALL_unbind_table(A1) /* no-op */
#define MYSQL_UNBIND_TABLE(handler) do { } while(0)
#define MYSQL_REBIND_TABLE(handler) do { } while(0)
#define PSI_CALL_unbind_table(A1) do { } while(0)
#define PSI_CALL_rebind_table(A1,A2,A3) NULL
#define PSI_CALL_close_table(A1) /* no-op */
#define PSI_CALL_close_table(A1) do { } while(0)
#define PSI_CALL_open_table(A1,A2) NULL
#define PSI_CALL_get_table_share(A1,A2) NULL
#define PSI_CALL_release_table_share(A1) /* no-op */
#define PSI_CALL_drop_table_share(A1,A2,A3,A4,A5) /* no-op */
#define PSI_CALL_release_table_share(A1) do { } while(0)
#define PSI_CALL_drop_table_share(A1,A2,A3,A4,A5) do { } while(0)
#endif
/**

View File

@@ -1,4 +1,3 @@
#include "mysql/psi/psi.h"
C_MODE_START
struct TABLE_SHARE;
struct sql_digest_storage;

View File

@@ -1,4 +1,3 @@
#include "mysql/psi/psi.h"
C_MODE_START
struct TABLE_SHARE;
struct sql_digest_storage;

View File

@@ -20,7 +20,7 @@
Functions to support data encryption and encryption key management.
They are normally implemented in an encryption plugin, so this service
connects encryption *consumers* (storage engines) to the encryption
connects encryption *consumers* (e.g. storage engines) to the encryption
*provider* (encryption plugin).
*/
@@ -28,6 +28,15 @@
extern "C" {
#endif
#ifndef MYSQL_ABI_CHECK
#ifdef _WIN32
#include <malloc.h>
#define inline __inline
#else
#include <alloca.h>
#endif
#endif
/* returned from encryption_key_get_latest_version() */
#define ENCRYPTION_KEY_VERSION_INVALID (~(unsigned int)0)
#define ENCRYPTION_KEY_NOT_ENCRYPTED (0)
@@ -38,20 +47,23 @@ extern "C" {
/* returned from encryption_key_get() */
#define ENCRYPTION_KEY_BUFFER_TOO_SMALL (100)
typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int no_padding, unsigned int key_id,
unsigned int key_version);
#define ENCRYPTION_FLAG_DECRYPT 0
#define ENCRYPTION_FLAG_ENCRYPT 1
#define ENCRYPTION_FLAG_NOPAD 2
struct encryption_service_st {
unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
unsigned int (*encryption_key_get_latest_version_func)(unsigned int key_id);
unsigned int (*encryption_key_get_func)(unsigned int key_id, unsigned int key_version,
unsigned char* buffer, unsigned int* length);
unsigned int (*encryption_ctx_size_func)(unsigned int key_id, unsigned int key_version);
int (*encryption_ctx_init_func)(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id,
unsigned int key_version);
int (*encryption_ctx_update_func)(void *ctx, const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen);
int (*encryption_ctx_finish_func)(void *ctx, unsigned char* dst, unsigned int* dlen);
unsigned int (*encryption_encrypted_length_func)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};
#ifdef MYSQL_DYNAMIC_PLUGIN
@@ -59,23 +71,53 @@ struct encryption_service_st {
extern struct encryption_service_st *encryption_service;
#define encryption_key_get_latest_version(KI) encryption_service->encryption_key_get_latest_version_func(KI)
#define encryption_key_id_exists(KI) encryption_service->encryption_key_id_exists_func((KI))
#define encryption_key_version_exists(KI,KV) encryption_service->encryption_key_version_exists_func((KI),(KV))
#define encryption_key_get(KI,KV,K,S) encryption_service->encryption_key_get_func((KI),(KV),(K),(S))
#define encryption_encrypt(S,SL,D,DL,K,KL,I,IL,NP,KI,KV) encryption_service->encryption_encrypt_func((S),(SL),(D),(DL),(K),(KL),(I),(IL),(NP),(KI),(KV))
#define encryption_decrypt(S,SL,D,DL,K,KL,I,IL,NP,KI,KV) encryption_service->encryption_decrypt_func((S),(SL),(D),(DL),(K),(KL),(I),(IL),(NP),(KI),(KV))
#define encryption_ctx_size(KI,KV) encryption_service->encryption_ctx_size_func((KI),(KV))
#define encryption_ctx_init(CTX,K,KL,IV,IVL,F,KI,KV) encryption_service->encryption_ctx_init_func((CTX),(K),(KL),(IV),(IVL),(F),(KI),(KV))
#define encryption_ctx_update(CTX,S,SL,D,DL) encryption_service->encryption_ctx_update_func((CTX),(S),(SL),(D),(DL))
#define encryption_ctx_finish(CTX,D,DL) encryption_service->encryption_ctx_finish_func((CTX),(D),(DL))
#define encryption_encrypted_length(SL,KI,KV) encryption_service->encryption_encrypted_length_func((SL),(KI),(KV))
#else
extern struct encryption_service_st encryption_handler;
#define encryption_key_get_latest_version(KI) encryption_handler.encryption_key_get_latest_version_func(KI)
#define encryption_key_id_exists(KI) encryption_handler.encryption_key_id_exists_func((KI))
#define encryption_key_version_exists(KI,KV) encryption_handler.encryption_key_version_exists_func((KI),(KV))
#define encryption_key_get(KI,KV,K,S) encryption_handler.encryption_key_get_func((KI),(KV),(K),(S))
#define encryption_encrypt(S,SL,D,DL,K,KL,I,IL,NP,KI,KV) encryption_handler.encryption_encrypt_func((S),(SL),(D),(DL),(K),(KL),(I),(IL),(NP),(KI),(KV))
#define encryption_decrypt(S,SL,D,DL,K,KL,I,IL,NP,KI,KV) encryption_handler.encryption_decrypt_func((S),(SL),(D),(DL),(K),(KL),(I),(IL),(NP),(KI),(KV))
#define encryption_ctx_size(KI,KV) encryption_handler.encryption_ctx_size_func((KI),(KV))
#define encryption_ctx_init(CTX,K,KL,IV,IVL,F,KI,KV) encryption_handler.encryption_ctx_init_func((CTX),(K),(KL),(IV),(IVL),(F),(KI),(KV))
#define encryption_ctx_update(CTX,S,SL,D,DL) encryption_handler.encryption_ctx_update_func((CTX),(S),(SL),(D),(DL))
#define encryption_ctx_finish(CTX,D,DL) encryption_handler.encryption_ctx_finish_func((CTX),(D),(DL))
#define encryption_encrypted_length(SL,KI,KV) encryption_handler.encryption_encrypted_length_func((SL),(KI),(KV))
#endif
static inline unsigned int encryption_key_id_exists(unsigned int id)
{
return encryption_key_get_latest_version(id) != ENCRYPTION_KEY_VERSION_INVALID;
}
static inline unsigned int encryption_key_version_exists(unsigned int id, unsigned int version)
{
unsigned int unused;
return encryption_key_get(id, version, NULL, &unused) != ENCRYPTION_KEY_VERSION_INVALID;
}
static inline int encryption_crypt(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int flags, unsigned int key_id, unsigned int key_version)
{
void *ctx= alloca(encryption_ctx_size(key_id, key_version));
int res1, res2;
unsigned int d1, d2;
if ((res1= encryption_ctx_init(ctx, key, klen, iv, ivlen, flags, key_id, key_version)))
return res1;
res1= encryption_ctx_update(ctx, src, slen, dst, &d1);
res2= encryption_ctx_finish(ctx, dst + d1, &d2);
*dlen= d1 + d2;
return res1 ? res1 : res2;
}
#ifdef __cplusplus
}
#endif

View File

@@ -1,5 +1,5 @@
#ifndef MYSQL_SERVICE_WSREP_INCLUDED
/* Copyright (c) 2013, Monty Program Ab
/* Copyright (c) 2015 MariaDB Corporation Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -38,9 +38,16 @@ enum wsrep_conflict_state {
};
enum wsrep_exec_mode {
/* Transaction processing before replication. */
LOCAL_STATE,
/* Slave thread applying write sets from other nodes or replaying thread. */
REPL_RECV,
/* Total-order-isolation mode. */
TOTAL_ORDER,
/*
Transaction procession after it has been replicated in prepare stage and
has passed certification.
*/
LOCAL_COMMIT
};
@@ -69,6 +76,7 @@ extern struct wsrep_service_st {
my_bool (*get_wsrep_certify_nonPK_func)();
my_bool (*get_wsrep_debug_func)();
my_bool (*get_wsrep_drupal_282555_workaround_func)();
my_bool (*get_wsrep_recovery_func)();
my_bool (*get_wsrep_load_data_splitting_func)();
my_bool (*get_wsrep_log_conflicts_func)();
long (*get_wsrep_protocol_version_func)();
@@ -108,6 +116,7 @@ extern struct wsrep_service_st {
#define get_wsrep_certify_nonPK() wsrep_service->get_wsrep_certify_nonPK_func()
#define get_wsrep_debug() wsrep_service->get_wsrep_debug_func()
#define get_wsrep_drupal_282555_workaround() wsrep_service->get_wsrep_drupal_282555_workaround_func()
#define get_wsrep_recovery() wsrep_service->get_wsrep_recovery_func()
#define get_wsrep_load_data_splitting() wsrep_service->get_wsrep_load_data_splitting_func()
#define get_wsrep_log_conflicts() wsrep_service->get_wsrep_log_conflicts_func()
#define get_wsrep_protocol_version() wsrep_service->get_wsrep_protocol_version_func()
@@ -146,6 +155,7 @@ extern struct wsrep_service_st {
#define wsrep_certify_nonPK get_wsrep_certify_nonPK()
#define wsrep_load_data_splitting get_wsrep_load_data_splitting()
#define wsrep_drupal_282555_workaround get_wsrep_drupal_282555_workaround()
#define wsrep_recovery get_wsrep_recovery()
#define wsrep_protocol_version get_wsrep_protocol_version()
#else
@@ -155,6 +165,7 @@ extern my_bool wsrep_log_conflicts;
extern my_bool wsrep_certify_nonPK;
extern my_bool wsrep_load_data_splitting;
extern my_bool wsrep_drupal_282555_workaround;
extern my_bool wsrep_recovery;
extern long wsrep_protocol_version;
bool wsrep_consistency_check(THD *thd);
@@ -178,6 +189,7 @@ long long wsrep_thd_trx_seqno(THD *thd);
my_bool get_wsrep_certify_nonPK();
my_bool get_wsrep_debug();
my_bool get_wsrep_drupal_282555_workaround();
my_bool get_wsrep_recovery();
my_bool get_wsrep_load_data_splitting();
my_bool get_wsrep_log_conflicts();
my_bool wsrep_aborting_thd_contains(THD *thd);

View File

@@ -386,10 +386,7 @@ typedef struct st_net {
queries in cache that have not stored its results yet
*/
#endif
/*
Unused, please remove with the next incompatible ABI change.
*/
unsigned char *unused;
void *thd; /* Used by MariaDB server to avoid calling current_thd */
unsigned int last_errno;
unsigned char error;
my_bool unused4; /* Please remove with the next incompatible ABI change. */
@@ -517,7 +514,7 @@ enum enum_mysql_set_option
extern "C" {
#endif
my_bool my_net_init(NET *net, Vio* vio, unsigned int my_flags);
my_bool my_net_init(NET *net, Vio* vio, void *thd, unsigned int my_flags);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net, my_bool clear_buffer);
@@ -550,7 +547,7 @@ struct my_rnd_struct;
enum Item_result
{
STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT,
TIME_RESULT,IMPOSSIBLE_RESULT
TIME_RESULT
};
typedef struct st_udf_args

View File

@@ -35,6 +35,6 @@
#define VERSION_thd_autoinc 0x0100
#define VERSION_thd_error_context 0x0100
#define VERSION_thd_specifics 0x0100
#define VERSION_encryption 0x0200
#define VERSION_encryption 0x0300
#define VERSION_encryption_scheme 0x0100

View File

@@ -381,7 +381,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
CONFIGURE_FILE(
${VERSION_SCRIPT_TEMPLATE}
${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld
@ONLY@
@ONLY
)
SET(VERSION_SCRIPT_LINK_FLAGS
"-Wl,${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld")

View File

@@ -1507,6 +1507,12 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
memory
*/
#ifdef EMBEDDED_LIBRARY
#define STMT_INIT_PREALLOC(S) 0
#else
#define STMT_INIT_PREALLOC(S) S
#endif /*EMBEDDED_LIBRARY*/
MYSQL_STMT * STDCALL
mysql_stmt_init(MYSQL *mysql)
{
@@ -1525,8 +1531,10 @@ mysql_stmt_init(MYSQL *mysql)
DBUG_RETURN(NULL);
}
init_alloc_root(&stmt->mem_root, 2048, 2048, MYF(MY_THREAD_SPECIFIC));
init_alloc_root(&stmt->result.alloc, 4096, 4096, MYF(MY_THREAD_SPECIFIC));
init_alloc_root(&stmt->mem_root, 2048, STMT_INIT_PREALLOC(2048),
MYF(MY_THREAD_SPECIFIC));
init_alloc_root(&stmt->result.alloc, 4096, STMT_INIT_PREALLOC(4096),
MYF(MY_THREAD_SPECIFIC));
stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS);
mysql->stmts= list_add(mysql->stmts, &stmt->list);
stmt->list.data= stmt;
@@ -1543,6 +1551,8 @@ mysql_stmt_init(MYSQL *mysql)
DBUG_RETURN(stmt);
}
#undef STMT_INIT_PREALLOC
/*
Prepare server side statement with query.

View File

@@ -84,7 +84,7 @@ it should also declare all the accompanying data structures, as necessary
7. add the new file to libservices/CMakeLists.txt (MYSQLSERVICES_SOURCES)
8. Add all new files to repository (bzr add)
9. and finally, register your service for dynamic linking in
sql/sql_plugin_services.h as follows:
sql/sql_plugin_services.ic as follows:
9.1 fill in the service structure:
==================================================================
static struct foo_service_st foo_handler = {

View File

@@ -23,3 +23,4 @@ ssl_crl_clrpath : broken upstream
innodb-wl5522-debug-zip : broken upstream
innodb_bug12902967 : broken upstream
file_contents : MDEV-6526 these files are not installed anymore
max_statement_time : cannot possibly work, depends on timing

View File

@@ -84,7 +84,7 @@ CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b))
engine=innodb;
RESET MASTER;
--error ER_ROW_IS_REFERENCED
--error ER_ROW_IS_REFERENCED_2
DROP DATABASE db1; # Fails because of the fk
SHOW TABLES FROM db1; # t1 was dropped, t2 remains
--source include/show_binlog_events.inc # Check that the binlog drops t1

View File

@@ -228,7 +228,7 @@ rollback;
create table t0 (n int);
insert t0 select * from t1;
set autocommit=1;
insert into t0 select GET_LOCK("lock1",null);
insert into t0 select GET_LOCK("lock1",0);
set autocommit=0;
create table t2 (n int) engine=innodb;
insert into t2 values (3);

View File

@@ -16,6 +16,7 @@
#
--source include/have_log_bin.inc
set sql_mode="";
SET NAMES 'utf8';
#SHOW VARIABLES LIKE 'character_set%';

View File

@@ -128,6 +128,8 @@
###############################################################
# Some preparations
###############################################################
set global sql_mode='';
set local sql_mode='';
# The sync_slave_with_master is needed to make the xids deterministic.
sync_slave_with_master;
@@ -609,3 +611,5 @@ DROP TEMPORARY TABLE mysqltest1.t22;
DROP DATABASE mysqltest1;
# mysqltest2 was alreday DROPPED some tests before.
DROP DATABASE mysqltest3;
set global sql_mode=default;

View File

@@ -0,0 +1,241 @@
# WL#5096
#
# Description
# ===========
#
# This test case checks replication between hosts with same index
# structure but may differ on engines.
#
# Usage
# =====
#
# Before including this file the following variables should be set:
# * $server_1_engine
# * $server_2_engine
# * $server_3_engine
#
# Example:
#
# -- let $server_1_engine= Falcon
# -- let $server_2_engine= MyISAM
# -- let $server_3_engine= InnoDB
#
# -- source extra/rpl_tests/rpl_row_img.test
#
-- connection server_1
-- let $diff_table=test.t
let $i= 12;
while($i)
{
let $step= "";
-- connection server_1
SET SQL_LOG_BIN=0;
-- connection server_2
SET SQL_LOG_BIN=0;
-- connection server_3
SET SQL_LOG_BIN=0;
if ($i == 1) {
let $step= No keys;
--echo ******* TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_3_engine;
}
if ($i == 2)
{
let $step= One key;
--echo ******* TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_3_engine;
}
if ($i == 3)
{
let $step= One Composite key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_3_engine;
}
if ($i == 4)
{
let $step= One Unique key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_3_engine;
}
if ($i == 5)
{
let $step= One Composite Unique key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_3_engine;
}
if ($i == 6)
{
let $step= One Primary key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_3_engine;
}
if ($i == 7)
{
let $step= One Composite Primary Key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_3_engine;
}
if ($i == 8)
{
let $step= One Composite key with holes;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_3_engine;
}
if ($i == 9)
{
let $step= One Composite Unique key with holes;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_3_engine;
}
if ($i == 10)
{
let $step= One Composite Primary Key with holes;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_3_engine;
}
if ($i == 11)
{
let $step= One Composite NOT NULL Unique key with holes;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_3_engine;
}
if ($i == 12)
{
let $step= One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_3_engine;
}
-- connection server_1
SET SQL_LOG_BIN=1;
-- connection server_2
SET SQL_LOG_BIN=1;
-- connection server_3
SET SQL_LOG_BIN=1;
-- connection server_1
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
-- source include/rpl_sync.inc
-- connection server_1
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
UPDATE t SET c1 = '5' WHERE c1 = 1;
UPDATE t SET c4 = '8' WHERE c2 = '4';
UPDATE t SET c1 = '8' WHERE c2 = '4';
UPDATE t SET c2 = '8' WHERE c2 = '4';
UPDATE t SET c3 = '0' WHERE c4 = NULL;
UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
-- source include/rpl_sync.inc
-- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
-- source include/diff_tables.inc
-- connection server_1
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
-- source include/rpl_sync.inc
-- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
-- source include/diff_tables.inc
-- connection server_1
DROP TABLE t;
-- source include/rpl_sync.inc
dec $i;
}

View File

@@ -0,0 +1,179 @@
# WL#5096
#
# Description
# ===========
#
# This test case covers Requirements for replication using different
# combinations of indexes and blob fields.
#
# It acts as a complement for rpl_row_img_sanity tests as it checks
# that in a chained replication scenario, replication does not break.
#
# Usage
# =====
#
# Before including this file the following variables should be set:
# * $server_1_engine
# * $server_2_engine
# * $server_3_engine
#
# Example:
#
# -- let $server_1_engine= Falcon
# -- let $server_2_engine= MyISAM
# -- let $server_3_engine= InnoDB
#
# -- source extra/rpl_tests/rpl_row_img_blobs.test
#
-- connection server_1
-- let $diff_table=test.t
let $i= 7;
while($i)
{
-- connection server_1
SET SQL_LOG_BIN=0;
-- connection server_2
SET SQL_LOG_BIN=0;
-- connection server_3
SET SQL_LOG_BIN=0;
#
# The comments below (on create table) must be read with the SQL
# instructions issued later in mind. Declaring a table obviously is
# not enough to assert anything.
#
# Also, the tests in this file make more sense when performed with
# binlog_row_image configured as NOBLOB.
#
if ($i == 1) {
-- echo ### Asserts that declaring a blob as part of a primary key does not break replication
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= $server_3_engine;
}
if ($i == 2)
{
-- echo ### Asserts that declaring a blob as part of a unique (not null) key does not break replication
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= $server_3_engine;
}
if ($i == 3)
{
-- echo ### Asserts that declaring a blob in a key does not break replication
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= $server_3_engine;
}
if ($i == 4) {
-- echo ### Asserts that updates without blobs in the BI (PK exists int the table)
-- echo ### will not break replication
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= $server_3_engine;
}
if ($i == 5)
{
-- echo ### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
-- echo ### will not break replication
-- connection server_1
--eval CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= $server_3_engine;
}
if ($i == 6)
{
-- echo ### Asserts that updates without blobs in the AI (they are not updated)
-- echo ### will not break replication (check even if there is a key in the table)
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= $server_3_engine;
}
if ($i == 7)
{
-- echo ### Asserts that updates without blobs in the AI (they are not updated)
-- echo ### will not break replication (check when there is no key in the table)
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 blob, c3 int) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 blob, c3 int) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 blob, c3 int) engine= $server_3_engine;
}
-- connection server_1
SET SQL_LOG_BIN=1;
-- connection server_2
SET SQL_LOG_BIN=1;
-- connection server_3
SET SQL_LOG_BIN=1;
-- connection server_1
-- let $blob1= "a"
-- let $blob2= "b"
-- let $blob3= "c"
-- eval INSERT INTO t VALUES (1, $blob1, 10)
-- eval INSERT INTO t VALUES (2, $blob2, 20)
-- eval INSERT INTO t VALUES (3, $blob3, 30)
-- source include/rpl_sync.inc
-- connection server_1
-- eval UPDATE t SET c1=10 WHERE c2=$blob1
-- eval UPDATE t SET c1=20 WHERE c1=2
-- eval UPDATE t SET c1=30 WHERE c3=30
-- eval UPDATE t SET c3=40 WHERE c1=30
-- source include/rpl_sync.inc
-- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
-- source include/diff_tables.inc
-- connection server_1
-- eval DELETE FROM t WHERE c2=$blob1
-- eval DELETE FROM t WHERE c1=20
-- eval DELETE FROM t
-- source include/rpl_sync.inc
-- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
-- source include/diff_tables.inc
-- connection server_1
DROP TABLE t;
-- source include/rpl_sync.inc
dec $i;
}

View File

@@ -10,19 +10,19 @@
#
# Format_description_log_event length =
# 19 /* event common header */ +
# 57 /* misc stuff in the Format description header */ +
# 58 /* misc stuff in the Format description header */ +
# number of events +
# 1 /* Checksum algorithm */ +
# 4 /* CRC32 length */
#
# With current number of events = 163,
# With current number of events = 164,
#
# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 248.
# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 249.
#
##############################################################################
let $binlog_start_pos=248;
let $binlog_start_pos=249;
--disable_query_log
SET @binlog_start_pos=248;
SET @binlog_start_pos=249;
--enable_query_log

View File

@@ -11,6 +11,10 @@
# Don't write these queries to binlog
set SQL_LOG_BIN=0;
# Do not replicate updates to other galera nodes
--error 0,1193
set WSREP_ON=0;
# Turn off any debug crashes, allow the variable to be
# non existent in release builds
--error 0,1193

View File

@@ -26,6 +26,7 @@
#
connection default;
SET SQL_MODE="";
#
# Show prerequisites for this test.
#
@@ -670,3 +671,4 @@ connection default;
drop table t1;
drop user mysqltest@localhost;
SET SQL_MODE=default;

View File

@@ -2,6 +2,10 @@
# Bug#11650: LIKE pattern matching using prefix index
# doesn't return correct result
#
--disable_query_log
set @ctype_save_sql_mode=@@sql_mode;
set sql_mode="";
--enable_query_log
--disable_warnings
#
# This query creates a column using
@@ -10,6 +14,9 @@
#
create table t1 engine=innodb select repeat('a',50) as c1;
--enable_warnings
--disable_query_log
set sql_mode=@ctype_save_sql_mode;
--enable_query_log
alter table t1 add index(c1(5));
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');

View File

@@ -37,3 +37,19 @@ SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
DROP TABLE t1;
--echo #
--echo # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
--echo #
CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('a'),('a ');
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
DROP TABLE t1;
--echo #
--echo # End of MDEV-8694
--echo #

View File

@@ -28,17 +28,35 @@ INSERT INTO t1 (ch) VALUES (_utf8 0x61D680);
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch;
ALTER TABLE t1 DROP KEY ch;

View File

@@ -688,9 +688,16 @@ eval create table t1 (
insert into t1 values(1,'foo'),(2,'foobar');
--sorted_result
select * from t1 where b like 'foob%';
--disable_query_log
set @ctype_save_sql_mode=@@sql_mode;
set sql_mode="";
--enable_query_log
--disable_warnings
alter table t1 engine=innodb;
--enable_warnings
--disable_query_log
set sql_mode=@ctype_save_sql_mode;
--enable_query_log
--sorted_result
select * from t1 where b like 'foob%';
drop table t1;
@@ -1802,5 +1809,33 @@ DROP TABLE t1;
--echo #
--echo #
--echo # End of tests
--echo # ctype_utf8mb4.inc: Start of 10.1 tests
--echo #
--echo #
--echo # MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
--echo #
CREATE TABLE t1 (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id)
);
INSERT INTO t1 (a) VALUES (0x61);
INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF);
INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF);
INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF);
SELECT id,HEX(a) FROM t1 ORDER BY a,id;
SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
SELECT COUNT(DISTINCT a) FROM t1;
ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
SELECT id,HEX(a) FROM t1 ORDER BY a;
SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
SELECT COUNT(DISTINCT a) FROM t1;
DROP TABLE t1;
--echo #
--echo # ctype_utf8mb4.inc: End of 10.1 tests
--echo #
--echo #
--echo # End of ctype_utf8mb4.inc
--echo #

View File

@@ -33,6 +33,7 @@ debug-no-sync
# Retry bind as this may fail on busy server
port-open-timeout=10
bind-address=127.0.0.1
log-bin-trust-function-creators=1
key_buffer_size= 1M

View File

@@ -0,0 +1,64 @@
# Trailing garbage in string literals
--eval CREATE TABLE t1 (a $TYPE);
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
SELECT * FROM t1 WHERE a='2001-01-01 00:00:00x';
SELECT * FROM t1 WHERE LENGTH(a) != 20;
SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x';
DROP TABLE t1;
# Leading spaces in string literals
--eval CREATE TABLE t1 (a $TYPE);
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
SELECT * FROM t1 WHERE LENGTH(a)=19;
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
# This should not propagate
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
DROP TABLE t1;
# Trailing fractional digits in temporal literals
--eval CREATE TABLE t1 (a $TYPE);
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
SELECT * FROM t1 WHERE LENGTH(a)=19;
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
DROP TABLE t1;
# Trailing fractional digits in temporal literals, the same precision
--eval CREATE TABLE t1 (a $TYPE(6));
INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000'),('2001-01-01 00:00:01.000000');
SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
SELECT * FROM t1 WHERE LENGTH(a)=26;
SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
DROP TABLE t1;
# DATETIME/TIMESTAMP column vs TIME literal
SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
--eval CREATE TABLE t1 (a $TYPE);
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
SELECT * FROM t1 WHERE a=TIME'00:00:00';
SELECT * FROM t1 WHERE LENGTH(a)=19;
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
DROP TABLE t1;

View File

@@ -771,7 +771,7 @@ DROP TABLE t1,t2;
--echo #74
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t1(a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
--echo # used key is modified & Using temporary

View File

@@ -37,12 +37,16 @@
--source include/add_anonymous_users.inc
set GLOBAL sql_mode="";
set LOCAL sql_mode="";
#
--disable_warnings
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
drop database if exists mysqltest;
--enable_warnings
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
reset query cache;
@@ -214,5 +218,9 @@ drop table test.t1,mysqltest.t1,mysqltest.t2;
drop database mysqltest;
set GLOBAL query_cache_size=default;
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
--source include/delete_anonymous_users.inc
set GLOBAL sql_mode=default;
set GLOBAL query_cache_type=default;

View File

@@ -1,20 +0,0 @@
# Check if ipv6 is available.
#
--disable_query_log
--disable_result_log
--disable_abort_on_error
connect (checkcon123456789,::1,root,,test);
if($mysql_errno)
{
skip No IPv6 support;
}
connection default;
if(!$mysql_errno)
{
disconnect checkcon123456789;
}
--enable_abort_on_error
--enable_result_log
--enable_query_log
# end check

View File

@@ -443,13 +443,13 @@ DROP TABLE t1;
--echo # when ICP is on"
--echo #
CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t1 VALUES (11,0);
INSERT INTO t1 VALUES (12,5);
INSERT INTO t1 VALUES (15,0);
CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t2 VALUES (11,1);
INSERT INTO t2 VALUES (12,2);
@@ -639,6 +639,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
# MDEV-8189 field<>const and const<>field are not symmetric
# Do the same EXPLAIN and SELECT
# with "t1.d1 <> t2.pk" instead of "t2.pk <> t1.d1"
EXPLAIN
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
WHERE t1.d1 <> t2.pk AND t2.pk = 4;
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
WHERE t1.d1 <> t2.pk AND t2.pk = 4;
DROP TABLE t1, t2;
--echo #

View File

@@ -1,5 +1,3 @@
# Tests for the performance schema
# The file with expected results fits only to a run without
# ps-protocol/sp-protocol/cursor-protocol/view-protocol.
if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL

View File

@@ -15,6 +15,8 @@
# main code went into include/query_cache.inc
#
SET global query_cache_type=ON;
SET local query_cache_type=ON;
eval SET SESSION STORAGE_ENGINE = $engine_type;
# Initialise
@@ -193,3 +195,5 @@ disconnect connection1;
connection default;
set @@global.query_cache_size = @save_query_cache_size;
drop table t2;
SET global query_cache_type=default;

View File

@@ -4,6 +4,8 @@
# $engine_type -- storage engine to be tested
# have to be set before sourcing this script.
SET global query_cache_type=ON;
SET local query_cache_type=ON;
eval SET SESSION STORAGE_ENGINE = $engine_type;
# Initialise
@@ -124,3 +126,4 @@ show status like "Qcache_hits";
drop table t1;
set @@global.query_cache_size = @save_query_cache_size;
SET global query_cache_type=default;

View File

@@ -20,6 +20,8 @@
--source include/have_query_cache.inc
# embedded can't make more than one connection, which this test needs
-- source include/not_embedded.inc
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
--echo ---- establish connection con1 (root) ----
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
@@ -528,3 +530,4 @@ drop table t1;
set @@global.query_cache_size=@initial_query_cache_size;
flush status; # reset Qcache status variables for next tests
set GLOBAL query_cache_type=default;

View File

@@ -0,0 +1,42 @@
#
# This is a helper script for rpl_row_img.test. It creates
# all combinations MyISAM / InnoDB in a three server replication
# chain. Each engine combination is tested against the current
# seetings for binlog_row_image (on each server).
#
# The test script that is executed on every combination is the
# only argument to this wrapper script. See below.
#
# This script takes one parameter:
# - $row_img_test_script
# the name of the test script to include in every combination
#
# Sample usage:
# -- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
# -- source include/rpl_row_img_general_loop.test
-- let $engine_type_a= 2
-- let $server_1_engine= MyISAM
while($engine_type_a)
{
-- let $engine_type_b= 2
-- let $server_2_engine= MyISAM
while($engine_type_b)
{
-- let $engine_type_c= 2
-- let $server_3_engine= MyISAM
while($engine_type_c)
{
-- echo ### engines: $server_1_engine, $server_2_engine, $server_3_engine
-- source $row_img_test_script
-- let $server_3_engine= InnoDB
-- dec $engine_type_c
}
-- let $server_2_engine= InnoDB
-- dec $engine_type_b
}
-- let $server_1_engine= InnoDB
-- dec $engine_type_a
}

View File

@@ -0,0 +1,55 @@
#
# This is an auxiliar script that sets the binlog-row-image
# on a set of connections. These connections are passed as
# a parameter to this script. Its format is the following:
#
# <conid,value,Y_or_N>:[<conid,value,Y_or_N>:...]
#
# In detail:
#
# conid -- connection id (eg, master)
# value -- binlog_row_image value to set (eg, FULL)
# Y_or_N -- Issue stop and start slave (eg, Y)
#
# Sample usage:
#
# -- let $row_img_set=master:FULL:N,slave:MINIMAL:Y
# -- source include/rpl_row_img_set.inc
#
# Notes:
#
# 1. This script saves and restores the original connection that was
# in use at the time it was included.
-- let $old_conn= $CURRENT_CONNECTION
while (`SELECT HEX('$row_img_set') != HEX('')`)
{
-- let $tuple= `SELECT SUBSTRING_INDEX('$row_img_set', ',', 1)`
-- let $conn= `SELECT SUBSTRING_INDEX('$tuple', ':', 1)`
-- let $rimg= `SELECT SUBSTRING_INDEX(LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + 2)), ':', 1)`
-- let $is_slave_restart= `SELECT LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + LENGTH('$rimg')+ 3))`
-- echo CON: '$conn', IMG: '$rimg', RESTART SLAVE: '$is_slave_restart'
-- connection $conn
-- eval SET SESSION binlog_row_image= '$rimg'
-- eval SET GLOBAL binlog_row_image= '$rimg'
if ($is_slave_restart == Y)
{
-- source include/stop_slave.inc
-- source include/start_slave.inc
}
FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
-- let $row_img_set= `SELECT LTRIM(SUBSTRING('$row_img_set', LENGTH('$tuple') + 2 ))`
}
-- connection $old_conn

View File

@@ -4,7 +4,7 @@ if ($binlog_start)
}
if (!$binlog_start)
{
--let $_binlog_start=248
--let $_binlog_start=249
}
if ($binlog_file)
{

View File

@@ -15,7 +15,19 @@
--let $statement=show BINLOG events
if ($is_relay_log)
{
--let $statement=show relaylog events
if ($master_name)
{
let _master_name='$master_name';
}
if (!$master_name)
{
let _master_name=`select @@default_master_connection`;
if ($_master_name)
{
let _master_name='$_master_name';
}
}
--let $statement=show relaylog $_master_name events
}
if ($binlog_file)
@@ -25,7 +37,7 @@ if ($binlog_file)
{
if ($is_relay_log)
{
--let $_binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
--let $_binlog_file= query_get_value(SHOW SLAVE $_master_name STATUS, Relay_Log_File, 1)
}
if (!$is_relay_log)
{

View File

@@ -1,10 +1,11 @@
##############################################################################
# Show relay log events
#
# Useage:
# Usage:
# let $binlog_file= slave-relay-bin.000002;
# let $binlog_start= 106;
# let $binlog_limit= 1, 3;
# let $master_name= master1;
# source include/show_relaylog_events.inc;
#
# It shows the first relay log file if $binlog_file is not given.

View File

@@ -34,6 +34,10 @@ let $_slave_timeout= $slave_timeout;
if (!$_slave_timeout)
{
let $_slave_timeout= 120;
if ($VALGRIND_TEST)
{
let $_slave_timeout= 1200;
}
}
--let $_result= `SELECT master_gtid_wait('$master_pos', $_slave_timeout)`

View File

@@ -0,0 +1,75 @@
--echo #
--echo # MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
--echo #
# Testing direct INSERT
SET sql_mode=DEFAULT;
eval CREATE TABLE t1 (a $type DEFAULT $defval);
SET sql_mode=TRADITIONAL;
--error ER_TRUNCATED_WRONG_VALUE
eval INSERT INTO t1 VALUES ($defval);
--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
INSERT INTO t1 VALUES ();
--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
INSERT INTO t1 VALUES (DEFAULT);
DROP TABLE t1;
SET sql_mode=DEFAULT;
# Testing INSERT .. SELECT
eval CREATE TABLE t1 (a $type NOT NULL DEFAULT $defval, b $type NOT NULL DEFAULT $defval);
eval CREATE TABLE t2 (a $type NOT NULL DEFAULT $defval);
eval INSERT INTO t2 VALUES ($defval);
SET sql_mode=TRADITIONAL;
--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
INSERT INTO t1 (a) SELECT a FROM t2;
DROP TABLE t1, t2;
SET sql_mode=DEFAULT;
# Testing LOAD
--eval CREATE TABLE t1 (a $type DEFAULT $defval, b $type DEFAULT $defval)
--eval INSERT INTO t1 VALUES (DEFAULT,DEFAULT);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1
DELETE FROM t1;
SET sql_mode=TRADITIONAL;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' INTO TABLE t1 (a)
--remove_file $MYSQLTEST_VARDIR/tmp/mdev-7824.txt
DROP TABLE t1;
SET sql_mode=DEFAULT;
# Testing ALTER when an old field default becomes invalid
# Return an error, even if there is no STRICT_XXX_TABLES set
--eval CREATE TABLE t1 (a $type DEFAULT $defval);
SET sql_mode='NO_ZERO_DATE';
--error ER_INVALID_DEFAULT
ALTER TABLE t1 ADD b INT NOT NULL;
DROP TABLE t1;
SET sql_mode=DEFAULT;
--echo #
--echo # End of MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
--echo #
--echo #
--echo # MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
--echo #
SET sql_mode=DEFAULT;
--eval CREATE TABLE t1 (a $type);
INSERT INTO t1 VALUES (0);
SET sql_mode='TRADITIONAL';
--error ER_TRUNCATED_WRONG_VALUE
CREATE TABLE t2 AS SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
--echo #

View File

@@ -0,0 +1,34 @@
# If wsrep patch is enabled, wait for a minute until node is ready.
# Note: include/wait_for_status_var.inc cannot be used here, as server rejects
# all commands except SHOW & SET until its ready. (see wsrep_ready status
# variable)
--disable_result_log
--disable_query_log
--enable_reconnect
let $counter= 600;
# Check if wsrep_ready status variable exists.
if (`SHOW STATUS LIKE 'wsrep_ready'`)
{
let $wsrep_ready= query_get_value("SHOW STATUS LIKE 'wsrep_ready'", Value, 1);
while ($wsrep_ready == 'OFF')
{
if (!$counter)
{
echo ===============================================;
echo Node still not ready after a minute, giving up!;
echo ===============================================;
die;
}
dec $counter;
sleep 0.1;
let $wsrep_ready= query_get_value("SHOW STATUS LIKE 'wsrep_ready'", Value, 1);
}
}
--disable_reconnect
--enable_query_log
--enable_result_log

View File

@@ -148,6 +148,14 @@ extern "C" void handle_signal(int sig)
}
void setlimit(int what, uint soft, uint hard)
{
struct rlimit lim = { soft, hard };
if (setrlimit (what, &lim) < 0)
message("setrlimit failed, errno=%d", errno);
}
int main(int argc, char* const argv[] )
{
char* const* child_argv= 0;
@@ -249,13 +257,13 @@ int main(int argc, char* const argv[] )
signal(SIGCHLD, SIG_DFL);
if (nocore)
{
struct rlimit corelim = { 0, 0 };
if (setrlimit (RLIMIT_CORE, &corelim) < 0)
{
message("setrlimit failed, errno=%d", errno);
}
}
setlimit(RLIMIT_CORE, 0, 0);
/*
mysqld defaults depend on that. make test results stable and independent
from the environment
*/
setlimit(RLIMIT_NOFILE, 1024, 1024);
// Signal that child is ready
buf= 37;

View File

@@ -2579,15 +2579,18 @@ sub setup_vardir() {
{
$plugindir="$opt_vardir/plugins";
mkpath($plugindir);
if (IS_WINDOWS && !$opt_embedded_server)
if (IS_WINDOWS)
{
for (<$bindir/storage/*$opt_vs_config/*.dll>,
<$bindir/plugin/*$opt_vs_config/*.dll>,
<$bindir/sql$opt_vs_config/*.dll>)
if (!$opt_embedded_server)
{
my $pname=basename($_);
copy rel2abs($_), "$plugindir/$pname";
set_plugin_var($pname);
for (<$bindir/storage/*$opt_vs_config/*.dll>,
<$bindir/plugin/*$opt_vs_config/*.dll>,
<$bindir/sql$opt_vs_config/*.dll>)
{
my $pname=basename($_);
copy rel2abs($_), "$plugindir/$pname";
set_plugin_var($pname);
}
}
}
else
@@ -3338,7 +3341,7 @@ sub do_before_run_mysqltest($)
my $resdir= dirname($resfile);
# we'll use a separate extension for generated result files
# to be able to distinguish them from manually created
# version-controlled results, and to ignore them in bzr.
# version-controlled results, and to ignore them in git.
my $dest = "$base_file$suites.result~";
my @cmd = ($exe_patch, qw/--binary -r - -f -s -o/,
$dest, $base_result, $resfile);
@@ -4374,6 +4377,7 @@ sub extract_warning_lines ($$) {
qr/InnoDB: Redo log crypto: Can't initialize to key version -1u/,
qr/InnoDB: Dumping buffer pool.*/,
qr/InnoDB: Buffer pool.*/,
qr/InnoDB: Warning: Writer thread is waiting this semaphore/,
qr/Slave: Unknown table 't1' .* 1051/,
qr/Slave SQL:.*(Internal MariaDB error code: [[:digit:]]+|Query:.*)/,
qr/slave SQL thread aborted/,
@@ -4429,6 +4433,22 @@ sub extract_warning_lines ($$) {
qr|InnoDB: Setting thread \d+ nice to \d+ failed, current nice \d+, errno 13|, # setpriority() fails under valgrind
qr|Failed to setup SSL|,
qr|SSL error: Failed to set ciphers to use|,
qr/Plugin 'InnoDB' will be forced to shutdown/,
qr|Could not increase number of max_open_files to more than|,
qr/InnoDB: Error table encrypted but encryption service not available.*/,
qr/InnoDB: Could not find a valid tablespace file for*/,
qr/InnoDB: Tablespace open failed for*/,
qr/InnoDB: Failed to find tablespace for table*/,
qr/InnoDB: Space */,
qr|InnoDB: You may have to recover from a backup|,
qr|InnoDB: It is also possible that your operatingsystem has corrupted its own file cache|,
qr|InnoDB: and rebooting your computer removes the error|,
qr|InnoDB: If the corrupt page is an index page you can also try to|,
qr|nnoDB: fix the corruption by dumping, dropping, and reimporting|,
qr|InnoDB: the corrupt table. You can use CHECK|,
qr|InnoDB: TABLE to scan your table for corruption|,
qr/InnoDB: See also */
);
my $matched_lines= [];
@@ -5471,6 +5491,12 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "--max-connections=%d", $opt_max_connections);
}
if ( $opt_valgrind )
{
# Longer timeouts when running with valgrind
mtr_add_arg($args, "--wait-longer-for-timeouts");
}
if ( $opt_embedded_server )
{
@@ -6028,6 +6054,8 @@ Options to control what test suites or cases to run
skip-test-list=FILE Skip the tests listed in FILE. Each line in the file
is an entry and should be formatted as:
<TESTNAME> : <COMMENT>
force-restart Always restart servers between tests. This makes it
easier to see from which test warnings may come from.
Options that specify ports
@@ -6145,7 +6173,6 @@ Misc options
servers to exit before finishing the process
fast Run as fast as possible, dont't wait for servers
to shutdown etc.
force-restart Always restart servers between tests
parallel=N Run tests in N parallel threads (default 1)
Use parallel=auto for auto-setting of N
repeat=N Run each test N number of times

View File

@@ -293,6 +293,15 @@ t2 CREATE TABLE `t2` (
drop table if exists t1, t2;
create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
insert into t1 (a) values(1);
Warnings:
Warning 1364 Field 'b' doesn't have a default value
Warning 1364 Field 'c' doesn't have a default value
Warning 1364 Field 'd' doesn't have a default value
Warning 1364 Field 'e' doesn't have a default value
Warning 1364 Field 'f' doesn't have a default value
Warning 1364 Field 'g' doesn't have a default value
Warning 1364 Field 'h' doesn't have a default value
Warning 1364 Field 'i' doesn't have a default value
show table status like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL
@@ -1488,6 +1497,17 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
CREATE TABLE t1 (
`transaction_id` int(11) NOT NULL DEFAULT '0',
KEY `transaction_id` (`transaction_id`));
ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS (transaction_id);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`transaction_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`transaction_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
# Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't
# identify correct column name.
#
@@ -1762,8 +1782,8 @@ ALTER TABLE tm1 DROP INDEX im3;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
ALTER TABLE ti1 DROP COLUMN d2;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE tm1 DROP COLUMN d2;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0

View File

@@ -143,7 +143,7 @@ ANALYZE
"attached_condition": "(tbl2.b < 60)"
},
"buffer_type": "flat",
"buffer_size": "128Kb",
"buffer_size": "256Kb",
"join_type": "BNL",
"r_filtered": 100
}
@@ -181,7 +181,7 @@ ANALYZE
"attached_condition": "(tbl2.b < 60)"
},
"buffer_type": "flat",
"buffer_size": "128Kb",
"buffer_size": "256Kb",
"join_type": "BNL",
"attached_condition": "(tbl1.c > tbl2.c)",
"r_filtered": 15.833

View File

@@ -40,6 +40,7 @@ ANALYZE
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_limit": 5,
"r_used_priority_queue": true,
"r_output_rows": 6,
@@ -140,6 +141,7 @@ ANALYZE
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_buffer_size": "REPLACED",
@@ -203,6 +205,11 @@ ANALYZE
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_limit": 4,
"r_used_priority_queue": true,
"r_output_rows": 4,
"temporary_table": {
"table": {
"table_name": "t0",
@@ -284,6 +291,7 @@ ANALYZE
"r_rows": 10,
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10,
"r_buffer_size": "REPLACED",
@@ -318,4 +326,261 @@ ANALYZE
}
}
drop table t2;
drop table t0, t1;
create table t2 (
a int,
b int,
c int
);
insert into t2
select
a.a+10*b.a+100*c.a,
b.a+10*c.a,
c.a
from t0 a, t0 b, t0 c;
analyze format=json
select MAX(b) from t2 where mod(a,2)=0 group by c;
ANALYZE
{
"query_block": {
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10,
"r_buffer_size": "REPLACED",
"temporary_table": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 50,
"attached_condition": "((t2.a % 2) = 0)"
}
}
}
}
}
drop table t2;
#
# MDEV-8282: crash in filesort() with simple ordered delete
#
create table t3(a int) engine=innodb;
delete from t3 order by a;
# EXPLAIN thinks it will use delete_all_rows():
explain
delete from t3 order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL 1 Deleting all rows
# ANALYZE shows that delete_all_rows() didn't work and we deleted rows
# one-by-one:
analyze
delete from t3 order by a;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 1 0.00 100.00 100.00 Using filesort
drop table t3;
#
# A test for duplicate_removal()
#
create table t3 (a int, b int);
insert into t3 select a, 123 from t0;
analyze format=json
select distinct max(t3.b) Q from t0, t3 where t0.a=t3.a group by t0.a order by null;
ANALYZE
{
"query_block": {
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"duplicate_removal": {
"temporary_table": {
"table": {
"table_name": "t0",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"block-nl-join": {
"table": {
"table_name": "t3",
"access_type": "ALL",
"r_loops": 1,
"rows": 10,
"r_rows": 10,
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"attached_condition": "(t3.a = t0.a)",
"r_filtered": 10
}
}
}
}
}
#
# A query with two filesort calls:
# - first is needed to do group-by-group grouping to calculate COUNT(DISTINCT)
# - the second is need to produce ORDER BY.
# (see MDEV-7836 for description of the query plan)
create table t5 (a int , b int) ;
create table t6 like t5 ;
create table t7 like t5 ;
insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
(2, -1), (3, 10);
insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1);
insert into t7 values (3, 3), (2, 2), (1, 1);
# TODO: This ANALYZE output doesn't make it clear what is used for what.
analyze format=json
select count(distinct t5.b) as sum from t5, t6
where t5.a=t6.a and t6.b > 0 and t5.a <= 5
group by t5.a order by sum limit 1;
ANALYZE
{
"query_block": {
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_limit": 1,
"r_used_priority_queue": true,
"r_output_rows": 2,
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 6,
"r_buffer_size": "REPLACED",
"temporary_table": {
"temporary_table": {
"table": {
"table_name": "t6",
"access_type": "ALL",
"r_loops": 1,
"rows": 5,
"r_rows": 5,
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 80,
"attached_condition": "((t6.b > 0) and (t6.a <= 5))"
},
"block-nl-join": {
"table": {
"table_name": "t5",
"access_type": "ALL",
"r_loops": 1,
"rows": 7,
"r_rows": 7,
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"attached_condition": "(t5.a = t6.a)",
"r_filtered": 21.429
}
}
}
}
}
}
}
explain format=json
select count(distinct t5.b) as sum from t5, t6
where t5.a=t6.a and t6.b > 0 and t5.a <= 5
group by t5.a order by sum limit 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"filesort": {
"temporary_table": {
"function": "buffer",
"table": {
"table_name": "t6",
"access_type": "ALL",
"rows": 5,
"filtered": 100,
"attached_condition": "((t6.b > 0) and (t6.a <= 5))"
},
"block-nl-join": {
"table": {
"table_name": "t5",
"access_type": "ALL",
"rows": 7,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"attached_condition": "(t5.a = t6.a)"
}
}
}
}
}
drop table t5,t6,t7;
drop table t3;
#
# Tabular ANALYZE must get its data from execution tracker (and not from
# the query plan)
#
CREATE TABLE t2(
col1 int,
col2 int,
UNIQUE INDEX idx (col1, col2)) engine=myisam;
INSERT INTO t2(col1, col2) VALUES
(1,20),(2,19),(3,18),(4,17),(5,16),(6,15),(7,14),(8,13),(9,12),(10,11),
(11,10),(12,9),(13,8),(14,7),(15,6),(16,5),(17,4),(18,3),(19,2),(20,1);
flush status;
explain
select col1 f1, col2 f2, col1 f3 from t2 group by f1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range NULL idx 5 NULL 7 Using index for group-by
analyze
select col1 f1, col2 f2, col1 f3 from t2 group by f1;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t2 range NULL idx 5 NULL 7 20.00 100.00 100.00 Using index for group-by
analyze format=json
select col1 f1, col2 f2, col1 f3 from t2 group by f1;
ANALYZE
{
"query_block": {
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t2",
"access_type": "range",
"key": "idx",
"key_length": "5",
"used_key_parts": ["col1"],
"r_loops": 1,
"rows": 7,
"r_rows": 20,
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"using_index_for_group_by": true
}
}
}
drop table t2;
drop table t0,t1;

View File

@@ -7,6 +7,7 @@ use db;
create table t1 (i int, c varchar(8));
insert into t1 values (1,'foo'),(2,'bar'),(3,'baz'),(4,'qux');
create view v1 as select * from t1 where i > 1;
CREATE USER u1@localhost;
grant ALL on db.v1 to u1@localhost;
connect con1,localhost,u1,,;
select * from db.t1;

View File

@@ -1,3 +1,5 @@
set GLOBAL sql_mode="";
set LOCAL sql_mode="";
CREATE DATABASE privtest_db;
CREATE TABLE privtest_db.t1 (a INT, b VARCHAR(3)) ENGINE=MyISAM;
CREATE TABLE privtest_db.t2 (a INT, b VARCHAR(3)) ENGINE=MyISAM;
@@ -5232,3 +5234,4 @@ connection default;
DROP USER 'privtest'@localhost;
USE test;
DROP DATABASE privtest_db;
set GLOBAL sql_mode=default;

View File

@@ -180,14 +180,14 @@ create table t1 select 1 as 'a';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(1) NOT NULL DEFAULT '0'
`a` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 select 9223372036854775809 as 'a';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(19) unsigned NOT NULL DEFAULT '0'
`a` bigint(19) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
a
@@ -397,12 +397,12 @@ select -(-9223372036854775808), -(-(-9223372036854775808));
create table t1 select -9223372036854775808 bi;
describe t1;
Field Type Null Key Default Extra
bi bigint(20) NO 0
bi bigint(20) NO NULL
drop table t1;
create table t1 select -9223372036854775809 bi;
describe t1;
Field Type Null Key Default Extra
bi decimal(19,0) NO 0
bi decimal(19,0) NO NULL
drop table t1;
#
# Bug #45360: wrong results

View File

@@ -1,11 +1,13 @@
set sql_mode="";
CREATE TABLE t1(a int) ENGINE=BLACKHOLE;
Warnings:
Warning 1286 Unknown storage engine 'BLACKHOLE'
Warning 1266 Using storage engine MyISAM for table 't1'
set sql_mode=default;
DROP TABLE t1;
INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so';
INSTALL PLUGIN BLACKHOLE SONAME 'ha_blackhole.so';
ERROR HY000: Function 'BLACKHOLE' already exists
ERROR HY000: Plugin 'BLACKHOLE' already installed
UNINSTALL PLUGIN blackhole;
INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so';
CREATE TABLE t1(a int) ENGINE=BLACKHOLE;

View File

@@ -49,5 +49,66 @@ col435
0.00000000000000000
0.00000000000000000
0.00000000000000000
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
set session sort_buffer_size= default;
DROP TABLE t1, t2, t3;

View File

@@ -1,3 +1,5 @@
SET global query_cache_type=ON;
SET local query_cache_type=ON;
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1,t2,t3;
set @save_query_cache_size = @@global.query_cache_size;
@@ -221,6 +223,7 @@ Variable_name Value
Qcache_hits 1
set @@global.query_cache_size = @save_query_cache_size;
drop table t2;
SET global query_cache_type=default;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES(1);

View File

@@ -99,18 +99,18 @@ CASE WHEN 1 THEN 0.1e1 else '1' END AS c12
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
`c2` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
`c3` varchar(1) NOT NULL DEFAULT '',
`c4` varchar(1) NOT NULL DEFAULT '',
`c5` varchar(4) NOT NULL DEFAULT '',
`c6` varchar(4) NOT NULL DEFAULT '',
`c7` decimal(2,1) NOT NULL DEFAULT '0.0',
`c8` decimal(2,1) NOT NULL DEFAULT '0.0',
`c1` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL,
`c2` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL,
`c3` varchar(1) NOT NULL,
`c4` varchar(1) NOT NULL,
`c5` varchar(4) NOT NULL,
`c6` varchar(4) NOT NULL,
`c7` decimal(2,1) NOT NULL,
`c8` decimal(2,1) NOT NULL,
`c9` decimal(2,1) DEFAULT NULL,
`c10` double NOT NULL DEFAULT '0',
`c11` double NOT NULL DEFAULT '0',
`c12` varchar(5) NOT NULL DEFAULT ''
`c10` double NOT NULL,
`c11` double NOT NULL,
`c12` varchar(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT CASE
@@ -151,13 +151,13 @@ Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,c
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`COALESCE(1)` int(1) NOT NULL DEFAULT '0',
`COALESCE(1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
`COALESCE('a')` varchar(1) NOT NULL DEFAULT '',
`COALESCE(1,1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
`COALESCE(1,'1')` varchar(1) NOT NULL DEFAULT '',
`COALESCE(1.1,'1')` varchar(4) NOT NULL DEFAULT '',
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
`COALESCE(1)` int(1) NOT NULL,
`COALESCE(1.0)` decimal(2,1) NOT NULL,
`COALESCE('a')` varchar(1) NOT NULL,
`COALESCE(1,1.0)` decimal(2,1) NOT NULL,
`COALESCE(1,'1')` varchar(1) NOT NULL,
`COALESCE(1.1,'1')` varchar(4) NOT NULL,
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 SELECT IFNULL('a' COLLATE latin1_swedish_ci, 'b' COLLATE latin1_bin);
@@ -231,3 +231,138 @@ case t1.f1 when '00:00:00' then 1 end
1
NULL
drop table t1;
#
# Start of 10.1 test
#
#
# MDEV-8752 Wrong result for SELECT..WHERE CASE enum_field WHEN 1 THEN 1 ELSE 0 END AND a='5'
#
CREATE TABLE t1 (a ENUM('5','6') CHARACTER SET BINARY);
INSERT INTO t1 VALUES ('5'),('6');
SELECT * FROM t1 WHERE a='5';
a
5
SELECT * FROM t1 WHERE a=1;
a
5
SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END;
a
5
SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END AND a='5';
a
5
# Multiple comparison types in CASE, not Ok to propagate
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE CASE a WHEN 1 THEN 1 ELSE 0 END AND a='5';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '5') and (case `test`.`t1`.`a` when 1 then 1 else 0 end))
DROP TABLE t1;
CREATE TABLE t1 (a ENUM('a','b','100'));
INSERT INTO t1 VALUES ('a'),('b'),('100');
SELECT * FROM t1 WHERE a='a';
a
a
SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END;
a
a
SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END AND a='a';
a
a
# String comparison in CASE and in the equality, ok to propagate
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE CASE a WHEN 'a' THEN 1 ELSE 0 END AND a='a';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
SELECT * FROM t1 WHERE a=3;
a
100
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END;
a
100
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a=3;
a
100
# Integer comparison in CASE and in the equality, not ok to propagate
# ENUM does not support this type of propagation yet.
# This can change in the future. See MDEV-8748.
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a=3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((case `test`.`t1`.`a` when 3 then 1 else 0 end) and (`test`.`t1`.`a` = 3))
SELECT * FROM t1 WHERE a=3;
a
100
SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END;
a
100
SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END AND a=3;
a
100
# String comparison in CASE, integer comparison in the equality, not Ok to propagate
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE CASE a WHEN '100' THEN 1 ELSE 0 END AND a=3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((case `test`.`t1`.`a` when '100' then 1 else 0 end) and (`test`.`t1`.`a` = 3))
SELECT * FROM t1 WHERE a='100';
a
100
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END;
a
100
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a='100';
a
100
# Integer comparison in CASE, string comparison in the equality, not Ok to propagate
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 ELSE 0 END AND a='100';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '100') and (case `test`.`t1`.`a` when 3 then 1 else 0 end))
SELECT * FROM t1 WHERE a='100';
a
100
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END;
a
100
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a='100';
a
100
# Multiple type comparison in CASE, string comparison in the equality, not Ok to propagate
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a='100';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '100') and (case `test`.`t1`.`a` when 3 then 1 when '100' then 1 else 0 end))
SELECT * FROM t1 WHERE a=3;
a
100
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END;
a
100
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a=3;
a
100
# Multiple type comparison in CASE, integer comparison in the equality, not Ok to propagate
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE CASE a WHEN 3 THEN 1 WHEN '100' THEN 1 ELSE 0 END AND a=3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((case `test`.`t1`.`a` when 3 then 1 when '100' then 1 else 0 end) and (`test`.`t1`.`a` = 3))
DROP TABLE t1;
#
# End of MDEV-8752
#
#
# End of 10.1 test
#

View File

@@ -13,7 +13,7 @@ select CAST('10 ' as unsigned integer);
CAST('10 ' as unsigned integer)
10
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '10 '
Note 1292 Truncated incorrect INTEGER value: '10 '
select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
cast(-5 as unsigned) | 1 cast(-5 as unsigned) & -1
18446744073709551611 18446744073709551611
@@ -404,7 +404,7 @@ create table t1 select cast(_koi8r'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
`t` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
@@ -438,11 +438,11 @@ ab a ab a 6100
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varbinary(2) NOT NULL DEFAULT '',
`c2` varbinary(2) NOT NULL DEFAULT '',
`c3` varbinary(2) NOT NULL DEFAULT '',
`c4` varbinary(2) NOT NULL DEFAULT '',
`c5` varbinary(2) NOT NULL DEFAULT ''
`c1` varbinary(2) NOT NULL,
`c2` varbinary(2) NOT NULL,
`c3` varbinary(2) NOT NULL,
`c4` varbinary(2) NOT NULL,
`c5` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
@@ -471,11 +471,11 @@ c1 c2 c3 c4 c5
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
`c2` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
`c3` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
`c4` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
`c5` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
`c1` varchar(2) CHARACTER SET utf8 NOT NULL,
`c2` varchar(2) CHARACTER SET utf8 NOT NULL,
`c3` varchar(2) CHARACTER SET utf8 NOT NULL,
`c4` varchar(2) CHARACTER SET utf8 NOT NULL,
`c5` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a binary(4), b char(4) character set koi8r);
@@ -582,12 +582,12 @@ create table t1 select cast(1 as unsigned), cast(1 as signed), cast(1 as double
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`cast(1 as unsigned)` int(1) unsigned NOT NULL DEFAULT '0',
`cast(1 as signed)` int(1) NOT NULL DEFAULT '0',
`cast(1 as unsigned)` int(1) unsigned NOT NULL,
`cast(1 as signed)` int(1) NOT NULL,
`cast(1 as double(5,2))` double(5,2) DEFAULT NULL,
`cast(1 as decimal(5,3))` decimal(5,3) NOT NULL DEFAULT '0.000',
`cast("A" as binary)` varbinary(1) NOT NULL DEFAULT '',
`cast("A" as char(100))` varbinary(100) NOT NULL DEFAULT '',
`cast(1 as decimal(5,3))` decimal(5,3) NOT NULL,
`cast("A" as binary)` varbinary(1) NOT NULL,
`cast("A" as char(100))` varbinary(100) NOT NULL,
`cast("2001-1-1" as DATE)` date DEFAULT NULL,
`cast("2001-1-1" as DATETIME)` datetime DEFAULT NULL,
`cast("1:2:3" as TIME)` time DEFAULT NULL
@@ -751,8 +751,8 @@ Warning 1292 Truncated incorrect INTEGER value: '9999999999999999999999999999999
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL DEFAULT '',
`CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL DEFAULT ''
`CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL,
`CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
# End of test for Bug#13581962, Bug#14096619

View File

@@ -1,6 +1,10 @@
set global secure_auth=0;
create user test_nopw;
grant select on test.* to test_nopw;
grant select on test.* to test_oldpw identified by password "09301740536db389";
grant select on test.* to test_newpw identified by "newpw";
create user test_oldpw identified by password "09301740536db389";
grant select on test.* to test_oldpw;
create user test_newpw identified by "newpw";
grant select on test.* to test_newpw;
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
concat('<', user(), '>') concat('<', current_user(), '>') database()
<root@localhost> <root@localhost> test
@@ -85,3 +89,4 @@ IS_USED_LOCK('bug31418')
NULL
FLUSH STATUS;
Value of com_select did not change
set global secure_auth=default;

View File

@@ -64,7 +64,7 @@ EXPLAIN EXTENDED SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 1) and (concat('01',`test`.`t1`.`c`) = '0101'))
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 1) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = '0101'))
SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101';
b c
01 01

Some files were not shown because too many files have changed in this diff Show More