1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mariarocks

This commit is contained in:
Sergei Petrunia
2017-03-11 20:12:15 +00:00
1755 changed files with 63733 additions and 53790 deletions

6
.gitignore vendored
View File

@@ -3,6 +3,7 @@
*.reject
*.spec
*.bak
*.dgcov
*.rpm
.*.swp
*.ninja
@@ -50,6 +51,7 @@ extra/jemalloc/build/
extra/jemalloc/tmp/
extra/my_print_defaults
extra/mysql_waitpid
extra/mysqld_safe_helper
extra/perror
extra/replace
extra/resolve_stack_dump
@@ -80,6 +82,9 @@ mysql-test/lib/My/SafeProcess/my_safe_process
mysql-test/mtr
mysql-test/mysql-test-run
mysql-test/var
mysql-test-gcov.err
mysql-test-gcov.msg
mysys/test_hash
mysys/thr_lock
mysys/thr_timer
packaging/rpm-oel/mysql.spec
@@ -223,6 +228,7 @@ support-files/mysql.spec
support-files/mysqld_multi.server
support-files/wsrep.cnf
support-files/wsrep_notify
support-files/policy/selinux/mysqld-safe.pp
tags
tests/async_queries
tests/bug25714

View File

@@ -14,6 +14,7 @@ cache:
env:
matrix:
- GCC_VERSION=4.8
- GCC_VERSION=5
- GCC_VERSION=6
addons:

View File

@@ -32,9 +32,9 @@ then
configure="$configure --verbose"
fi
# git clean -fdX removes all ignored (build) files
commands="\
/bin/rm -rf configure;
/bin/rm -rf CMakeCache.txt CMakeFiles/
git clean -fdX
path=`dirname $0`
. \"$path/autorun.sh\""

View File

@@ -42,7 +42,7 @@ Usage: $0 [-h|-n] [configure-options]
Influences the debug flags. Old is default.
--prefix=path Build with prefix 'path'.
Note: this script is intended for internal use by MySQL developers.
Note: this script is intended for internal use by MariaDB developers.
EOF
}
@@ -120,10 +120,9 @@ path=`dirname $0`
get_make_parallel_flag
# SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. To use OpenSSL you will need to specify
# the location of OpenSSL headers and libs on your system.
# Ex --with-ssl=/usr
SSL_LIBRARY=--with-ssl
# implementation of SSL. --with-ssl=yes will first try system library
# then the boundled one --with-ssl=system will use the system library.
SSL_LIBRARY=--with-ssl=system
if [ "x$warning_mode" = "xpedantic" ]; then
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
@@ -293,7 +292,7 @@ gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
# GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well
# as on the compiler command line), and this requires setting LDFLAGS for BDB.
gcov_link_flags="-fprofile-arcs -ftest-coverage"
gcov_link_flags="-fprofile-arcs -ftest-coverage -lgcov"
gcov_configs="--with-gcov"

View File

@@ -28,6 +28,6 @@ export LDFLAGS="$gcov_link_flags"
extra_flags="$pentium64_cflags $max_cflags $gcov_compile_flags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs --with-zlib-dir=bundled"
extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs"
. "$path/FINISH.sh"

View File

@@ -183,18 +183,18 @@ INCLUDE(check_compiler_flag)
OPTION(WITH_ASAN "Enable address sanitizer" OFF)
IF (WITH_ASAN)
# gcc 4.8.1 and new versions of clang
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -O1 -Wno-error -fPIC"
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fPIC"
DEBUG RELWITHDEBINFO)
SET(HAVE_C_FSANITIZE ${HAVE_C__fsanitize_address__O1__Wno_error__fPIC})
SET(HAVE_CXX_FSANITIZE ${HAVE_CXX__fsanitize_address__O1__Wno_error__fPIC})
SET(HAVE_C_FSANITIZE ${have_C__fsanitize_address__fPIC})
SET(HAVE_CXX_FSANITIZE ${have_CXX__fsanitize_address__fPIC})
IF(HAVE_C_FSANITIZE AND HAVE_CXX_FSANITIZE)
SET(WITH_ASAN_OK 1)
ELSE()
# older versions of clang
MY_CHECK_AND_SET_COMPILER_FLAG("-faddress-sanitizer -O1 -fPIC"
MY_CHECK_AND_SET_COMPILER_FLAG("-faddress-sanitizer -fPIC"
DEBUG RELWITHDEBINFO)
SET(HAVE_C_FADDRESS ${HAVE_C__faddress_sanitizer__O1__fPIC})
SET(HAVE_CXX_FADDRESS ${HAVE_CXX__faddress_sanitizer__O1__fPIC})
SET(HAVE_C_FADDRESS ${have_C__faddress_sanitizer__fPIC})
SET(HAVE_CXX_FADDRESS ${have_CXX__faddress_sanitizer__fPIC})
IF(HAVE_C_FADDRESS AND HAVE_CXX_FADDRESS)
SET(WITH_ASAN_OK 1)
ENDIF()
@@ -274,7 +274,7 @@ ENDIF()
# Set commonly used variables
IF(WIN32)
SET(DEFAULT_MYSQL_HOME "C:/MariaDB${MYSQL_BASE_VERSION}")
SET(DEFAULT_MYSQL_HOME "C:/Program Files/MariaDB ${MYSQL_BASE_VERSION}")
SET(SHAREDIR share)
ELSE()
SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX})

View File

@@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
MYSQL_VERSION_PATCH=4
MYSQL_VERSION_PATCH=5

View File

@@ -66,6 +66,10 @@ enum options_client
OPT_MYSQLDUMP_SLAVE_APPLY,
OPT_MYSQLDUMP_SLAVE_DATA,
OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT,
#ifdef WHEN_FLASHBACK_REVIEW_READY
OPT_REVIEW,
OPT_REVIEW_DBNAME, OPT_REVIEW_TABLENAME,
#endif
OPT_SLAP_CSV, OPT_SLAP_CREATE_STRING,
OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
OPT_SLAP_AUTO_GENERATE_ADD_AUTO,

View File

@@ -1571,8 +1571,10 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile)
if (mysql_query(mysql, "SHOW VARIABLES LIKE 'pid_file'"))
{
my_printf_error(0, "query failed; error: '%s'", error_flags,
mysql_error(mysql));
my_printf_error(mysql_errno(mysql),
"The query to get the server's pid file failed,"
" error: '%s'. Continuing.", error_flags,
mysql_error(mysql));
}
result = mysql_store_result(mysql);
if (result)

View File

@@ -66,6 +66,10 @@ Rpl_filter *binlog_filter= 0;
/* Needed for Rpl_filter */
CHARSET_INFO* system_charset_info= &my_charset_utf8_general_ci;
/* Needed for Flashback */
DYNAMIC_ARRAY binlog_events; // Storing the events output string
String stop_event_string; // Storing the STOP_EVENT output string
char server_version[SERVER_VERSION_LENGTH];
ulong server_id = 0;
@@ -89,7 +93,7 @@ static const char *load_groups[]=
static void error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
static void warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0;
static bool one_database=0, one_table=0, to_last_remote_log= 0, disable_log_bin= 0;
static bool opt_hexdump= 0, opt_version= 0;
const char *base64_output_mode_names[]=
{"NEVER", "AUTO", "ALWAYS", "UNSPEC", "DECODE-ROWS", NullS};
@@ -99,6 +103,7 @@ TYPELIB base64_output_mode_typelib=
static enum_base64_output_mode opt_base64_output_mode= BASE64_OUTPUT_UNSPEC;
static char *opt_base64_output_mode_str= NullS;
static char* database= 0;
static char* table= 0;
static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
static my_bool debug_info_flag, debug_check_flag;
static my_bool force_if_open_opt= 1;
@@ -132,6 +137,12 @@ static MYSQL* mysql = NULL;
static const char* dirname_for_local_load= 0;
static bool opt_skip_annotate_row_events= 0;
static my_bool opt_flashback;
#ifdef WHEN_FLASHBACK_REVIEW_READY
static my_bool opt_flashback_review;
static char *flashback_review_dbname, *flashback_review_tablename;
#endif
/**
Pointer to the Format_description_log_event of the currently active binlog.
@@ -790,6 +801,23 @@ print_skip_replication_statement(PRINT_EVENT_INFO *pinfo, const Log_event *ev)
pinfo->skip_replication= cur_val;
}
/**
Indicates whether the given table should be filtered out,
according to the --table=X option.
@param log_tblname Name of table.
@return nonzero if the table with the given name should be
filtered out, 0 otherwise.
*/
static bool shall_skip_table(const char *log_tblname)
{
return one_table &&
(log_tblname != NULL) &&
strcmp(log_tblname, table);
}
/**
Prints the given event in base64 format.
@@ -952,6 +980,12 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Exit_status retval= OK_CONTINUE;
IO_CACHE *const head= &print_event_info->head_cache;
/* Bypass flashback settings to event */
ev->is_flashback= opt_flashback;
#ifdef WHEN_FLASHBACK_REVIEW_READY
ev->need_flashback_review= opt_flashback_review;
#endif
/*
Format events are not concerned by --offset and such, we always need to
read them to be able to process the wanted events.
@@ -988,7 +1022,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
retval= OK_STOP;
goto end;
}
if (!short_form)
if (!short_form && !opt_flashback)
fprintf(result_file, "# at %s\n",llstr(pos,ll_buff));
if (!opt_hexdump)
@@ -1214,12 +1248,128 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case TABLE_MAP_EVENT:
{
Table_map_log_event *map= ((Table_map_log_event *)ev);
if (shall_skip_database(map->get_db_name()))
if (shall_skip_database(map->get_db_name()) ||
shall_skip_table(map->get_table_name()))
{
print_event_info->m_table_map_ignored.set_table(map->get_table_id(), map);
destroy_evt= FALSE;
goto end;
}
#ifdef WHEN_FLASHBACK_REVIEW_READY
/* Create review table for Flashback */
if (opt_flashback_review)
{
// Check if the table was already created?
Table_map_log_event *exist_table;
exist_table= print_event_info->m_table_map.get_table(map->get_table_id());
if (!exist_table)
{
MYSQL *conn;
MYSQL_RES *res;
MYSQL_ROW row;
char tmp_sql[8096];
int tmp_sql_offset;
conn = mysql_init(NULL);
if (!mysql_real_connect(conn, host, user, pass,
map->get_db_name(), port, sock, 0))
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
if (mysql_query(conn, "SET group_concat_max_len=10000;"))
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
memset(tmp_sql, 0, sizeof(tmp_sql));
sprintf(tmp_sql, " "
"SELECT Group_concat(cols) "
"FROM (SELECT 'op_type char(1)' cols "
" UNION ALL "
" SELECT Concat('`', column_name, '_old` ', column_type, ' ', "
" IF(character_set_name IS NOT NULL, "
" Concat('character set ', character_set_name, ' '), ' '), "
" IF(collation_name IS NOT NULL, "
" Concat('collate ', collation_name, ' '), ' ')) cols "
" FROM information_schema.columns "
" WHERE table_schema = '%s' "
" AND table_name = '%s' "
" UNION ALL "
" SELECT Concat('`', column_name, '_new` ', column_type, ' ', "
" IF(character_set_name IS NOT NULL, "
" Concat('character set ', character_set_name, ' '), ' '), "
" IF(collation_name IS NOT NULL, "
" Concat('collate ', collation_name, ' '), ' ')) cols "
" FROM information_schema.columns "
" WHERE table_schema = '%s' "
" AND table_name = '%s') tmp;",
map->get_db_name(), map->get_table_name(),
map->get_db_name(), map->get_table_name());
if (mysql_query(conn, tmp_sql))
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
res = mysql_use_result(conn);
if ((row = mysql_fetch_row(res)) != NULL) // only one row
{
if (flashback_review_dbname)
{
ev->set_flashback_review_dbname(flashback_review_dbname);
}
else
{
ev->set_flashback_review_dbname(map->get_db_name());
}
if (flashback_review_tablename)
{
ev->set_flashback_review_tablename(flashback_review_tablename);
}
else
{
memset(tmp_sql, 0, sizeof(tmp_sql));
sprintf(tmp_sql, "__%s", map->get_table_name());
ev->set_flashback_review_tablename(tmp_sql);
}
memset(tmp_sql, 0, sizeof(tmp_sql));
tmp_sql_offset= sprintf(tmp_sql, "CREATE TABLE IF NOT EXISTS");
tmp_sql_offset+= sprintf(tmp_sql + tmp_sql_offset, " `%s`.`%s` (%s) %s",
ev->get_flashback_review_dbname(),
ev->get_flashback_review_tablename(),
row[0],
print_event_info->delimiter);
}
fprintf(result_file, "%s\n", tmp_sql);
mysql_free_result(res);
mysql_close(conn);
}
else
{
char tmp_str[128];
if (flashback_review_dbname)
ev->set_flashback_review_dbname(flashback_review_dbname);
else
ev->set_flashback_review_dbname(map->get_db_name());
if (flashback_review_tablename)
ev->set_flashback_review_tablename(flashback_review_tablename);
else
{
memset(tmp_str, 0, sizeof(tmp_str));
sprintf(tmp_str, "__%s", map->get_table_name());
ev->set_flashback_review_tablename(tmp_str);
}
}
}
#endif
/*
The Table map is to be printed, so it's just the time when we may
print the kept Annotate event (if there is any).
@@ -1294,6 +1444,38 @@ end:
*/
if (ev)
{
/* Holding event output if needed */
if (!ev->output_buf.is_empty())
{
LEX_STRING tmp_str;
tmp_str.length= ev->output_buf.length();
tmp_str.str= ev->output_buf.release();
if (opt_flashback)
{
if (ev_type == STOP_EVENT)
stop_event_string.reset(tmp_str.str, tmp_str.length, tmp_str.length,
&my_charset_bin);
else
{
if (push_dynamic(&binlog_events, (uchar *) &tmp_str))
{
error("Out of memory: can't allocate memory to store the flashback events.");
exit(1);
}
}
}
else
{
my_fwrite(result_file, (const uchar *) tmp_str.str, tmp_str.length,
MYF(MY_NABP));
my_free(tmp_str.str);
}
}
if (remote_opt)
ev->temp_buf= 0;
if (destroy_evt) /* destroy it later if not set (ignored table map) */
delete ev;
}
@@ -1352,6 +1534,13 @@ static struct my_option my_options[] =
"already have. NOTE: you will need a SUPER privilege to use this option.",
&disable_log_bin, &disable_log_bin, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"flashback", 'B', "Flashback feature can rollback you committed data to a special time point.",
#ifdef WHEN_FLASHBACK_REVIEW_READY
"before Flashback feature writing a row, original row can insert to review-dbname.review-tablename,"
"and mysqlbinlog will login mysql by user(-u) and password(-p) and host(-h).",
#endif
&opt_flashback, &opt_flashback, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"force-if-open", 'F', "Force if binlog was not closed properly.",
&force_if_open_opt, &force_if_open_opt, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
@@ -1395,6 +1584,19 @@ static struct my_option my_options[] =
"prefix for the file names.",
&result_file_name, &result_file_name, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef WHEN_FLASHBACK_REVIEW_READY
{"review", opt_flashback_review, "Print review sql in output file.",
&opt_flashback_review, &opt_flashback_review, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"review-dbname", opt_flashback_flashback_review_dbname,
"Writing flashback original row data into this db",
&flashback_review_dbname, &flashback_review_dbname,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"review-tablename", opt_flashback_flashback_review_tablename,
"Writing flashback original row data into this table",
&flashback_review_tablename, &flashback_review_tablename,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"server-id", 0,
"Extract only binlog entries created by the server having the given id.",
&server_id, &server_id, 0, GET_ULONG,
@@ -1458,6 +1660,9 @@ static struct my_option my_options[] =
&stop_position, &stop_position, 0, GET_ULL,
REQUIRED_ARG, (longlong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
(ulonglong)(~(my_off_t)0), 0, 0, 0},
{"table", 'T', "List entries for just this table (local log only).",
&table, &table, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"to-last-log", 't', "Requires -R. Will not stop at the end of the \
requested binlog but rather continue printing until the end of the last \
binlog of the MySQL server. If you send the output to the same MySQL server, \
@@ -1567,6 +1772,7 @@ static void cleanup()
{
my_free(pass);
my_free(database);
my_free(table);
my_free(host);
my_free(user);
my_free(const_cast<char*>(dirname_for_local_load));
@@ -1637,6 +1843,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
#endif
#include <sslopt-case.h>
case 'B':
opt_flashback= 1;
break;
case 'd':
one_database = 1;
break;
@@ -1658,10 +1867,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'R':
remote_opt= 1;
break;
case 'T':
one_table= 1;
break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
break;
#ifdef WHEN_FLASHBACK_REVIEW_READY
case opt_flashback_review:
opt_flashback_review= 1;
break;
#endif
case OPT_START_DATETIME:
start_datetime= convert_str_to_timestamp(start_datetime_str);
break;
@@ -1862,7 +2079,7 @@ static Exit_status dump_log_entries(const char* logname)
dump_local_log_entries(&print_event_info, logname));
/* Set delimiter back to semicolon */
if (!opt_raw_mode)
if (!opt_raw_mode && !opt_flashback)
fprintf(result_file, "DELIMITER ;\n");
strmov(print_event_info.delimiter, ";");
return rc;
@@ -2697,6 +2914,10 @@ int main(int argc, char** argv)
my_set_max_open_files(open_files_limit);
if (opt_flashback)
my_init_dynamic_array(&binlog_events, sizeof(LEX_STRING), 1024, 1024,
MYF(0));
if (opt_stop_never)
to_last_remote_log= TRUE;
@@ -2795,6 +3016,29 @@ int main(int argc, char** argv)
start_position= BIN_LOG_HEADER_SIZE;
}
/*
If enable flashback, need to print the events from the end to the
beginning
*/
if (opt_flashback)
{
for (uint i= binlog_events.elements; i > 0; --i)
{
LEX_STRING *event_str= dynamic_element(&binlog_events, i - 1,
LEX_STRING*);
fprintf(result_file, "%s", event_str->str);
my_free(event_str->str);
}
fprintf(result_file, "COMMIT\n/*!*/;\n");
delete_dynamic(&binlog_events);
}
/* Set delimiter back to semicolon */
if (!stop_event_string.is_empty())
fprintf(result_file, "%s", stop_event_string.ptr());
if (!opt_raw_mode && opt_flashback)
fprintf(result_file, "DELIMITER ;\n");
if (!opt_raw_mode)
{
/*

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, MariaDB
Copyright (c) 2010, 2017, MariaDB Corporation.
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
@@ -199,12 +199,12 @@ const char *compatible_mode_names[]=
};
#define MASK_ANSI_QUOTES \
(\
(1<<2) | /* POSTGRESQL */\
(1<<3) | /* ORACLE */\
(1<<4) | /* MSSQL */\
(1<<5) | /* DB2 */\
(1<<6) | /* MAXDB */\
(1<<10) /* ANSI */\
(1U<<2) | /* POSTGRESQL */\
(1U<<3) | /* ORACLE */\
(1U<<4) | /* MSSQL */\
(1U<<5) | /* DB2 */\
(1U<<6) | /* MAXDB */\
(1U<<10) /* ANSI */\
)
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
"", compatible_mode_names, NULL};
@@ -5476,7 +5476,7 @@ static ulong find_set(TYPELIB *lib, const char *x, size_t length,
*err_len= var_len;
}
else
found|= ((longlong) 1 << (find - 1));
found|= 1UL << (find - 1);
if (pos == end)
break;
start= pos + 1;

