Skip to content
Permalink
Browse files

Merge tag 'mariadb-5.5.63' into 5.5-galera

  • Loading branch information...
janlindstrom committed Jan 31, 2019
2 parents f8a84ed + 2175bfc commit c28d7ace8b48c891dc78a87b7c81853530216b63
Showing with 868 additions and 269 deletions.
  1. +8 −2 CMakeLists.txt
  2. +32 −19 client/mysqltest.cc
  3. +0 −1 cmake/build_configurations/mysql_release.cmake
  4. +10 −1 cmake/ssl.cmake
  5. +0 −5 cmake/zlib.cmake
  6. +5 −1 config.h.cmake
  7. +2 −2 include/my_valgrind.h
  8. +1 −1 include/mysql.h
  9. +1 −1 include/mysql.h.pp
  10. +1 −1 mysql-test/lib/v1/mysql-test-run.pl
  11. +13 −4 mysql-test/mysql-test-run.pl
  12. +14 −0 mysql-test/r/auto_increment_ranges_innodb.result
  13. +11 −0 mysql-test/r/bigint.result
  14. +26 −0 mysql-test/r/mysql.result
  15. +3 −3 mysql-test/r/mysqldump.result
  16. +11 −0 mysql-test/r/read_only.result
  17. +16 −0 mysql-test/r/row-checksum-old.result
  18. +16 −0 mysql-test/r/row-checksum.result
  19. +22 −0 mysql-test/r/subselect2.result
  20. +42 −0 mysql-test/r/type_newdecimal.result
  21. +100 −0 mysql-test/suite/engines/iuds/r/insert_number.result
  22. +17 −0 mysql-test/suite/engines/iuds/r/update_delete_number.result
  23. +13 −0 mysql-test/t/auto_increment_ranges_innodb.test
  24. +9 −0 mysql-test/t/bigint.test
  25. +22 −0 mysql-test/t/mysql.test
  26. +1 −1 mysql-test/t/mysqldump.test
  27. +13 −0 mysql-test/t/read_only.test
  28. +17 −0 mysql-test/t/row-checksum.test
  29. +20 −0 mysql-test/t/subselect2.test
  30. +44 −0 mysql-test/t/type_newdecimal.test
  31. +4 −0 mysys/mf_iocache.c
  32. +3 −4 mysys/my_file.c
  33. +19 −7 mysys/my_pread.c
  34. +28 −24 mysys/my_read.c
  35. +14 −3 scripts/mysql_install_db.sh
  36. +10 −9 scripts/mytop.sh
  37. +27 −3 sql-common/client.c
  38. +1 −1 sql/CMakeLists.txt
  39. +4 −0 sql/item.h
  40. +103 −87 sql/item_cmpfunc.cc
  41. +5 −0 sql/item_cmpfunc.h
  42. +3 −3 sql/log.cc
  43. +66 −6 sql/mysql_install_db.cc
  44. +1 −0 sql/sql_parse.cc
  45. +3 −3 sql/sql_repl.cc
  46. +4 −1 sql/sql_table.cc
  47. +28 −0 sql/sql_type_int.h
  48. +13 −10 sql/sql_yacc.yy
  49. +3 −1 storage/innobase/fil/fil0fil.c
  50. +3 −1 storage/xtradb/fil/fil0fil.c
  51. +19 −16 strings/decimal.c
  52. +5 −1 support-files/mysql.server.sh
  53. +0 −5 unittest/mysys/lf-t.c
  54. +1 −16 unittest/mysys/my_atomic-t.c
  55. +9 −22 unittest/mysys/thr_template.c
  56. +1 −3 unittest/mysys/waiting_threads-t.c
  57. +1 −1 win/packaging/heidisql.cmake
@@ -257,9 +257,15 @@ IF(HAVE_GGDB3)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb3")
ENDIF()

OPTION(ENABLED_LOCAL_INFILE
"If we should should enable LOAD DATA LOCAL by default" ${IF_WIN})
SET(ENABLED_LOCAL_INFILE "AUTO" CACHE STRING "If we should should enable LOAD DATA LOCAL by default (OFF/ON/AUTO)")
MARK_AS_ADVANCED(ENABLED_LOCAL_INFILE)
IF (ENABLED_LOCAL_INFILE MATCHES "^(0|FALSE)$")
SET(ENABLED_LOCAL_INFILE OFF)
ELSEIF(ENABLED_LOCAL_INFILE MATCHES "^(1|TRUE)$")
SET(ENABLED_LOCAL_INFILE ON)
ELSEIF (NOT ENABLED_LOCAL_INFILE MATCHES "^(ON|OFF|AUTO)$")
MESSAGE(FATAL_ERROR "ENABLED_LOCAL_INFILE must be one of OFF, ON, AUTO")
ENDIF()

OPTION(WITH_FAST_MUTEXES "Compile with fast mutexes" OFF)
MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
@@ -20,7 +20,7 @@
Tool used for executing a .test file
See the "MySQL Test framework manual" for more information
http://dev.mysql.com/doc/mysqltest/en/index.html
https://mariadb.com/kb/en/library/mysqltest/
Please keep the test framework tools identical in all versions!
@@ -6045,7 +6045,6 @@ void do_connect(struct st_command *command)
#endif
if (opt_compress || con_compress)
mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
mysql_options(con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
if (opt_charsets_dir)
@@ -6129,6 +6128,11 @@ void do_connect(struct st_command *command)
if (con_slot == next_con)
next_con++; /* if we used the next_con slot, advance the pointer */
}
else // Failed to connect. Free the memory.
{
mysql_close(con_slot->mysql);
con_slot->mysql= NULL;
}

dynstr_free(&ds_connection_name);
dynstr_free(&ds_host);
@@ -6501,8 +6505,6 @@ static inline bool is_escape_char(char c, char in_string)
SYNOPSIS
read_line
buf buffer for the read line
size size of the buffer i.e max size to read
DESCRIPTION
This function actually reads several lines and adds them to the
@@ -6520,21 +6522,37 @@ static inline bool is_escape_char(char c, char in_string)
*/

int read_line(char *buf, int size)
static char *read_command_buf= NULL;
static size_t read_command_buflen= 0;
static const size_t max_multibyte_length= 6;

int read_line()
{
char c, last_quote=0, last_char= 0;
char *p= buf, *buf_end= buf + size - 1;
char *p= read_command_buf;
char *buf_end= read_command_buf + read_command_buflen - max_multibyte_length;
int skip_char= 0;
my_bool have_slash= FALSE;

enum {R_NORMAL, R_Q, R_SLASH_IN_Q,
R_COMMENT, R_LINE_START} state= R_LINE_START;
DBUG_ENTER("read_line");

*p= 0;
start_lineno= cur_file->lineno;
DBUG_PRINT("info", ("Starting to read at lineno: %d", start_lineno));
for (; p < buf_end ;)
while (1)
{
if (p >= buf_end)
{
my_ptrdiff_t off= p - read_command_buf;
read_command_buf= (char*)my_realloc(read_command_buf,
read_command_buflen*2, MYF(MY_FAE));
p= read_command_buf + off;
read_command_buflen*= 2;
buf_end= read_command_buf + read_command_buflen - max_multibyte_length;
}

skip_char= 0;
c= my_getc(cur_file->file);
if (feof(cur_file->file))
@@ -6570,7 +6588,7 @@ int read_line(char *buf, int size)
cur_file->lineno++;

/* Convert cr/lf to lf */
if (p != buf && *(p-1) == '\r')
if (p != read_command_buf && *(p-1) == '\r')
p--;
}

@@ -6585,9 +6603,9 @@ int read_line(char *buf, int size)
}
else if ((c == '{' &&
(!my_strnncoll_simple(charset_info, (const uchar*) "while", 5,
(uchar*) buf, min(5, p - buf), 0) ||
(uchar*) read_command_buf, min(5, p - read_command_buf), 0) ||
!my_strnncoll_simple(charset_info, (const uchar*) "if", 2,
(uchar*) buf, min(2, p - buf), 0))))
(uchar*) read_command_buf, min(2, p - read_command_buf), 0))))
{
/* Only if and while commands can be terminated by { */
*p++= c;
@@ -6721,8 +6739,6 @@ int read_line(char *buf, int size)
*p++= c;
}
}
die("The input buffer is too small for this query.x\n" \
"check your query or increase MAX_QUERY and recompile");
DBUG_RETURN(0);
}

@@ -6867,12 +6883,8 @@ bool is_delimiter(const char* p)
terminated by new line '\n' regardless how many "delimiter" it contain.
*/

#define MAX_QUERY (256*1024*2) /* 256K -- a test in sp-big is >128K */
static char read_command_buf[MAX_QUERY];