View File

@@ -5156,6 +5156,7 @@ uint get_errcode_from_name(const char *error_name, const char *error_end)
handler_error_names)))
return tmp;
die("Unknown SQL error name '%s'", error_name);
return 0; // Keep compiler happy
}
const char *unknown_error= "<Unknown>";
@@ -5786,6 +5787,7 @@ void do_connect(struct st_command *command)
my_bool con_shm __attribute__ ((unused))= 0;
int read_timeout= 0;
int write_timeout= 0;
int connect_timeout= 0;
struct st_connection* con_slot;
static DYNAMIC_STRING ds_connection_name;
@@ -5892,6 +5894,11 @@ void do_connect(struct st_command *command)
{
write_timeout= atoi(con_options + sizeof("write_timeout=")-1);
}
else if (strncasecmp(con_options, "connect_timeout=",
sizeof("connect_timeout=")-1) == 0)
{
connect_timeout= atoi(con_options + sizeof("connect_timeout=")-1);
}
else
die("Illegal option to connect: %.*s",
(int) (end - con_options), con_options);
@@ -5976,6 +5983,12 @@ void do_connect(struct st_command *command)
(char*)&write_timeout);
}
if (connect_timeout)
{
mysql_options(con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
(char*)&connect_timeout);
}
#ifdef HAVE_SMEM
if (con_shm)
{

View File

@@ -165,21 +165,26 @@ foreach my $option (@ARGV)
$cmakeargs = $cmakeargs." -DWITH_LIBEVENT=bundled";
next;
}
if($option =~ /with-ssl=/)
if($option =~ /with-ssl=yes/)
{
$cmakeargs = $cmakeargs." -DWITH_SSL=yes";
next;
}
if($option =~ /with-ssl=system/)
{
$cmakeargs = $cmakeargs." -DWITH_SSL=system";
next;
}
if($option =~ /with-ssl$/)
{
$cmakeargs = $cmakeargs." -DWITH_SSL=bundled";
next;
}
if($option =~ /with-debug/)
{
$cmakeargs = $cmakeargs." -DCMAKE_BUILD_TYPE=Debug -DSECURITY_HARDENED=OFF";
next;
}
if($option =~ /with-ssl/)
{
$cmakeargs = $cmakeargs." -DWITH_SSL=bundled";
next;
}
if($option =~ /prefix=/)
{
$cmake_install_prefix= substr($option, 7);

View File

@@ -45,10 +45,10 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
ENDIF()
ENDMACRO()
EXTRACT_LINK_LIBRARIES(mysqlclient LIBS)
EXTRACT_LINK_LIBRARIES(mariadb LIBS)
EXTRACT_LINK_LIBRARIES(mysqlserver EMB_LIBS)
SET(LIBS "-lmysqlclient ${ZLIB_DEPS} ${LIBS} ${openssl_libs}")
SET(LIBS "-lmariadb ${ZLIB_DEPS} ${LIBS} ${openssl_libs}")
SET(EMB_LIBS "-lmysqld ${ZLIB_DEPS} ${EMB_LIBS} ${openssl_libs}")
MACRO(REPLACE_FOR_CLIENTS VAR)

View File

@@ -19,9 +19,13 @@ MACRO (MYSQL_CHECK_LZ4)
IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO")
CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_limitedOutput "" HAVE_LZ4_SHARED_LIB)
CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
IF (HAVE_LZ4_COMPRESS_DEFAULT)
ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
ENDIF()
LINK_LIBRARIES(lz4)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
@@ -35,9 +39,13 @@ MACRO (MYSQL_CHECK_LZ4_STATIC)
IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO")
CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
CHECK_LIBRARY_EXISTS(liblz4.a LZ4_compress_limitedOutput "" HAVE_LZ4_LIB)
CHECK_LIBRARY_EXISTS(liblz3.a LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
IF(HAVE_LZ4_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
IF (HAVE_LZ4_COMPRESS_DEFAULT)
ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
ENDIF()
LINK_LIBRARIES(liblz4.a)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
@@ -45,4 +53,4 @@ MACRO (MYSQL_CHECK_LZ4_STATIC)
ENDIF()
ENDIF()
ENDIF()
ENDMACRO()
ENDMACRO()

View File

@@ -119,55 +119,19 @@ MACRO (MYSQL_CHECK_SSL)
WITH_SSL STREQUAL "yes" OR
WITH_SSL_PATH
)
# First search in WITH_SSL_PATH.
FIND_PATH(OPENSSL_ROOT_DIR
NAMES include/openssl/ssl.h
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
HINTS ${WITH_SSL_PATH}
)
# Then search in standard places (if not found above).
FIND_PATH(OPENSSL_ROOT_DIR
NAMES include/openssl/ssl.h
)
FIND_PATH(OPENSSL_INCLUDE_DIR
NAMES openssl/ssl.h
HINTS ${OPENSSL_ROOT_DIR}/include
)
IF (WIN32)
FIND_FILE(OPENSSL_APPLINK_C
NAMES openssl/applink.c
HINTS ${OPENSSL_ROOT_DIR}/include
)
MESSAGE_ONCE(OPENSSL_APPLINK_C "OPENSSL_APPLINK_C ${OPENSSL_APPLINK_C}")
IF(NOT OPENSSL_ROOT_DIR)
IF(WITH_SSL_PATH)
SET(OPENSSL_ROOT_DIR ${WITH_SSL_PATH})
ENDIF()
ENDIF()
# On mac this list is <.dylib;.so;.a>
# We prefer static libraries, so we revert it here.
IF (WITH_SSL_PATH)
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
ENDIF()
FIND_LIBRARY(OPENSSL_SSL_LIBRARY
NAMES ssl ssleay32 ssleay32MD
HINTS ${OPENSSL_ROOT_DIR}/lib)
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY
NAMES crypto libeay32
HINTS ${OPENSSL_ROOT_DIR}/lib)
MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY OPENSSL_ROOT_DIR
OPENSSL_INCLUDE_DIR)
IF (WITH_SSL_PATH)
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
ENDIF()
INCLUDE(CheckSymbolExists)
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
HAVE_SHA512_DIGEST_LENGTH)
SET(CMAKE_REQUIRED_INCLUDES)
IF(OPENSSL_INCLUDE_DIR AND OPENSSL_SSL_LIBRARY AND
OPENSSL_CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
FIND_PACKAGE(OpenSSL)
IF(OPENSSL_FOUND)
SET(OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY})
INCLUDE(CheckSymbolExists)
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
HAVE_SHA512_DIGEST_LENGTH)
SET(CMAKE_REQUIRED_INCLUDES)
SET(SSL_SOURCES "")
SET(SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
@@ -177,16 +141,6 @@ MACRO (MYSQL_CHECK_SSL)
SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${LIBDL})
ENDIF()
# Verify version number. Version information looks like:
# #define OPENSSL_VERSION_NUMBER 0x1000103fL
# Encoded as MNNFFPPS: major minor fix patch status
FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h"
OPENSSL_VERSION_TEXT
REGEX "^# *define[\t ]+OPENSSL_VERSION_TEXT[\t ]+")
STRING(REGEX REPLACE
"^.*OPENSSL_VERSION_TEXT[\t ]+\"OpenSSL ([-0-9a-z.]+).*$" "\\1"
OPENSSL_VERSION "${OPENSSL_VERSION_TEXT}")
MESSAGE_ONCE(OPENSSL_INCLUDE_DIR "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}")
MESSAGE_ONCE(OPENSSL_SSL_LIBRARY "OPENSSL_SSL_LIBRARY = ${OPENSSL_SSL_LIBRARY}")
MESSAGE_ONCE(OPENSSL_CRYPTO_LIBRARY "OPENSSL_CRYPTO_LIBRARY = ${OPENSSL_CRYPTO_LIBRARY}")

View File

@@ -58,13 +58,13 @@ IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode)
ADD_CUSTOM_COMMAND(OUTPUT user.ps
DEPENDS user.r ${OUTPUT_INC} ${SOURCE_INC}
COMMAND ${GROFF} -mm ${CMAKE_CURRENT_SOURCE_DIR}/user.r > user.ps || touch user.ps)
ADD_CUSTOM_TARGET(user.ps ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.ps)
ADD_CUSTOM_TARGET(user_ps ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.ps)
ENDIF(GROFF)
IF(NROFF)
ADD_CUSTOM_COMMAND(OUTPUT user.t
DEPENDS user.r ${OUTPUT_INC} ${SOURCE_INC}
COMMAND ${NROFF} -mm ${CMAKE_CURRENT_SOURCE_DIR}/user.r > user.t || touch user.t)
ADD_CUSTOM_TARGET(user.t ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.t)
ADD_CUSTOM_TARGET(user_t ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.t)
ENDIF(NROFF)
ENDIF()

View File

@@ -115,18 +115,18 @@
* (until we add flags to _db_stack_frame_, increasing it by 4 bytes)
*/
#define DEBUG_ON (1 << 1) /* Debug enabled */
#define FILE_ON (1 << 2) /* File name print enabled */
#define LINE_ON (1 << 3) /* Line number print enabled */
#define DEPTH_ON (1 << 4) /* Function nest level print enabled */
#define PROCESS_ON (1 << 5) /* Process name print enabled */
#define NUMBER_ON (1 << 6) /* Number each line of output */
#define PID_ON (1 << 8) /* Identify each line with process id */
#define TIMESTAMP_ON (1 << 9) /* timestamp every line of output */
#define FLUSH_ON_WRITE (1 << 10) /* Flush on every write */
#define OPEN_APPEND (1 << 11) /* Open for append */
#define SANITY_CHECK_ON (1 << 12) /* Check memory on every DBUG_ENTER/RETURN */
#define TRACE_ON ((uint)1 << 31) /* Trace enabled. MUST be the highest bit!*/
#define DEBUG_ON (1U << 1) /* Debug enabled */
#define FILE_ON (1U << 2) /* File name print enabled */
#define LINE_ON (1U << 3) /* Line number print enabled */
#define DEPTH_ON (1U << 4) /* Function nest level print enabled */
#define PROCESS_ON (1U << 5) /* Process name print enabled */
#define NUMBER_ON (1U << 6) /* Number each line of output */
#define PID_ON (1U << 8) /* Identify each line with process id */
#define TIMESTAMP_ON (1U << 9) /* timestamp every line of output */
#define FLUSH_ON_WRITE (1U << 10) /* Flush on every write */
#define OPEN_APPEND (1U << 11) /* Open for append */
#define SANITY_CHECK_ON (1U << 12) /* Check memory on every DBUG_ENTER/RETURN */
#define TRACE_ON (1U << 31) /* Trace enabled. MUST be the highest bit!*/
#define sf_sanity() (0)
#define TRACING (cs->stack->flags & TRACE_ON)
@@ -1213,7 +1213,7 @@ void _db_return_(struct _db_stack_frame_ *_stack_frame_)
*
* SYNOPSIS
*
* VOID _db_pargs_(_line_, keyword)
* int _db_pargs_(_line_, keyword)
* int _line_;
* char *keyword;
*
@@ -1226,12 +1226,14 @@ void _db_return_(struct _db_stack_frame_ *_stack_frame_)
*
*/
void _db_pargs_(uint _line_, const char *keyword)
int _db_pargs_(uint _line_, const char *keyword)
{
CODE_STATE *cs;
get_code_state_or_return;
get_code_state_or_return 0;
cs->u_line= _line_;
cs->u_keyword= keyword;
return DEBUGGING && _db_keyword_(cs, cs->u_keyword, 0);
}
@@ -1265,27 +1267,24 @@ void _db_doprnt_(const char *format,...)
{
va_list args;
CODE_STATE *cs;
int save_errno;
get_code_state_or_return;
va_start(args,format);
if (!cs->locked)
pthread_mutex_lock(&THR_LOCK_dbug);
if (_db_keyword_(cs, cs->u_keyword, 0))
{
int save_errno=errno;
DoPrefix(cs, cs->u_line);
if (TRACING)
Indent(cs, cs->level + 1);
else
(void) fprintf(cs->stack->out_file->file, "%s: ", cs->func);
(void) fprintf(cs->stack->out_file->file, "%s: ", cs->u_keyword);
DbugVfprintf(cs->stack->out_file->file, format, args);
DbugFlush(cs);
errno=save_errno;
}
else if (!cs->locked)
pthread_mutex_unlock(&THR_LOCK_dbug);
save_errno=errno;
DoPrefix(cs, cs->u_line);
if (TRACING)
Indent(cs, cs->level + 1);
else
(void) fprintf(cs->stack->out_file->file, "%s: ", cs->func);
(void) fprintf(cs->stack->out_file->file, "%s: ", cs->u_keyword);
DbugVfprintf(cs->stack->out_file->file, format, args);
DbugFlush(cs);
errno=save_errno;
va_end(args);
}

View File

@@ -27,6 +27,7 @@ usr/bin/mysql_tzinfo_to_sql
usr/bin/mysqlbinlog
usr/bin/mysqld_multi
usr/bin/mysqld_safe
usr/bin/mysqld_safe_helper
usr/bin/mysqlhotcopy
usr/bin/perror
usr/bin/replace

View File