int read_command(struct st_command** command_ptr)
{
char *p= read_command_buf;
struct st_command* command;
DBUG_ENTER("read_command");

@@ -6888,8 +6900,7 @@ int read_command(struct st_command** command_ptr)
die("Out of memory");
command->type= Q_UNKNOWN;

read_command_buf[0]= 0;
if (read_line(read_command_buf, sizeof(read_command_buf)))
if (read_line())
{
check_eol_junk(read_command_buf);
DBUG_RETURN(1);
@@ -6898,6 +6909,7 @@ int read_command(struct st_command** command_ptr)
if (opt_result_format_version == 1)
convert_to_format_v1(read_command_buf);

char *p= read_command_buf;
DBUG_PRINT("info", ("query: '%s'", read_command_buf));
if (*p == '#')
{
@@ -9025,6 +9037,8 @@ int main(int argc, char **argv)
init_win_path_patterns();
#endif

read_command_buf= (char*)my_malloc(read_command_buflen= 65536, MYF(MY_FAE));

init_dynamic_string(&ds_res, "", 2048, 2048);
init_alloc_root(&require_file_root, 1024, 1024);

@@ -9095,7 +9109,6 @@ int main(int argc, char **argv)
(void *) &opt_connect_timeout);
if (opt_compress)
mysql_options(con->mysql,MYSQL_OPT_COMPRESS,NullS);
mysql_options(con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(con->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
if (opt_charsets_dir)
@@ -94,7 +94,6 @@ IF(FEATURE_SET)
ENDFOREACH()
ENDIF()

OPTION(ENABLED_LOCAL_INFILE "" ON)
IF(RPM)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
@@ -71,15 +71,24 @@ MACRO (MYSQL_CHECK_SSL)
FIND_LIBRARY(CRYPTO_LIBRARY crypto)
MARK_AS_ADVANCED(CRYPTO_LIBRARY)
INCLUDE(CheckSymbolExists)
INCLUDE(CheckCSourceCompiles)
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
HAVE_SHA512_DIGEST_LENGTH)
CHECK_SYMBOL_EXISTS(ERR_remove_thread_state "openssl/err.h"
HAVE_ERR_remove_thread_state)
CHECK_C_SOURCE_COMPILES("
#include <openssl/dh.h>
int main()
{
DH dh;
return sizeof(dh.version);
}" OLD_OPENSSL_API)
SET(CMAKE_REQUIRED_INCLUDES)
SET(CMAKE_REQUIRED_LIBRARIES)
IF(OPENSSL_FOUND AND CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
IF(OPENSSL_FOUND AND OLD_OPENSSL_API AND
CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
SET(SSL_SOURCES "")
SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY})
SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
@@ -34,11 +34,6 @@ ENDMACRO()

MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)

# For NDBCLUSTER: Use bundled zlib by default
IF (NOT WITH_ZLIB)
SET(WITH_ZLIB "bundled" CACHE STRING "By default use bundled zlib on this platform")
ENDIF()

IF(WITH_ZLIB STREQUAL "bundled")
MYSQL_USE_BUNDLED_ZLIB()
ELSE()
@@ -531,7 +531,11 @@
/*
MySQL features
*/
#cmakedefine ENABLED_LOCAL_INFILE 1
#define LOCAL_INFILE_MODE_OFF 0
#define LOCAL_INFILE_MODE_ON 1
#define LOCAL_INFILE_MODE_AUTO 2
#define ENABLED_LOCAL_INFILE LOCAL_INFILE_MODE_@ENABLED_LOCAL_INFILE@

#cmakedefine ENABLED_PROFILING 1
#cmakedefine EXTRA_DEBUG 1
#cmakedefine BACKUP_TEST 1
@@ -42,7 +42,7 @@
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
#else
# define MEM_UNDEFINED(a,len) ((void) 0)
# define MEM_UNDEFINED(a,len) ((void) (a), (void) (len))
# define MEM_NOACCESS(a,len) ((void) 0)
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
@@ -51,7 +51,7 @@
#ifndef DBUG_OFF
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
#else
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp __attribute__((unused))= (B); MEM_UNDEFINED(A,trash_tmp); } while (0)
#define TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0)
#endif
#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)
@@ -274,7 +274,7 @@ typedef struct st_mysql

/* session-wide random string */
char scramble[SCRAMBLE_LENGTH+1];
my_bool unused1;
my_bool auto_local_infile;
void *unused2, *unused3, *unused4, *unused5;

LIST *stmts; /* list of all statements */
@@ -341,7 +341,7 @@
my_bool free_me;
my_bool reconnect;
char scramble[20 +1];
my_bool unused1;
my_bool auto_local_infile;
void *unused2, *unused3, *unused4, *unused5;
LIST *stmts;
const struct st_mysql_methods *methods;
@@ -23,7 +23,7 @@
# Tool used for executing a suite of .test file
#
# See the "MySQL Test framework manual" for more information
# http://dev.mysql.com/doc/mysqltest/en/index.html
# https://mariadb.com/kb/en/library/mysqltest/
#
# Please keep the test framework tools identical in all versions!
#
@@ -25,7 +25,7 @@
# Tool used for executing a suite of .test files
#
# See the "MySQL Test framework manual" for more information
# http://dev.mysql.com/doc/mysqltest/en/index.html
# https://mariadb.com/kb/en/library/mysqltest/
#
#
##############################################################################
@@ -1144,7 +1144,7 @@ sub command_line_setup {
'debug' => \$opt_debug,
'debug-common' => \$opt_debug_common,
'debug-server' => \$opt_debug_server,
'gdb' => \$opt_gdb,
'gdb=s' => \$opt_gdb,
'client-gdb' => \$opt_client_gdb,
'manual-gdb' => \$opt_manual_gdb,
'manual-lldb' => \$opt_manual_lldb,
@@ -1238,6 +1238,9 @@ sub command_line_setup {
'skip-test-list=s' => \@opt_skip_test_list
);

# fix options (that take an optional argument and *only* after = sign
my %fixopt = ( '--gdb' => '--gdb=#' );
@ARGV = map { $fixopt{$_} or $_ } @ARGV;
GetOptions(%options) or usage("Can't read options");
usage("") if $opt_usage;
list_options(\%options) if $opt_list_options;
@@ -5996,7 +5999,9 @@ sub gdb_arguments {
# Put $args into a single string
$input = $input ? "< $input" : "";

if ($type ne 'client' and $opt_valgrind_mysqld) {
if ($type eq 'client') {
mtr_tofile($gdb_init_file, "set args @$$args $input");
} elsif ($opt_valgrind_mysqld) {
my $v = $$exe;
my $vargs = [];
valgrind_arguments($vargs, \$v);
@@ -6006,7 +6011,11 @@ sub gdb_arguments {
target remote | /usr/lib64/valgrind/../../bin/vgdb
EOF
} else {
mtr_tofile($gdb_init_file, "set args @$$args $input\n");
mtr_tofile($gdb_init_file,
join("\n",
"set args @$$args $input",
split /;/, $opt_gdb || ""
));
}

if ( $opt_manual_gdb )
@@ -264,3 +264,17 @@ delete from t1 where a=32767;
insert into t1 values(NULL);
ERROR 22003: Out of range value for column 'a' at row 1
drop table t1;
create table t1 (pk int auto_increment primary key, f varchar(20));
insert t1 (f) values ('a'), ('b'), ('c'), ('d');
select null, f into outfile 'load.data' from t1 limit 1;
load data infile 'load.data' into table t1;
insert t1 (f) values ('<===');
select * from t1;
pk f
1 a
2 b
3 c
4 d
5 a
6 <===
drop table t1;
@@ -508,3 +508,14 @@ DROP TABLE t1;
SELECT 100 BETWEEN 1 AND 9223372036854775808;
100 BETWEEN 1 AND 9223372036854775808
1
#
# MDEV-17724 Wrong result for BETWEEN 0 AND 18446744073709551615
#
CREATE TABLE t1 (c1 bigint(20) unsigned NOT NULL);
INSERT INTO t1 VALUES (0),(101),(255);
SELECT * FROM t1 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1;
c1
0
101
255
DROP TABLE t1;
@@ -587,3 +587,29 @@ a
2
drop table "a1\""b1";
set sql_mode=default;
create table t1 (a text);
select count(*) from t1;
count(*)
41
truncate table t1;
select count(*) from t1;
count(*)
41
truncate table t1;
select count(*) from t1;
count(*)
0
truncate table t1;
select count(*) from t1;
count(*)
0
truncate table t1;
select count(*) from t1;
count(*)
41
truncate table t1;
select count(*) from t1;
count(*)
0
truncate table t1;
drop table t1;

0 comments on commit c28d7ac

Please sign in to comment.
You can’t perform that action at this time.