@@ -50,7 +50,7 @@ stop_server() {
################################ main() ##########################
this_version=10.2
max_upgradeable_version=5.6
max_upgradeable_version=5.7
# Check if a flag file is found that indicates a previous MariaDB or MySQL
# version was installed. If multiple flags are found, check which one was

View File

@@ -17,7 +17,7 @@ usr/lib/mysql/plugin/qa_auth_client.so
usr/lib/mysql/plugin/qa_auth_interface.so
usr/lib/mysql/plugin/qa_auth_server.so
usr/share/mysql/mysql-test/README
usr/share/mysql/mysql-test/README.gcov
usr/share/mysql/mysql-test/README-gcov
usr/share/mysql/mysql-test/README.stress
usr/share/mysql/mysql-test/disabled.def
usr/share/mysql/mysql-test/lib

View File

@@ -8,8 +8,8 @@
## DP: http://bugs.mysql.com/bug.php?id=6901
@DPATCH@
--- old/scripts/mysql_system_tables_data.sql 2008-12-04 22:59:44.000000000 +0100
+++ new/scripts/mysql_system_tables_data.sql 2008-12-04 23:00:07.000000000 +0100
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -26,16 +26,6 @@
-- a plain character
SELECT LOWER( REPLACE((SELECT REPLACE(@@hostname,'_','\_')),'%','\%') )INTO @current_hostname;
@@ -26,14 +26,14 @@
-
-- Fill "user" table with default users allowing root access
-- from local machine if "user" table didn't exist before
CREATE TEMPORARY TABLE tmp_user LIKE user;
@@ -43,8 +33,6 @@ INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','
REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N','',0 FROM dual WHERE @current_hostname != 'localhost';
REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N','',0);
REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N', '', 0);
-INSERT INTO tmp_user (host,user) VALUES ('localhost','');
-INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost';
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
DROP TABLE tmp_user;
CREATE TEMPORARY TABLE tmp_user_nopasswd LIKE user;
@@ -48,9 +38,6 @@ REPLACE INTO tmp_user_nopasswd VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y'
REPLACE INTO tmp_user_nopasswd VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N', '', 0);
-- More secure root account using unix sucket auth.
INSERT INTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root'),'','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'unix_socket','','N', 'N','', 0);
--- Anonymous user with no privileges.
-INSERT INTO tmp_user_anonymous (host,user) VALUES ('localhost','');
-INSERT INTO tmp_user_anonymous (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost';
INSERT INTO user SELECT * FROM tmp_user_nopasswd WHERE @had_user_table=0 AND @skip_auth_root_nopasswd IS NULL;
INSERT INTO user SELECT * FROM tmp_user_socket WHERE @had_user_table=0 AND @auth_root_socket IS NOT NULL;

12
debian/rules vendored
View File

@@ -84,6 +84,10 @@ endif
-DCOMPILATION_COMMENT="mariadb.org binary distribution" \
-DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \
-DSYSTEM_TYPE="debian-$(DEB_BUILD_GNU_SYSTEM)" \
$${MYSQL_BUILD_CXX:+-DCMAKE_CXX_COMPILER=$${MYSQL_BUILD_CXX}} \
$${MYSQL_BUILD_CC:+-DCMAKE_C_COMPILER=$${MYSQL_BUILD_CC}} \
$${MYSQL_COMPILER_LAUNCHER:+-DCMAKE_CXX_COMPILER_LAUNCHER=${MYSQL_COMPILER_LAUNCHER}} \
$${MYSQL_COMPILER_LAUNCHER:+-DCMAKE_C_COMPILER_LAUNCHER=${MYSQL_COMPILER_LAUNCHER}} \
-DCMAKE_SYSTEM_PROCESSOR=$(DEB_BUILD_ARCH) \
-DBUILD_CONFIG=mysql_release \
-DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
@@ -158,12 +162,12 @@ override_dh_auto_install:
install -D -m 644 debian/mariadb-server-10.2.py $(TMP)/usr/share/apport/package-hooks/source_mariadb-10.2.py
# Install libmariadbclient18 compatibility links
ln -s $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadbclient.so.18
ln -s /usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadbclient.so.18
# Install libmysqlclientclientXX compatibility links
ln -s $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqlclient.so.18
ln -s $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqlclient.so.19
ln -s $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqlclient.so.20
ln -s /usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqlclient.so.18
ln -s /usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqlclient.so.19
ln -s /usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqlclient.so.20
touch $@

View File

@@ -80,6 +80,7 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_XTRADB_STORAGE_ENGINE)
../storage/innobase/buf/buf0buf.cc
../storage/innobase/page/page0zip.cc
../storage/innobase/os/os0file.cc
../storage/innobase/fil/fil0crypt.cc
)
@@ -97,4 +98,7 @@ IF(UNIX)
MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c COMPONENT Client)
TARGET_LINK_LIBRARIES(mysql_waitpid mysys)
MYSQL_ADD_EXECUTABLE(mysqld_safe_helper mysqld_safe_helper.c COMPONENT Server)
TARGET_LINK_LIBRARIES(mysqld_safe_helper mysys)
ENDIF()

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014, 2016, MariaDB Corporation.
Copyright (c) 2014, 2017, MariaDB Corporation.
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
@@ -70,6 +70,24 @@ The parts not included are excluded by #ifndef UNIV_INNOCHECKSUM. */
#define PRIuMAX "llu"
#endif
/*********************************************************************
Verify checksum for a page (iff it's encrypted)
NOTE: currently this function can only be run in single threaded mode
as it modifies srv_checksum_algorithm (temporarily)
@param[in] src_fame page to verify
@param[in] page_size page_size
@param[in] page_no page number of given read_buf
@param[in] strict_check true if strict-check option is enabled
@return true if page is encrypted AND OK, false otherwise */
UNIV_INTERN
bool
fil_space_verify_crypt_checksum(
/*============================*/
const byte* src_frame, /*!< in: page the verify */
const page_size_t& page_size /*!< in: page size */
,uintmax_t page_no,
bool strict_check);
/* Global variables */
static bool verbose;
static bool just_count;
@@ -564,9 +582,25 @@ is_page_corrupted(
}
}
is_corrupted = buf_page_is_corrupted(
true, buf, page_size, false, cur_page_num, strict_verify,
is_log_enabled, log_file);
/* If page is encrypted, use different checksum calculation
as innochecksum can't decrypt pages. Note that some old InnoDB
versions did not initialize FIL_PAGE_FILE_FLUSH_LSN field
so if crypt checksum does not match we verify checksum using
normal method.
*/
if (mach_read_from_4(buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION) != 0) {
is_corrupted = fil_space_verify_crypt_checksum(buf, page_size,
cur_page_num, strict_verify);
} else {
is_corrupted = true;
}
if (is_corrupted) {
is_corrupted = buf_page_is_corrupted(
true, buf, page_size, false,
cur_page_num, strict_verify,
is_log_enabled, log_file);
}
return(is_corrupted);
}
@@ -1312,10 +1346,8 @@ static struct my_option innochecksum_options[] = {
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Verbose (prints progress every 5 seconds).",
&verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
{"debug", '#', "Output debug log. See " REFMAN "dbug-package.html",
&dbug_setting, &dbug_setting, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif /* !DBUG_OFF */
{"count", 'c', "Print the count of pages in the file and exits.",
&just_count, &just_count, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"start_page", 's', "Start on this page number (0 based).",
@@ -1347,7 +1379,7 @@ static struct my_option innochecksum_options[] = {
{"log", 'l', "log output.",
&log_filename, &log_filename, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"leaf", 'l', "Examine leaf index pages",
{"leaf", 'e', "Examine leaf index pages",
&do_leaf, &do_leaf, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"merge", 'm', "leaf page count if merge given number of consecutive pages",
&n_merge, &n_merge, 0, GET_ULONG, REQUIRED_ARG, 0, 0, (longlong)10L, 0, 1, 0},
@@ -1377,7 +1409,7 @@ static void usage(void)
printf("Usage: %s [-c] [-s <start page>] [-e <end page>] "
"[-p <page>] [-v] [-a <allow mismatches>] [-n] "
"[-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] "
"[-l <log>] <filename or [-]>\n", my_progname);
"[-l <log>] [-e] <filename or [-]>\n", my_progname);
printf("See " REFMAN "innochecksum.html for usage hints.\n");
my_print_help(innochecksum_options);
my_print_variables(innochecksum_options);

View File

@@ -0,0 +1,77 @@
#include <my_global.h>
#include <m_string.h>
#include <my_sys.h>
#include <my_pthread.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#include <stdlib.h>
#include <stdio.h>
void my_exit(int c)
{
my_end(0);
exit(c);
}
void do_usage()
{
printf("Usage:\n"
" %s <user> log <filename>\n"
" %s <user> exec <command> <args>\n",
my_progname, my_progname);
my_exit(1);
}
void do_log(const char *logfile)
{
FILE *f;
uchar buf[4096];
int size;
if (!logfile)
do_usage();
f= my_fopen(logfile, O_WRONLY|O_APPEND|O_CREAT, MYF(MY_WME));
if (!f)
my_exit(1);
while ((size= my_fread(stdin, buf, sizeof(buf), MYF(MY_WME))) > 0)
if ((int)my_fwrite(f, buf, size, MYF(MY_WME)) != size)
my_exit(1);
my_fclose(f, MYF(0));
my_exit(0);
}
void do_exec(char *args[])
{
if (!args[0])
do_usage();
my_end(0);
execvp(args[0], args);
}
int main(int argc, char *argv[])
{
struct passwd *user_info;
MY_INIT(argv[0]);
if (argc < 3)
do_usage(argv[0]);
user_info= my_check_user(argv[1], MYF(0));
if (user_info ? my_set_user(argv[1], user_info, MYF(MY_WME))
: my_errno == EINVAL)
my_exit(1);
if (strcmp(argv[2], "log") == 0)
do_log(argv[3]);
if (strcmp(argv[2], "exec") == 0)
do_exec(argv+3);
my_end(0);
return 1;
}

View File

@@ -1,5 +1,6 @@
/*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, MariaDB Corporation.
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
@@ -599,8 +600,8 @@ inline word16 UnalignedGetWordNonTemplate(ByteOrder order, const byte* block,
word16*)
{
return (order == BigEndianOrder)
? block[1] | (block[0] << 8)
: block[0] | (block[1] << 8);
? word16(block[1] | (word16(block[0]) << 8))
: word16(block[0] | (word16(block[1]) << 8));
}
inline word32 UnalignedGetWordNonTemplate(ByteOrder order, const byte* block,
@@ -625,7 +626,7 @@ inline void UnalignedPutWord(ByteOrder order, byte *block, byte value,
block[0] = xorBlock ? (value ^ xorBlock[0]) : value;
}
#define GETBYTE(x, y) (unsigned int)byte((x)>>(8*(y)))
#define GETBYTE(x, y) byte((x)>>(8*(y)))
inline void UnalignedPutWord(ByteOrder order, byte *block, word16 value,
const byte *xorBlock = 0)
@@ -827,7 +828,7 @@ word ShiftWordsLeftByBits(word* r, unsigned int n, unsigned int shiftBits)
inline
word ShiftWordsRightByBits(word* r, unsigned int n, unsigned int shiftBits)
word ShiftWordsRightByBits(word* r, int n, unsigned int shiftBits)
{
word u, carry=0;
if (shiftBits)

View File

@@ -1,5 +1,6 @@
/*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, MariaDB Corporation.
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
@@ -57,7 +58,7 @@ class Mode_BASE : public virtual_base {
public:
enum { MaxBlockSz = 16 };
explicit Mode_BASE(int sz, CipherDir dir, Mode mode)
explicit Mode_BASE(unsigned sz, CipherDir dir, Mode mode)
: blockSz_(sz), reg_(reinterpret_cast<byte*>(r_)),
tmp_(reinterpret_cast<byte*>(t_)), dir_(dir), mode_(mode)
{}
@@ -67,7 +68,7 @@ public:
void SetIV(const byte* iv) { memcpy(reg_, iv, blockSz_); }
protected:
int blockSz_;
unsigned blockSz_;
byte* reg_;
byte* tmp_;

View File

@@ -42,7 +42,7 @@ extern "C" {
#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */
#define HASH_THREAD_SPECIFIC 2 /* Mark allocated memory THREAD_SPECIFIC */
typedef uint my_hash_value_type;
typedef uint32 my_hash_value_type;
typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool);
typedef my_hash_value_type (*my_hash_function)(CHARSET_INFO *,
const uchar *, size_t);

View File

@@ -219,7 +219,7 @@ typedef struct st_json_engine_t
/* string constants. */
int stack[JSON_DEPTH_LIMIT]; /* Keeps the stack of nested JSON structures. */
int *stack_p; /* The 'stack' pointer. */
int stack_p; /* The 'stack' pointer. */
} json_engine_t;
@@ -308,7 +308,7 @@ typedef const int *json_level_t;
*/
#define json_get_level(j) (j->stack_p)
int json_skip_to_level(json_engine_t *j, json_level_t level);
int json_skip_to_level(json_engine_t *j, int level);
/*
json_skip_level() works as above with just current structre.
@@ -391,6 +391,32 @@ int json_append_ascii(CHARSET_INFO *json_cs,
uchar *json, uchar *json_end,
const uchar *ascii, const uchar *ascii_end);
/*
Scan the JSON and return paths met one-by-one.
json_get_path_start(&p)
while (json_get_path_next(&p))
{
handle_the_next_path();
}
*/
int json_get_path_start(json_engine_t *je, CHARSET_INFO *i_cs,
const uchar *str, const uchar *end,
json_path_t *p);
int json_get_path_next(json_engine_t *je, json_path_t *p);
int json_path_parts_compare(
const json_path_step_t *a, const json_path_step_t *a_end,
const json_path_step_t *b, const json_path_step_t *b_end,
enum json_value_types vt);
int json_path_compare(const json_path_t *a, const json_path_t *b,
enum json_value_types vt);
#ifdef __cplusplus
}
#endif

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 1995, 2012 Monty Program Ab
Copyright (c) 1995, 2017, MariaDB Corporation.
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
@@ -34,25 +34,25 @@
/* The following is bits in the flag parameter to ha_open() */
#define HA_OPEN_ABORT_IF_LOCKED 0 /* default */
#define HA_OPEN_WAIT_IF_LOCKED 1
#define HA_OPEN_IGNORE_IF_LOCKED 2
#define HA_OPEN_TMP_TABLE 4 /* Table is a temp table */
#define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */
#define HA_OPEN_ABORT_IF_CRASHED 16
#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */
#define HA_OPEN_FROM_SQL_LAYER 64
#define HA_OPEN_MMAP 128 /* open memory mapped */
#define HA_OPEN_COPY 256 /* Open copy (for repair) */
#define HA_OPEN_ABORT_IF_LOCKED 0U /* default */
#define HA_OPEN_WAIT_IF_LOCKED 1U
#define HA_OPEN_IGNORE_IF_LOCKED 2U
#define HA_OPEN_TMP_TABLE 4U /* Table is a temp table */
#define HA_OPEN_DELAY_KEY_WRITE 8U /* Don't update index */
#define HA_OPEN_ABORT_IF_CRASHED 16U
#define HA_OPEN_FOR_REPAIR 32U /* open even if crashed */
#define HA_OPEN_FROM_SQL_LAYER 64U
#define HA_OPEN_MMAP 128U /* open memory mapped */
#define HA_OPEN_COPY 256U /* Open copy (for repair) */
/* Internal temp table, used for temporary results */
#define HA_OPEN_INTERNAL_TABLE 512
#define HA_OPEN_NO_PSI_CALL 1024 /* Don't call/connect PSI */
#define HA_OPEN_MERGE_TABLE 2048
#define HA_OPEN_INTERNAL_TABLE 512U
#define HA_OPEN_NO_PSI_CALL 1024U /* Don't call/connect PSI */
#define HA_OPEN_MERGE_TABLE 2048U
/*
Allow opening even if table is incompatible as this is for ALTER TABLE which
will fix the table structure.
*/
#define HA_OPEN_FOR_ALTER 4096
#define HA_OPEN_FOR_ALTER 4096U
/* The following is parameter to ha_rkey() how to use key */
@@ -248,15 +248,15 @@ enum ha_base_keytype {
Note that these can only be up to 16 bits!
*/
#define HA_NOSAME 1 /* Set if not dupplicated records */
#define HA_PACK_KEY 2 /* Pack string key to previous key */
#define HA_AUTO_KEY 16
#define HA_BINARY_PACK_KEY 32 /* Packing of all keys to prev key */
#define HA_FULLTEXT 128 /* For full-text search */
#define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */
#define HA_SPATIAL 1024 /* For spatial search */
#define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */
#define HA_GENERATED_KEY 8192 /* Automaticly generated key */
#define HA_NOSAME 1U /* Set if not dupplicated records */
#define HA_PACK_KEY 2U /* Pack string key to previous key */
#define HA_AUTO_KEY 16U
#define HA_BINARY_PACK_KEY 32U /* Packing of all keys to prev key */
#define HA_FULLTEXT 128U /* For full-text search */
#define HA_UNIQUE_CHECK 256U /* Check the key for uniqueness */
#define HA_SPATIAL 1024U /* For spatial search */
#define HA_NULL_ARE_EQUAL 2048U /* NULL in key are cmp as equal */
#define HA_GENERATED_KEY 8192U /* Automaticly generated key */
/* The combination of the above can be used for key type comparison. */
#define HA_KEYFLAG_MASK (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | \
@@ -303,25 +303,25 @@ enum ha_base_keytype {
#define HA_CAN_MEMCMP 2048 /* internal, never stored in frm */
/* optionbits for database */
#define HA_OPTION_PACK_RECORD 1
#define HA_OPTION_PACK_KEYS 2
#define HA_OPTION_COMPRESS_RECORD 4
#define HA_OPTION_LONG_BLOB_PTR 8 /* new ISAM format */
#define HA_OPTION_TMP_TABLE 16
#define HA_OPTION_CHECKSUM 32
#define HA_OPTION_DELAY_KEY_WRITE 64
#define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */
#define HA_OPTION_PACK_RECORD 1U
#define HA_OPTION_PACK_KEYS 2U
#define HA_OPTION_COMPRESS_RECORD 4U
#define HA_OPTION_LONG_BLOB_PTR 8U /* new ISAM format */
#define HA_OPTION_TMP_TABLE 16U
#define HA_OPTION_CHECKSUM 32U
#define HA_OPTION_DELAY_KEY_WRITE 64U
#define HA_OPTION_NO_PACK_KEYS 128U /* Reserved for MySQL */
/* unused 256 */
#define HA_OPTION_RELIES_ON_SQL_LAYER 512
#define HA_OPTION_NULL_FIELDS 1024
#define HA_OPTION_PAGE_CHECKSUM 2048
#define HA_OPTION_RELIES_ON_SQL_LAYER 512U
#define HA_OPTION_NULL_FIELDS 1024U
#define HA_OPTION_PAGE_CHECKSUM 2048U
/*
STATS_PERSISTENT=1 has been specified in the SQL command (either CREATE
or ALTER TABLE). Table and index statistics that are collected by the
storage engine and used by the optimizer for query optimization will be
stored on disk and will not change after a server restart.
*/
#define HA_OPTION_STATS_PERSISTENT 4096
#define HA_OPTION_STATS_PERSISTENT 4096U
/*
STATS_PERSISTENT=0 has been specified in CREATE/ALTER TABLE. Statistics
for the table will be wiped away on server shutdown and new ones recalculated
@@ -330,31 +330,31 @@ enum ha_base_keytype {
explicitly set at table level and the corresponding table will use whatever
is the global server default.
*/
#define HA_OPTION_NO_STATS_PERSISTENT 8192
#define HA_OPTION_NO_STATS_PERSISTENT 8192U
/* .frm has extra create options in linked-list format */
#define HA_OPTION_TEXT_CREATE_OPTIONS_legacy (1L << 14) /* 5.2 to 5.5, unused since 10.0 */
#define HA_OPTION_TEMP_COMPRESS_RECORD (1L << 15) /* set by isamchk */
#define HA_OPTION_READ_ONLY_DATA (1L << 16) /* Set by isamchk */
#define HA_OPTION_NO_CHECKSUM (1L << 17)
#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
#define HA_OPTION_TEXT_CREATE_OPTIONS_legacy (1U << 14) /* 5.2 to 5.5, unused since 10.0 */
#define HA_OPTION_TEMP_COMPRESS_RECORD (1U << 15) /* set by isamchk */
#define HA_OPTION_READ_ONLY_DATA (1U << 16) /* Set by isamchk */
#define HA_OPTION_NO_CHECKSUM (1U << 17)
#define HA_OPTION_NO_DELAY_KEY_WRITE (1U << 18)
/* Bits in flag to create() */
#define HA_DONT_TOUCH_DATA 1 /* Don't empty datafile (isamchk) */
#define HA_PACK_RECORD 2 /* Request packed record format */
#define HA_CREATE_TMP_TABLE 4
#define HA_CREATE_CHECKSUM 8
#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */
#define HA_CREATE_PAGE_CHECKSUM 32
#define HA_CREATE_DELAY_KEY_WRITE 64
#define HA_CREATE_RELIES_ON_SQL_LAYER 128
#define HA_CREATE_INTERNAL_TABLE 256
#define HA_PRESERVE_INSERT_ORDER 512
#define HA_DONT_TOUCH_DATA 1U /* Don't empty datafile (isamchk) */
#define HA_PACK_RECORD 2U /* Request packed record format */
#define HA_CREATE_TMP_TABLE 4U
#define HA_CREATE_CHECKSUM 8U
#define HA_CREATE_KEEP_FILES 16U /* don't overwrite .MYD and MYI */
#define HA_CREATE_PAGE_CHECKSUM 32U
#define HA_CREATE_DELAY_KEY_WRITE 64U
#define HA_CREATE_RELIES_ON_SQL_LAYER 128U
#define HA_CREATE_INTERNAL_TABLE 256U
#define HA_PRESERVE_INSERT_ORDER 512U
/* Flags used by start_bulk_insert */
#define HA_CREATE_UNIQUE_INDEX_BY_SORT 1
#define HA_CREATE_UNIQUE_INDEX_BY_SORT 1U
/*
@@ -366,44 +366,44 @@ enum ha_base_keytype {
*/
/* this one is not used */
#define HA_STATUS_POS 1
#define HA_STATUS_POS 1U
/*
assuming the table keeps shared actual copy of the 'info' and
local, possibly outdated copy, the following flag means that
it should not try to get the actual data (locking the shared structure)
slightly outdated version will suffice
*/
#define HA_STATUS_NO_LOCK 2
#define HA_STATUS_NO_LOCK 2U
/* update the time of the last modification (in handler::update_time) */
#define HA_STATUS_TIME 4
#define HA_STATUS_TIME 4U
/*
update the 'constant' part of the info:
handler::max_data_file_length, max_index_file_length, create_time
sortkey, ref_length, block_size, data_file_name, index_file_name.
handler::table->s->keys_in_use, keys_for_keyread, rec_per_key
*/
#define HA_STATUS_CONST 8
#define HA_STATUS_CONST 8U
/*
update the 'variable' part of the info:
handler::records, deleted, data_file_length, index_file_length,
check_time, mean_rec_length
*/
#define HA_STATUS_VARIABLE 16
#define HA_STATUS_VARIABLE 16U
/*
get the information about the key that caused last duplicate value error
update handler::errkey and handler::dupp_ref
see handler::get_dup_key()
*/
#define HA_STATUS_ERRKEY 32
#define HA_STATUS_ERRKEY 32U
/*
update handler::auto_increment_value
*/
#define HA_STATUS_AUTO 64
#define HA_STATUS_AUTO 64U
/*
Get also delete_length when HA_STATUS_VARIABLE is called. It's ok to set it also
when only HA_STATUS_VARIABLE but it won't be used.
*/
#define HA_STATUS_VARIABLE_EXTRA 128
#define HA_STATUS_VARIABLE_EXTRA 128U
/*
Errorcodes given by handler functions
@@ -521,23 +521,23 @@ typedef ulong key_part_map;
/* Intern constants in databases */
/* bits in _search */
#define SEARCH_FIND 1
#define SEARCH_NO_FIND 2
#define SEARCH_SAME 4
#define SEARCH_BIGGER 8
#define SEARCH_SMALLER 16
#define SEARCH_SAVE_BUFF 32
#define SEARCH_UPDATE 64
#define SEARCH_PREFIX 128
#define SEARCH_LAST 256
#define MBR_CONTAIN 512
#define MBR_INTERSECT 1024
#define MBR_WITHIN 2048
#define MBR_DISJOINT 4096
#define MBR_EQUAL 8192
#define MBR_DATA 16384
#define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */
#define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */
#define SEARCH_FIND 1U
#define SEARCH_NO_FIND 2U
#define SEARCH_SAME 4U
#define SEARCH_BIGGER 8U
#define SEARCH_SMALLER 16U
#define SEARCH_SAVE_BUFF 32U
#define SEARCH_UPDATE 64U
#define SEARCH_PREFIX 128U
#define SEARCH_LAST 256U
#define MBR_CONTAIN 512U
#define MBR_INTERSECT 1024U
#define MBR_WITHIN 2048U
#define MBR_DISJOINT 4096U
#define MBR_EQUAL 8192U
#define MBR_DATA 16384U
#define SEARCH_NULL_ARE_EQUAL 32768U /* NULL in keys are equal */
#define SEARCH_NULL_ARE_NOT_EQUAL 65536U/* NULL in keys are not equal */
/* Use this when inserting a key in position order */
#define SEARCH_INSERT (SEARCH_NULL_ARE_NOT_EQUAL*2)
/* Only part of the key is specified while reading */
@@ -548,27 +548,27 @@ typedef ulong key_part_map;
#define SEARCH_PAGE_KEY_HAS_TRANSID (SEARCH_USER_KEY_HAS_TRANSID*2)
/* bits in opt_flag */
#define QUICK_USED 1
#define READ_CACHE_USED 2
#define READ_CHECK_USED 4
#define KEY_READ_USED 8
#define WRITE_CACHE_USED 16
#define OPT_NO_ROWS 32
#define QUICK_USED 1U
#define READ_CACHE_USED 2U
#define READ_CHECK_USED 4U
#define KEY_READ_USED 8U
#define WRITE_CACHE_USED 16U
#define OPT_NO_ROWS 32U
/* bits in update */
#define HA_STATE_CHANGED 1 /* Database has changed */
#define HA_STATE_AKTIV 2 /* Has a current record */
#define HA_STATE_WRITTEN 4 /* Record is written */
#define HA_STATE_DELETED 8
#define HA_STATE_NEXT_FOUND 16 /* Next found record (record before) */
#define HA_STATE_PREV_FOUND 32 /* Prev found record (record after) */
#define HA_STATE_NO_KEY 64 /* Last read didn't find record */
#define HA_STATE_KEY_CHANGED 128
#define HA_STATE_WRITE_AT_END 256 /* set in _ps_find_writepos */
#define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */
#define HA_STATE_ROW_CHANGED 1024 /* To invalidate ROW cache */
#define HA_STATE_EXTEND_BLOCK 2048
#define HA_STATE_RNEXT_SAME 4096 /* rnext_same occupied lastkey2 */
#define HA_STATE_CHANGED 1U /* Database has changed */
#define HA_STATE_AKTIV 2U /* Has a current record */
#define HA_STATE_WRITTEN 4U /* Record is written */
#define HA_STATE_DELETED 8U
#define HA_STATE_NEXT_FOUND 16U /* Next found record (record before) */
#define HA_STATE_PREV_FOUND 32U /* Prev found record (record after) */
#define HA_STATE_NO_KEY 64U /* Last read didn't find record */
#define HA_STATE_KEY_CHANGED 128U
#define HA_STATE_WRITE_AT_END 256U /* set in _ps_find_writepos */
#define HA_STATE_BUFF_SAVED 512U /* If current keybuff is info->buff */
#define HA_STATE_ROW_CHANGED 1024U /* To invalidate ROW cache */
#define HA_STATE_EXTEND_BLOCK 2048U
#define HA_STATE_RNEXT_SAME 4096U /* rnext_same occupied lastkey2 */
/* myisampack expects no more than 32 field types. */
enum en_fieldtype {
@@ -584,15 +584,15 @@ enum data_file_type {
/* For key ranges */
#define NO_MIN_RANGE 1
#define NO_MAX_RANGE 2
#define NEAR_MIN 4
#define NEAR_MAX 8
#define UNIQUE_RANGE 16
#define EQ_RANGE 32
#define NULL_RANGE 64
#define GEOM_FLAG 128
#define SKIP_RANGE 256
#define NO_MIN_RANGE 1U
#define NO_MAX_RANGE 2U
#define NEAR_MIN 4U
#define NEAR_MAX 8U
#define UNIQUE_RANGE 16U
#define EQ_RANGE 32U
#define NULL_RANGE 64U
#define GEOM_FLAG 128U
#define SKIP_RANGE 256U
typedef struct st_key_range
{

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2007, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
Copyright (c) 2009, 2017, MariaDB Corporation.
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
@@ -108,7 +108,7 @@ static inline uint32 my_clear_highest_bit(uint32 v)
static inline uint32 my_reverse_bits(uint32 key)
{
return
return (uint32)
(_my_bits_reverse_table[ key & 255] << 24) |
(_my_bits_reverse_table[(key>> 8) & 255] << 16) |
(_my_bits_reverse_table[(key>>16) & 255] << 8) |

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (C) 2000-2011 Monty Program Ab
Copyright (C) 2000, 2017, 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
@@ -50,7 +50,7 @@ extern void _db_set_init_(const char *control);
extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
struct _db_stack_frame_ *_stack_frame_);
extern void _db_return_(struct _db_stack_frame_ *_stack_frame_);
extern void _db_pargs_(uint _line_,const char *keyword);
extern int _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_(const char *format,...)
ATTRIBUTE_FORMAT(printf, 1, 2);
extern void _db_dump_(uint _line_,const char *keyword,
@@ -91,7 +91,7 @@ extern const char* _db_get_func_(void);
#define DBUG_EVALUATE_IF(keyword,a1,a2) \
(_db_keyword_(0,(keyword), 1) ? (a1) : (a2))
#define DBUG_PRINT(keyword,arglist) \
do {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;} while(0)
do if (_db_pargs_(__LINE__,keyword)) _db_doprnt_ arglist; while(0)
#define DBUG_PUSH(a1) _db_push_ (a1)
#define DBUG_POP() _db_pop_ ()
#define DBUG_SET(a1) _db_set_ (a1)
@@ -193,8 +193,18 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
#define DBUG_SYNC_POINT(lock_name,lock_timeout)
#endif /* EXTRA_DEBUG */
#ifdef __cplusplus
#ifdef __cplusplus
}
# ifdef DBUG_OFF
# define DBUG_LOG(keyword, v) do {} while (0)
# else
# include <sstream>
# define DBUG_LOG(keyword, v) do { \
if (_db_pargs_(__LINE__, keyword)) { \
std::ostringstream _db_s; _db_s << v; \
_db_doprnt_("%s", _db_s.str().c_str()); \
}} while (0)
# endif
#endif
#endif /* _my_dbug_h */

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab.
Copyright (c) 2010, 2017, MariaDB Corporation.
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
@@ -677,7 +677,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
smaller what the disk page size. This influences the speed of the
isam btree library. eg to big to slow.
*/
#define IO_SIZE 4096
#define IO_SIZE 4096U
/*
How much overhead does malloc have. The code often allocates
something like 1024-MALLOC_OVERHEAD bytes

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2009, 2014, MariaDB
Copyright (c) 2009, 2017, MariaDB Corporation.
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
@@ -651,7 +651,7 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr;
#define ESRCH 1
#endif
typedef int64 my_thread_id;
typedef uint64 my_thread_id;
extern void my_threadattr_global_init(void);
extern my_bool my_thread_global_init(void);

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, Monty Program Ab.
Copyright (c) 2010, 2017, MariaDB Corporation.
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,75 +60,75 @@ typedef struct my_aio_result {
#define MY_FILE_ERROR ((size_t) -1)
/* General bitmaps for my_func's */
#define MY_FFNF 1 /* Fatal if file not found */
#define MY_FNABP 2 /* Fatal if not all bytes read/writen */
#define MY_NABP 4 /* Error if not all bytes read/writen */
#define MY_FAE 8 /* Fatal if any error */
#define MY_WME 16 /* Write message on error */
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
#define MY_ENCRYPT 64 /* Encrypt IO_CACHE temporary files */
#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
#define MY_COPYTIME 64 /* my_redel() copys time */
#define MY_DELETE_OLD 256 /* my_create_with_symlink() */
#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */
#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */
#define MY_REDEL_MAKE_BACKUP 256
#define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */
#define MY_SHORT_WAIT 64 /* my_lock() don't wait if can't lock */
#define MY_FORCE_LOCK 128 /* use my_lock() even if disable_locking */
#define MY_NO_WAIT 256 /* my_lock() don't wait at all */
#define MY_FFNF 1U /* Fatal if file not found */
#define MY_FNABP 2U /* Fatal if not all bytes read/writen */
#define MY_NABP 4U /* Error if not all bytes read/writen */
#define MY_FAE 8U /* Fatal if any error */
#define MY_WME 16U /* Write message on error */
#define MY_WAIT_IF_FULL 32U /* Wait and try again if disk full error */
#define MY_IGNORE_BADFD 32U /* my_sync: ignore 'bad descriptor' errors */
#define MY_ENCRYPT 64U /* Encrypt IO_CACHE temporary files */
#define MY_FULL_IO 512U /* For my_read - loop intil I/O is complete */
#define MY_DONT_CHECK_FILESIZE 128U /* Option to init_io_cache() */
#define MY_LINK_WARNING 32U /* my_redel() gives warning if links */
#define MY_COPYTIME 64U /* my_redel() copys time */
#define MY_DELETE_OLD 256U /* my_create_with_symlink() */
#define MY_RESOLVE_LINK 128U /* my_realpath(); Only resolve links */
#define MY_HOLD_ORIGINAL_MODES 128U /* my_copy() holds to file modes */
#define MY_REDEL_MAKE_BACKUP 256U
#define MY_SEEK_NOT_DONE 32U /* my_lock may have to do a seek */
#define MY_SHORT_WAIT 64U /* my_lock() don't wait if can't lock */
#define MY_FORCE_LOCK 128U /* use my_lock() even if disable_locking */
#define MY_NO_WAIT 256U /* my_lock() don't wait at all */
/*
init_dynamic_array() has init buffer; Internal flag, not to be used by
caller.
*/
#define MY_INIT_BUFFER_USED 256
#define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */
#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
#define MY_DONT_OVERWRITE_FILE 2048 /* my_copy: Don't overwrite file */
#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
#define MY_SYNC 4096 /* my_copy(): sync dst file */
#define MY_SYNC_DIR 32768 /* my_create/delete/rename: sync directory */
#define MY_SYNC_FILESIZE 65536 /* my_sync(): safe sync when file is extended */
#define MY_THREAD_SPECIFIC 0x10000 /* my_malloc(): thread specific */
#define MY_THREAD_MOVE 0x20000 /* realloc(); Memory can move */
/* Tree that should delete things automaticly */
#define MY_TREE_WITH_DELETE 0x40000
#define MY_INIT_BUFFER_USED 256U
#define MY_ZEROFILL 32U /* my_malloc(), fill array with zero */
#define MY_ALLOW_ZERO_PTR 64U /* my_realloc() ; zero ptr -> malloc */
#define MY_FREE_ON_ERROR 128U /* my_realloc() ; Free old ptr on error */
#define MY_HOLD_ON_ERROR 256U /* my_realloc() ; Return old ptr on error */
#define MY_DONT_OVERWRITE_FILE 2048U /* my_copy: Don't overwrite file */
#define MY_THREADSAFE 2048U /* my_seek(): lock fd mutex */
#define MY_SYNC 4096U /* my_copy(): sync dst file */
#define MY_SYNC_DIR 32768U /* my_create/delete/rename: sync directory */
#define MY_SYNC_FILESIZE 65536U /* my_sync(): safe sync when file is extended */
#define MY_THREAD_SPECIFIC 0x10000U /* my_malloc(): thread specific */
#define MY_THREAD_MOVE 0x20000U /* realloc(); Memory can move */
/* Tree that should delete things automaticly */
#define MY_TREE_WITH_DELETE 0x40000U
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/
#define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */
#define MY_CHECK_ERROR 1U /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2U /* Give time info about process*/
#define MY_DONT_FREE_DBUG 4U /* Do not call DBUG_END() in my_end() */
#define ME_HIGHBYTE 8 /* Shift for colours */
#define ME_NOCUR 1 /* Don't use curses message */
#define ME_OLDWIN 2 /* Use old window */
#define ME_BELL 4 /* Ring bell then printing message */
#define ME_HOLDTANG 8 /* Don't delete last keys */
#define ME_WAITTOT 16 /* Wait for errtime secs of for a action */
#define ME_WAITTANG 32 /* Wait for a user action */
#define ME_NOREFRESH 64 /* Write the error message to error log */
#define ME_NOINPUT 128 /* Dont use the input libary */
#define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */
#define ME_COLOUR2 ((2 << ME_HIGHBYTE))
#define ME_COLOUR3 ((3 << ME_HIGHBYTE))
#define ME_JUST_INFO 1024 /**< not error but just info */
#define ME_JUST_WARNING 2048 /**< not error but just warning */
#define ME_FATALERROR 4096 /* Fatal statement error */
#define ME_HIGHBYTE 8U /* Shift for colours */
#define ME_NOCUR 1U /* Don't use curses message */
#define ME_OLDWIN 2U /* Use old window */
#define ME_BELL 4U /* Ring bell then printing message */
#define ME_HOLDTANG 8U /* Don't delete last keys */
#define ME_WAITTOT 16U /* Wait for errtime secs of for a action */
#define ME_WAITTANG 32U /* Wait for a user action */
#define ME_NOREFRESH 64U /* Write the error message to error log */
#define ME_NOINPUT 128U /* Dont use the input libary */
#define ME_COLOUR1 ((1U << ME_HIGHBYTE)) /* Possibly error-colours */
#define ME_COLOUR2 ((2U << ME_HIGHBYTE))
#define ME_COLOUR3 ((3U << ME_HIGHBYTE))
#define ME_JUST_INFO 1024U /**< not error but just info */
#define ME_JUST_WARNING 2048U /**< not error but just warning */
#define ME_FATALERROR 4096U /* Fatal statement error */
/* Bits in last argument to fn_format */
#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
#define MY_REPLACE_EXT 2 /* replace extension with 'ext' */
#define MY_UNPACK_FILENAME 4 /* Unpack name (~ -> home) */
#define MY_PACK_FILENAME 8 /* Pack name (home -> ~) */
#define MY_RESOLVE_SYMLINKS 16 /* Resolve all symbolic links */
#define MY_RETURN_REAL_PATH 32 /* return full path for file */
#define MY_SAFE_PATH 64 /* Return NULL if too long path */
#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */
#define MY_APPEND_EXT 256 /* add 'ext' as additional extension*/
#define MY_REPLACE_DIR 1U /* replace dir in name with 'dir' */
#define MY_REPLACE_EXT 2U /* replace extension with 'ext' */
#define MY_UNPACK_FILENAME 4U /* Unpack name (~ -> home) */
#define MY_PACK_FILENAME 8U /* Pack name (home -> ~) */
#define MY_RESOLVE_SYMLINKS 16U /* Resolve all symbolic links */
#define MY_RETURN_REAL_PATH 32U /* return full path for file */
#define MY_SAFE_PATH 64U /* Return NULL if too long path */
#define MY_RELATIVE_PATH 128U /* name is relative to 'dir' */
#define MY_APPEND_EXT 256U /* add 'ext' as additional extension*/
/* My seek flags */
@@ -143,19 +143,19 @@ typedef struct my_aio_result {
#define DFLT_INIT_HITS 3
/* root_alloc flags */
#define MY_KEEP_PREALLOC 1
#define MY_MARK_BLOCKS_FREE 2 /* move used to free list and reuse them */
#define MY_KEEP_PREALLOC 1U
#define MY_MARK_BLOCKS_FREE 2U /* move used to free list and reuse them */
/* Internal error numbers (for assembler functions) */
#define MY_ERRNO_EDOM 33
#define MY_ERRNO_ERANGE 34
/* Bits for get_date timeflag */
#define GETDATE_DATE_TIME 1
#define GETDATE_SHORT_DATE 2
#define GETDATE_HHMMSSTIME 4
#define GETDATE_GMT 8
#define GETDATE_FIXEDLENGTH 16
#define GETDATE_DATE_TIME 1U
#define GETDATE_SHORT_DATE 2U
#define GETDATE_HHMMSSTIME 4U
#define GETDATE_GMT 8U
#define GETDATE_FIXEDLENGTH 16U
/* Extra length needed for filename if one calls my_create_backup_name */
#define MY_BACKUP_NAME_EXTRA_LENGTH 17
@@ -192,6 +192,14 @@ extern void my_large_free(uchar *ptr);
#define my_large_free(A) my_free_lock((A))
#endif /* HAVE_LARGE_PAGES */
void my_init_atomic_write(void);
#ifdef __linux__
my_bool my_test_if_atomic_write(File handle, int pagesize);
#else
#define my_test_if_atomic_write(A, B) 0
#endif /* __linux__ */
extern my_bool my_may_have_atomic_write;
#if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind)
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca
@@ -670,8 +678,12 @@ extern void *my_memmem(const void *haystack, size_t haystacklen,
#ifdef _WIN32
extern int my_access(const char *path, int amode);
#define my_check_user(A,B) (NULL)
#define my_set_user(A,B,C) (0)
#else
#define my_access access
struct passwd *my_check_user(const char *user, myf MyFlags);
int my_set_user(const char *user, struct passwd *user_info, myf MyFlags);
#endif
extern int check_if_legal_filename(const char *path);

View File

@@ -1,5 +1,6 @@
/*
Copyright (c) 2004, 2011, Oracle and/or its affiliates.
Copyright (c) 2017, Monty Program 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
@@ -61,16 +62,16 @@ extern uchar days_in_month[];
TIME_FUZZY_DATES is used for the result will only be used for comparison
purposes. Conversion is as relaxed as possible.
*/
#define TIME_FUZZY_DATES 1
#define TIME_DATETIME_ONLY 2
#define TIME_TIME_ONLY 4
#define TIME_FUZZY_DATES 1U
#define TIME_DATETIME_ONLY 2U
#define TIME_TIME_ONLY 4U
#define TIME_NO_ZERO_IN_DATE (1UL << 23) /* == MODE_NO_ZERO_IN_DATE */
#define TIME_NO_ZERO_DATE (1UL << 24) /* == MODE_NO_ZERO_DATE */
#define TIME_INVALID_DATES (1UL << 25) /* == MODE_INVALID_DATES */
#define MYSQL_TIME_WARN_TRUNCATED 1
#define MYSQL_TIME_WARN_OUT_OF_RANGE 2
#define MYSQL_TIME_NOTE_TRUNCATED 16
#define MYSQL_TIME_WARN_TRUNCATED 1U
#define MYSQL_TIME_WARN_OUT_OF_RANGE 2U
#define MYSQL_TIME_NOTE_TRUNCATED 16U
#define MYSQL_TIME_WARN_WARNINGS (MYSQL_TIME_WARN_TRUNCATED|MYSQL_TIME_WARN_OUT_OF_RANGE)
#define MYSQL_TIME_WARN_NOTES (MYSQL_TIME_NOTE_TRUNCATED)

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2010 Monty Program Ab
/* Copyright (C) 2010, 2017, MariaDB Corporation.
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,7 +38,7 @@
#define TRASH_FILL(A,B,C) do{ const size_t trash_tmp __attribute__((unused)) = (B) ; MEM_CHECK_ADDRESSABLE(A,trash_tmp);MEM_UNDEFINED(A,trash_tmp);} while (0)
#endif
#define TRASH_ALLOC(A,B) TRASH_FILL(A,B,0xA5)
#define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F)
#define TRASH_FREE(A,B) TRASH_FILL(A,(size_t) (B),0x8F)
#define TRASH(A,B) TRASH_FREE(A,B)
# define DBUG_ASSERT_DEFINED(x) \

View File

@@ -1,4 +1,5 @@
/* Copyright (C) 2006 MySQL AB
Copyright (c) 2017, MariaDB Corporation.
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
@@ -24,13 +25,13 @@
to xxxcheck.c follows:
*/
#define TT_USEFRM 1
#define TT_FOR_UPGRADE 2
#define TT_FROM_MYSQL 4
#define TT_USEFRM 1U
#define TT_FOR_UPGRADE 2U
#define TT_FROM_MYSQL 4U
/* Bits set in out_flag */
#define O_NEW_DATA 2
#define O_DATA_LOST 4
#define O_NEW_DATA 2U
#define O_DATA_LOST 4U
typedef struct st_sort_key_blocks /* Used when sorting */
{

View File

@@ -9,6 +9,8 @@ enum enum_server_command
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON,
COM_UNIMPLEMENTED,
COM_RESET_CONNECTION,
COM_MDB_GAP_BEG,
COM_MDB_GAP_END=250,
COM_SLAVE_WORKER=251,

View File

@@ -1,4 +1,5 @@
/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, MariaDB Corporation.
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
@@ -67,7 +68,7 @@
*/
static inline struct PSI_idle_locker *
inline_mysql_start_idle_wait(PSI_idle_locker_state *state,
const char *src_file, int src_line)
const char *src_file, uint src_line)
{
struct PSI_idle_locker *locker;
locker= PSI_IDLE_CALL(start_idle_wait)(state, src_file, src_line);

View File

@@ -1,4 +1,5 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -241,7 +242,7 @@ inline_mysql_start_socket_wait(PSI_socket_locker_state *state,
MYSQL_SOCKET mysql_socket,
enum PSI_socket_operation op,
size_t byte_count,
const char *src_file, int src_line)
const char *src_file, uint src_line)
{
struct PSI_socket_locker *locker;
if (mysql_socket.m_psi != NULL)
@@ -744,8 +745,7 @@ inline_mysql_socket_send
/* Instrumentation end */
if (locker != NULL)
{
size_t bytes_written;
bytes_written= (result > -1) ? result : 0;
size_t bytes_written= (result > 0) ? (size_t) result : 0;
PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_written);
}
@@ -786,8 +786,7 @@ inline_mysql_socket_recv
/* Instrumentation end */
if (locker != NULL)
{
size_t bytes_read;
bytes_read= (result > -1) ? result : 0;
size_t bytes_read= (result > 0) ? (size_t) result : 0;
PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_read);
}
@@ -828,8 +827,7 @@ inline_mysql_socket_sendto
/* Instrumentation end */
if (locker != NULL)
{
size_t bytes_written;
bytes_written = (result > -1) ? result : 0;
size_t bytes_written = (result > 0) ? (size_t) result : 0;
PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_written);
}
@@ -871,8 +869,7 @@ inline_mysql_socket_recvfrom
/* Instrumentation end */
if (locker != NULL)
{
size_t bytes_read;
bytes_read = (result > -1) ? result : 0;
size_t bytes_read= (result > 0) ? (size_t) result : 0;
PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_read);
}

View File

@@ -1,4 +1,5 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, MariaDB Corporation.
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
@@ -146,7 +147,7 @@ inline_mysql_start_statement(PSI_statement_locker_state *state,
PSI_statement_key key,
const char *db, uint db_len,
const CHARSET_INFO *charset,
const char *src_file, int src_line)
const char *src_file, uint src_line)
{
PSI_statement_locker *locker;
locker= PSI_STATEMENT_CALL(get_thread_statement_locker)(state, key, charset);

View File

@@ -1,4 +1,5 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, MariaDB Corporation.
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
@@ -183,7 +184,7 @@ static inline struct PSI_table_locker *
inline_mysql_start_table_lock_wait(PSI_table_locker_state *state,
struct PSI_table *psi,
enum PSI_table_lock_operation op,
ulong flags, const char *src_file, int src_line)
ulong flags, const char *src_file, uint src_line)
{
if (psi != NULL)
{

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab
Copyright (c) 2010, 2017, MariaDB Corporation.
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
@@ -25,8 +25,8 @@
#define HOSTNAME_LENGTH 60
#define SYSTEM_CHARSET_MBMAXLEN 3
#define NAME_CHAR_LEN 64 /* Field/table name length */
#define USERNAME_CHAR_LENGTH 128
#define NAME_CHAR_LEN 64U /* Field/table name length */
#define USERNAME_CHAR_LENGTH 128U
#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)
#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN)
#define DEFINER_CHAR_LENGTH (USERNAME_CHAR_LENGTH + HOSTNAME_LENGTH + 1)
@@ -111,6 +111,8 @@ enum enum_server_command
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON,
COM_UNIMPLEMENTED, // COM_BINLOG_DUMP_GTID in MySQL
COM_RESET_CONNECTION,
/* don't forget to update const char *command_name[] in sql_parse.cc */
COM_MDB_GAP_BEG,
COM_MDB_GAP_END=250,
@@ -147,40 +149,40 @@ enum enum_indicator_type
#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2)
#define NOT_NULL_FLAG 1 /* Field can't be NULL */
#define PRI_KEY_FLAG 2 /* Field is part of a primary key */
#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */
#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */
#define BLOB_FLAG 16 /* Field is a blob */
#define UNSIGNED_FLAG 32 /* Field is unsigned */
#define ZEROFILL_FLAG 64 /* Field is zerofill */
#define BINARY_FLAG 128 /* Field is binary */
#define NOT_NULL_FLAG 1U /* Field can't be NULL */
#define PRI_KEY_FLAG 2U /* Field is part of a primary key */
#define UNIQUE_KEY_FLAG 4U /* Field is part of a unique key */
#define MULTIPLE_KEY_FLAG 8U /* Field is part of a key */
#define BLOB_FLAG 16U /* Field is a blob */
#define UNSIGNED_FLAG 32U /* Field is unsigned */
#define ZEROFILL_FLAG 64U /* Field is zerofill */
#define BINARY_FLAG 128U /* Field is binary */
/* The following are only sent to new clients */
#define ENUM_FLAG 256 /* field is an enum */
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
#define SET_FLAG 2048 /* field is a set */
#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */
#define ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */
#define NUM_FLAG 32768 /* Field is num (for clients) */
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
#define GROUP_FLAG 32768 /* Intern: Group field */
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */
#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */
#define ENUM_FLAG 256U /* field is an enum */
#define AUTO_INCREMENT_FLAG 512U /* field is a autoincrement field */
#define TIMESTAMP_FLAG 1024U /* Field is a timestamp */
#define SET_FLAG 2048U /* field is a set */
#define NO_DEFAULT_VALUE_FLAG 4096U /* Field doesn't have default value */
#define ON_UPDATE_NOW_FLAG 8192U /* Field is set to NOW on UPDATE */
#define NUM_FLAG 32768U /* Field is num (for clients) */
#define PART_KEY_FLAG 16384U /* Intern; Part of some key */
#define GROUP_FLAG 32768U /* Intern: Group field */
#define BINCMP_FLAG 131072U /* Intern: Used by sql_yacc */
#define GET_FIXED_FIELDS_FLAG (1U << 18) /* Used to get fields in item tree */
#define FIELD_IN_PART_FUNC_FLAG (1U << 19)/* Field part of partition func */
/**
Intern: Field in TABLE object for new version of altered table,
which participates in a newly added index.
*/
#define FIELD_IN_ADD_INDEX (1 << 20)
#define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */
#define FIELD_IN_ADD_INDEX (1U << 20)
#define FIELD_IS_RENAMED (1U << 21) /* Intern: Field is being renamed */
#define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23 */
#define FIELD_FLAGS_STORAGE_MEDIA_MASK (3 << FIELD_FLAGS_STORAGE_MEDIA)
#define FIELD_FLAGS_STORAGE_MEDIA_MASK (3U << FIELD_FLAGS_STORAGE_MEDIA)
#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25 */
#define FIELD_FLAGS_COLUMN_FORMAT_MASK (3 << FIELD_FLAGS_COLUMN_FORMAT)
#define FIELD_IS_DROPPED (1<< 26) /* Intern: Field is being dropped */
#define FIELD_FLAGS_COLUMN_FORMAT_MASK (3U << FIELD_FLAGS_COLUMN_FORMAT)
#define FIELD_IS_DROPPED (1U << 26) /* Intern: Field is being dropped */
#define REFRESH_GRANT (1ULL << 0) /* Refresh grant tables */
#define REFRESH_LOG (1ULL << 1) /* Start on new log file */
@@ -333,36 +335,36 @@ enum enum_indicator_type
implicitly, by the first transactional
statement, when autocommit=off.
*/
#define SERVER_STATUS_IN_TRANS 1
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
#define SERVER_QUERY_NO_INDEX_USED 32
#define SERVER_STATUS_IN_TRANS 1U
#define SERVER_STATUS_AUTOCOMMIT 2U /* Server in auto_commit mode */
#define SERVER_MORE_RESULTS_EXISTS 8U /* Multi query - next query exists */
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16U
#define SERVER_QUERY_NO_INDEX_USED 32U
/**
The server was able to fulfill the clients request and opened a
read-only non-scrollable cursor for a query. This flag comes
in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
*/
#define SERVER_STATUS_CURSOR_EXISTS 64
#define SERVER_STATUS_CURSOR_EXISTS 64U
/**
This flag is sent when a read-only cursor is exhausted, in reply to
COM_STMT_FETCH command.
*/
#define SERVER_STATUS_LAST_ROW_SENT 128
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
#define SERVER_STATUS_LAST_ROW_SENT 128U
#define SERVER_STATUS_DB_DROPPED 256U /* A database was dropped */
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512U
/**
Sent to the client if after a prepared statement reprepare
we discovered that the new statement returns a different
number of result set columns.
*/
#define SERVER_STATUS_METADATA_CHANGED 1024
#define SERVER_QUERY_WAS_SLOW 2048
#define SERVER_STATUS_METADATA_CHANGED 1024U
#define SERVER_QUERY_WAS_SLOW 2048U
/**
To mark ResultSet containing output parameter values.
*/
#define SERVER_PS_OUT_PARAMS 4096
#define SERVER_PS_OUT_PARAMS 4096U
/**
Set at the same time as SERVER_STATUS_IN_TRANS if the started
@@ -371,7 +373,7 @@ enum enum_indicator_type
to clients in OK and EOF packets, the flag indicates the
transaction status at the end of command execution.
*/
#define SERVER_STATUS_IN_TRANS_READONLY 8192
#define SERVER_STATUS_IN_TRANS_READONLY 8192U
/**
This status flag, when on, implies that one of the state information has
@@ -453,7 +455,7 @@ typedef struct st_net {
} NET;
#define packet_error (~(unsigned long) 0)
#define packet_error ~0UL
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
@@ -704,9 +706,9 @@ void my_thread_end(void);
}
#endif
#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
#define MYSQL_STMT_HEADER 4
#define MYSQL_LONG_DATA_HEADER 6
#define NULL_LENGTH ~0UL /* For net_store_length */
#define MYSQL_STMT_HEADER 4U
#define MYSQL_LONG_DATA_HEADER 6U
/*
If a float or double field have more than this number of decimals,

View File

@@ -1,4 +1,5 @@
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, MariaDB Corporation.
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
@@ -76,10 +77,10 @@ enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1,
/* Priority for locks */
#define THR_LOCK_LATE_PRIV 1 /* For locks to be merged with org lock */
#define THR_LOCK_MERGE_PRIV 2 /* For merge tables */
#define THR_LOCK_LATE_PRIV 1U /* For locks to be merged with org lock */
#define THR_LOCK_MERGE_PRIV 2U /* For merge tables */
#define THR_UNLOCK_UPDATE_STATUS 1
#define THR_UNLOCK_UPDATE_STATUS 1U
extern ulong max_write_lock_count;
extern my_bool thr_lock_inited;

View File

@@ -1,4 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, MariaDB Corporation.
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
@@ -33,13 +34,13 @@ extern int find_type_or_exit(const char *x, TYPELIB *typelib,
const char *option);
#define FIND_TYPE_BASIC 0
/** makes @c find_type() require the whole name, no prefix */
#define FIND_TYPE_NO_PREFIX (1 << 0)
#define FIND_TYPE_NO_PREFIX (1U << 0)
/** always implicitely on, so unused, but old code may pass it */
#define FIND_TYPE_NO_OVERWRITE 0
/** makes @c find_type() accept a number. Not used either */
#define FIND_TYPE_ALLOW_NUMBER 0
/** makes @c find_type() treat ',' and '=' as terminators */
#define FIND_TYPE_COMMA_TERM (1 << 3)
#define FIND_TYPE_COMMA_TERM (1U << 3)
extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2012 Monty Program Ab
Copyright (c) 2012, 2017, MariaDB Corporation.
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
@@ -51,9 +51,9 @@ enum enum_vio_io_event
VIO_IO_EVENT_CONNECT
};
#define VIO_LOCALHOST 1 /* a localhost connection */
#define VIO_BUFFERED_READ 2 /* use buffered read */
#define VIO_READ_BUFFER_SIZE 16384 /* size of read buffer */
#define VIO_LOCALHOST 1U /* a localhost connection */
#define VIO_BUFFERED_READ 2U /* use buffered read */
#define VIO_READ_BUFFER_SIZE 16384U /* size of read buffer */
#define VIO_DESCRIPTION_SIZE 30 /* size of description */
Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_SECURE_INST" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
.TH "\FBMYSQL_SECURE_INST" "1" "3 January 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -71,9 +71,8 @@ test
database, which by default can be accessed by anonymous users\&.
.RE
.PP
Invoke
\fBmysql_secure_installation\fR
without arguments:
can be invoked without arguments:
.sp
.if n \{\
.RS 4
@@ -86,10 +85,75 @@ shell> \fBmysql_secure_installation\fR
.\}
.PP
The script will prompt you to determine which actions to perform\&.
.PP
\fBmysql_secure_installation\fR
accepts some options:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_secure_installation: basedir option
.\" basedir option: mysql_secure_installation
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
Base directory\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_secure_installation: defaults-extra-file option
.\" defaults-extra-file option: mysql_secure_installation
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Additional option file\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_secure_installation: defaults-file option
.\" defaults-file option: mysql_secure_installation
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Option file\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_secure_installation: no-defaults option
.\" no-defaults option: mysql_secure_installation
\fB\-\-no\-defaults\fR
.sp
Don't read any defaults file\&.
.RE
.sp
Other unrecognized options will be passed on to the server\&.
.SH "COPYRIGHT"
.br
.PP
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2017 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP

View File

@@ -76,3 +76,9 @@ then put your .test file and .result file(s) into a tar.gz archive,
add a README that explains the problem, ftp the archive to
ftp://ftp.askmonty.org/private and submit a report to
http://mariadb.org/jira about it.
The latest information about mysql-test-run can be found at:
https://mariadb.com/kb/en/mariadb/mysqltest/
If you want to create .rdiff files, check
https://mariadb.com/kb/en/mariadb/mysql-test-auxiliary-files/

View File

@@ -2,12 +2,14 @@ To be able to see the level of coverage with the current test suite,
do the following:
- Make sure gcov is installed
- Compile the MySQL distribution with BUILD/compile-pentium-gcov (if your
- Compile the MySQL distribution with BUILD/compile-pentium64-gcov (if your
machine does not have a pentium CPU, hack this script, or just live with
the pentium-specific stuff)
- In the mysql-test directory, run this command: ./mysql-test-run -gcov
- To see the level of coverage for a given source file:
grep source_file_name /tmp/gcov.out
grep -1 source_file_name ../mysql-test-gcov.msg
- To see which lines are not yet covered, look at source_file_name.gcov in
the source tree. Then think hard about a test case that will cover those
lines, and write one!
the source tree. You can find this by doing something like:
find source-directory -name "mysqld.cc.gcov"
Then think hard about a test case that will cover those lines, and write
one!

198
mysql-test/dgcov.pl Executable file
View File

@@ -0,0 +1,198 @@
#! /usr/bin/perl
# Copyright (C) 2003,2008 MySQL AB
# Copyright (C) 2010,2017 Sergei Golubchik and MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Run gcov and report test coverage on only those code lines touched by
# a given list of commits.
use strict;
use warnings;
use Getopt::Long;
use File::Find;
use Cwd qw/realpath/;
my $opt_verbose=0;
my $opt_generate;
my $opt_help;
my $opt_purge;
my $opt_only_gcov;
my $opt_skip_gcov;
my %cov;
my $file_no=0;
GetOptions
("v|verbose+" => \$opt_verbose,
"h|help" => \$opt_help,
"p|purge" => \$opt_purge,
"g|generate" => \$opt_generate,
"o|only-gcov" => \$opt_only_gcov,
"s|skip-gcov" => \$opt_skip_gcov,
) or usage();
usage() if $opt_help;
sub logv(@) { print STDERR @_,"\n" if $opt_verbose; }
sub gcov_prefix($) { defined($_[0]) ? $_[0] || '#####' : '-' }
my $root= `git rev-parse --show-toplevel`;
chomp $root;
die "Failed to find tree root" unless $root;
$root=realpath($root).'/';
logv "Chdir $root";
chdir $root or die "chdir($root): $!";
my $res;
my $cmd;
if ($opt_purge)
{
$cmd= "find . -name '*.da' -o -name '*.gcda' -o -name '*.gcov' -o ".
"-name '*.dgcov' | grep -v 'README\.gcov' | xargs rm -f ''";
logv "Running: $cmd";
system($cmd)==0 or die "system($cmd): $? $!";
exit 0;
}
find(\&gcov_one_file, $root);
find(\&write_coverage, $root) if $opt_generate;
exit 0 if $opt_only_gcov;
if (@ARGV) {
print_gcov_for_diff(@ARGV);
} else {
print_gcov_for_diff('HEAD') or print_gcov_for_diff('HEAD^');
}
exit 0;
sub print_gcov_for_diff {
$cmd="git diff --no-prefix --ignore-space-change @_";
logv "Running: $cmd";
open PIPE, '-|', $cmd or die "Failed to popen '$cmd': $!: $?";
my ($lnum, $cnt, $fcov, $acc, $printme, $fname);
while (<PIPE>) {
if (/^diff --git (.*) \1\n/) {
print $acc if $printme;
$fname=$1;
$acc="dgcov $fname";
$acc=('*' x length($acc)) . "\n$acc\n" . ('*' x length($acc));
$lnum=undef;
$fcov=$cov{realpath($fname)};
$printme=0;
logv "File: $fname";
next;
}
if (/^@@ -\d+,\d+ \+(\d+),(\d+) @@/ and $fcov) {
$lnum=$1;
$cnt=$2;
$acc.="\n@@ +$lnum,$cnt @\@$'";
logv " lines: $lnum,",$lnum+$cnt;
next;
}
next unless $lnum and $cnt;
$acc.=sprintf '%9s:%5s:%s', '', $lnum, $' if /^ /;
++$printme, $acc.=sprintf '%9s:%5s:%s', gcov_prefix($fcov->{$lnum}), $lnum, $' if /^\+/;
die "$_^^^ dying", unless /^[- +]/;
++$lnum;
--$cnt;
}
print $acc if $printme;
close PIPE or die "command '$cmd' failed: $!: $?";
return defined($fname);
}
sub usage {
print <<END;
Usage: $0 --help
$0 [options] [git diff arguments]
The dgcov program runs gcov for code coverage analysis, and reports missing
coverage only for those lines that are changed by the specified commit(s).
Commits are specified in the format of git diff arguments. For example:
* All unpushed commits: $0 \@{u} HEAD
* All uncommitted changes: $0 HEAD
* Specific commit: $0 <commit>^ <commit>
If no arguments are specified, it prints the coverage for all uncommitted
changes, if any, otherwise for the last commit.
Options:
-h --help This help.
-v --verbose Show commands run.
-p --purge Delete all test coverage information, to prepare for a
new coverage test.
-o --only-gcov Stop after running gcov, don't run git
-s --skip-gcov Do not run gcov, assume .gcov files are already in place
-g --generate Create .dgcov files for all source files
Prior to running this tool, MariaDB should be built with
cmake -DENABLE_GCOV=ON
and the testsuite should be run. dgcov will report the coverage
for all lines modified in the specified commits.
END
exit 1;
}
sub gcov_one_file {
return unless /\.gcda$/;
unless ($opt_skip_gcov) {
$cmd= "gcov -i '$_' 2>/dev/null >/dev/null";
print STDERR ++$file_no,"\r" if not $opt_verbose and -t STDERR;
logv "Running: $cmd";
system($cmd)==0 or die "system($cmd): $? $!";
}
# now, read the generated file
open FH, '<', "$_.gcov" or die "open(<$_.gcov): $!";
my $fname;
while (<FH>) {
chomp;
if (/^function:/) {
next;
}
if (/^file:/) {
$fname=realpath($');
next;
}
next if /^lcount:\d+,-\d+/; # whatever that means
unless (/^lcount:(\d+),(\d+)/ and $fname) {
warn "unknown line '$_' after running '$cmd'";
next;
}
$cov{$fname}->{$1}+=$2;
}
close(FH);
}
sub write_coverage {
my $fn=$File::Find::name;
my $h=$cov{$fn};
return unless $h and $root eq substr $fn, 0, length($root);
open I, '<', $fn or die "open(<$fn): $!";
open O, '>', "$fn.dgcov" or die "open(>$fn.dgcov): $!";
logv "Annotating: ", substr $fn, length($root);
while (<I>) {
printf O '%9s:%5s:%s', gcov_prefix($h->{$.}), $., $_;
}
close I;
close O;
}

View File

@@ -272,7 +272,7 @@ create table if not exists t3 like tt1;
--disable_warnings
USE mysql;
INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
INSERT IGNORE INTO user SET host='localhost', user='@#@', password=password('Just a test');
UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
DELETE FROM user WHERE host='localhost' AND user='@#@';
--enable_warnings

View File

@@ -71,7 +71,7 @@ source include/binlog_inject_error.inc;
let $query= DROP VIEW v1;
source include/binlog_inject_error.inc;
let $query= CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
let $query= CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
source include/binlog_inject_error.inc;
let $query= DROP PROCEDURE p1;

View File

@@ -436,9 +436,9 @@ drop table t2;
#
create table t1 (col1 varchar(1)) character set cp932;
insert into t1 values ('a');
insert into t1 values ('ab');
insert ignore into t1 values ('ab');
select * from t1;
insert into t1 values ('abc');
insert ignore into t1 values ('abc');
select * from t1;
drop table t1;

View File

@@ -53,7 +53,7 @@ SELECT * FROM t1;
DROP TABLE t1;
FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /TIMESTAMP=[0-9]*/TIMESTAMP=XXX/ /# at [0-9]*/# at #/ /(exec_time=|end_log_pos |Xid = |thread_id=|server id |table id |mapped to number )[0-9]+/\1#/ /server v [^ ]*/server v #.##.##/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Gtid list [[][0-9]+-[0-9]+-[0-9]+[\]]/Gtid list [#-#-#]/ /session[.](gtid_domain_id|server_id|gtid_seq_no)=[0-9]+/session.\1=#/
--replace_regex /TIMESTAMP=[0-9]*/TIMESTAMP=XXX/ /# at [0-9]*/# at #/ /(exec_time=|end_log_pos |Xid = |thread_id=|server id |table id |mapped to number )[0-9]+/\1#/ /server v [^ ]*/server v #.##.##/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Gtid list [[][0-9]+-[0-9]+-[0-9]+[\]]/Gtid list [#-#-#]/ /session[.](gtid_domain_id|server_id|gtid_seq_no)=[0-9]+/session.\1=#/ /(^#|created )[0-9]{6} [ 1][0-9]:[0-9]{2}:[0-9]{2}/\1YYMMDD HH:MM:SS/
--exec $MYSQL_BINLOG --base64-output=decode-rows -vv $MYSQLD_DATADIR/master-bin.000003
SET TIMESTAMP=DEFAULT;

View File

@@ -346,7 +346,7 @@ if ($CRC_RET_stmt_sidef) {
SHOW BINLOG EVENTS;
--die Warnings printed
}
--let $event_type= query_get_value(SHOW BINLOG EVENTS, Event_type, 5)
--let $event_type= query_get_value(SHOW BINLOG EVENTS, Event_type, 6)
# The first event is format_description, the second is Gtid list, the
# third is Binlog_checkpoint, the fourth Gtid, and the fifth should be
# our Query for 'INSERT DELAYED' unsafe_type 3, which is safe after
@@ -357,12 +357,13 @@ if ($CRC_RET_stmt_sidef) {
SHOW BINLOG EVENTS;
--die Wrong events in binlog.
}
# The first event is format_description, the second is Binlog_checkpoint,
# the third is Query_event('BEGIN'), and the fourth should be our Table_map
# The first event is format_description, the second is Gtid list,
# the third is Binlog_checkpoint, the fourth is Query_event('BEGIN'),
# the fifth is Annotate_rows, and the sixth should be our Table_map
# for unsafe statement.
if (`SELECT $unsafe_type != 3 AND '$event_type' != 'Table_map'`) {
--enable_query_log
--echo ******** Failure! Event number 4 was a '$event_type', not a 'Table_map'. ********
--echo ******** Failure! Event number 6 was a '$event_type', not a 'Table_map'. ********
SHOW BINLOG EVENTS;
--die Wrong events in binlog.
}

View File

@@ -50,7 +50,7 @@ call mtr.add_suppression("Can't generate a unique log-filename");
call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
call mtr.add_suppression("Error writing file .*");
SET @old_debug= @@global.debug;
SET @old_debug= @@global.debug_dbug;
### ACTION: create a large file (> 4096 bytes) that will be later used
### in LOAD DATA INFILE to check binlog errors in its vacinity
@@ -192,6 +192,11 @@ RESET MASTER;
### is written to the current binary log.
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
# Disable logging Annotate_rows events to preserve events count.
let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
SET @@binlog_annotate_row_events= 0;
SELECT count(*) FROM t4;
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- error ER_NO_UNIQUE_LOGFILE
@@ -210,6 +215,11 @@ if (!$binlog_limit)
# clean up and move to next test
DELETE FROM t4;
--disable_query_log
eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
--enable_query_log
RESET MASTER;
-- echo ###################### TEST #8
@@ -286,7 +296,7 @@ SET GLOBAL debug_dbug="+d,fault_injection_registering_index";
-- replace_regex /\.[\\\/]master/master/
-- error ER_CANT_OPEN_FILE
FLUSH LOGS;
SET GLOBAL debug_dbug="-d,fault_injection_registering_index";
SET GLOBAL debug_dbug=@old_debug;
-- error ER_NO_BINARY_LOGGING
SHOW BINARY LOGS;
@@ -298,6 +308,7 @@ INSERT INTO t2 VALUES ('aaaaa');
DELETE FROM t4;
DELETE FROM t2;
DROP TABLE t5;
flush tables;
-- echo ###################### TEST #11
@@ -314,7 +325,7 @@ SET GLOBAL debug_dbug="+d,fault_injection_openning_index";
-- replace_regex /\.[\\\/]master/master/
-- error ER_CANT_OPEN_FILE
FLUSH LOGS;
SET GLOBAL debug_dbug="-d,fault_injection_openning_index";
SET GLOBAL debug_dbug=@old_debug;
-- error ER_FLUSH_MASTER_BINLOG_CLOSED
RESET MASTER;
@@ -326,6 +337,7 @@ INSERT INTO t2 VALUES ('aaaaa');
DELETE FROM t4;
DELETE FROM t2;
DROP TABLE t5;
flush tables;
# restart the server so that we have binlog again
--let $rpl_server_number= 1
@@ -341,7 +353,7 @@ DROP TABLE t5;
SET GLOBAL debug_dbug="+d,fault_injection_new_file_rotate_event";
-- error ER_ERROR_ON_WRITE
FLUSH LOGS;
SET GLOBAL debug_dbug="-d,fault_injection_new_file_rotate_event";
SET GLOBAL debug_dbug=@old_debug;
-- error ER_FLUSH_MASTER_BINLOG_CLOSED
RESET MASTER;
@@ -353,6 +365,7 @@ INSERT INTO t2 VALUES ('aaaaa');
DELETE FROM t4;
DELETE FROM t2;
DROP TABLE t5;
flush tables;
# restart the server so that we have binlog again
--let $rpl_server_number= 1

View File

@@ -8,8 +8,8 @@
-- source include/master-slave.inc
--disable_warnings
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t2 set data=repeat.*'a', @act_size.*");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t2 set data=repeat.*'a', @act_size.*");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
--enable_warnings
connection master;

View File

@@ -253,9 +253,9 @@ some var char';
INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
binary data';
INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
insert ignore into t31 set f1=1, f2=1, f3=2, f4='second',
f9=2.2, f10='seven samurai', f28=222.222, f35='222';
INSERT into t31 values (1, 1, 3, 'third',
insert ignore into t31 values (1, 1, 3, 'third',
/* f5 BIGINT, */ 333333333333333333333333,
/* f6 BLOB, */ '3333333333333333333333',
/* f7 DATE, */ '2007-07-18',
@@ -289,7 +289,7 @@ binary data';
/*f35 VARCHAR(257),*/ 'three times three'
);
INSERT into t31 values (1, 1, 4, 'fourth',
insert ignore into t31 values (1, 1, 4, 'fourth',
/* f5 BIGINT, */ 333333333333333333333333,
/* f6 BLOB, */ '3333333333333333333333',
/* f7 DATE, */ '2007-07-18',
@@ -408,7 +408,7 @@ connection master;
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
update ignore t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
--echo
--echo ** Delete from Master **

View File

@@ -455,9 +455,13 @@ SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex
--connection server_1
SET gtid_domain_id=2;
SET gtid_seq_no=1030;
# Disable logging Annotate_rows events to preserve events count.
let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
SET @@binlog_annotate_row_events= 0;
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
--save_master_pos
--connection server_2

View File

@@ -62,7 +62,7 @@ while ($ddl_cases >= 1)
#
if (`select @@binlog_format = 'ROW'`)
{
let $commit_event_row_number= 4;
let $commit_event_row_number= 5;
}
let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1);
@@ -164,7 +164,7 @@ while ($ddl_cases >= 1)
#
if (`select @@binlog_format = 'ROW'`)
{
let $commit_event_row_number= 5;
let $commit_event_row_number= 6;
}
}
if ($ddl_cases == 22)
@@ -250,7 +250,7 @@ while ($ddl_cases >= 1)
#
if (`select @@binlog_format = 'MIXED'`)
{
let $commit_event_row_number= 4;
let $commit_event_row_number= 5;
}
}
if ($ddl_cases == 9)
@@ -267,7 +267,7 @@ while ($ddl_cases >= 1)
#
if (`select @@binlog_format = 'MIXED'`)
{
let $commit_event_row_number= 4;
let $commit_event_row_number= 5;
}
}
if ($ddl_cases == 8)
@@ -293,10 +293,14 @@ while ($ddl_cases >= 1)
# 3: ROW EVENT
# 4: COMMIT
#
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'ROW'`)
if (`select @@binlog_format = 'STATEMENT'`)
{
let $commit_event_row_number= 4;
}
if (`select @@binlog_format = 'ROW'`)
{
let $commit_event_row_number= 5;
}
# In MIXED mode, the changes are logged as rows and we have what follows:
#
# 1: BEGIN
@@ -307,7 +311,7 @@ while ($ddl_cases >= 1)
#
if (`select @@binlog_format = 'MIXED'`)
{
let $commit_event_row_number= 5;
let $commit_event_row_number= 6;
}
}
if ($ddl_cases == 7)

View File

@@ -43,7 +43,7 @@ source include/show_binlog_events.inc;
let $binlog_limit= 3;
source include/show_binlog_events.inc;
let $binlog_limit= 2,4;
let $binlog_limit= 2,5;
source include/show_binlog_events.inc;
let $binlog_limit=;
flush logs;

View File

@@ -12,7 +12,7 @@
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
-- disable_warnings
UPDATE t1 SET c5 = 'a';
UPDATE IGNORE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master
@@ -33,7 +33,7 @@ DROP TABLE t1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
-- disable_warnings
UPDATE t1 SET c5 = 'a';
UPDATE IGNORE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master

View File

@@ -123,7 +123,7 @@ source include/wait_for_slave_sql_error.inc;
--disable_query_log
--eval SELECT "$err" as 'Last_SQL_Error (expected "Delete_rows_v1 event on table test1.t3; Can\'t find record in \'t3\'" error)'
--enable_query_log
call mtr.add_suppression("Slave: Can't find record in 't3' Error_code: 1032");
call mtr.add_suppression("Can't find record in 't3'");
SET GLOBAL sql_slave_skip_counter=1;
START SLAVE;

View File

@@ -411,6 +411,7 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535");
call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* error.* 1032");
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, error.* 1677");
call mtr.add_suppression("Can't find record in 't1'");
--let $rpl_only_running_threads= 1
--source include/rpl_reset.inc
@@ -622,33 +623,33 @@ eval CREATE TABLE t1 (a bit) ENGINE=$type;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
INSERT INTO t1 ( a ) VALUES ( 5 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 5 );
DELETE FROM t1 WHERE a < 2 LIMIT 4;
DELETE FROM t1 WHERE a < 9 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 9 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 9 );
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
INSERT INTO t1 ( a ) VALUES ( 8 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 8 );
UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
INSERT INTO t1 ( a ) VALUES ( 4 );
INSERT INTO t1 ( a ) VALUES ( 3 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 4 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
DELETE FROM t1 WHERE a = 4 LIMIT 7;
UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
UPDATE IGNORE t1 SET a = 9 WHERE a < 2 LIMIT 9;
UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
DELETE FROM t1 WHERE a < 0 LIMIT 5;
INSERT INTO t1 ( a ) VALUES ( 5 );
UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 5 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
INSERT IGNORE INTO t1 ( a ) VALUES ( 5 );
UPDATE IGNORE t1 SET a = 4 WHERE a < 6 LIMIT 4;
INSERT IGNORE INTO t1 ( a ) VALUES ( 5 );
UPDATE IGNORE t1 SET a = 9 WHERE a < 5 LIMIT 8;
DELETE FROM t1 WHERE a < 8 LIMIT 8;
INSERT INTO t1 ( a ) VALUES ( 6 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 6 );
DELETE FROM t1 WHERE a < 6 LIMIT 7;
UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
INSERT INTO t1 ( a ) VALUES ( 7 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 7 );
DELETE FROM t1 WHERE a < 9 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 7 );
INSERT INTO t1 ( a ) VALUES ( 6 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 7 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 6 );
UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
DELETE FROM t1 WHERE a = 2 LIMIT 9;
DELETE FROM t1 WHERE a = 1 LIMIT 4;
@@ -657,7 +658,7 @@ INSERT INTO t1 ( a ) VALUES ( 0 );
DELETE FROM t1 WHERE a < 3 LIMIT 0;
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
UPDATE IGNORE t1 SET a = 9 WHERE a < 5 LIMIT 3;
--enable_warnings
sync_slave_with_master;

View File

@@ -4,7 +4,7 @@
--source extra/rpl_tests/rpl_show_binlog_events.inc
--let $binlog_limit= 2
--source extra/rpl_tests/rpl_show_binlog_events.inc
--let $binlog_limit= 2,3
--let $binlog_limit= 2,4
--source extra/rpl_tests/rpl_show_binlog_events.inc
--let $binlog_limit=
--let $binlog_file=

View File

@@ -20,7 +20,7 @@
# then set default's client character set(latin1) as client's character set.
###############################################################################
--source include/master-slave.inc
call mtr.add_suppression("Cannot use utf16 as character_set_client");
call mtr.add_suppression("'utf16' can not be used as client character set");
CREATE TABLE t1(i VARCHAR(20));
INSERT INTO t1 VALUES (0xFFFF);
--sync_slave_with_master

View File

@@ -156,12 +156,14 @@ insert into t1 select "yesterday_24_";
create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
create table t3 select 1 union select UUID();
--disable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
--enable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
# what if UUID() is first:
--disable_warnings
insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
--enable_warnings
# inside a stored procedure

View File

@@ -1,7 +1,7 @@
# Allow anonymous users to connect
disable_warnings;
disable_query_log;
INSERT INTO mysql.user (host, user) VALUES ('localhost','');
INSERT IGNORE INTO mysql.user (host, user) VALUES ('localhost','');
FLUSH PRIVILEGES;
enable_query_log;
enable_warnings;

View File

@@ -2,6 +2,8 @@
--echo # mdev-539: fast build of unique/primary indexes for MyISAM/Aria
--echo #
call mtr.add_suppression("Can't find record in '.*'");
--disable_warnings
DROP DATABASE IF EXISTS dbt3_s001;
--enable_warnings

View File

@@ -0,0 +1,3 @@
# The time on ANALYSE FORMAT=JSON is rather variable
--replace_regex /("(r_total_time_ms|r_buffer_size)": )[^, \n]*/\1"REPLACED"/

View File

@@ -267,7 +267,7 @@ select * from t2;
insert into t2 (a) values (1026);
--replace_result $MYSQLTEST_VARDIR ..
--error ER_DUP_ENTRY
eval load data infile "../../std_data/words.dat" into table t1 (a) set a:=f2(26);
eval load data infile "../../std_data/words.dat" ignore into table t1 (a) set a:=f2(26);
select * from t2;
rollback;

View File

@@ -58,7 +58,7 @@ DROP TABLE t1;
# Bug #32726: crash with cast in order by clause and cp932 charset
#
create table t1 (a set('a') not null);
insert into t1 values (),();
insert ignore into t1 values (),();
select cast(a as char(1)) from t1;
select a sounds like a from t1;
select 1 from t1 order by cast(a as char(1));

View File

@@ -739,6 +739,7 @@ show create table t1;
drop table t1;
select hex(concat(period_diff(200902, 200802)));
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t1 as select concat(period_add(200902, 200802)) as c1;
show create table t1;
drop table t1;

View File

@@ -1,5 +1,7 @@
--echo # Start of ctype_unescape.inc
SET sql_mode = '';
#
# Testing how string literals with backslash and quote-quote are unescaped.
# The tests assume that single quote (') is used as a delimiter.
@@ -323,5 +325,6 @@ DROP FUNCTION wellformedness;
DROP FUNCTION mysql_real_escape_string_generated;
DROP FUNCTION iswellformed;
DROP TABLE allbytes;
SET sql_mode = DEFAULT;
--echo # End of ctype_backslash.inc

View File

@@ -124,7 +124,7 @@ set LC_TIME_NAMES='en_US';
#
set names koi8r;
eval create table t1 (s1 char(1) character set utf8mb4) engine $engine;
insert into t1 values (_koi8r'<27><>');
insert ignore into t1 values (_koi8r'<27><>');
select s1,hex(s1),char_length(s1),octet_length(s1) from t1;
drop table t1;
@@ -136,11 +136,11 @@ if ($is_heap)
{
eval create table t1 (s1 varchar(255) character set utf8mb4) engine $engine;
}
insert into t1 select repeat('a',300);
insert into t1 select repeat('<27>',300);
insert into t1 select repeat('a<>',300);
insert into t1 select repeat('<27>a',300);
insert into t1 select repeat('<27><>',300);
insert ignore into t1 select repeat('a',300);
insert ignore into t1 select repeat('<27>',300);
insert ignore into t1 select repeat('a<>',300);
insert ignore into t1 select repeat('<27>a',300);
insert ignore into t1 select repeat('<27><>',300);
--sorted_result
select hex(s1) from t1;
--sorted_result
@@ -155,11 +155,11 @@ if ($is_heap)
{
eval create table t1 (s1 varchar(255) character set utf8mb4) engine $engine;
}
insert into t1 select repeat('a',66000);
insert into t1 select repeat('<27>',66000);
insert into t1 select repeat('a<>',66000);
insert into t1 select repeat('<27>a',66000);
insert into t1 select repeat('<27><>',66000);
insert ignore into t1 select repeat('a',66000);
insert ignore into t1 select repeat('<27>',66000);
insert ignore into t1 select repeat('a<>',66000);
insert ignore into t1 select repeat('<27>a',66000);
insert ignore into t1 select repeat('<27><>',66000);
--sorted_result
select length(s1),char_length(s1) from t1;
drop table t1;
@@ -168,19 +168,19 @@ drop table t1;
# Bug #2368 Multibyte charsets do not check that incoming data is well-formed
#
eval create table t1 (s1 char(10) character set utf8mb4) engine $engine;
insert into t1 values (0x41FF);
insert ignore into t1 values (0x41FF);
select hex(s1) from t1;
drop table t1;
eval create table t1 (s1 varchar(10) character set utf8mb4) engine $engine;
insert into t1 values (0x41FF);
insert ignore into t1 values (0x41FF);
select hex(s1) from t1;
drop table t1;
if (!$is_heap)
{
eval create table t1 (s1 text character set utf8mb4) engine $engine;
insert into t1 values (0x41FF);
insert ignore into t1 values (0x41FF);
select hex(s1) from t1;
drop table t1;
}
@@ -895,6 +895,7 @@ DROP TABLE t1,t2;
#
eval create table t1 (a char(20) character set utf8mb4) engine $engine;
insert into t1 values ('123456'),('андрей');
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 modify a char(2) character set utf8mb4;
select char_length(a), length(a), a from t1 order by a;
drop table t1;
@@ -1282,15 +1283,19 @@ eval create table t1 (
insert into t1 (a) values ('abcdefghijklmnopqrstuvwxyz');
select * from t1;
# varchar to varchar
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a varchar(20) character set utf8mb4 not null;
select * from t1;
# varchar to char
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a char(15) character set utf8mb4 not null;
select * from t1;
# char to char
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a char(10) character set utf8mb4 not null;
select * from t1;
# char to varchar
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a varchar(5) character set utf8mb4 not null;
select * from t1;
drop table t1;
@@ -1302,6 +1307,7 @@ eval create table t1 (
a varchar(4000) not null
) default character set utf8mb4 engine $engine;
insert into t1 values (repeat('a',4000));
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a varchar(3000) character set utf8mb4 not null;
select length(a) from t1;
drop table t1;
@@ -1552,7 +1558,7 @@ eval create table t1 (utf8mb4 char(1) character set utf8mb4) engine $engine;
--echo Testing [F0][90..BF][80..BF][80..BF]
insert into t1 values (0xF0908080);
insert into t1 values (0xF0BFBFBF);
insert into t1 values (0xF08F8080);
insert ignore into t1 values (0xF08F8080);
--sorted_result
select hex(utf8mb4) from t1;
delete from t1;
@@ -1567,7 +1573,7 @@ delete from t1;
--echo Testing [F4][80..8F][80..BF][80..BF]
insert into t1 values (0xF4808080);
insert into t1 values (0xF48F8080);
insert into t1 values (0xF4908080);
insert ignore into t1 values (0xF4908080);
--sorted_result
select hex(utf8mb4) from t1;
drop table t1;
@@ -1648,13 +1654,13 @@ INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859
# Mix of 3-byte and 4-byte chars
INSERT INTO t1 VALUES (65131, x'efb9abf09d849ef09d859ef09d859ef09d8480f09d859fefb9abefb9abf09d85a0efb9ab');
# All from musical chars, but 11 instead of 10 chars. truncated
INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480f09d85a0');
INSERT IGNORE INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480f09d85a0');
--sorted_result
SELECT u_decimal, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_general_ci, BINARY utf8mb4_encoding;
# First invalid 4 byte value
INSERT INTO t1 VALUES (1114111, x'f5808080');
INSERT IGNORE INTO t1 VALUES (1114111, x'f5808080');
--sorted_result
SELECT character_maximum_length, character_octet_length FROM information_schema.columns WHERE
@@ -1672,14 +1678,14 @@ INSERT INTO t2 VALUES (42856, x'ea9da8');
# SMALL COMMERCIAL AT
INSERT INTO t2 VALUES (65131, x'efb9ab');
# <Plane 16 Private Use, Last> (last 4 byte character)
INSERT INTO t2 VALUES (1114111, x'f48fbfbf');
INSERT IGNORE INTO t2 VALUES (1114111, x'f48fbfbf');
--sorted_result
SELECT character_maximum_length, character_octet_length FROM information_schema.columns WHERE
table_name= 't2' AND column_name= 'utf8mb3_encoding';
# Update a 3-byte char col with a 4-byte char, error
UPDATE t2 SET utf8mb3_encoding= x'f48fbfbd' where u_decimal= 42856;
UPDATE IGNORE t2 SET utf8mb3_encoding= x'f48fbfbd' where u_decimal= 42856;
# Update to a 3-byte char casted to 4-byte, error?
UPDATE t2 SET utf8mb3_encoding= _utf8mb4 x'ea9da8' where u_decimal= 42856;
@@ -1700,6 +1706,7 @@ SELECT count(*) FROM t1, t2
# Alter from 4-byte charset to 3-byte charset, error
--disable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
--enable_warnings
SHOW CREATE TABLE t1;

View File

@@ -62,6 +62,7 @@ SELECT
FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t2;
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
CREATE TABLE t2 AS
SELECT
CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,

View File

@@ -835,10 +835,10 @@ SELECT 1, 2 INTO OUTFILE 't5.dat' FROM dual;
--echo # Mon Aug 1 15:11:19 2011 UTC
SET TIMESTAMP = 1312211479.918273;
LOAD DATA INFILE 't3.dat' INTO TABLE t1;
LOAD DATA INFILE 't3.dat' IGNORE INTO TABLE t1;
--query_vertical SELECT * FROM t1
LOAD DATA INFILE 't4.dat' INTO TABLE t2;
LOAD DATA INFILE 't4.dat' IGNORE INTO TABLE t2;
SELECT a FROM t2;
SELECT b FROM t2;
SELECT c FROM t2;
@@ -866,7 +866,7 @@ DELETE FROM t2;
--echo # (read_fixed_length()) than under the LOAD ... INTO TABLE t1 command
--echo # above. The code in this path is copy-pasted code from the path taken
--echo # under the syntax used in the previous LOAD command.
LOAD DATA INFILE 't3.dat' INTO TABLE t1
LOAD DATA INFILE 't3.dat' IGNORE INTO TABLE t1
FIELDS TERMINATED BY '' ENCLOSED BY '';
SELECT b FROM t1;
@@ -954,7 +954,7 @@ CREATE TABLE t1 (
--echo # There is no promotion
SHOW CREATE TABLE t1;
LOAD DATA INFILE "file1.dat" INTO table t1;
LOAD DATA INFILE "file1.dat" IGNORE INTO table t1;
--echo # It is strange that "like_b" gets NULL when "b" gets 0. But
--echo # this is consistent with how "a" gets NULL when "b" gets 0,
@@ -971,7 +971,7 @@ modify f TIMESTAMP NULL default CURRENT_TIMESTAMP;
--echo # There is no promotion
SHOW CREATE TABLE t1;
LOAD DATA INFILE "file1.dat" INTO table t1;
LOAD DATA INFILE "file1.dat" IGNORE INTO table t1;
--query_vertical SELECT * FROM t1
delete from t1;
@@ -1007,7 +1007,7 @@ CREATE TABLE t1 (
--echo # There is no promotion
SHOW CREATE TABLE t1;
LOAD DATA INFILE "file2.dat" INTO table t1;
LOAD DATA INFILE "file2.dat" IGNORE INTO table t1;
--query_vertical SELECT * FROM t1
delete from t1;
@@ -1018,7 +1018,7 @@ modify f TIMESTAMP NULL default CURRENT_TIMESTAMP;
--echo # There is no promotion
SHOW CREATE TABLE t1;
LOAD DATA INFILE "file2.dat" INTO table t1;
LOAD DATA INFILE "file2.dat" IGNORE INTO table t1;
--query_vertical SELECT * FROM t1
delete from t1;

View File

@@ -509,7 +509,7 @@ CREATE TABLE t2 (
);
--disable_warnings
INSERT INTO t2 VALUES ();
INSERT IGNORE INTO t2 VALUES ();
INSERT INTO t1 VALUES ();
--enable_warnings
@@ -610,7 +610,7 @@ CREATE TABLE t1 (
KEY idx4267 (col1000, col1003)
);
INSERT INTO t1 VALUES (),();
INSERT IGNORE INTO t1 VALUES (),();
SELECT col999 FROM t1 WHERE col1000 = "3" AND col1003 <=> sysdate();
DROP TABLE t1;
@@ -888,7 +888,7 @@ DROP TABLE t1;
# MDEV-308 lp:1008516 - Failing assertion: templ->mysql_col_len == len
#
create table t1 (a int,b char(5),primary key (a), key (b(1)));
insert into t1 values ('a','b');
insert ignore into t1 values ('a','b');
select 1 from t1 where a and b >= 'aa';
drop table t1;

View File

@@ -11,13 +11,13 @@ let $load_file= $MYSQLTEST_VARDIR/std_data/loaddata2.dat;
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
start transaction;
--replace_result $load_file LOAD_FILE
eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
eval load data infile '$load_file' ignore into table t1 fields terminated by ',' enclosed by '''' (a, b);
commit;
select count(*) from t1;
truncate table t1;
start transaction;
--replace_result $load_file LOAD_FILE
eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
eval load data infile '$load_file' ignore into table t1 fields terminated by ',' enclosed by '''' (a, b);
rollback;
select count(*) from t1;

View File

@@ -573,14 +573,14 @@ INSERT INTO t1(stat_id,acct_id) VALUES
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
UPDATE t1 SET acct_id=785
WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
OPTIMIZE TABLE t1;
@@ -987,6 +987,7 @@ DROP TABLE t1;
#
create table t1(a text) engine=innodb default charset=utf8;
insert into t1 values('aaa');
set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for
alter table t1 add index(a(1024));
show create table t1;
drop table t1;
@@ -1558,6 +1559,7 @@ if ($test_foreign_keys)
# auto_increment keys
#
create table t1 (a int auto_increment primary key) engine=innodb;
set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for
alter table t1 order by a;
drop table t1;

View File

@@ -1470,9 +1470,11 @@ source include/varchar.inc;
--replace_result \\ / $MYSQL_TEST_DIR . /var/mysqld.1/data/ / t1.frm t1
create table t1 (v varchar(65530), key(v));
drop table t1;
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t1 (v varchar(65536));
show create table t1;
drop table t1;
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t1 (v varchar(65530) character set utf8);
show create table t1;
drop table t1;

View File

@@ -576,6 +576,7 @@ prepare my_delete from "delete from t9 where c21 = 'O' ";
#
# Use the maximum BIGINT from the manual
set @arg00= 9223372036854775807 ;
set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -585,6 +586,7 @@ execute my_select ;
--replace_result e+0 e+
execute my_delete ;
set @arg00= '9223372036854775807' ;
set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -596,6 +598,7 @@ execute my_delete ;
# Use the minimum BIGINT from the manual
#
set @arg00= -9223372036854775808 ;
set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -605,6 +608,7 @@ execute my_select ;
--replace_result e+0 e+
execute my_delete ;
set @arg00= '-9223372036854775808' ;
set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -618,6 +622,7 @@ execute my_delete ;
# (FLOAT,REAL,DOUBLE) during insert
#
set @arg00= 1.11111111111111111111e+50 ;
set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -630,6 +635,7 @@ execute my_delete ;
# because the string is treated as written integer and
# '.11111111111111111111e+50' is cut away.
set @arg00= '1.11111111111111111111e+50' ;
set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -639,6 +645,7 @@ execute my_select ;
--replace_result e+0 e+
execute my_delete ;
set @arg00= -1.11111111111111111111e+50 ;
set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -651,6 +658,7 @@ execute my_delete ;
# because the string is treated as written integer and
# '.11111111111111111111e+50' is cut away.
set @arg00= '-1.11111111111111111111e+50' ;
set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -672,6 +680,7 @@ select '-- insert into string columns --' as test_sequence ;
--enable_query_log
######## INSERT into .. string columns values(CHAR(n),LONGTEXT) ########
set sql_mode = '';
insert into t9
( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 )
values
@@ -803,6 +812,7 @@ values
( 57, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00 ;
set sql_mode = default;
######## INSERT into .. string columns values(LONGBLOB,NULL) ########
@@ -984,6 +994,7 @@ delete from t9 ;
select '-- insert into date/time columns --' as test_sequence ;
--enable_query_log
######## INSERT into .. date/time columns values(VARCHAR(19),LONGTEXT) ########
set sql_mode = '';
set @arg00= '1991-01-01 01:01:01' ;
insert into t9
( c1, c13, c14, c15, c16, c17 )
@@ -1079,6 +1090,7 @@ prepare stmt2 from "insert into t9
values
( 53, ?, ?, ?, ?, ? )" ;
execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
set sql_mode = default;
######## INSERT into .. date/time columns values(LONGBLOB,NULL) ########

View File

@@ -108,7 +108,9 @@ execute stmt1 using @arg00, @arg01;
select a,b from t1 where a=@arg00;
set @arg00=NULL;
set @arg01=2;
set sql_mode = '';
execute stmt1 using @arg00, @arg01;
set sql_mode = default;
select a,b from t1 order by a;
set @arg00=0;
execute stmt1 using @arg01, @arg00;

View File

@@ -47,8 +47,8 @@ if ($rpl_debug)
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it
shutdown_server 10;
# it 60 seconds to die before zapping it
shutdown_server 60;
--source include/wait_until_disconnected.inc

View File

@@ -82,8 +82,14 @@ perl;
}
$ENV{'SEARCH_FILE'} =~ s{^.*?([^/\\]+)$}{$1};
if ($content =~ m{$search_pattern}) {
die "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
if $ENV{SEARCH_ABORT} eq 'FOUND';
print "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
unless defined $ENV{SEARCH_ABORT};
} else {
die "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
if $ENV{SEARCH_ABORT} eq 'NOT FOUND';
print "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
unless defined $ENV{SEARCH_ABORT};
}
EOF

View File

@@ -1,7 +1,14 @@
# Include this script only after using shutdown_mysqld.inc
# where $_expect_file_name was initialized.
# Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $_expect_file_name
if ($restart_parameters)
{
--exec echo "restart: $restart_parameters" > $_expect_file_name
}
if (!$restart_parameters)
{
--exec echo "restart" > $_expect_file_name
}
# Turn on reconnect
--enable_reconnect

View File

@@ -15,7 +15,7 @@ insert t1 values ('2010-12-11 00:20:03.1234');
insert t1 values ('2010-12-11 15:47:11.1234');
insert t1 values (20101211010203.45678);
insert t1 values (20101211030405.789e0);
insert t1 values (99991231235959e1);
insert ignore t1 values (99991231235959e1);
select * from t1;
--replace_regex /121000/121094/ /457000/457031/ /789000/789062/
select truncate(a, 6) from t1; # Field::val_real()
@@ -50,7 +50,7 @@ select a, a+interval 9876543 microsecond from t1;
update t1 set a=a+interval 9876543 microsecond;
select * from t1;
select a, a + interval 2 year from t1;
insert t1 select a + interval 2 year from t1;
insert ignore t1 select a + interval 2 year from t1;
select * from t1;
delete from t1 where a < 20110101;
select * from t1;

View File

@@ -9,8 +9,8 @@
# --source include/wait_innodb_all_purged.inc
#
--source include/have_innodb.inc
--source include/have_debug.inc
if (`select version() like '%debug%'`) {
--disable_query_log
let $wait_counter_init= 300;
@@ -57,3 +57,4 @@ if (!$success)
}
--enable_query_log
}

View File

@@ -4,7 +4,7 @@
# Table Country
INSERT INTO Country VALUES
INSERT IGNORE INTO Country VALUES
('AFG','Afghanistan',652090.00,22720000,1),
('NLD','Netherlands',41526.00,15864000,5),
('ANT','Netherlands Antilles',800.00,217000,33),
@@ -649,7 +649,7 @@ INSERT INTO City VALUES
(398,'Franco da Rocha','BRA',108964),
(399,'Teixeira de Freitas','BRA',108441),
(400,'Varginha','BRA',108314);
INSERT INTO City VALUES
INSERT IGNORE INTO City VALUES
(401,'Ribeirão Pires','BRA',108121),
(402,'Sabará','BRA',107781),
(403,'Catanduva','BRA',107761),
@@ -1855,7 +1855,7 @@ INSERT INTO City VALUES
(1598,'Aomori','JPN',295969),
(1599,'Hakodate','JPN',294788),
(1600,'Akashi','JPN',292253);
INSERT INTO City VALUES
INSERT IGNORE INTO City VALUES
(1601,'Yokkaichi','JPN',288173),
(1602,'Fukushima','JPN',287525),
(1603,'Morioka','JPN',287353),
@@ -2056,7 +2056,7 @@ INSERT INTO City VALUES
(1798,'Subotica','YUG',100386),
(1799,'Prizren','YUG',92303),
(1800,'Phnom Penh','KHM',570155);
INSERT INTO City VALUES
INSERT IGNORE INTO City VALUES
(1801,'Battambang','KHM',129800),
(1802,'Siem Reap','KHM',105100),
(1803,'Douala','CMR',1448300),
@@ -2659,7 +2659,7 @@ INSERT INTO City VALUES
(2398,'Namwon','KOR',103544),
(2399,'Tonghae','KOR',95472),
(2400,'Mun-gyong','KOR',92239);
INSERT INTO City VALUES
INSERT IGNORE INTO City VALUES
(2401,'Athenai','GRC',772072),
(2402,'Thessaloniki','GRC',383967),
(2403,'Pireus','GRC',182671),
@@ -3463,7 +3463,7 @@ INSERT INTO City VALUES
(3198,'Dakar','SEN',785071),
(3199,'Thiès','SEN',248000),
(3200,'Kaolack','SEN',199000);
INSERT INTO City VALUES
INSERT IGNORE INTO City VALUES
(3201,'Ziguinchor','SEN',192000),
(3202,'Rufisque','SEN',150000),
(3203,'Saint-Louis','SEN',132400),
@@ -3664,7 +3664,7 @@ INSERT INTO City VALUES
(3398,'Çorlu','TUR',123300),
(3399,'Isparta','TUR',121911),
(3400,'Karabük','TUR',118285);
INSERT INTO City VALUES
INSERT IGNORE INTO City VALUES
(3401,'Kilis','TUR',118245),
(3402,'Alanya','TUR',117300),
(3403,'Kiziltepe','TUR',112000),
@@ -3865,7 +3865,7 @@ INSERT INTO City VALUES
(3598,'Izevsk','RUS',652800),
(3599,'Krasnodar','RUS',639000),
(3600,'Jaroslavl','RUS',616700);
INSERT INTO City VALUES
INSERT IGNORE INTO City VALUES
(3601,'Habarovsk','RUS',609400),
(3602,'Vladivostok','RUS',606200),
(3603,'Irkutsk','RUS',593700),
@@ -4350,7 +4350,7 @@ INSERT INTO City VALUES
# Table CountryLanguage
INSERT INTO CountryLanguage VALUES
INSERT IGNORE INTO CountryLanguage VALUES
('AFG','Pashto',52.4),
('NLD','Dutch',95.6),
('ANT','Papiamento',86.2),
@@ -4551,7 +4551,7 @@ INSERT INTO CountryLanguage VALUES
('TJK','Tadzhik',62.2),
('TWN','Min',66.7),
('TZA','Nyamwesi',21.1);
INSERT INTO CountryLanguage VALUES
INSERT IGNORE INTO CountryLanguage VALUES
('DNK','Danish',93.5),
('THA','Thai',52.6),
('TGO','Ewe',23.2),
@@ -4752,7 +4752,7 @@ INSERT INTO CountryLanguage VALUES
('WSM','Samoan',47.5),
('STP','French',0.7),
('SEN','Ful',21.7);
INSERT INTO CountryLanguage VALUES
INSERT IGNORE INTO CountryLanguage VALUES
('SYC','English',3.8),
('SLE','Temne',31.8),
('SGP','Malay',14.1),
@@ -4953,7 +4953,7 @@ INSERT INTO CountryLanguage VALUES
('AGO','Luimbe-nganguela',5.4),
('ABW','Dutch',5.3),
('AUS','Canton Chinese',1.1);
INSERT INTO CountryLanguage VALUES
INSERT IGNORE INTO CountryLanguage VALUES
('AZE','Armenian',2.0),
('BGD','Garo',0.1),
('BEL','Arabic',1.6),

View File

@@ -1,71 +0,0 @@
# -*- cperl -*-
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# This is a library file used by the Perl version of mysql-test-run,
# and is part of the translation of the Bourne shell script with the
# same name.
use strict;
our $basedir;
sub gcov_prepare ($) {
my ($dir)= @_;
print "Purging gcov information from '$dir'...\n";
system("find $dir -name \*.gcov -o -name \*.da"
. " -o -name \*.gcda | grep -v 'README.gcov\$' | xargs rm");
}
#
# Collect gcov statistics.
# Arguments:
# $dir basedir, normally build directory
# $gcov gcov utility program [path] name
# $gcov_msg message file name
# $gcov_err error file name
#
sub gcov_collect ($$$) {
my ($dir, $gcov, $gcov_msg, $gcov_err)= @_;
# Get current directory to return to later.
my $start_dir= cwd();
print "Collecting source coverage info using '$gcov'...$basedir\n";
-f "$dir/$gcov_msg" and unlink("$dir/$gcov_msg");
-f "$dir/$gcov_err" and unlink("$dir/$gcov_err");
my @dirs= `find "$dir" -type d -print | sort`;
#print "List of directories:\n@dirs\n";
foreach my $d ( @dirs ) {
chomp($d);
chdir($d) or next;
my @flist= glob("*.*.gcno");
print ("Collecting in '$d'...\n") if @flist;
foreach my $f (@flist) {
system("$gcov $f 2>>$dir/$gcov_err >>$dir/$gcov_msg");
system("perl", "$basedir/mysql-test/lib/process-purecov-annotations.pl", "$f.gcov");
}
chdir($start_dir);
}
print "gcov info in $dir/$gcov_msg, errors in $dir/$gcov_err\n";
}
1;

View File

@@ -104,7 +104,6 @@ use IO::Select;
require "mtr_process.pl";
require "mtr_io.pl";
require "mtr_gcov.pl";
require "mtr_gprof.pl";
require "mtr_misc.pl";
@@ -183,6 +182,7 @@ my @DEFAULT_SUITES= qw(
innodb_fts-
innodb_gis-
innodb_zip-
json-
maria-
multi_source-
optimizer_unfixed_bugs-
@@ -248,11 +248,6 @@ our $opt_mem= $ENV{'MTR_MEM'};
our $opt_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'};
our $opt_gcov;
our $opt_gcov_src_dir;
our $opt_gcov_exe= "gcov";
our $opt_gcov_err= "mysql-test-gcov.err";
our $opt_gcov_msg= "mysql-test-gcov.msg";
our $opt_gprof;
our %gprof_dirs;
@@ -383,11 +378,6 @@ sub main {
# --help will not reach here, so now it's safe to assume we have binaries
My::SafeProcess::find_bin();
if ( $opt_gcov ) {
gcov_prepare($basedir . "/" . $opt_gcov_src_dir);
}
print "vardir: $opt_vardir\n";
initialize_servers();
init_timers();
@@ -431,6 +421,10 @@ sub main {
exit 0;
}
if ($opt_gcov) {
system './dgcov.pl --purge';
}
#######################################################################
my $num_tests= @$tests;
if ( $opt_parallel eq "auto" ) {
@@ -555,15 +549,15 @@ sub main {
mtr_print_line();
if ( $opt_gcov ) {
gcov_collect($basedir . "/" . $opt_gcov_src_dir, $opt_gcov_exe,
$opt_gcov_msg, $opt_gcov_err);
}
print_total_times($opt_parallel) if $opt_report_times;
mtr_report_stats($prefix, $fail, $completed, $extra_warnings);
if ($opt_gcov) {
mtr_report("Running dgcov");
system "./dgcov.pl --generate > $opt_vardir/last_changes.dgcov";
}
if ( @$completed != $num_tests)
{
mtr_error("Not all tests completed (only ". scalar(@$completed) .
@@ -1148,7 +1142,6 @@ sub command_line_setup {
# Coverage, profiling etc
'gcov' => \$opt_gcov,
'gcov-src-dir=s' => \$opt_gcov_src_dir,
'gprof' => \$opt_gprof,
'valgrind|valgrind-all' => \$opt_valgrind,
'valgrind-mysqltest' => \$opt_valgrind_mysqltest,
@@ -1840,6 +1833,9 @@ sub collect_mysqld_features {
mtr_add_arg($args, "--lc-messages-dir=%s", $path_language);
mtr_add_arg($args, "--skip-grant-tables");
mtr_add_arg($args, "--log-warnings=0");
mtr_add_arg($args, "--log-slow-admin-statements=0");
mtr_add_arg($args, "--log-queries-not-using-indexes=0");
mtr_add_arg($args, "--log-slow-slave-statements=0");
mtr_add_arg($args, "--verbose");
mtr_add_arg($args, "--help");
@@ -4349,10 +4345,7 @@ sub extract_warning_lines ($$) {
qr/error .*connecting to master/,
qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/,
qr/InnoDB: Error: table `test`.`t[12]` .*does not exist in the InnoDB internal/,
qr/InnoDB: Warning: Setting innodb_use_sys_malloc/,
qr/InnoDB: Warning: a long semaphore wait:/,
qr/InnoDB: Disabling redo log encryption/,
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/,
@@ -4389,6 +4382,7 @@ sub extract_warning_lines ($$) {
qr|Checking table: '\..mtr.test_suppressions'|,
qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in MySQL|,
qr|Table '\..mtr.test_suppressions' is marked as crashed and should be repaired|,
qr|Table 'test_suppressions' is marked as crashed and should be repaired|,
qr|Can't open shared library|,
qr|Couldn't load plugin named .*EXAMPLE.*|,
qr|InnoDB: Error: table 'test/bug39438'|,
@@ -4425,9 +4419,6 @@ sub extract_warning_lines ($$) {
qr|InnoDB: TABLE to scan your table for corruption|,
qr/InnoDB: See also */,
qr/InnoDB: Cannot open .*ib_buffer_pool.* for reading: No such file or directory*/,
qr/InnoDB: Upgrading redo log:*/,
qr|InnoDB: Starting to delete and rewrite log files.|,
qr/InnoDB: New log files created, LSN=*/,
qr|InnoDB: Creating foreign key constraint system tables.|,
qr/InnoDB: Table .*mysql.*innodb_table_stats.* not found./,
qr/InnoDB: User stopword table .* does not exist./
@@ -6180,9 +6171,6 @@ Misc options
actions. Disable facility with NUM=0.
gcov Collect coverage information after the test.
The result is a gcov file per source and header file.
gcov-src-dir=subdir Collect coverage only within the given subdirectory.
For example, if you're only developing the SQL layer,
it makes sense to use --gcov-src-dir=sql
gprof Collect profiling information using gprof.
experimental=<file> Refer to list of tests considered experimental;
failures will be marked exp-fail instead of fail.

View File

@@ -3,7 +3,7 @@ insert into t1 values ('2012-00-00');
select * from t1;
d
2012-00-00
update t1 set d = adddate(d, interval 1 day);
update ignore t1 set d = adddate(d, interval 1 day);
Warnings:
Warning 1292 Incorrect datetime value: '2012-00-00'
select * from t1;

View File

@@ -292,7 +292,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`)
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);
insert ignore 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
@@ -311,7 +311,7 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I
t1 MyISAM 10 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL
drop table t1;
create table t1 (a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, g int not null, h int not null,i int not null, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
insert into t1 (a) values(1);
insert ignore 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
@@ -2089,6 +2089,21 @@ tab1 CREATE TABLE `tab1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `tab1`;
#
# MDEV-11548 Reproducible server crash after the 2nd ALTER TABLE ADD FOREIGN KEY IF NOT EXISTS
#
CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY);
CREATE TABLE t2 (id1 INT UNSIGNED NOT NULL);
ALTER TABLE t2
ADD FOREIGN KEY IF NOT EXISTS (id1)
REFERENCES t1 (id);
ALTER TABLE t2
ADD FOREIGN KEY IF NOT EXISTS (id1)
REFERENCES t1 (id);
Warnings:
Note 1061 Duplicate key name 'id1'
DROP TABLE t2;
DROP TABLE t1;
#
# Start of 10.1 tests
#
#

View File

@@ -3,6 +3,7 @@ set @@storage_engine= Aria;
#
# mdev-539: fast build of unique/primary indexes for MyISAM/Aria
#
call mtr.add_suppression("Can't find record in '.*'");
DROP DATABASE IF EXISTS dbt3_s001;
CREATE DATABASE dbt3_s001;
use dbt3_s001;

View File

@@ -3,6 +3,7 @@ set @@storage_engine= MyISAM;
#
# mdev-539: fast build of unique/primary indexes for MyISAM/Aria
#
call mtr.add_suppression("Can't find record in '.*'");
DROP DATABASE IF EXISTS dbt3_s001;
CREATE DATABASE dbt3_s001;
use dbt3_s001;

View File

@@ -491,15 +491,15 @@ ANALYZE
"query_block": {
"select_id": 1,
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"having_condition": "TOP > t2.a",
"filesort": {
"sort_key": "t2.a",
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 0,
"volatile parameter": "REPLACED",
"r_buffer_size": "REPLACED",
"temporary_table": {
"table": {
"table_name": "t2",
@@ -507,7 +507,7 @@ ANALYZE
"r_loops": 1,
"rows": 256,
"r_rows": 256,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
@@ -522,14 +522,14 @@ ANALYZE
"query_block": {
"select_id": 1,
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filesort": {
"sort_key": "t2.a",
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 256,
"volatile parameter": "REPLACED",
"r_buffer_size": "REPLACED",
"temporary_table": {
"table": {
"table_name": "t2",
@@ -537,7 +537,7 @@ ANALYZE
"r_loops": 1,
"rows": 256,
"r_rows": 256,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
@@ -563,14 +563,14 @@ ANALYZE
"query_block": {
"select_id": 1,
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filesort": {
"sort_key": "t2.a",
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 256,
"volatile parameter": "REPLACED",
"r_buffer_size": "REPLACED",
"temporary_table": {
"table": {
"table_name": "t2",
@@ -578,7 +578,7 @@ ANALYZE
"r_loops": 1,
"rows": 256,
"r_rows": 256,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
@@ -600,14 +600,14 @@ ANALYZE
"query_block": {
"select_id": 1,
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
@@ -619,7 +619,7 @@ ANALYZE
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
@@ -632,14 +632,14 @@ ANALYZE
"query_block": {
"select_id": 2,
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "t1",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
@@ -653,7 +653,7 @@ ANALYZE
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
@@ -685,22 +685,22 @@ ANALYZE
"query_block": {
"select_id": 1,
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filesort": {
"sort_key": "group_concat(t3.f3 separator ',')",
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 0,
"volatile parameter": "REPLACED",
"r_buffer_size": "REPLACED",
"temporary_table": {
"filesort": {
"sort_key": "(subquery#2)",
"r_loops": 1,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 0,
"volatile parameter": "REPLACED",
"r_buffer_size": "REPLACED",
"temporary_table": {
"table": {
"table_name": "t2",
@@ -708,7 +708,7 @@ ANALYZE
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100
},
@@ -719,7 +719,7 @@ ANALYZE
"r_loops": 1,
"rows": 2,
"r_rows": 2,
"volatile parameter": "REPLACED",
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 0,
"attached_condition": "t3.f3 in (1,2)"

View File

@@ -25,7 +25,7 @@ truncate table t1;
insert into t1 values(32767-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(32767+1);
insert ignore into t1 values(32767+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -59,7 +59,7 @@ truncate table t1;
insert into t1 values(65535-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(65535+1);
insert ignore into t1 values(65535+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -93,7 +93,7 @@ truncate table t1;
insert into t1 values(2147483647-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(2147483647+1);
insert ignore into t1 values(2147483647+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -127,7 +127,7 @@ truncate table t1;
insert into t1 values(4294967295-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(4294967295+1);
insert ignore into t1 values(4294967295+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -161,7 +161,7 @@ truncate table t1;
insert into t1 values(cast(9223372036854775807 as unsigned)-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(cast(9223372036854775807 as unsigned)+1);
insert ignore into t1 values(cast(9223372036854775807 as unsigned)+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -245,7 +245,7 @@ DROP TABLE t1;
#
CREATE TABLE t1 (a smallint AUTO_INCREMENT, PRIMARY KEY (a));
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (32768);
INSERT IGNORE INTO t1 VALUES (32768);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
INSERT INTO t1 VALUES (NULL);

View File

@@ -26,7 +26,7 @@ truncate table t1;
insert into t1 values(32767-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(32767+1);
insert ignore into t1 values(32767+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -61,7 +61,7 @@ truncate table t1;
insert into t1 values(65535-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(65535+1);
insert ignore into t1 values(65535+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -96,7 +96,7 @@ truncate table t1;
insert into t1 values(2147483647-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(2147483647+1);
insert ignore into t1 values(2147483647+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -131,7 +131,7 @@ truncate table t1;
insert into t1 values(4294967295-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(4294967295+1);
insert ignore into t1 values(4294967295+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -166,7 +166,7 @@ truncate table t1;
insert into t1 values(cast(9223372036854775807 as unsigned)-1),(NULL),(NULL);
ERROR 22003: Out of range value for column 'a' at row 3
truncate table t1;
insert into t1 values(cast(9223372036854775807 as unsigned)+1);
insert ignore into t1 values(cast(9223372036854775807 as unsigned)+1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
@@ -251,7 +251,7 @@ DROP TABLE t1;
#
CREATE TABLE t1 (a smallint AUTO_INCREMENT, PRIMARY KEY (a));
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (32768);
INSERT IGNORE INTO t1 VALUES (32768);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
INSERT INTO t1 VALUES (NULL);

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